@storecraft/dashboard 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/src/index.js +34424 -61880
- package/dist/lib/src/index.umd.cjs +459 -573
- package/dist/lib/src/src/apps/gallery/gallery-image-grid.d.ts +14 -0
- package/dist/lib/src/src/apps/gallery/gallery-page.d.ts +2 -0
- package/dist/lib/src/{apps → src/apps}/gallery/gallery-searchbar.d.ts +8 -7
- package/dist/lib/src/src/apps/gallery/gallery-select.d.ts +9 -0
- package/dist/lib/src/src/apps/gallery/gallery.d.ts +29 -0
- package/dist/lib/src/src/apps/gallery/image-header.d.ts +9 -0
- package/dist/lib/src/src/apps/gallery/image-page.d.ts +16 -0
- package/dist/lib/src/src/apps/gallery/utils.d.ts +2 -0
- package/dist/lib/src/src/apps/index.d.ts +2 -0
- package/dist/lib/src/src/comps/action-bar.d.ts +8 -0
- package/dist/lib/src/src/comps/air-date-picker.d.ts +6 -0
- package/dist/lib/src/src/comps/asset-favicon.d.ts +1 -0
- package/dist/lib/src/src/comps/attributes.d.ts +23 -0
- package/dist/lib/src/src/comps/base-chart-view.d.ts +31 -0
- package/dist/lib/src/src/comps/bulk-tag-products-in-collection.d.ts +9 -0
- package/dist/lib/src/src/comps/capsule.d.ts +8 -0
- package/dist/lib/src/src/comps/capsules-view.d.ts +10 -0
- package/dist/lib/src/src/comps/chart.demo.tsx.d.ts +2 -0
- package/dist/lib/src/src/comps/client-only.d.ts +3 -0
- package/dist/lib/src/src/comps/collection-actions.d.ts +21 -0
- package/dist/lib/src/src/comps/collection-products.d.ts +26 -0
- package/dist/lib/src/src/comps/common-button.d.ts +78 -0
- package/dist/lib/src/src/comps/common-fields.d.ts +83 -0
- package/dist/lib/src/src/comps/common-table-fields.d.ts +18 -0
- package/dist/lib/src/src/comps/common-ui.d.ts +97 -0
- package/dist/lib/src/{comps → src/comps}/copyable-view.d.ts +5 -2
- package/dist/lib/src/src/comps/customer-orders.d.ts +5 -0
- package/dist/lib/src/src/comps/dark-mode.d.ts +2 -0
- package/dist/lib/src/src/comps/discount-details.d.ts +54 -0
- package/dist/lib/src/src/comps/discount-filters.d.ts +60 -0
- package/dist/lib/src/src/comps/discount-performance.d.ts +5 -0
- package/dist/lib/src/src/comps/discounts-quick-search-actions.d.ts +2 -0
- package/dist/lib/src/src/comps/discounts-table-code.d.ts +8 -0
- package/dist/lib/src/src/comps/discounts-table-type.d.ts +6 -0
- package/dist/lib/src/src/comps/document-actions.d.ts +10 -0
- package/dist/lib/src/src/comps/document-details.d.ts +7 -0
- package/dist/lib/src/src/comps/document-title.d.ts +7 -0
- package/dist/lib/src/src/comps/drawer.d.ts +6 -0
- package/dist/lib/src/src/comps/error-message.d.ts +18 -0
- package/dist/lib/src/{comps → src/comps}/fields-view.d.ts +24 -27
- package/dist/lib/src/src/comps/gradient-text.d.ts +1 -0
- package/dist/lib/src/src/comps/home-header.d.ts +10 -0
- package/dist/lib/src/src/comps/home-invite-action-card.d.ts +7 -0
- package/dist/lib/src/src/comps/home-performace.d.ts +19 -0
- package/dist/lib/src/src/comps/home-sales-chart.d.ts +8 -0
- package/dist/lib/src/src/comps/home-stat-card.d.ts +10 -0
- package/dist/lib/src/src/comps/home-time-frame.d.ts +10 -0
- package/dist/lib/src/{comps → src/comps}/image-editor.d.ts +9 -42
- package/dist/lib/src/src/comps/img.d.ts +11 -0
- package/dist/lib/src/src/comps/json.d.ts +8 -0
- package/dist/lib/src/src/comps/lazy-carousel.d.ts +9 -0
- package/dist/lib/src/src/comps/loading-image.d.ts +3 -0
- package/dist/lib/src/src/comps/login-connect.d.ts +3 -0
- package/dist/lib/src/{comps → src/comps}/login-content.d.ts +1 -1
- package/dist/lib/src/src/comps/login-copyright.d.ts +3 -0
- package/dist/lib/src/src/comps/login-form.d.ts +16 -0
- package/dist/lib/src/{comps → src/comps}/login-latest-updates.d.ts +3 -6
- package/dist/lib/src/src/comps/login-marquee.d.ts +3 -0
- package/dist/lib/src/src/comps/logo-text.d.ts +4 -0
- package/dist/lib/src/src/comps/logo.d.ts +8 -0
- package/dist/lib/src/{comps → src/comps}/markdown-card.d.ts +2 -2
- package/dist/lib/src/src/comps/md-editor.d.ts +8 -0
- package/dist/lib/src/src/comps/md-view.d.ts +5 -0
- package/dist/lib/src/{comps → src/comps}/media.d.ts +13 -37
- package/dist/lib/src/{comps → src/comps}/modal.d.ts +4 -5
- package/dist/lib/src/src/comps/notifications-button.d.ts +11 -0
- package/dist/lib/src/{comps → src/comps}/notifications.d.ts +6 -5
- package/dist/lib/src/src/comps/order-coupon-info.d.ts +5 -0
- package/dist/lib/src/src/comps/order-delivery-method.d.ts +5 -0
- package/dist/lib/src/src/comps/order-line-items.d.ts +12 -0
- package/dist/lib/src/src/comps/order-payment-gateway.d.ts +16 -0
- package/dist/lib/src/src/comps/order-price.d.ts +12 -0
- package/dist/lib/src/src/comps/orders-quick-search-actions.d.ts +4 -0
- package/dist/lib/src/src/comps/overlay.d.ts +11 -0
- package/dist/lib/src/src/comps/portal-creator.d.ts +12 -0
- package/dist/lib/src/src/comps/product-discounts.d.ts +15 -0
- package/dist/lib/src/src/comps/product-related-products.d.ts +10 -0
- package/dist/lib/src/src/comps/products-variants.d.ts +26 -0
- package/dist/lib/src/src/comps/quick-search-browser.d.ts +26 -0
- package/dist/lib/src/src/comps/resource-browse.d.ts +30 -0
- package/dist/lib/src/src/comps/resource-onboard-svg.d.ts +2 -0
- package/dist/lib/src/src/comps/resource-title.d.ts +7 -0
- package/dist/lib/src/{comps → src/comps}/resource-view.d.ts +2 -2
- package/dist/lib/src/src/comps/secret-view.d.ts +4 -0
- package/dist/lib/src/src/comps/select-resource.d.ts +80 -0
- package/dist/lib/src/src/comps/settings-api-keys.d.ts +12 -0
- package/dist/lib/src/src/comps/settings-change-password.d.ts +1 -0
- package/dist/lib/src/src/comps/show-if.d.ts +14 -0
- package/dist/lib/src/src/comps/side-menu.d.ts +22 -0
- package/dist/lib/src/src/comps/splitter-view.d.ts +1 -0
- package/dist/lib/src/src/comps/storefront-products.d.ts +11 -0
- package/dist/lib/src/src/comps/symbols.d.ts +4 -0
- package/dist/lib/src/{comps → src/comps}/table-schema-view.d.ts +11 -10
- package/dist/lib/src/src/comps/tag-values.d.ts +5 -0
- package/dist/lib/src/src/comps/tags-edit.d.ts +12 -0
- package/dist/lib/src/src/comps/template-example-input.d.ts +5 -0
- package/dist/lib/src/src/comps/template-template.d.ts +18 -0
- package/dist/lib/src/src/comps/transition.d.ts +32 -0
- package/dist/lib/src/{hooks → src/hooks}/create-media-query-hook.d.ts +3 -3
- package/dist/lib/src/src/hooks/use-collections-actions.d.ts +48 -0
- package/dist/lib/src/src/hooks/use-document-actions.d.ts +64 -0
- package/dist/lib/src/src/hooks/use-interval.d.ts +8 -0
- package/dist/lib/src/src/hooks/use-keyboard-match.d.ts +5 -0
- package/dist/lib/src/src/hooks/use-media-query.d.ts +1 -0
- package/dist/lib/src/src/hooks/use-mounted.d.ts +1 -0
- package/dist/lib/src/src/hooks/use-navigate-with-state.d.ts +18 -0
- package/dist/lib/src/src/hooks/use-on-click-outside.d.ts +5 -0
- package/dist/lib/src/{hooks → src/hooks}/use-preferences.d.ts +4 -4
- package/dist/lib/src/src/hooks/use-scroll-delta.d.ts +13 -0
- package/dist/lib/src/src/hooks/use-toggle.d.ts +5 -0
- package/dist/lib/src/{hooks → src/hooks}/use-trigger.d.ts +2 -2
- package/dist/lib/src/src/hooks/utils.browser.d.ts +11 -0
- package/dist/lib/src/src/index.d.ts +13 -0
- package/dist/lib/src/src/layout.d.ts +9 -0
- package/dist/lib/src/src/login.d.ts +5 -0
- package/dist/lib/src/src/pages/collection.d.ts +17 -0
- package/dist/lib/src/src/pages/collections.d.ts +2 -0
- package/dist/lib/src/src/pages/customer.d.ts +17 -0
- package/dist/lib/src/src/pages/customers.d.ts +4 -0
- package/dist/lib/src/src/pages/discount.d.ts +18 -0
- package/dist/lib/src/src/pages/discounts.d.ts +2 -0
- package/dist/lib/src/src/pages/extension.d.ts +14 -0
- package/dist/lib/src/src/pages/extensions.d.ts +8 -0
- package/dist/lib/src/src/pages/home.d.ts +2 -0
- package/dist/lib/src/src/pages/index.d.ts +33 -0
- package/dist/lib/src/src/pages/order.d.ts +24 -0
- package/dist/lib/src/src/pages/orders.d.ts +2 -0
- package/dist/lib/src/src/pages/payment-gateway.d.ts +14 -0
- package/dist/lib/src/src/pages/payment-gateways.d.ts +8 -0
- package/dist/lib/src/src/pages/post.d.ts +18 -0
- package/dist/lib/src/src/pages/posts.d.ts +2 -0
- package/dist/lib/src/src/pages/product.d.ts +30 -0
- package/dist/lib/src/src/pages/products.d.ts +2 -0
- package/dist/lib/src/src/pages/settings.d.ts +2 -0
- package/dist/lib/src/src/pages/shipping-method.d.ts +18 -0
- package/dist/lib/src/src/pages/shipping-methods.d.ts +2 -0
- package/dist/lib/src/src/pages/storefront.d.ts +18 -0
- package/dist/lib/src/src/pages/storefronts.d.ts +2 -0
- package/dist/lib/src/src/pages/tag.d.ts +17 -0
- package/dist/lib/src/src/pages/tags.d.ts +2 -0
- package/dist/lib/src/src/pages/template.d.ts +13 -0
- package/dist/lib/src/src/pages/templates.d.ts +2 -0
- package/dist/lib/src/src/routes.d.ts +1 -0
- package/dist/lib/src/src/screens.d.ts +10 -0
- package/dist/lib/src/src/utils/index.d.ts +7 -0
- package/dist/lib/src/src/utils/time.d.ts +7 -0
- package/dist/website/assets/index-BjGWqHuK.js +685 -0
- package/dist/website/assets/style-BJD2VYZP.css +1 -0
- package/dist/website/index.html +2 -2
- package/package.json +29 -24
- package/dist/lib/src/apps/gallery/gallery-image-grid.d.ts +0 -30
- package/dist/lib/src/apps/gallery/gallery-page.d.ts +0 -2
- package/dist/lib/src/apps/gallery/gallery-select.d.ts +0 -7
- package/dist/lib/src/apps/gallery/gallery.d.ts +0 -56
- package/dist/lib/src/apps/gallery/image-header.d.ts +0 -18
- package/dist/lib/src/apps/gallery/image-page.d.ts +0 -16
- package/dist/lib/src/apps/gallery/index.d.ts +0 -1
- package/dist/lib/src/apps/gallery/utils.d.ts +0 -2
- package/dist/lib/src/apps/index.d.ts +0 -2
- package/dist/lib/src/comps/action-bar.d.ts +0 -25
- package/dist/lib/src/comps/asset-favicon.d.ts +0 -1
- package/dist/lib/src/comps/attributes.d.ts +0 -16
- package/dist/lib/src/comps/base-chart-view.d.ts +0 -20
- package/dist/lib/src/comps/bulk-tag-products-in-collection.d.ts +0 -5
- package/dist/lib/src/comps/capsule.d.ts +0 -8
- package/dist/lib/src/comps/capsules-view.d.ts +0 -27
- package/dist/lib/src/comps/client-only.d.ts +0 -11
- package/dist/lib/src/comps/collection-actions.d.ts +0 -35
- package/dist/lib/src/comps/collection-products.d.ts +0 -33
- package/dist/lib/src/comps/common-button.d.ts +0 -77
- package/dist/lib/src/comps/common-fields.d.ts +0 -61
- package/dist/lib/src/comps/common-table-fields.d.ts +0 -18
- package/dist/lib/src/comps/common-ui.d.ts +0 -101
- package/dist/lib/src/comps/customer-orders.d.ts +0 -13
- package/dist/lib/src/comps/dark-mode.d.ts +0 -5
- package/dist/lib/src/comps/discount-details.d.ts +0 -60
- package/dist/lib/src/comps/discount-filters.d.ts +0 -83
- package/dist/lib/src/comps/discount-performance.d.ts +0 -13
- package/dist/lib/src/comps/discounts-quick-search-actions.d.ts +0 -6
- package/dist/lib/src/comps/discounts-table-code.d.ts +0 -12
- package/dist/lib/src/comps/discounts-table-type.d.ts +0 -9
- package/dist/lib/src/comps/document-actions.d.ts +0 -11
- package/dist/lib/src/comps/document-details.d.ts +0 -20
- package/dist/lib/src/comps/document-title.d.ts +0 -20
- package/dist/lib/src/comps/drawer.d.ts +0 -18
- package/dist/lib/src/comps/error-message.d.ts +0 -29
- package/dist/lib/src/comps/gradient-text.d.ts +0 -1
- package/dist/lib/src/comps/home-header.d.ts +0 -24
- package/dist/lib/src/comps/home-invite-action-card.d.ts +0 -17
- package/dist/lib/src/comps/home-performace.d.ts +0 -33
- package/dist/lib/src/comps/home-sales-chart.d.ts +0 -20
- package/dist/lib/src/comps/home-stat-card.d.ts +0 -25
- package/dist/lib/src/comps/home-time-frame.d.ts +0 -21
- package/dist/lib/src/comps/img.d.ts +0 -11
- package/dist/lib/src/comps/json.d.ts +0 -14
- package/dist/lib/src/comps/lazy-carousel.d.ts +0 -20
- package/dist/lib/src/comps/login-connect.d.ts +0 -4
- package/dist/lib/src/comps/login-copyright.d.ts +0 -7
- package/dist/lib/src/comps/login-form.d.ts +0 -45
- package/dist/lib/src/comps/login-marquee.d.ts +0 -4
- package/dist/lib/src/comps/logo-text.d.ts +0 -2
- package/dist/lib/src/comps/logo.d.ts +0 -8
- package/dist/lib/src/comps/md-editor.d.ts +0 -20
- package/dist/lib/src/comps/md-view.d.ts +0 -16
- package/dist/lib/src/comps/notifications-button.d.ts +0 -28
- package/dist/lib/src/comps/order-coupon-info.d.ts +0 -12
- package/dist/lib/src/comps/order-delivery-method.d.ts +0 -11
- package/dist/lib/src/comps/order-line-items.d.ts +0 -19
- package/dist/lib/src/comps/order-payment-gateway.d.ts +0 -27
- package/dist/lib/src/comps/order-price.d.ts +0 -21
- package/dist/lib/src/comps/orders-quick-search-actions.d.ts +0 -9
- package/dist/lib/src/comps/overlay.d.ts +0 -19
- package/dist/lib/src/comps/portal-creator.d.ts +0 -6
- package/dist/lib/src/comps/product-discounts.d.ts +0 -22
- package/dist/lib/src/comps/product-related-products.d.ts +0 -10
- package/dist/lib/src/comps/products-variants-test.d.ts +0 -1
- package/dist/lib/src/comps/products-variants.d.ts +0 -38
- package/dist/lib/src/comps/quick-search-browser.d.ts +0 -32
- package/dist/lib/src/comps/resource-browse.d.ts +0 -51
- package/dist/lib/src/comps/resource-onboard-svg.d.ts +0 -2
- package/dist/lib/src/comps/resource-title.d.ts +0 -7
- package/dist/lib/src/comps/secret-view.d.ts +0 -9
- package/dist/lib/src/comps/select-resource.d.ts +0 -88
- package/dist/lib/src/comps/settings-api-keys.d.ts +0 -2
- package/dist/lib/src/comps/settings-change-password.d.ts +0 -2
- package/dist/lib/src/comps/settings-storage.d.ts +0 -15
- package/dist/lib/src/comps/show-if.d.ts +0 -25
- package/dist/lib/src/comps/side-menu.d.ts +0 -50
- package/dist/lib/src/comps/splitter-view.d.ts +0 -1
- package/dist/lib/src/comps/storefront-products.d.ts +0 -12
- package/dist/lib/src/comps/symbols.d.ts +0 -4
- package/dist/lib/src/comps/tag-values.d.ts +0 -9
- package/dist/lib/src/comps/tags-edit.d.ts +0 -13
- package/dist/lib/src/comps/template-example-input.d.ts +0 -3
- package/dist/lib/src/comps/template-template.d.ts +0 -15
- package/dist/lib/src/comps/transition.d.ts +0 -51
- package/dist/lib/src/hooks/use-collections-actions.d.ts +0 -43
- package/dist/lib/src/hooks/use-document-actions.d.ts +0 -37
- package/dist/lib/src/hooks/use-interval.d.ts +0 -13
- package/dist/lib/src/hooks/use-keyboard-match.d.ts +0 -6
- package/dist/lib/src/hooks/use-media-query.d.ts +0 -3
- package/dist/lib/src/hooks/use-mounted.d.ts +0 -1
- package/dist/lib/src/hooks/use-navigate-with-state.d.ts +0 -26
- package/dist/lib/src/hooks/use-on-click-outside.d.ts +0 -7
- package/dist/lib/src/hooks/use-scroll-delta.d.ts +0 -4
- package/dist/lib/src/hooks/use-toggle.d.ts +0 -7
- package/dist/lib/src/hooks/utils.browser.d.ts +0 -7
- package/dist/lib/src/index.cjs +0 -800
- package/dist/lib/src/index.d.ts +0 -6
- package/dist/lib/src/layout.d.ts +0 -18
- package/dist/lib/src/login.d.ts +0 -17
- package/dist/lib/src/pages/collection.d.ts +0 -15
- package/dist/lib/src/pages/collections.d.ts +0 -2
- package/dist/lib/src/pages/customer.d.ts +0 -15
- package/dist/lib/src/pages/customers.d.ts +0 -3
- package/dist/lib/src/pages/discount.d.ts +0 -15
- package/dist/lib/src/pages/discounts.d.ts +0 -2
- package/dist/lib/src/pages/extension.d.ts +0 -13
- package/dist/lib/src/pages/extensions.d.ts +0 -16
- package/dist/lib/src/pages/home.d.ts +0 -2
- package/dist/lib/src/pages/index.d.ts +0 -36
- package/dist/lib/src/pages/order.d.ts +0 -21
- package/dist/lib/src/pages/orders.d.ts +0 -2
- package/dist/lib/src/pages/payment-gateway.d.ts +0 -13
- package/dist/lib/src/pages/payment-gateways.d.ts +0 -16
- package/dist/lib/src/pages/post.d.ts +0 -15
- package/dist/lib/src/pages/posts.d.ts +0 -2
- package/dist/lib/src/pages/product.d.ts +0 -22
- package/dist/lib/src/pages/products.d.ts +0 -2
- package/dist/lib/src/pages/settings.d.ts +0 -4
- package/dist/lib/src/pages/shipping-method.d.ts +0 -15
- package/dist/lib/src/pages/shipping-methods.d.ts +0 -2
- package/dist/lib/src/pages/storefront.d.ts +0 -15
- package/dist/lib/src/pages/storefronts.d.ts +0 -2
- package/dist/lib/src/pages/tag.d.ts +0 -15
- package/dist/lib/src/pages/tags.d.ts +0 -2
- package/dist/lib/src/pages/template.d.ts +0 -15
- package/dist/lib/src/pages/templates.d.ts +0 -2
- package/dist/lib/src/routes.d.ts +0 -1
- package/dist/lib/src/utils/index.d.ts +0 -7
- package/dist/lib/src/utils/time.d.ts +0 -7
- package/dist/website/assets/index-CKdUTkr6.js +0 -813
- package/dist/website/assets/style-DkU0t4eA.css +0 -1
- /package/dist/lib/src/{auto-mount.d.ts → src/auto-mount.d.ts} +0 -0
- /package/dist/lib/src/{hooks → src/hooks}/use-dark-mode.d.ts +0 -0
@@ -0,0 +1,685 @@
|
|
1
|
+
var cw=Object.defineProperty;var m0=n=>{throw TypeError(n)};var uw=(n,e,t)=>e in n?cw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var we=(n,e,t)=>uw(n,typeof e!="symbol"?e+"":e,t),g0=(n,e,t)=>e.has(n)||m0("Cannot "+t);var Ue=(n,e,t)=>(g0(n,e,"read from private field"),t?t.call(n):e.get(n)),An=(n,e,t)=>e.has(n)?m0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Un=(n,e,t,s)=>(g0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t);function hw(n,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in n)){const a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();function Za(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hh={exports:{}},ya={},dh={exports:{}},Ye={};/**
|
2
|
+
* @license React
|
3
|
+
* react.production.min.js
|
4
|
+
*
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/var v0;function dw(){if(v0)return Ye;v0=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,_={};function C(D,$,ie){this.props=D,this.context=$,this.refs=_,this.updater=ie||w}C.prototype.isReactComponent={},C.prototype.setState=function(D,$){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,$,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=C.prototype;function M(D,$,ie){this.props=D,this.context=$,this.refs=_,this.updater=ie||w}var I=M.prototype=new S;I.constructor=M,k(I,C.prototype),I.isPureReactComponent=!0;var L=Array.isArray,O=Object.prototype.hasOwnProperty,K={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function R(D,$,ie){var ge,le={},se=null,Me=null;if($!=null)for(ge in $.ref!==void 0&&(Me=$.ref),$.key!==void 0&&(se=""+$.key),$)O.call($,ge)&&!E.hasOwnProperty(ge)&&(le[ge]=$[ge]);var He=arguments.length-2;if(He===1)le.children=ie;else if(1<He){for(var Re=Array(He),pt=0;pt<He;pt++)Re[pt]=arguments[pt+2];le.children=Re}if(D&&D.defaultProps)for(ge in He=D.defaultProps,He)le[ge]===void 0&&(le[ge]=He[ge]);return{$$typeof:n,type:D,key:se,ref:Me,props:le,_owner:K.current}}function F(D,$){return{$$typeof:n,type:D.type,key:$,ref:D.ref,props:D.props,_owner:D._owner}}function J(D){return typeof D=="object"&&D!==null&&D.$$typeof===n}function oe(D){var $={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ie){return $[ie]})}var Ne=/\/+/g;function Ee(D,$){return typeof D=="object"&&D!==null&&D.key!=null?oe(""+D.key):$.toString(36)}function be(D,$,ie,ge,le){var se=typeof D;(se==="undefined"||se==="boolean")&&(D=null);var Me=!1;if(D===null)Me=!0;else switch(se){case"string":case"number":Me=!0;break;case"object":switch(D.$$typeof){case n:case e:Me=!0}}if(Me)return Me=D,le=le(Me),D=ge===""?"."+Ee(Me,0):ge,L(le)?(ie="",D!=null&&(ie=D.replace(Ne,"$&/")+"/"),be(le,$,ie,"",function(pt){return pt})):le!=null&&(J(le)&&(le=F(le,ie+(!le.key||Me&&Me.key===le.key?"":(""+le.key).replace(Ne,"$&/")+"/")+D)),$.push(le)),1;if(Me=0,ge=ge===""?".":ge+":",L(D))for(var He=0;He<D.length;He++){se=D[He];var Re=ge+Ee(se,He);Me+=be(se,$,ie,Re,le)}else if(Re=y(D),typeof Re=="function")for(D=Re.call(D),He=0;!(se=D.next()).done;)se=se.value,Re=ge+Ee(se,He++),Me+=be(se,$,ie,Re,le);else if(se==="object")throw $=String(D),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return Me}function te(D,$,ie){if(D==null)return D;var ge=[],le=0;return be(D,ge,"","",function(se){return $.call(ie,se,le++)}),ge}function B(D){if(D._status===-1){var $=D._result;$=$(),$.then(function(ie){(D._status===0||D._status===-1)&&(D._status=1,D._result=ie)},function(ie){(D._status===0||D._status===-1)&&(D._status=2,D._result=ie)}),D._status===-1&&(D._status=0,D._result=$)}if(D._status===1)return D._result.default;throw D._result}var Z={current:null},X={transition:null},ne={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:X,ReactCurrentOwner:K};return Ye.Children={map:te,forEach:function(D,$,ie){te(D,function(){$.apply(this,arguments)},ie)},count:function(D){var $=0;return te(D,function(){$++}),$},toArray:function(D){return te(D,function($){return $})||[]},only:function(D){if(!J(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Ye.Component=C,Ye.Fragment=t,Ye.Profiler=r,Ye.PureComponent=M,Ye.StrictMode=s,Ye.Suspense=d,Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Ye.cloneElement=function(D,$,ie){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ge=k({},D.props),le=D.key,se=D.ref,Me=D._owner;if($!=null){if($.ref!==void 0&&(se=$.ref,Me=K.current),$.key!==void 0&&(le=""+$.key),D.type&&D.type.defaultProps)var He=D.type.defaultProps;for(Re in $)O.call($,Re)&&!E.hasOwnProperty(Re)&&(ge[Re]=$[Re]===void 0&&He!==void 0?He[Re]:$[Re])}var Re=arguments.length-2;if(Re===1)ge.children=ie;else if(1<Re){He=Array(Re);for(var pt=0;pt<Re;pt++)He[pt]=arguments[pt+2];ge.children=He}return{$$typeof:n,type:D.type,key:le,ref:se,props:ge,_owner:Me}},Ye.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:a,_context:D},D.Consumer=D},Ye.createElement=R,Ye.createFactory=function(D){var $=R.bind(null,D);return $.type=D,$},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(D){return{$$typeof:u,render:D}},Ye.isValidElement=J,Ye.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:B}},Ye.memo=function(D,$){return{$$typeof:f,type:D,compare:$===void 0?null:$}},Ye.startTransition=function(D){var $=X.transition;X.transition={};try{D()}finally{X.transition=$}},Ye.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Ye.useCallback=function(D,$){return Z.current.useCallback(D,$)},Ye.useContext=function(D){return Z.current.useContext(D)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(D){return Z.current.useDeferredValue(D)},Ye.useEffect=function(D,$){return Z.current.useEffect(D,$)},Ye.useId=function(){return Z.current.useId()},Ye.useImperativeHandle=function(D,$,ie){return Z.current.useImperativeHandle(D,$,ie)},Ye.useInsertionEffect=function(D,$){return Z.current.useInsertionEffect(D,$)},Ye.useLayoutEffect=function(D,$){return Z.current.useLayoutEffect(D,$)},Ye.useMemo=function(D,$){return Z.current.useMemo(D,$)},Ye.useReducer=function(D,$,ie){return Z.current.useReducer(D,$,ie)},Ye.useRef=function(D){return Z.current.useRef(D)},Ye.useState=function(D){return Z.current.useState(D)},Ye.useSyncExternalStore=function(D,$,ie){return Z.current.useSyncExternalStore(D,$,ie)},Ye.useTransition=function(){return Z.current.useTransition()},Ye.version="18.2.0",Ye}var x0;function Bd(){return x0||(x0=1,dh.exports=dw()),dh.exports}/**
|
10
|
+
* @license React
|
11
|
+
* react-jsx-runtime.production.min.js
|
12
|
+
*
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
14
|
+
*
|
15
|
+
* This source code is licensed under the MIT license found in the
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
17
|
+
*/var y0;function fw(){if(y0)return ya;y0=1;var n=Bd(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,f){var p,g={},y=null,w=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(w=d.ref);for(p in d)s.call(d,p)&&!a.hasOwnProperty(p)&&(g[p]=d[p]);if(u&&u.defaultProps)for(p in d=u.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:e,type:u,key:y,ref:w,props:g,_owner:r.current}}return ya.Fragment=t,ya.jsx=l,ya.jsxs=l,ya}var w0;function pw(){return w0||(w0=1,hh.exports=fw()),hh.exports}var c=pw(),v=Bd();const q=Za(v),mw=hw({__proto__:null,default:q},[v]);var fh={exports:{}},an={},ph={exports:{}},mh={};/**
|
18
|
+
* @license React
|
19
|
+
* scheduler.production.min.js
|
20
|
+
*
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
22
|
+
*
|
23
|
+
* This source code is licensed under the MIT license found in the
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
25
|
+
*/var b0;function gw(){return b0||(b0=1,function(n){function e(X,ne){var D=X.length;X.push(ne);e:for(;0<D;){var $=D-1>>>1,ie=X[$];if(0<r(ie,ne))X[$]=ne,X[D]=ie,D=$;else break e}}function t(X){return X.length===0?null:X[0]}function s(X){if(X.length===0)return null;var ne=X[0],D=X.pop();if(D!==ne){X[0]=D;e:for(var $=0,ie=X.length,ge=ie>>>1;$<ge;){var le=2*($+1)-1,se=X[le],Me=le+1,He=X[Me];if(0>r(se,D))Me<ie&&0>r(He,se)?(X[$]=He,X[Me]=D,$=Me):(X[$]=se,X[le]=D,$=le);else if(Me<ie&&0>r(He,D))X[$]=He,X[Me]=D,$=Me;else break e}}return ne}function r(X,ne){var D=X.sortIndex-ne.sortIndex;return D!==0?D:X.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,g=null,y=3,w=!1,k=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(X){for(var ne=t(f);ne!==null;){if(ne.callback===null)s(f);else if(ne.startTime<=X)s(f),ne.sortIndex=ne.expirationTime,e(d,ne);else break;ne=t(f)}}function L(X){if(_=!1,I(X),!k)if(t(d)!==null)k=!0,B(O);else{var ne=t(f);ne!==null&&Z(L,ne.startTime-X)}}function O(X,ne){k=!1,_&&(_=!1,S(R),R=-1),w=!0;var D=y;try{for(I(ne),g=t(d);g!==null&&(!(g.expirationTime>ne)||X&&!oe());){var $=g.callback;if(typeof $=="function"){g.callback=null,y=g.priorityLevel;var ie=$(g.expirationTime<=ne);ne=n.unstable_now(),typeof ie=="function"?g.callback=ie:g===t(d)&&s(d),I(ne)}else s(d);g=t(d)}if(g!==null)var ge=!0;else{var le=t(f);le!==null&&Z(L,le.startTime-ne),ge=!1}return ge}finally{g=null,y=D,w=!1}}var K=!1,E=null,R=-1,F=5,J=-1;function oe(){return!(n.unstable_now()-J<F)}function Ne(){if(E!==null){var X=n.unstable_now();J=X;var ne=!0;try{ne=E(!0,X)}finally{ne?Ee():(K=!1,E=null)}}else K=!1}var Ee;if(typeof M=="function")Ee=function(){M(Ne)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,te=be.port2;be.port1.onmessage=Ne,Ee=function(){te.postMessage(null)}}else Ee=function(){C(Ne,0)};function B(X){E=X,K||(K=!0,Ee())}function Z(X,ne){R=C(function(){X(n.unstable_now())},ne)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(X){X.callback=null},n.unstable_continueExecution=function(){k||w||(k=!0,B(O))},n.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<X?Math.floor(1e3/X):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return t(d)},n.unstable_next=function(X){switch(y){case 1:case 2:case 3:var ne=3;break;default:ne=y}var D=y;y=ne;try{return X()}finally{y=D}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(X,ne){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var D=y;y=X;try{return ne()}finally{y=D}},n.unstable_scheduleCallback=function(X,ne,D){var $=n.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?$+D:$):D=$,X){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=D+ie,X={id:p++,callback:ne,priorityLevel:X,startTime:D,expirationTime:ie,sortIndex:-1},D>$?(X.sortIndex=D,e(f,X),t(d)===null&&X===t(f)&&(_?(S(R),R=-1):_=!0,Z(L,D-$))):(X.sortIndex=ie,e(d,X),k||w||(k=!0,B(O))),X},n.unstable_shouldYield=oe,n.unstable_wrapCallback=function(X){var ne=y;return function(){var D=y;y=ne;try{return X.apply(this,arguments)}finally{y=D}}}}(mh)),mh}var k0;function vw(){return k0||(k0=1,ph.exports=gw()),ph.exports}/**
|
26
|
+
* @license React
|
27
|
+
* react-dom.production.min.js
|
28
|
+
*
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
30
|
+
*
|
31
|
+
* This source code is licensed under the MIT license found in the
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
33
|
+
*/var _0;function xw(){if(_0)return an;_0=1;var n=Bd(),e=vw();function t(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,r={};function a(i,o){l(i,o),l(i+"Capture",o)}function l(i,o){for(r[i]=o,i=0;i<o.length;i++)s.add(o[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function y(i){return d.call(g,i)?!0:d.call(p,i)?!1:f.test(i)?g[i]=!0:(p[i]=!0,!1)}function w(i,o,h,m){if(h!==null&&h.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,o,h,m){if(o===null||typeof o>"u"||w(i,o,h,m))return!0;if(m)return!1;if(h!==null)switch(h.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function _(i,o,h,m,x,b,N){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=m,this.attributeNamespace=x,this.mustUseProperty=h,this.propertyName=i,this.type=o,this.sanitizeURL=b,this.removeEmptyString=N}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new _(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];C[o]=new _(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new _(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new _(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){C[i]=new _(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new _(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new _(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new _(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new _(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function M(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(S,M);C[o]=new _(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(S,M);C[o]=new _(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(S,M);C[o]=new _(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new _(i,1,!1,i.toLowerCase(),null,!1,!1)}),C.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){C[i]=new _(i,1,!1,i.toLowerCase(),null,!0,!0)});function I(i,o,h,m){var x=C.hasOwnProperty(o)?C[o]:null;(x!==null?x.type!==0:m||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(k(o,h,x,m)&&(h=null),m||x===null?y(o)&&(h===null?i.removeAttribute(o):i.setAttribute(o,""+h)):x.mustUseProperty?i[x.propertyName]=h===null?x.type===3?!1:"":h:(o=x.attributeName,m=x.attributeNamespace,h===null?i.removeAttribute(o):(x=x.type,h=x===3||x===4&&h===!0?"":""+h,m?i.setAttributeNS(m,o,h):i.setAttribute(o,h))))}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),K=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),oe=Symbol.for("react.context"),Ne=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),X=Symbol.iterator;function ne(i){return i===null||typeof i!="object"?null:(i=X&&i[X]||i["@@iterator"],typeof i=="function"?i:null)}var D=Object.assign,$;function ie(i){if($===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);$=o&&o[1]||""}return`
|
34
|
+
`+$+i}var ge=!1;function le(i,o){if(!i||ge)return"";ge=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(re){var m=re}Reflect.construct(i,[],o)}else{try{o.call()}catch(re){m=re}i.call(o.prototype)}else{try{throw Error()}catch(re){m=re}i()}}catch(re){if(re&&m&&typeof re.stack=="string"){for(var x=re.stack.split(`
|
35
|
+
`),b=m.stack.split(`
|
36
|
+
`),N=x.length-1,A=b.length-1;1<=N&&0<=A&&x[N]!==b[A];)A--;for(;1<=N&&0<=A;N--,A--)if(x[N]!==b[A]){if(N!==1||A!==1)do if(N--,A--,0>A||x[N]!==b[A]){var V=`
|
37
|
+
`+x[N].replace(" at new "," at ");return i.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",i.displayName)),V}while(1<=N&&0<=A);break}}}finally{ge=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?ie(i):""}function se(i){switch(i.tag){case 5:return ie(i.type);case 16:return ie("Lazy");case 13:return ie("Suspense");case 19:return ie("SuspenseList");case 0:case 2:case 15:return i=le(i.type,!1),i;case 11:return i=le(i.type.render,!1),i;case 1:return i=le(i.type,!0),i;default:return""}}function Me(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case K:return"Portal";case F:return"Profiler";case R:return"StrictMode";case Ee:return"Suspense";case be:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case oe:return(i.displayName||"Context")+".Consumer";case J:return(i._context.displayName||"Context")+".Provider";case Ne:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case te:return o=i.displayName||null,o!==null?o:Me(i.type)||"Memo";case B:o=i._payload,i=i._init;try{return Me(i(o))}catch{}}return null}function He(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Me(o);case 8:return o===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Re(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function pt(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Y(i){var o=pt(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),m=""+i[o];if(!i.hasOwnProperty(o)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,b=h.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return x.call(this)},set:function(N){m=""+N,b.call(this,N)}}),Object.defineProperty(i,o,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(N){m=""+N},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function j(i){i._valueTracker||(i._valueTracker=Y(i))}function z(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var h=o.getValue(),m="";return i&&(m=pt(i)?i.checked?"true":"false":i.value),i=m,i!==h?(o.setValue(i),!0):!1}function T(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function U(i,o){var h=o.checked;return D({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function H(i,o){var h=o.defaultValue==null?"":o.defaultValue,m=o.checked!=null?o.checked:o.defaultChecked;h=Re(o.value!=null?o.value:h),i._wrapperState={initialChecked:m,initialValue:h,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function P(i,o){o=o.checked,o!=null&&I(i,"checked",o,!1)}function Q(i,o){P(i,o);var h=Re(o.value),m=o.type;if(h!=null)m==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(m==="submit"||m==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?he(i,o.type,h):o.hasOwnProperty("defaultValue")&&he(i,o.type,Re(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function ae(i,o,h){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var m=o.type;if(!(m!=="submit"&&m!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,h||o===i.value||(i.value=o),i.defaultValue=o}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function he(i,o,h){(o!=="number"||T(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var je=Array.isArray;function Ce(i,o,h,m){if(i=i.options,o){o={};for(var x=0;x<h.length;x++)o["$"+h[x]]=!0;for(h=0;h<i.length;h++)x=o.hasOwnProperty("$"+i[h].value),i[h].selected!==x&&(i[h].selected=x),x&&m&&(i[h].defaultSelected=!0)}else{for(h=""+Re(h),o=null,x=0;x<i.length;x++){if(i[x].value===h){i[x].selected=!0,m&&(i[x].defaultSelected=!0);return}o!==null||i[x].disabled||(o=i[x])}o!==null&&(o.selected=!0)}}function Oe(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(t(91));return D({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function qe(i,o){var h=o.value;if(h==null){if(h=o.children,o=o.defaultValue,h!=null){if(o!=null)throw Error(t(92));if(je(h)){if(1<h.length)throw Error(t(93));h=h[0]}o=h}o==null&&(o=""),h=o}i._wrapperState={initialValue:Re(h)}}function _t(i,o){var h=Re(o.value),m=Re(o.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),o.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),m!=null&&(i.defaultValue=""+m)}function dt(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function xs(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rn(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?xs(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Ct,ue=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,h,m,x){MSApp.execUnsafeLocalFunction(function(){return i(o,h,m,x)})}:i}(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for(Ct=Ct||document.createElement("div"),Ct.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Ct.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function ve(i,o){if(o){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=o;return}}i.textContent=o}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(i){nt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),Ae[o]=Ae[i]})});function Xe(i,o,h){return o==null||typeof o=="boolean"||o===""?"":h||typeof o!="number"||o===0||Ae.hasOwnProperty(i)&&Ae[i]?(""+o).trim():o+"px"}function Hr(i,o){i=i.style;for(var h in o)if(o.hasOwnProperty(h)){var m=h.indexOf("--")===0,x=Xe(h,o[h],m);h==="float"&&(h="cssFloat"),m?i.setProperty(h,x):i[h]=x}}var py=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _c(i,o){if(o){if(py[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(t(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(t(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(t(61))}if(o.style!=null&&typeof o.style!="object")throw Error(t(62))}}function Cc(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nc=null;function jc(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Sc=null,Ur=null,Wr=null;function Tf(i){if(i=ra(i)){if(typeof Sc!="function")throw Error(t(280));var o=i.stateNode;o&&(o=Do(o),Sc(i.stateNode,i.type,o))}}function If(i){Ur?Wr?Wr.push(i):Wr=[i]:Ur=i}function Af(){if(Ur){var i=Ur,o=Wr;if(Wr=Ur=null,Tf(i),o)for(i=0;i<o.length;i++)Tf(o[i])}}function Lf(i,o){return i(o)}function Of(){}var Ec=!1;function Rf(i,o,h){if(Ec)return i(o,h);Ec=!0;try{return Lf(i,o,h)}finally{Ec=!1,(Ur!==null||Wr!==null)&&(Of(),Af())}}function Pi(i,o){var h=i.stateNode;if(h===null)return null;var m=Do(h);if(m===null)return null;h=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(t(231,o,typeof h));return h}var Mc=!1;if(u)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){Mc=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{Mc=!1}function my(i,o,h,m,x,b,N,A,V){var re=Array.prototype.slice.call(arguments,3);try{o.apply(h,re)}catch(fe){this.onError(fe)}}var Bi=!1,oo=null,lo=!1,Dc=null,gy={onError:function(i){Bi=!0,oo=i}};function vy(i,o,h,m,x,b,N,A,V){Bi=!1,oo=null,my.apply(gy,arguments)}function xy(i,o,h,m,x,b,N,A,V){if(vy.apply(this,arguments),Bi){if(Bi){var re=oo;Bi=!1,oo=null}else throw Error(t(198));lo||(lo=!0,Dc=re)}}function mr(i){var o=i,h=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(h=o.return),i=o.return;while(i)}return o.tag===3?h:null}function Pf(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function zf(i){if(mr(i)!==i)throw Error(t(188))}function yy(i){var o=i.alternate;if(!o){if(o=mr(i),o===null)throw Error(t(188));return o!==i?null:i}for(var h=i,m=o;;){var x=h.return;if(x===null)break;var b=x.alternate;if(b===null){if(m=x.return,m!==null){h=m;continue}break}if(x.child===b.child){for(b=x.child;b;){if(b===h)return zf(x),i;if(b===m)return zf(x),o;b=b.sibling}throw Error(t(188))}if(h.return!==m.return)h=x,m=b;else{for(var N=!1,A=x.child;A;){if(A===h){N=!0,h=x,m=b;break}if(A===m){N=!0,m=x,h=b;break}A=A.sibling}if(!N){for(A=b.child;A;){if(A===h){N=!0,h=b,m=x;break}if(A===m){N=!0,m=b,h=x;break}A=A.sibling}if(!N)throw Error(t(189))}}if(h.alternate!==m)throw Error(t(190))}if(h.tag!==3)throw Error(t(188));return h.stateNode.current===h?i:o}function Bf(i){return i=yy(i),i!==null?Vf(i):null}function Vf(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=Vf(i);if(o!==null)return o;i=i.sibling}return null}var $f=e.unstable_scheduleCallback,Ff=e.unstable_cancelCallback,wy=e.unstable_shouldYield,by=e.unstable_requestPaint,Nt=e.unstable_now,ky=e.unstable_getCurrentPriorityLevel,Tc=e.unstable_ImmediatePriority,Hf=e.unstable_UserBlockingPriority,co=e.unstable_NormalPriority,_y=e.unstable_LowPriority,Uf=e.unstable_IdlePriority,uo=null,qn=null;function Cy(i){if(qn&&typeof qn.onCommitFiberRoot=="function")try{qn.onCommitFiberRoot(uo,i,void 0,(i.current.flags&128)===128)}catch{}}var Pn=Math.clz32?Math.clz32:Sy,Ny=Math.log,jy=Math.LN2;function Sy(i){return i>>>=0,i===0?32:31-(Ny(i)/jy|0)|0}var ho=64,fo=4194304;function Vi(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function po(i,o){var h=i.pendingLanes;if(h===0)return 0;var m=0,x=i.suspendedLanes,b=i.pingedLanes,N=h&268435455;if(N!==0){var A=N&~x;A!==0?m=Vi(A):(b&=N,b!==0&&(m=Vi(b)))}else N=h&~x,N!==0?m=Vi(N):b!==0&&(m=Vi(b));if(m===0)return 0;if(o!==0&&o!==m&&(o&x)===0&&(x=m&-m,b=o&-o,x>=b||x===16&&(b&4194240)!==0))return o;if((m&4)!==0&&(m|=h&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=m;0<o;)h=31-Pn(o),x=1<<h,m|=i[h],o&=~x;return m}function Ey(i,o){switch(i){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function My(i,o){for(var h=i.suspendedLanes,m=i.pingedLanes,x=i.expirationTimes,b=i.pendingLanes;0<b;){var N=31-Pn(b),A=1<<N,V=x[N];V===-1?((A&h)===0||(A&m)!==0)&&(x[N]=Ey(A,o)):V<=o&&(i.expiredLanes|=A),b&=~A}}function Ic(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Wf(){var i=ho;return ho<<=1,(ho&4194240)===0&&(ho=64),i}function Ac(i){for(var o=[],h=0;31>h;h++)o.push(i);return o}function $i(i,o,h){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Pn(o),i[o]=h}function Dy(i,o){var h=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0<h;){var x=31-Pn(h),b=1<<x;o[x]=0,m[x]=-1,i[x]=-1,h&=~b}}function Lc(i,o){var h=i.entangledLanes|=o;for(i=i.entanglements;h;){var m=31-Pn(h),x=1<<m;x&o|i[m]&o&&(i[m]|=o),h&=~x}}var tt=0;function Yf(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Kf,Oc,Qf,Zf,Gf,Rc=!1,mo=[],Rs=null,Ps=null,zs=null,Fi=new Map,Hi=new Map,Bs=[],Ty="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Jf(i,o){switch(i){case"focusin":case"focusout":Rs=null;break;case"dragenter":case"dragleave":Ps=null;break;case"mouseover":case"mouseout":zs=null;break;case"pointerover":case"pointerout":Fi.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hi.delete(o.pointerId)}}function Ui(i,o,h,m,x,b){return i===null||i.nativeEvent!==b?(i={blockedOn:o,domEventName:h,eventSystemFlags:m,nativeEvent:b,targetContainers:[x]},o!==null&&(o=ra(o),o!==null&&Oc(o)),i):(i.eventSystemFlags|=m,o=i.targetContainers,x!==null&&o.indexOf(x)===-1&&o.push(x),i)}function Iy(i,o,h,m,x){switch(o){case"focusin":return Rs=Ui(Rs,i,o,h,m,x),!0;case"dragenter":return Ps=Ui(Ps,i,o,h,m,x),!0;case"mouseover":return zs=Ui(zs,i,o,h,m,x),!0;case"pointerover":var b=x.pointerId;return Fi.set(b,Ui(Fi.get(b)||null,i,o,h,m,x)),!0;case"gotpointercapture":return b=x.pointerId,Hi.set(b,Ui(Hi.get(b)||null,i,o,h,m,x)),!0}return!1}function qf(i){var o=gr(i.target);if(o!==null){var h=mr(o);if(h!==null){if(o=h.tag,o===13){if(o=Pf(h),o!==null){i.blockedOn=o,Gf(i.priority,function(){Qf(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function go(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var h=zc(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var m=new h.constructor(h.type,h);Nc=m,h.target.dispatchEvent(m),Nc=null}else return o=ra(h),o!==null&&Oc(o),i.blockedOn=h,!1;o.shift()}return!0}function Xf(i,o,h){go(i)&&h.delete(o)}function Ay(){Rc=!1,Rs!==null&&go(Rs)&&(Rs=null),Ps!==null&&go(Ps)&&(Ps=null),zs!==null&&go(zs)&&(zs=null),Fi.forEach(Xf),Hi.forEach(Xf)}function Wi(i,o){i.blockedOn===o&&(i.blockedOn=null,Rc||(Rc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ay)))}function Yi(i){function o(x){return Wi(x,i)}if(0<mo.length){Wi(mo[0],i);for(var h=1;h<mo.length;h++){var m=mo[h];m.blockedOn===i&&(m.blockedOn=null)}}for(Rs!==null&&Wi(Rs,i),Ps!==null&&Wi(Ps,i),zs!==null&&Wi(zs,i),Fi.forEach(o),Hi.forEach(o),h=0;h<Bs.length;h++)m=Bs[h],m.blockedOn===i&&(m.blockedOn=null);for(;0<Bs.length&&(h=Bs[0],h.blockedOn===null);)qf(h),h.blockedOn===null&&Bs.shift()}var Yr=L.ReactCurrentBatchConfig,vo=!0;function Ly(i,o,h,m){var x=tt,b=Yr.transition;Yr.transition=null;try{tt=1,Pc(i,o,h,m)}finally{tt=x,Yr.transition=b}}function Oy(i,o,h,m){var x=tt,b=Yr.transition;Yr.transition=null;try{tt=4,Pc(i,o,h,m)}finally{tt=x,Yr.transition=b}}function Pc(i,o,h,m){if(vo){var x=zc(i,o,h,m);if(x===null)tu(i,o,m,xo,h),Jf(i,m);else if(Iy(x,i,o,h,m))m.stopPropagation();else if(Jf(i,m),o&4&&-1<Ty.indexOf(i)){for(;x!==null;){var b=ra(x);if(b!==null&&Kf(b),b=zc(i,o,h,m),b===null&&tu(i,o,m,xo,h),b===x)break;x=b}x!==null&&m.stopPropagation()}else tu(i,o,m,null,h)}}var xo=null;function zc(i,o,h,m){if(xo=null,i=jc(m),i=gr(i),i!==null)if(o=mr(i),o===null)i=null;else if(h=o.tag,h===13){if(i=Pf(o),i!==null)return i;i=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return xo=i,null}function ep(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ky()){case Tc:return 1;case Hf:return 4;case co:case _y:return 16;case Uf:return 536870912;default:return 16}default:return 16}}var Vs=null,Bc=null,yo=null;function tp(){if(yo)return yo;var i,o=Bc,h=o.length,m,x="value"in Vs?Vs.value:Vs.textContent,b=x.length;for(i=0;i<h&&o[i]===x[i];i++);var N=h-i;for(m=1;m<=N&&o[h-m]===x[b-m];m++);return yo=x.slice(i,1<m?1-m:void 0)}function wo(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function bo(){return!0}function np(){return!1}function fn(i){function o(h,m,x,b,N){this._reactName=h,this._targetInst=x,this.type=m,this.nativeEvent=b,this.target=N,this.currentTarget=null;for(var A in i)i.hasOwnProperty(A)&&(h=i[A],this[A]=h?h(b):b[A]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?bo:np,this.isPropagationStopped=np,this}return D(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=bo)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=bo)},persist:function(){},isPersistent:bo}),o}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vc=fn(Kr),Ki=D({},Kr,{view:0,detail:0}),Ry=fn(Ki),$c,Fc,Qi,ko=D({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Qi&&(Qi&&i.type==="mousemove"?($c=i.screenX-Qi.screenX,Fc=i.screenY-Qi.screenY):Fc=$c=0,Qi=i),$c)},movementY:function(i){return"movementY"in i?i.movementY:Fc}}),sp=fn(ko),Py=D({},ko,{dataTransfer:0}),zy=fn(Py),By=D({},Ki,{relatedTarget:0}),Hc=fn(By),Vy=D({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),$y=fn(Vy),Fy=D({},Kr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Hy=fn(Fy),Uy=D({},Kr,{data:0}),rp=fn(Uy),Wy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ky={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qy(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Ky[i])?!!o[i]:!1}function Uc(){return Qy}var Zy=D({},Ki,{key:function(i){if(i.key){var o=Wy[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=wo(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Yy[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(i){return i.type==="keypress"?wo(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?wo(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Gy=fn(Zy),Jy=D({},ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ip=fn(Jy),qy=D({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),Xy=fn(qy),e2=D({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),t2=fn(e2),n2=D({},ko,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),s2=fn(n2),r2=[9,13,27,32],Wc=u&&"CompositionEvent"in window,Zi=null;u&&"documentMode"in document&&(Zi=document.documentMode);var i2=u&&"TextEvent"in window&&!Zi,ap=u&&(!Wc||Zi&&8<Zi&&11>=Zi),op=" ",lp=!1;function cp(i,o){switch(i){case"keyup":return r2.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function up(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Qr=!1;function a2(i,o){switch(i){case"compositionend":return up(o);case"keypress":return o.which!==32?null:(lp=!0,op);case"textInput":return i=o.data,i===op&&lp?null:i;default:return null}}function o2(i,o){if(Qr)return i==="compositionend"||!Wc&&cp(i,o)?(i=tp(),yo=Bc=Vs=null,Qr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ap&&o.locale!=="ko"?null:o.data;default:return null}}var l2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function hp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!l2[i.type]:o==="textarea"}function dp(i,o,h,m){If(m),o=So(o,"onChange"),0<o.length&&(h=new Vc("onChange","change",null,h,m),i.push({event:h,listeners:o}))}var Gi=null,Ji=null;function c2(i){Dp(i,0)}function _o(i){var o=Xr(i);if(z(o))return i}function u2(i,o){if(i==="change")return o}var fp=!1;if(u){var Yc;if(u){var Kc="oninput"in document;if(!Kc){var pp=document.createElement("div");pp.setAttribute("oninput","return;"),Kc=typeof pp.oninput=="function"}Yc=Kc}else Yc=!1;fp=Yc&&(!document.documentMode||9<document.documentMode)}function mp(){Gi&&(Gi.detachEvent("onpropertychange",gp),Ji=Gi=null)}function gp(i){if(i.propertyName==="value"&&_o(Ji)){var o=[];dp(o,Ji,i,jc(i)),Rf(c2,o)}}function h2(i,o,h){i==="focusin"?(mp(),Gi=o,Ji=h,Gi.attachEvent("onpropertychange",gp)):i==="focusout"&&mp()}function d2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return _o(Ji)}function f2(i,o){if(i==="click")return _o(o)}function p2(i,o){if(i==="input"||i==="change")return _o(o)}function m2(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var zn=typeof Object.is=="function"?Object.is:m2;function qi(i,o){if(zn(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var h=Object.keys(i),m=Object.keys(o);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var x=h[m];if(!d.call(o,x)||!zn(i[x],o[x]))return!1}return!0}function vp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function xp(i,o){var h=vp(i);i=0;for(var m;h;){if(h.nodeType===3){if(m=i+h.textContent.length,i<=o&&m>=o)return{node:h,offset:o-i};i=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=vp(h)}}function yp(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?yp(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function wp(){for(var i=window,o=T();o instanceof i.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)i=o.contentWindow;else break;o=T(i.document)}return o}function Qc(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function g2(i){var o=wp(),h=i.focusedElem,m=i.selectionRange;if(o!==h&&h&&h.ownerDocument&&yp(h.ownerDocument.documentElement,h)){if(m!==null&&Qc(h)){if(o=m.start,i=m.end,i===void 0&&(i=o),"selectionStart"in h)h.selectionStart=o,h.selectionEnd=Math.min(i,h.value.length);else if(i=(o=h.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var x=h.textContent.length,b=Math.min(m.start,x);m=m.end===void 0?b:Math.min(m.end,x),!i.extend&&b>m&&(x=m,m=b,b=x),x=xp(h,b);var N=xp(h,m);x&&N&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==N.node||i.focusOffset!==N.offset)&&(o=o.createRange(),o.setStart(x.node,x.offset),i.removeAllRanges(),b>m?(i.addRange(o),i.extend(N.node,N.offset)):(o.setEnd(N.node,N.offset),i.addRange(o)))}}for(o=[],i=h;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<o.length;h++)i=o[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var v2=u&&"documentMode"in document&&11>=document.documentMode,Zr=null,Zc=null,Xi=null,Gc=!1;function bp(i,o,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Gc||Zr==null||Zr!==T(m)||(m=Zr,"selectionStart"in m&&Qc(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Xi&&qi(Xi,m)||(Xi=m,m=So(Zc,"onSelect"),0<m.length&&(o=new Vc("onSelect","select",null,o,h),i.push({event:o,listeners:m}),o.target=Zr)))}function Co(i,o){var h={};return h[i.toLowerCase()]=o.toLowerCase(),h["Webkit"+i]="webkit"+o,h["Moz"+i]="moz"+o,h}var Gr={animationend:Co("Animation","AnimationEnd"),animationiteration:Co("Animation","AnimationIteration"),animationstart:Co("Animation","AnimationStart"),transitionend:Co("Transition","TransitionEnd")},Jc={},kp={};u&&(kp=document.createElement("div").style,"AnimationEvent"in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),"TransitionEvent"in window||delete Gr.transitionend.transition);function No(i){if(Jc[i])return Jc[i];if(!Gr[i])return i;var o=Gr[i],h;for(h in o)if(o.hasOwnProperty(h)&&h in kp)return Jc[i]=o[h];return i}var _p=No("animationend"),Cp=No("animationiteration"),Np=No("animationstart"),jp=No("transitionend"),Sp=new Map,Ep="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $s(i,o){Sp.set(i,o),a(o,[i])}for(var qc=0;qc<Ep.length;qc++){var Xc=Ep[qc],x2=Xc.toLowerCase(),y2=Xc[0].toUpperCase()+Xc.slice(1);$s(x2,"on"+y2)}$s(_p,"onAnimationEnd"),$s(Cp,"onAnimationIteration"),$s(Np,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(jp,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),w2=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function Mp(i,o,h){var m=i.type||"unknown-event";i.currentTarget=h,xy(m,o,void 0,i),i.currentTarget=null}function Dp(i,o){o=(o&4)!==0;for(var h=0;h<i.length;h++){var m=i[h],x=m.event;m=m.listeners;e:{var b=void 0;if(o)for(var N=m.length-1;0<=N;N--){var A=m[N],V=A.instance,re=A.currentTarget;if(A=A.listener,V!==b&&x.isPropagationStopped())break e;Mp(x,A,re),b=V}else for(N=0;N<m.length;N++){if(A=m[N],V=A.instance,re=A.currentTarget,A=A.listener,V!==b&&x.isPropagationStopped())break e;Mp(x,A,re),b=V}}}if(lo)throw i=Dc,lo=!1,Dc=null,i}function ct(i,o){var h=o[ou];h===void 0&&(h=o[ou]=new Set);var m=i+"__bubble";h.has(m)||(Tp(o,i,2,!1),h.add(m))}function eu(i,o,h){var m=0;o&&(m|=4),Tp(h,i,m,o)}var jo="_reactListening"+Math.random().toString(36).slice(2);function ta(i){if(!i[jo]){i[jo]=!0,s.forEach(function(h){h!=="selectionchange"&&(w2.has(h)||eu(h,!1,i),eu(h,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[jo]||(o[jo]=!0,eu("selectionchange",!1,o))}}function Tp(i,o,h,m){switch(ep(o)){case 1:var x=Ly;break;case 4:x=Oy;break;default:x=Pc}h=x.bind(null,o,h,i),x=void 0,!Mc||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(x=!0),m?x!==void 0?i.addEventListener(o,h,{capture:!0,passive:x}):i.addEventListener(o,h,!0):x!==void 0?i.addEventListener(o,h,{passive:x}):i.addEventListener(o,h,!1)}function tu(i,o,h,m,x){var b=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var A=m.stateNode.containerInfo;if(A===x||A.nodeType===8&&A.parentNode===x)break;if(N===4)for(N=m.return;N!==null;){var V=N.tag;if((V===3||V===4)&&(V=N.stateNode.containerInfo,V===x||V.nodeType===8&&V.parentNode===x))return;N=N.return}for(;A!==null;){if(N=gr(A),N===null)return;if(V=N.tag,V===5||V===6){m=b=N;continue e}A=A.parentNode}}m=m.return}Rf(function(){var re=b,fe=jc(h),pe=[];e:{var de=Sp.get(i);if(de!==void 0){var Se=Vc,Te=i;switch(i){case"keypress":if(wo(h)===0)break e;case"keydown":case"keyup":Se=Gy;break;case"focusin":Te="focus",Se=Hc;break;case"focusout":Te="blur",Se=Hc;break;case"beforeblur":case"afterblur":Se=Hc;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=sp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=zy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Xy;break;case _p:case Cp:case Np:Se=$y;break;case jp:Se=t2;break;case"scroll":Se=Ry;break;case"wheel":Se=s2;break;case"copy":case"cut":case"paste":Se=Hy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=ip}var Ie=(o&4)!==0,jt=!Ie&&i==="scroll",G=Ie?de!==null?de+"Capture":null:de;Ie=[];for(var W=re,ee;W!==null;){ee=W;var xe=ee.stateNode;if(ee.tag===5&&xe!==null&&(ee=xe,G!==null&&(xe=Pi(W,G),xe!=null&&Ie.push(na(W,xe,ee)))),jt)break;W=W.return}0<Ie.length&&(de=new Se(de,Te,null,h,fe),pe.push({event:de,listeners:Ie}))}}if((o&7)===0){e:{if(de=i==="mouseover"||i==="pointerover",Se=i==="mouseout"||i==="pointerout",de&&h!==Nc&&(Te=h.relatedTarget||h.fromElement)&&(gr(Te)||Te[ys]))break e;if((Se||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Se?(Te=h.relatedTarget||h.toElement,Se=re,Te=Te?gr(Te):null,Te!==null&&(jt=mr(Te),Te!==jt||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(Se=null,Te=re),Se!==Te)){if(Ie=sp,xe="onMouseLeave",G="onMouseEnter",W="mouse",(i==="pointerout"||i==="pointerover")&&(Ie=ip,xe="onPointerLeave",G="onPointerEnter",W="pointer"),jt=Se==null?de:Xr(Se),ee=Te==null?de:Xr(Te),de=new Ie(xe,W+"leave",Se,h,fe),de.target=jt,de.relatedTarget=ee,xe=null,gr(fe)===re&&(Ie=new Ie(G,W+"enter",Te,h,fe),Ie.target=ee,Ie.relatedTarget=jt,xe=Ie),jt=xe,Se&&Te)t:{for(Ie=Se,G=Te,W=0,ee=Ie;ee;ee=Jr(ee))W++;for(ee=0,xe=G;xe;xe=Jr(xe))ee++;for(;0<W-ee;)Ie=Jr(Ie),W--;for(;0<ee-W;)G=Jr(G),ee--;for(;W--;){if(Ie===G||G!==null&&Ie===G.alternate)break t;Ie=Jr(Ie),G=Jr(G)}Ie=null}else Ie=null;Se!==null&&Ip(pe,de,Se,Ie,!1),Te!==null&&jt!==null&&Ip(pe,jt,Te,Ie,!0)}}e:{if(de=re?Xr(re):window,Se=de.nodeName&&de.nodeName.toLowerCase(),Se==="select"||Se==="input"&&de.type==="file")var Le=u2;else if(hp(de))if(fp)Le=p2;else{Le=d2;var Pe=h2}else(Se=de.nodeName)&&Se.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Le=f2);if(Le&&(Le=Le(i,re))){dp(pe,Le,h,fe);break e}Pe&&Pe(i,de,re),i==="focusout"&&(Pe=de._wrapperState)&&Pe.controlled&&de.type==="number"&&he(de,"number",de.value)}switch(Pe=re?Xr(re):window,i){case"focusin":(hp(Pe)||Pe.contentEditable==="true")&&(Zr=Pe,Zc=re,Xi=null);break;case"focusout":Xi=Zc=Zr=null;break;case"mousedown":Gc=!0;break;case"contextmenu":case"mouseup":case"dragend":Gc=!1,bp(pe,h,fe);break;case"selectionchange":if(v2)break;case"keydown":case"keyup":bp(pe,h,fe)}var ze;if(Wc)e:{switch(i){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Qr?cp(i,h)&&(Ve="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ve="onCompositionStart");Ve&&(ap&&h.locale!=="ko"&&(Qr||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Qr&&(ze=tp()):(Vs=fe,Bc="value"in Vs?Vs.value:Vs.textContent,Qr=!0)),Pe=So(re,Ve),0<Pe.length&&(Ve=new rp(Ve,i,null,h,fe),pe.push({event:Ve,listeners:Pe}),ze?Ve.data=ze:(ze=up(h),ze!==null&&(Ve.data=ze)))),(ze=i2?a2(i,h):o2(i,h))&&(re=So(re,"onBeforeInput"),0<re.length&&(fe=new rp("onBeforeInput","beforeinput",null,h,fe),pe.push({event:fe,listeners:re}),fe.data=ze))}Dp(pe,o)})}function na(i,o,h){return{instance:i,listener:o,currentTarget:h}}function So(i,o){for(var h=o+"Capture",m=[];i!==null;){var x=i,b=x.stateNode;x.tag===5&&b!==null&&(x=b,b=Pi(i,h),b!=null&&m.unshift(na(i,b,x)),b=Pi(i,o),b!=null&&m.push(na(i,b,x))),i=i.return}return m}function Jr(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Ip(i,o,h,m,x){for(var b=o._reactName,N=[];h!==null&&h!==m;){var A=h,V=A.alternate,re=A.stateNode;if(V!==null&&V===m)break;A.tag===5&&re!==null&&(A=re,x?(V=Pi(h,b),V!=null&&N.unshift(na(h,V,A))):x||(V=Pi(h,b),V!=null&&N.push(na(h,V,A)))),h=h.return}N.length!==0&&i.push({event:o,listeners:N})}var b2=/\r\n?/g,k2=/\u0000|\uFFFD/g;function Ap(i){return(typeof i=="string"?i:""+i).replace(b2,`
|
38
|
+
`).replace(k2,"")}function Eo(i,o,h){if(o=Ap(o),Ap(i)!==o&&h)throw Error(t(425))}function Mo(){}var nu=null,su=null;function ru(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var iu=typeof setTimeout=="function"?setTimeout:void 0,_2=typeof clearTimeout=="function"?clearTimeout:void 0,Lp=typeof Promise=="function"?Promise:void 0,C2=typeof queueMicrotask=="function"?queueMicrotask:typeof Lp<"u"?function(i){return Lp.resolve(null).then(i).catch(N2)}:iu;function N2(i){setTimeout(function(){throw i})}function au(i,o){var h=o,m=0;do{var x=h.nextSibling;if(i.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"){if(m===0){i.removeChild(x),Yi(o);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=x}while(h);Yi(o)}function Fs(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function Op(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(o===0)return i;o--}else h==="/$"&&o++}i=i.previousSibling}return null}var qr=Math.random().toString(36).slice(2),Xn="__reactFiber$"+qr,sa="__reactProps$"+qr,ys="__reactContainer$"+qr,ou="__reactEvents$"+qr,j2="__reactListeners$"+qr,S2="__reactHandles$"+qr;function gr(i){var o=i[Xn];if(o)return o;for(var h=i.parentNode;h;){if(o=h[ys]||h[Xn]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(i=Op(i);i!==null;){if(h=i[Xn])return h;i=Op(i)}return o}i=h,h=i.parentNode}return null}function ra(i){return i=i[Xn]||i[ys],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Xr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(t(33))}function Do(i){return i[sa]||null}var lu=[],ei=-1;function Hs(i){return{current:i}}function ut(i){0>ei||(i.current=lu[ei],lu[ei]=null,ei--)}function ot(i,o){ei++,lu[ei]=i.current,i.current=o}var Us={},Ut=Hs(Us),en=Hs(!1),vr=Us;function ti(i,o){var h=i.type.contextTypes;if(!h)return Us;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===o)return m.__reactInternalMemoizedMaskedChildContext;var x={},b;for(b in h)x[b]=o[b];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=x),x}function tn(i){return i=i.childContextTypes,i!=null}function To(){ut(en),ut(Ut)}function Rp(i,o,h){if(Ut.current!==Us)throw Error(t(168));ot(Ut,o),ot(en,h)}function Pp(i,o,h){var m=i.stateNode;if(o=o.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var x in m)if(!(x in o))throw Error(t(108,He(i)||"Unknown",x));return D({},h,m)}function Io(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Us,vr=Ut.current,ot(Ut,i),ot(en,en.current),!0}function zp(i,o,h){var m=i.stateNode;if(!m)throw Error(t(169));h?(i=Pp(i,o,vr),m.__reactInternalMemoizedMergedChildContext=i,ut(en),ut(Ut),ot(Ut,i)):ut(en),ot(en,h)}var ws=null,Ao=!1,cu=!1;function Bp(i){ws===null?ws=[i]:ws.push(i)}function E2(i){Ao=!0,Bp(i)}function Ws(){if(!cu&&ws!==null){cu=!0;var i=0,o=tt;try{var h=ws;for(tt=1;i<h.length;i++){var m=h[i];do m=m(!0);while(m!==null)}ws=null,Ao=!1}catch(x){throw ws!==null&&(ws=ws.slice(i+1)),$f(Tc,Ws),x}finally{tt=o,cu=!1}}return null}var ni=[],si=0,Lo=null,Oo=0,Sn=[],En=0,xr=null,bs=1,ks="";function yr(i,o){ni[si++]=Oo,ni[si++]=Lo,Lo=i,Oo=o}function Vp(i,o,h){Sn[En++]=bs,Sn[En++]=ks,Sn[En++]=xr,xr=i;var m=bs;i=ks;var x=32-Pn(m)-1;m&=~(1<<x),h+=1;var b=32-Pn(o)+x;if(30<b){var N=x-x%5;b=(m&(1<<N)-1).toString(32),m>>=N,x-=N,bs=1<<32-Pn(o)+x|h<<x|m,ks=b+i}else bs=1<<b|h<<x|m,ks=i}function uu(i){i.return!==null&&(yr(i,1),Vp(i,1,0))}function hu(i){for(;i===Lo;)Lo=ni[--si],ni[si]=null,Oo=ni[--si],ni[si]=null;for(;i===xr;)xr=Sn[--En],Sn[En]=null,ks=Sn[--En],Sn[En]=null,bs=Sn[--En],Sn[En]=null}var pn=null,mn=null,ft=!1,Bn=null;function $p(i,o){var h=In(5,null,null,0);h.elementType="DELETED",h.stateNode=o,h.return=i,o=i.deletions,o===null?(i.deletions=[h],i.flags|=16):o.push(h)}function Fp(i,o){switch(i.tag){case 5:var h=i.type;return o=o.nodeType!==1||h.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,pn=i,mn=Fs(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,pn=i,mn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(h=xr!==null?{id:bs,overflow:ks}:null,i.memoizedState={dehydrated:o,treeContext:h,retryLane:1073741824},h=In(18,null,null,0),h.stateNode=o,h.return=i,i.child=h,pn=i,mn=null,!0):!1;default:return!1}}function du(i){return(i.mode&1)!==0&&(i.flags&128)===0}function fu(i){if(ft){var o=mn;if(o){var h=o;if(!Fp(i,o)){if(du(i))throw Error(t(418));o=Fs(h.nextSibling);var m=pn;o&&Fp(i,o)?$p(m,h):(i.flags=i.flags&-4097|2,ft=!1,pn=i)}}else{if(du(i))throw Error(t(418));i.flags=i.flags&-4097|2,ft=!1,pn=i}}}function Hp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;pn=i}function Ro(i){if(i!==pn)return!1;if(!ft)return Hp(i),ft=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!ru(i.type,i.memoizedProps)),o&&(o=mn)){if(du(i))throw Up(),Error(t(418));for(;o;)$p(i,o),o=Fs(o.nextSibling)}if(Hp(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(t(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(o===0){mn=Fs(i.nextSibling);break e}o--}else h!=="$"&&h!=="$!"&&h!=="$?"||o++}i=i.nextSibling}mn=null}}else mn=pn?Fs(i.stateNode.nextSibling):null;return!0}function Up(){for(var i=mn;i;)i=Fs(i.nextSibling)}function ri(){mn=pn=null,ft=!1}function pu(i){Bn===null?Bn=[i]:Bn.push(i)}var M2=L.ReactCurrentBatchConfig;function Vn(i,o){if(i&&i.defaultProps){o=D({},o),i=i.defaultProps;for(var h in i)o[h]===void 0&&(o[h]=i[h]);return o}return o}var Po=Hs(null),zo=null,ii=null,mu=null;function gu(){mu=ii=zo=null}function vu(i){var o=Po.current;ut(Po),i._currentValue=o}function xu(i,o,h){for(;i!==null;){var m=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),i===h)break;i=i.return}}function ai(i,o){zo=i,mu=ii=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(nn=!0),i.firstContext=null)}function Mn(i){var o=i._currentValue;if(mu!==i)if(i={context:i,memoizedValue:o,next:null},ii===null){if(zo===null)throw Error(t(308));ii=i,zo.dependencies={lanes:0,firstContext:i}}else ii=ii.next=i;return o}var wr=null;function yu(i){wr===null?wr=[i]:wr.push(i)}function Wp(i,o,h,m){var x=o.interleaved;return x===null?(h.next=h,yu(o)):(h.next=x.next,x.next=h),o.interleaved=h,_s(i,m)}function _s(i,o){i.lanes|=o;var h=i.alternate;for(h!==null&&(h.lanes|=o),h=i,i=i.return;i!==null;)i.childLanes|=o,h=i.alternate,h!==null&&(h.childLanes|=o),h=i,i=i.return;return h.tag===3?h.stateNode:null}var Ys=!1;function wu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yp(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Cs(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Ks(i,o,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(Ze&2)!==0){var x=m.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),m.pending=o,_s(i,h)}return x=m.interleaved,x===null?(o.next=o,yu(m)):(o.next=x.next,x.next=o),m.interleaved=o,_s(i,h)}function Bo(i,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194240)!==0)){var m=o.lanes;m&=i.pendingLanes,h|=m,o.lanes=h,Lc(i,h)}}function Kp(i,o){var h=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var x=null,b=null;if(h=h.firstBaseUpdate,h!==null){do{var N={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};b===null?x=b=N:b=b.next=N,h=h.next}while(h!==null);b===null?x=b=o:b=b.next=o}else x=b=o;h={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:b,shared:m.shared,effects:m.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=o:i.next=o,h.lastBaseUpdate=o}function Vo(i,o,h,m){var x=i.updateQueue;Ys=!1;var b=x.firstBaseUpdate,N=x.lastBaseUpdate,A=x.shared.pending;if(A!==null){x.shared.pending=null;var V=A,re=V.next;V.next=null,N===null?b=re:N.next=re,N=V;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,A=fe.lastBaseUpdate,A!==N&&(A===null?fe.firstBaseUpdate=re:A.next=re,fe.lastBaseUpdate=V))}if(b!==null){var pe=x.baseState;N=0,fe=re=V=null,A=b;do{var de=A.lane,Se=A.eventTime;if((m&de)===de){fe!==null&&(fe=fe.next={eventTime:Se,lane:0,tag:A.tag,payload:A.payload,callback:A.callback,next:null});e:{var Te=i,Ie=A;switch(de=o,Se=h,Ie.tag){case 1:if(Te=Ie.payload,typeof Te=="function"){pe=Te.call(Se,pe,de);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ie.payload,de=typeof Te=="function"?Te.call(Se,pe,de):Te,de==null)break e;pe=D({},pe,de);break e;case 2:Ys=!0}}A.callback!==null&&A.lane!==0&&(i.flags|=64,de=x.effects,de===null?x.effects=[A]:de.push(A))}else Se={eventTime:Se,lane:de,tag:A.tag,payload:A.payload,callback:A.callback,next:null},fe===null?(re=fe=Se,V=pe):fe=fe.next=Se,N|=de;if(A=A.next,A===null){if(A=x.shared.pending,A===null)break;de=A,A=de.next,de.next=null,x.lastBaseUpdate=de,x.shared.pending=null}}while(!0);if(fe===null&&(V=pe),x.baseState=V,x.firstBaseUpdate=re,x.lastBaseUpdate=fe,o=x.shared.interleaved,o!==null){x=o;do N|=x.lane,x=x.next;while(x!==o)}else b===null&&(x.shared.lanes=0);_r|=N,i.lanes=N,i.memoizedState=pe}}function Qp(i,o,h){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var m=i[o],x=m.callback;if(x!==null){if(m.callback=null,m=h,typeof x!="function")throw Error(t(191,x));x.call(m)}}}var Zp=new n.Component().refs;function bu(i,o,h,m){o=i.memoizedState,h=h(m,o),h=h==null?o:D({},o,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var $o={isMounted:function(i){return(i=i._reactInternals)?mr(i)===i:!1},enqueueSetState:function(i,o,h){i=i._reactInternals;var m=Gt(),x=Js(i),b=Cs(m,x);b.payload=o,h!=null&&(b.callback=h),o=Ks(i,b,x),o!==null&&(Hn(o,i,x,m),Bo(o,i,x))},enqueueReplaceState:function(i,o,h){i=i._reactInternals;var m=Gt(),x=Js(i),b=Cs(m,x);b.tag=1,b.payload=o,h!=null&&(b.callback=h),o=Ks(i,b,x),o!==null&&(Hn(o,i,x,m),Bo(o,i,x))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var h=Gt(),m=Js(i),x=Cs(h,m);x.tag=2,o!=null&&(x.callback=o),o=Ks(i,x,m),o!==null&&(Hn(o,i,m,h),Bo(o,i,m))}};function Gp(i,o,h,m,x,b,N){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,b,N):o.prototype&&o.prototype.isPureReactComponent?!qi(h,m)||!qi(x,b):!0}function Jp(i,o,h){var m=!1,x=Us,b=o.contextType;return typeof b=="object"&&b!==null?b=Mn(b):(x=tn(o)?vr:Ut.current,m=o.contextTypes,b=(m=m!=null)?ti(i,x):Us),o=new o(h,b),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=$o,i.stateNode=o,o._reactInternals=i,m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=x,i.__reactInternalMemoizedMaskedChildContext=b),o}function qp(i,o,h,m){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,m),o.state!==i&&$o.enqueueReplaceState(o,o.state,null)}function ku(i,o,h,m){var x=i.stateNode;x.props=h,x.state=i.memoizedState,x.refs=Zp,wu(i);var b=o.contextType;typeof b=="object"&&b!==null?x.context=Mn(b):(b=tn(o)?vr:Ut.current,x.context=ti(i,b)),x.state=i.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(bu(i,o,b,h),x.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(o=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),o!==x.state&&$o.enqueueReplaceState(x,x.state,null),Vo(i,h,x,m),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308)}function ia(i,o,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(t(309));var m=h.stateNode}if(!m)throw Error(t(147,i));var x=m,b=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===b?o.ref:(o=function(N){var A=x.refs;A===Zp&&(A=x.refs={}),N===null?delete A[b]:A[b]=N},o._stringRef=b,o)}if(typeof i!="string")throw Error(t(284));if(!h._owner)throw Error(t(290,i))}return i}function Fo(i,o){throw i=Object.prototype.toString.call(o),Error(t(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function Xp(i){var o=i._init;return o(i._payload)}function em(i){function o(G,W){if(i){var ee=G.deletions;ee===null?(G.deletions=[W],G.flags|=16):ee.push(W)}}function h(G,W){if(!i)return null;for(;W!==null;)o(G,W),W=W.sibling;return null}function m(G,W){for(G=new Map;W!==null;)W.key!==null?G.set(W.key,W):G.set(W.index,W),W=W.sibling;return G}function x(G,W){return G=Xs(G,W),G.index=0,G.sibling=null,G}function b(G,W,ee){return G.index=ee,i?(ee=G.alternate,ee!==null?(ee=ee.index,ee<W?(G.flags|=2,W):ee):(G.flags|=2,W)):(G.flags|=1048576,W)}function N(G){return i&&G.alternate===null&&(G.flags|=2),G}function A(G,W,ee,xe){return W===null||W.tag!==6?(W=ih(ee,G.mode,xe),W.return=G,W):(W=x(W,ee),W.return=G,W)}function V(G,W,ee,xe){var Le=ee.type;return Le===E?fe(G,W,ee.props.children,xe,ee.key):W!==null&&(W.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===B&&Xp(Le)===W.type)?(xe=x(W,ee.props),xe.ref=ia(G,W,ee),xe.return=G,xe):(xe=ol(ee.type,ee.key,ee.props,null,G.mode,xe),xe.ref=ia(G,W,ee),xe.return=G,xe)}function re(G,W,ee,xe){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=ah(ee,G.mode,xe),W.return=G,W):(W=x(W,ee.children||[]),W.return=G,W)}function fe(G,W,ee,xe,Le){return W===null||W.tag!==7?(W=Sr(ee,G.mode,xe,Le),W.return=G,W):(W=x(W,ee),W.return=G,W)}function pe(G,W,ee){if(typeof W=="string"&&W!==""||typeof W=="number")return W=ih(""+W,G.mode,ee),W.return=G,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case O:return ee=ol(W.type,W.key,W.props,null,G.mode,ee),ee.ref=ia(G,null,W),ee.return=G,ee;case K:return W=ah(W,G.mode,ee),W.return=G,W;case B:var xe=W._init;return pe(G,xe(W._payload),ee)}if(je(W)||ne(W))return W=Sr(W,G.mode,ee,null),W.return=G,W;Fo(G,W)}return null}function de(G,W,ee,xe){var Le=W!==null?W.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Le!==null?null:A(G,W,""+ee,xe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return ee.key===Le?V(G,W,ee,xe):null;case K:return ee.key===Le?re(G,W,ee,xe):null;case B:return Le=ee._init,de(G,W,Le(ee._payload),xe)}if(je(ee)||ne(ee))return Le!==null?null:fe(G,W,ee,xe,null);Fo(G,ee)}return null}function Se(G,W,ee,xe,Le){if(typeof xe=="string"&&xe!==""||typeof xe=="number")return G=G.get(ee)||null,A(W,G,""+xe,Le);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case O:return G=G.get(xe.key===null?ee:xe.key)||null,V(W,G,xe,Le);case K:return G=G.get(xe.key===null?ee:xe.key)||null,re(W,G,xe,Le);case B:var Pe=xe._init;return Se(G,W,ee,Pe(xe._payload),Le)}if(je(xe)||ne(xe))return G=G.get(ee)||null,fe(W,G,xe,Le,null);Fo(W,xe)}return null}function Te(G,W,ee,xe){for(var Le=null,Pe=null,ze=W,Ve=W=0,Pt=null;ze!==null&&Ve<ee.length;Ve++){ze.index>Ve?(Pt=ze,ze=null):Pt=ze.sibling;var Ge=de(G,ze,ee[Ve],xe);if(Ge===null){ze===null&&(ze=Pt);break}i&&ze&&Ge.alternate===null&&o(G,ze),W=b(Ge,W,Ve),Pe===null?Le=Ge:Pe.sibling=Ge,Pe=Ge,ze=Pt}if(Ve===ee.length)return h(G,ze),ft&&yr(G,Ve),Le;if(ze===null){for(;Ve<ee.length;Ve++)ze=pe(G,ee[Ve],xe),ze!==null&&(W=b(ze,W,Ve),Pe===null?Le=ze:Pe.sibling=ze,Pe=ze);return ft&&yr(G,Ve),Le}for(ze=m(G,ze);Ve<ee.length;Ve++)Pt=Se(ze,G,Ve,ee[Ve],xe),Pt!==null&&(i&&Pt.alternate!==null&&ze.delete(Pt.key===null?Ve:Pt.key),W=b(Pt,W,Ve),Pe===null?Le=Pt:Pe.sibling=Pt,Pe=Pt);return i&&ze.forEach(function(er){return o(G,er)}),ft&&yr(G,Ve),Le}function Ie(G,W,ee,xe){var Le=ne(ee);if(typeof Le!="function")throw Error(t(150));if(ee=Le.call(ee),ee==null)throw Error(t(151));for(var Pe=Le=null,ze=W,Ve=W=0,Pt=null,Ge=ee.next();ze!==null&&!Ge.done;Ve++,Ge=ee.next()){ze.index>Ve?(Pt=ze,ze=null):Pt=ze.sibling;var er=de(G,ze,Ge.value,xe);if(er===null){ze===null&&(ze=Pt);break}i&&ze&&er.alternate===null&&o(G,ze),W=b(er,W,Ve),Pe===null?Le=er:Pe.sibling=er,Pe=er,ze=Pt}if(Ge.done)return h(G,ze),ft&&yr(G,Ve),Le;if(ze===null){for(;!Ge.done;Ve++,Ge=ee.next())Ge=pe(G,Ge.value,xe),Ge!==null&&(W=b(Ge,W,Ve),Pe===null?Le=Ge:Pe.sibling=Ge,Pe=Ge);return ft&&yr(G,Ve),Le}for(ze=m(G,ze);!Ge.done;Ve++,Ge=ee.next())Ge=Se(ze,G,Ve,Ge.value,xe),Ge!==null&&(i&&Ge.alternate!==null&&ze.delete(Ge.key===null?Ve:Ge.key),W=b(Ge,W,Ve),Pe===null?Le=Ge:Pe.sibling=Ge,Pe=Ge);return i&&ze.forEach(function(lw){return o(G,lw)}),ft&&yr(G,Ve),Le}function jt(G,W,ee,xe){if(typeof ee=="object"&&ee!==null&&ee.type===E&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:e:{for(var Le=ee.key,Pe=W;Pe!==null;){if(Pe.key===Le){if(Le=ee.type,Le===E){if(Pe.tag===7){h(G,Pe.sibling),W=x(Pe,ee.props.children),W.return=G,G=W;break e}}else if(Pe.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===B&&Xp(Le)===Pe.type){h(G,Pe.sibling),W=x(Pe,ee.props),W.ref=ia(G,Pe,ee),W.return=G,G=W;break e}h(G,Pe);break}else o(G,Pe);Pe=Pe.sibling}ee.type===E?(W=Sr(ee.props.children,G.mode,xe,ee.key),W.return=G,G=W):(xe=ol(ee.type,ee.key,ee.props,null,G.mode,xe),xe.ref=ia(G,W,ee),xe.return=G,G=xe)}return N(G);case K:e:{for(Pe=ee.key;W!==null;){if(W.key===Pe)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){h(G,W.sibling),W=x(W,ee.children||[]),W.return=G,G=W;break e}else{h(G,W);break}else o(G,W);W=W.sibling}W=ah(ee,G.mode,xe),W.return=G,G=W}return N(G);case B:return Pe=ee._init,jt(G,W,Pe(ee._payload),xe)}if(je(ee))return Te(G,W,ee,xe);if(ne(ee))return Ie(G,W,ee,xe);Fo(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,W!==null&&W.tag===6?(h(G,W.sibling),W=x(W,ee),W.return=G,G=W):(h(G,W),W=ih(ee,G.mode,xe),W.return=G,G=W),N(G)):h(G,W)}return jt}var oi=em(!0),tm=em(!1),aa={},es=Hs(aa),oa=Hs(aa),la=Hs(aa);function br(i){if(i===aa)throw Error(t(174));return i}function _u(i,o){switch(ot(la,o),ot(oa,i),ot(es,aa),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:Rn(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=Rn(o,i)}ut(es),ot(es,o)}function li(){ut(es),ut(oa),ut(la)}function nm(i){br(la.current);var o=br(es.current),h=Rn(o,i.type);o!==h&&(ot(oa,i),ot(es,h))}function Cu(i){oa.current===i&&(ut(es),ut(oa))}var mt=Hs(0);function Ho(i){for(var o=i;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Nu=[];function ju(){for(var i=0;i<Nu.length;i++)Nu[i]._workInProgressVersionPrimary=null;Nu.length=0}var Uo=L.ReactCurrentDispatcher,Su=L.ReactCurrentBatchConfig,kr=0,gt=null,At=null,Ot=null,Wo=!1,ca=!1,ua=0,D2=0;function Wt(){throw Error(t(321))}function Eu(i,o){if(o===null)return!1;for(var h=0;h<o.length&&h<i.length;h++)if(!zn(i[h],o[h]))return!1;return!0}function Mu(i,o,h,m,x,b){if(kr=b,gt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Uo.current=i===null||i.memoizedState===null?L2:O2,i=h(m,x),ca){b=0;do{if(ca=!1,ua=0,25<=b)throw Error(t(301));b+=1,Ot=At=null,o.updateQueue=null,Uo.current=R2,i=h(m,x)}while(ca)}if(Uo.current=Qo,o=At!==null&&At.next!==null,kr=0,Ot=At=gt=null,Wo=!1,o)throw Error(t(300));return i}function Du(){var i=ua!==0;return ua=0,i}function ts(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?gt.memoizedState=Ot=i:Ot=Ot.next=i,Ot}function Dn(){if(At===null){var i=gt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var o=Ot===null?gt.memoizedState:Ot.next;if(o!==null)Ot=o,At=i;else{if(i===null)throw Error(t(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Ot===null?gt.memoizedState=Ot=i:Ot=Ot.next=i}return Ot}function ha(i,o){return typeof o=="function"?o(i):o}function Tu(i){var o=Dn(),h=o.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=i;var m=At,x=m.baseQueue,b=h.pending;if(b!==null){if(x!==null){var N=x.next;x.next=b.next,b.next=N}m.baseQueue=x=b,h.pending=null}if(x!==null){b=x.next,m=m.baseState;var A=N=null,V=null,re=b;do{var fe=re.lane;if((kr&fe)===fe)V!==null&&(V=V.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),m=re.hasEagerState?re.eagerState:i(m,re.action);else{var pe={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};V===null?(A=V=pe,N=m):V=V.next=pe,gt.lanes|=fe,_r|=fe}re=re.next}while(re!==null&&re!==b);V===null?N=m:V.next=A,zn(m,o.memoizedState)||(nn=!0),o.memoizedState=m,o.baseState=N,o.baseQueue=V,h.lastRenderedState=m}if(i=h.interleaved,i!==null){x=i;do b=x.lane,gt.lanes|=b,_r|=b,x=x.next;while(x!==i)}else x===null&&(h.lanes=0);return[o.memoizedState,h.dispatch]}function Iu(i){var o=Dn(),h=o.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=i;var m=h.dispatch,x=h.pending,b=o.memoizedState;if(x!==null){h.pending=null;var N=x=x.next;do b=i(b,N.action),N=N.next;while(N!==x);zn(b,o.memoizedState)||(nn=!0),o.memoizedState=b,o.baseQueue===null&&(o.baseState=b),h.lastRenderedState=b}return[b,m]}function sm(){}function rm(i,o){var h=gt,m=Dn(),x=o(),b=!zn(m.memoizedState,x);if(b&&(m.memoizedState=x,nn=!0),m=m.queue,Au(om.bind(null,h,m,i),[i]),m.getSnapshot!==o||b||Ot!==null&&Ot.memoizedState.tag&1){if(h.flags|=2048,da(9,am.bind(null,h,m,x,o),void 0,null),Rt===null)throw Error(t(349));(kr&30)!==0||im(h,o,x)}return x}function im(i,o,h){i.flags|=16384,i={getSnapshot:o,value:h},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.stores=[i]):(h=o.stores,h===null?o.stores=[i]:h.push(i))}function am(i,o,h,m){o.value=h,o.getSnapshot=m,lm(o)&&cm(i)}function om(i,o,h){return h(function(){lm(o)&&cm(i)})}function lm(i){var o=i.getSnapshot;i=i.value;try{var h=o();return!zn(i,h)}catch{return!0}}function cm(i){var o=_s(i,1);o!==null&&Hn(o,i,1,-1)}function um(i){var o=ts();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:i},o.queue=i,i=i.dispatch=A2.bind(null,gt,i),[o.memoizedState,i]}function da(i,o,h,m){return i={tag:i,create:o,destroy:h,deps:m,next:null},o=gt.updateQueue,o===null?(o={lastEffect:null,stores:null},gt.updateQueue=o,o.lastEffect=i.next=i):(h=o.lastEffect,h===null?o.lastEffect=i.next=i:(m=h.next,h.next=i,i.next=m,o.lastEffect=i)),i}function hm(){return Dn().memoizedState}function Yo(i,o,h,m){var x=ts();gt.flags|=i,x.memoizedState=da(1|o,h,void 0,m===void 0?null:m)}function Ko(i,o,h,m){var x=Dn();m=m===void 0?null:m;var b=void 0;if(At!==null){var N=At.memoizedState;if(b=N.destroy,m!==null&&Eu(m,N.deps)){x.memoizedState=da(o,h,b,m);return}}gt.flags|=i,x.memoizedState=da(1|o,h,b,m)}function dm(i,o){return Yo(8390656,8,i,o)}function Au(i,o){return Ko(2048,8,i,o)}function fm(i,o){return Ko(4,2,i,o)}function pm(i,o){return Ko(4,4,i,o)}function mm(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function gm(i,o,h){return h=h!=null?h.concat([i]):null,Ko(4,4,mm.bind(null,o,i),h)}function Lu(){}function vm(i,o){var h=Dn();o=o===void 0?null:o;var m=h.memoizedState;return m!==null&&o!==null&&Eu(o,m[1])?m[0]:(h.memoizedState=[i,o],i)}function xm(i,o){var h=Dn();o=o===void 0?null:o;var m=h.memoizedState;return m!==null&&o!==null&&Eu(o,m[1])?m[0]:(i=i(),h.memoizedState=[i,o],i)}function ym(i,o,h){return(kr&21)===0?(i.baseState&&(i.baseState=!1,nn=!0),i.memoizedState=h):(zn(h,o)||(h=Wf(),gt.lanes|=h,_r|=h,i.baseState=!0),o)}function T2(i,o){var h=tt;tt=h!==0&&4>h?h:4,i(!0);var m=Su.transition;Su.transition={};try{i(!1),o()}finally{tt=h,Su.transition=m}}function wm(){return Dn().memoizedState}function I2(i,o,h){var m=Js(i);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},bm(i))km(o,h);else if(h=Wp(i,o,h,m),h!==null){var x=Gt();Hn(h,i,m,x),_m(h,o,m)}}function A2(i,o,h){var m=Js(i),x={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(bm(i))km(o,x);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=o.lastRenderedReducer,b!==null))try{var N=o.lastRenderedState,A=b(N,h);if(x.hasEagerState=!0,x.eagerState=A,zn(A,N)){var V=o.interleaved;V===null?(x.next=x,yu(o)):(x.next=V.next,V.next=x),o.interleaved=x;return}}catch{}finally{}h=Wp(i,o,x,m),h!==null&&(x=Gt(),Hn(h,i,m,x),_m(h,o,m))}}function bm(i){var o=i.alternate;return i===gt||o!==null&&o===gt}function km(i,o){ca=Wo=!0;var h=i.pending;h===null?o.next=o:(o.next=h.next,h.next=o),i.pending=o}function _m(i,o,h){if((h&4194240)!==0){var m=o.lanes;m&=i.pendingLanes,h|=m,o.lanes=h,Lc(i,h)}}var Qo={readContext:Mn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},L2={readContext:Mn,useCallback:function(i,o){return ts().memoizedState=[i,o===void 0?null:o],i},useContext:Mn,useEffect:dm,useImperativeHandle:function(i,o,h){return h=h!=null?h.concat([i]):null,Yo(4194308,4,mm.bind(null,o,i),h)},useLayoutEffect:function(i,o){return Yo(4194308,4,i,o)},useInsertionEffect:function(i,o){return Yo(4,2,i,o)},useMemo:function(i,o){var h=ts();return o=o===void 0?null:o,i=i(),h.memoizedState=[i,o],i},useReducer:function(i,o,h){var m=ts();return o=h!==void 0?h(o):o,m.memoizedState=m.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},m.queue=i,i=i.dispatch=I2.bind(null,gt,i),[m.memoizedState,i]},useRef:function(i){var o=ts();return i={current:i},o.memoizedState=i},useState:um,useDebugValue:Lu,useDeferredValue:function(i){return ts().memoizedState=i},useTransition:function(){var i=um(!1),o=i[0];return i=T2.bind(null,i[1]),ts().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,h){var m=gt,x=ts();if(ft){if(h===void 0)throw Error(t(407));h=h()}else{if(h=o(),Rt===null)throw Error(t(349));(kr&30)!==0||im(m,o,h)}x.memoizedState=h;var b={value:h,getSnapshot:o};return x.queue=b,dm(om.bind(null,m,b,i),[i]),m.flags|=2048,da(9,am.bind(null,m,b,h,o),void 0,null),h},useId:function(){var i=ts(),o=Rt.identifierPrefix;if(ft){var h=ks,m=bs;h=(m&~(1<<32-Pn(m)-1)).toString(32)+h,o=":"+o+"R"+h,h=ua++,0<h&&(o+="H"+h.toString(32)),o+=":"}else h=D2++,o=":"+o+"r"+h.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},O2={readContext:Mn,useCallback:vm,useContext:Mn,useEffect:Au,useImperativeHandle:gm,useInsertionEffect:fm,useLayoutEffect:pm,useMemo:xm,useReducer:Tu,useRef:hm,useState:function(){return Tu(ha)},useDebugValue:Lu,useDeferredValue:function(i){var o=Dn();return ym(o,At.memoizedState,i)},useTransition:function(){var i=Tu(ha)[0],o=Dn().memoizedState;return[i,o]},useMutableSource:sm,useSyncExternalStore:rm,useId:wm,unstable_isNewReconciler:!1},R2={readContext:Mn,useCallback:vm,useContext:Mn,useEffect:Au,useImperativeHandle:gm,useInsertionEffect:fm,useLayoutEffect:pm,useMemo:xm,useReducer:Iu,useRef:hm,useState:function(){return Iu(ha)},useDebugValue:Lu,useDeferredValue:function(i){var o=Dn();return At===null?o.memoizedState=i:ym(o,At.memoizedState,i)},useTransition:function(){var i=Iu(ha)[0],o=Dn().memoizedState;return[i,o]},useMutableSource:sm,useSyncExternalStore:rm,useId:wm,unstable_isNewReconciler:!1};function ci(i,o){try{var h="",m=o;do h+=se(m),m=m.return;while(m);var x=h}catch(b){x=`
|
39
|
+
Error generating stack: `+b.message+`
|
40
|
+
`+b.stack}return{value:i,source:o,stack:x,digest:null}}function Ou(i,o,h){return{value:i,source:null,stack:h??null,digest:o??null}}function Ru(i,o){try{console.error(o.value)}catch(h){setTimeout(function(){throw h})}}var P2=typeof WeakMap=="function"?WeakMap:Map;function Cm(i,o,h){h=Cs(-1,h),h.tag=3,h.payload={element:null};var m=o.value;return h.callback=function(){tl||(tl=!0,Ju=m),Ru(i,o)},h}function Nm(i,o,h){h=Cs(-1,h),h.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var x=o.value;h.payload=function(){return m(x)},h.callback=function(){Ru(i,o)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(h.callback=function(){Ru(i,o),typeof m!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var N=o.stack;this.componentDidCatch(o.value,{componentStack:N!==null?N:""})}),h}function jm(i,o,h){var m=i.pingCache;if(m===null){m=i.pingCache=new P2;var x=new Set;m.set(o,x)}else x=m.get(o),x===void 0&&(x=new Set,m.set(o,x));x.has(h)||(x.add(h),i=J2.bind(null,i,o,h),o.then(i,i))}function Sm(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function Em(i,o,h,m,x){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(o=Cs(-1,1),o.tag=2,Ks(h,o,1))),h.lanes|=1),i):(i.flags|=65536,i.lanes=x,i)}var z2=L.ReactCurrentOwner,nn=!1;function Zt(i,o,h,m){o.child=i===null?tm(o,null,h,m):oi(o,i.child,h,m)}function Mm(i,o,h,m,x){h=h.render;var b=o.ref;return ai(o,x),m=Mu(i,o,h,m,b,x),h=Du(),i!==null&&!nn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Ns(i,o,x)):(ft&&h&&uu(o),o.flags|=1,Zt(i,o,m,x),o.child)}function Dm(i,o,h,m,x){if(i===null){var b=h.type;return typeof b=="function"&&!rh(b)&&b.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(o.tag=15,o.type=b,Tm(i,o,b,m,x)):(i=ol(h.type,null,m,o,o.mode,x),i.ref=o.ref,i.return=o,o.child=i)}if(b=i.child,(i.lanes&x)===0){var N=b.memoizedProps;if(h=h.compare,h=h!==null?h:qi,h(N,m)&&i.ref===o.ref)return Ns(i,o,x)}return o.flags|=1,i=Xs(b,m),i.ref=o.ref,i.return=o,o.child=i}function Tm(i,o,h,m,x){if(i!==null){var b=i.memoizedProps;if(qi(b,m)&&i.ref===o.ref)if(nn=!1,o.pendingProps=m=b,(i.lanes&x)!==0)(i.flags&131072)!==0&&(nn=!0);else return o.lanes=i.lanes,Ns(i,o,x)}return Pu(i,o,h,m,x)}function Im(i,o,h){var m=o.pendingProps,x=m.children,b=i!==null?i.memoizedState:null;if(m.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(hi,gn),gn|=h;else{if((h&1073741824)===0)return i=b!==null?b.baseLanes|h:h,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,ot(hi,gn),gn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:h,ot(hi,gn),gn|=m}else b!==null?(m=b.baseLanes|h,o.memoizedState=null):m=h,ot(hi,gn),gn|=m;return Zt(i,o,x,h),o.child}function Am(i,o){var h=o.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(o.flags|=512,o.flags|=2097152)}function Pu(i,o,h,m,x){var b=tn(h)?vr:Ut.current;return b=ti(o,b),ai(o,x),h=Mu(i,o,h,m,b,x),m=Du(),i!==null&&!nn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Ns(i,o,x)):(ft&&m&&uu(o),o.flags|=1,Zt(i,o,h,x),o.child)}function Lm(i,o,h,m,x){if(tn(h)){var b=!0;Io(o)}else b=!1;if(ai(o,x),o.stateNode===null)Go(i,o),Jp(o,h,m),ku(o,h,m,x),m=!0;else if(i===null){var N=o.stateNode,A=o.memoizedProps;N.props=A;var V=N.context,re=h.contextType;typeof re=="object"&&re!==null?re=Mn(re):(re=tn(h)?vr:Ut.current,re=ti(o,re));var fe=h.getDerivedStateFromProps,pe=typeof fe=="function"||typeof N.getSnapshotBeforeUpdate=="function";pe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(A!==m||V!==re)&&qp(o,N,m,re),Ys=!1;var de=o.memoizedState;N.state=de,Vo(o,m,N,x),V=o.memoizedState,A!==m||de!==V||en.current||Ys?(typeof fe=="function"&&(bu(o,h,fe,m),V=o.memoizedState),(A=Ys||Gp(o,h,A,m,de,V,re))?(pe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(o.flags|=4194308)):(typeof N.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=V),N.props=m,N.state=V,N.context=re,m=A):(typeof N.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{N=o.stateNode,Yp(i,o),A=o.memoizedProps,re=o.type===o.elementType?A:Vn(o.type,A),N.props=re,pe=o.pendingProps,de=N.context,V=h.contextType,typeof V=="object"&&V!==null?V=Mn(V):(V=tn(h)?vr:Ut.current,V=ti(o,V));var Se=h.getDerivedStateFromProps;(fe=typeof Se=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(A!==pe||de!==V)&&qp(o,N,m,V),Ys=!1,de=o.memoizedState,N.state=de,Vo(o,m,N,x);var Te=o.memoizedState;A!==pe||de!==Te||en.current||Ys?(typeof Se=="function"&&(bu(o,h,Se,m),Te=o.memoizedState),(re=Ys||Gp(o,h,re,m,de,Te,V)||!1)?(fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(m,Te,V),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,Te,V)),typeof N.componentDidUpdate=="function"&&(o.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof N.componentDidUpdate!="function"||A===i.memoizedProps&&de===i.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&de===i.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=Te),N.props=m,N.state=Te,N.context=V,m=re):(typeof N.componentDidUpdate!="function"||A===i.memoizedProps&&de===i.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&de===i.memoizedState||(o.flags|=1024),m=!1)}return zu(i,o,h,m,b,x)}function zu(i,o,h,m,x,b){Am(i,o);var N=(o.flags&128)!==0;if(!m&&!N)return x&&zp(o,h,!1),Ns(i,o,b);m=o.stateNode,z2.current=o;var A=N&&typeof h.getDerivedStateFromError!="function"?null:m.render();return o.flags|=1,i!==null&&N?(o.child=oi(o,i.child,null,b),o.child=oi(o,null,A,b)):Zt(i,o,A,b),o.memoizedState=m.state,x&&zp(o,h,!0),o.child}function Om(i){var o=i.stateNode;o.pendingContext?Rp(i,o.pendingContext,o.pendingContext!==o.context):o.context&&Rp(i,o.context,!1),_u(i,o.containerInfo)}function Rm(i,o,h,m,x){return ri(),pu(x),o.flags|=256,Zt(i,o,h,m),o.child}var Bu={dehydrated:null,treeContext:null,retryLane:0};function Vu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Pm(i,o,h){var m=o.pendingProps,x=mt.current,b=!1,N=(o.flags&128)!==0,A;if((A=N)||(A=i!==null&&i.memoizedState===null?!1:(x&2)!==0),A?(b=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(x|=1),ot(mt,x&1),i===null)return fu(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(N=m.children,i=m.fallback,b?(m=o.mode,b=o.child,N={mode:"hidden",children:N},(m&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=N):b=ll(N,m,0,null),i=Sr(i,m,h,null),b.return=o,i.return=o,b.sibling=i,o.child=b,o.child.memoizedState=Vu(h),o.memoizedState=Bu,i):$u(o,N));if(x=i.memoizedState,x!==null&&(A=x.dehydrated,A!==null))return B2(i,o,N,m,A,x,h);if(b){b=m.fallback,N=o.mode,x=i.child,A=x.sibling;var V={mode:"hidden",children:m.children};return(N&1)===0&&o.child!==x?(m=o.child,m.childLanes=0,m.pendingProps=V,o.deletions=null):(m=Xs(x,V),m.subtreeFlags=x.subtreeFlags&14680064),A!==null?b=Xs(A,b):(b=Sr(b,N,h,null),b.flags|=2),b.return=o,m.return=o,m.sibling=b,o.child=m,m=b,b=o.child,N=i.child.memoizedState,N=N===null?Vu(h):{baseLanes:N.baseLanes|h,cachePool:null,transitions:N.transitions},b.memoizedState=N,b.childLanes=i.childLanes&~h,o.memoizedState=Bu,m}return b=i.child,i=b.sibling,m=Xs(b,{mode:"visible",children:m.children}),(o.mode&1)===0&&(m.lanes=h),m.return=o,m.sibling=null,i!==null&&(h=o.deletions,h===null?(o.deletions=[i],o.flags|=16):h.push(i)),o.child=m,o.memoizedState=null,m}function $u(i,o){return o=ll({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Zo(i,o,h,m){return m!==null&&pu(m),oi(o,i.child,null,h),i=$u(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function B2(i,o,h,m,x,b,N){if(h)return o.flags&256?(o.flags&=-257,m=Ou(Error(t(422))),Zo(i,o,N,m)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(b=m.fallback,x=o.mode,m=ll({mode:"visible",children:m.children},x,0,null),b=Sr(b,x,N,null),b.flags|=2,m.return=o,b.return=o,m.sibling=b,o.child=m,(o.mode&1)!==0&&oi(o,i.child,null,N),o.child.memoizedState=Vu(N),o.memoizedState=Bu,b);if((o.mode&1)===0)return Zo(i,o,N,null);if(x.data==="$!"){if(m=x.nextSibling&&x.nextSibling.dataset,m)var A=m.dgst;return m=A,b=Error(t(419)),m=Ou(b,m,void 0),Zo(i,o,N,m)}if(A=(N&i.childLanes)!==0,nn||A){if(m=Rt,m!==null){switch(N&-N){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(m.suspendedLanes|N))!==0?0:x,x!==0&&x!==b.retryLane&&(b.retryLane=x,_s(i,x),Hn(m,i,x,-1))}return sh(),m=Ou(Error(t(421))),Zo(i,o,N,m)}return x.data==="$?"?(o.flags|=128,o.child=i.child,o=q2.bind(null,i),x._reactRetry=o,null):(i=b.treeContext,mn=Fs(x.nextSibling),pn=o,ft=!0,Bn=null,i!==null&&(Sn[En++]=bs,Sn[En++]=ks,Sn[En++]=xr,bs=i.id,ks=i.overflow,xr=o),o=$u(o,m.children),o.flags|=4096,o)}function zm(i,o,h){i.lanes|=o;var m=i.alternate;m!==null&&(m.lanes|=o),xu(i.return,o,h)}function Fu(i,o,h,m,x){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:x}:(b.isBackwards=o,b.rendering=null,b.renderingStartTime=0,b.last=m,b.tail=h,b.tailMode=x)}function Bm(i,o,h){var m=o.pendingProps,x=m.revealOrder,b=m.tail;if(Zt(i,o,m.children,h),m=mt.current,(m&2)!==0)m=m&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&zm(i,h,o);else if(i.tag===19)zm(i,h,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}m&=1}if(ot(mt,m),(o.mode&1)===0)o.memoizedState=null;else switch(x){case"forwards":for(h=o.child,x=null;h!==null;)i=h.alternate,i!==null&&Ho(i)===null&&(x=h),h=h.sibling;h=x,h===null?(x=o.child,o.child=null):(x=h.sibling,h.sibling=null),Fu(o,!1,x,h,b);break;case"backwards":for(h=null,x=o.child,o.child=null;x!==null;){if(i=x.alternate,i!==null&&Ho(i)===null){o.child=x;break}i=x.sibling,x.sibling=h,h=x,x=i}Fu(o,!0,h,null,b);break;case"together":Fu(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Go(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function Ns(i,o,h){if(i!==null&&(o.dependencies=i.dependencies),_r|=o.lanes,(h&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(t(153));if(o.child!==null){for(i=o.child,h=Xs(i,i.pendingProps),o.child=h,h.return=o;i.sibling!==null;)i=i.sibling,h=h.sibling=Xs(i,i.pendingProps),h.return=o;h.sibling=null}return o.child}function V2(i,o,h){switch(o.tag){case 3:Om(o),ri();break;case 5:nm(o);break;case 1:tn(o.type)&&Io(o);break;case 4:_u(o,o.stateNode.containerInfo);break;case 10:var m=o.type._context,x=o.memoizedProps.value;ot(Po,m._currentValue),m._currentValue=x;break;case 13:if(m=o.memoizedState,m!==null)return m.dehydrated!==null?(ot(mt,mt.current&1),o.flags|=128,null):(h&o.child.childLanes)!==0?Pm(i,o,h):(ot(mt,mt.current&1),i=Ns(i,o,h),i!==null?i.sibling:null);ot(mt,mt.current&1);break;case 19:if(m=(h&o.childLanes)!==0,(i.flags&128)!==0){if(m)return Bm(i,o,h);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ot(mt,mt.current),m)break;return null;case 22:case 23:return o.lanes=0,Im(i,o,h)}return Ns(i,o,h)}var Vm,Hu,$m,Fm;Vm=function(i,o){for(var h=o.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===o)break;for(;h.sibling===null;){if(h.return===null||h.return===o)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Hu=function(){},$m=function(i,o,h,m){var x=i.memoizedProps;if(x!==m){i=o.stateNode,br(es.current);var b=null;switch(h){case"input":x=U(i,x),m=U(i,m),b=[];break;case"select":x=D({},x,{value:void 0}),m=D({},m,{value:void 0}),b=[];break;case"textarea":x=Oe(i,x),m=Oe(i,m),b=[];break;default:typeof x.onClick!="function"&&typeof m.onClick=="function"&&(i.onclick=Mo)}_c(h,m);var N;h=null;for(re in x)if(!m.hasOwnProperty(re)&&x.hasOwnProperty(re)&&x[re]!=null)if(re==="style"){var A=x[re];for(N in A)A.hasOwnProperty(N)&&(h||(h={}),h[N]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(r.hasOwnProperty(re)?b||(b=[]):(b=b||[]).push(re,null));for(re in m){var V=m[re];if(A=x!=null?x[re]:void 0,m.hasOwnProperty(re)&&V!==A&&(V!=null||A!=null))if(re==="style")if(A){for(N in A)!A.hasOwnProperty(N)||V&&V.hasOwnProperty(N)||(h||(h={}),h[N]="");for(N in V)V.hasOwnProperty(N)&&A[N]!==V[N]&&(h||(h={}),h[N]=V[N])}else h||(b||(b=[]),b.push(re,h)),h=V;else re==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,A=A?A.__html:void 0,V!=null&&A!==V&&(b=b||[]).push(re,V)):re==="children"?typeof V!="string"&&typeof V!="number"||(b=b||[]).push(re,""+V):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(r.hasOwnProperty(re)?(V!=null&&re==="onScroll"&&ct("scroll",i),b||A===V||(b=[])):(b=b||[]).push(re,V))}h&&(b=b||[]).push("style",h);var re=b;(o.updateQueue=re)&&(o.flags|=4)}},Fm=function(i,o,h,m){h!==m&&(o.flags|=4)};function fa(i,o){if(!ft)switch(i.tailMode){case"hidden":o=i.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function Yt(i){var o=i.alternate!==null&&i.alternate.child===i.child,h=0,m=0;if(o)for(var x=i.child;x!==null;)h|=x.lanes|x.childLanes,m|=x.subtreeFlags&14680064,m|=x.flags&14680064,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)h|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=m,i.childLanes=h,o}function $2(i,o,h){var m=o.pendingProps;switch(hu(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(o),null;case 1:return tn(o.type)&&To(),Yt(o),null;case 3:return m=o.stateNode,li(),ut(en),ut(Ut),ju(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(i===null||i.child===null)&&(Ro(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Bn!==null&&(eh(Bn),Bn=null))),Hu(i,o),Yt(o),null;case 5:Cu(o);var x=br(la.current);if(h=o.type,i!==null&&o.stateNode!=null)$m(i,o,h,m,x),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!m){if(o.stateNode===null)throw Error(t(166));return Yt(o),null}if(i=br(es.current),Ro(o)){m=o.stateNode,h=o.type;var b=o.memoizedProps;switch(m[Xn]=o,m[sa]=b,i=(o.mode&1)!==0,h){case"dialog":ct("cancel",m),ct("close",m);break;case"iframe":case"object":case"embed":ct("load",m);break;case"video":case"audio":for(x=0;x<ea.length;x++)ct(ea[x],m);break;case"source":ct("error",m);break;case"img":case"image":case"link":ct("error",m),ct("load",m);break;case"details":ct("toggle",m);break;case"input":H(m,b),ct("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!b.multiple},ct("invalid",m);break;case"textarea":qe(m,b),ct("invalid",m)}_c(h,b),x=null;for(var N in b)if(b.hasOwnProperty(N)){var A=b[N];N==="children"?typeof A=="string"?m.textContent!==A&&(b.suppressHydrationWarning!==!0&&Eo(m.textContent,A,i),x=["children",A]):typeof A=="number"&&m.textContent!==""+A&&(b.suppressHydrationWarning!==!0&&Eo(m.textContent,A,i),x=["children",""+A]):r.hasOwnProperty(N)&&A!=null&&N==="onScroll"&&ct("scroll",m)}switch(h){case"input":j(m),ae(m,b,!0);break;case"textarea":j(m),dt(m);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(m.onclick=Mo)}m=x,o.updateQueue=m,m!==null&&(o.flags|=4)}else{N=x.nodeType===9?x:x.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=xs(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=N.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof m.is=="string"?i=N.createElement(h,{is:m.is}):(i=N.createElement(h),h==="select"&&(N=i,m.multiple?N.multiple=!0:m.size&&(N.size=m.size))):i=N.createElementNS(i,h),i[Xn]=o,i[sa]=m,Vm(i,o,!1,!1),o.stateNode=i;e:{switch(N=Cc(h,m),h){case"dialog":ct("cancel",i),ct("close",i),x=m;break;case"iframe":case"object":case"embed":ct("load",i),x=m;break;case"video":case"audio":for(x=0;x<ea.length;x++)ct(ea[x],i);x=m;break;case"source":ct("error",i),x=m;break;case"img":case"image":case"link":ct("error",i),ct("load",i),x=m;break;case"details":ct("toggle",i),x=m;break;case"input":H(i,m),x=U(i,m),ct("invalid",i);break;case"option":x=m;break;case"select":i._wrapperState={wasMultiple:!!m.multiple},x=D({},m,{value:void 0}),ct("invalid",i);break;case"textarea":qe(i,m),x=Oe(i,m),ct("invalid",i);break;default:x=m}_c(h,x),A=x;for(b in A)if(A.hasOwnProperty(b)){var V=A[b];b==="style"?Hr(i,V):b==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&ue(i,V)):b==="children"?typeof V=="string"?(h!=="textarea"||V!=="")&&ve(i,V):typeof V=="number"&&ve(i,""+V):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(r.hasOwnProperty(b)?V!=null&&b==="onScroll"&&ct("scroll",i):V!=null&&I(i,b,V,N))}switch(h){case"input":j(i),ae(i,m,!1);break;case"textarea":j(i),dt(i);break;case"option":m.value!=null&&i.setAttribute("value",""+Re(m.value));break;case"select":i.multiple=!!m.multiple,b=m.value,b!=null?Ce(i,!!m.multiple,b,!1):m.defaultValue!=null&&Ce(i,!!m.multiple,m.defaultValue,!0);break;default:typeof x.onClick=="function"&&(i.onclick=Mo)}switch(h){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Yt(o),null;case 6:if(i&&o.stateNode!=null)Fm(i,o,i.memoizedProps,m);else{if(typeof m!="string"&&o.stateNode===null)throw Error(t(166));if(h=br(la.current),br(es.current),Ro(o)){if(m=o.stateNode,h=o.memoizedProps,m[Xn]=o,(b=m.nodeValue!==h)&&(i=pn,i!==null))switch(i.tag){case 3:Eo(m.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Eo(m.nodeValue,h,(i.mode&1)!==0)}b&&(o.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[Xn]=o,o.stateNode=m}return Yt(o),null;case 13:if(ut(mt),m=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ft&&mn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Up(),ri(),o.flags|=98560,b=!1;else if(b=Ro(o),m!==null&&m.dehydrated!==null){if(i===null){if(!b)throw Error(t(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(t(317));b[Xn]=o}else ri(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Yt(o),b=!1}else Bn!==null&&(eh(Bn),Bn=null),b=!0;if(!b)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=h,o):(m=m!==null,m!==(i!==null&&i.memoizedState!==null)&&m&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(mt.current&1)!==0?Lt===0&&(Lt=3):sh())),o.updateQueue!==null&&(o.flags|=4),Yt(o),null);case 4:return li(),Hu(i,o),i===null&&ta(o.stateNode.containerInfo),Yt(o),null;case 10:return vu(o.type._context),Yt(o),null;case 17:return tn(o.type)&&To(),Yt(o),null;case 19:if(ut(mt),b=o.memoizedState,b===null)return Yt(o),null;if(m=(o.flags&128)!==0,N=b.rendering,N===null)if(m)fa(b,!1);else{if(Lt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(N=Ho(i),N!==null){for(o.flags|=128,fa(b,!1),m=N.updateQueue,m!==null&&(o.updateQueue=m,o.flags|=4),o.subtreeFlags=0,m=h,h=o.child;h!==null;)b=h,i=m,b.flags&=14680066,N=b.alternate,N===null?(b.childLanes=0,b.lanes=i,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=N.childLanes,b.lanes=N.lanes,b.child=N.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=N.memoizedProps,b.memoizedState=N.memoizedState,b.updateQueue=N.updateQueue,b.type=N.type,i=N.dependencies,b.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return ot(mt,mt.current&1|2),o.child}i=i.sibling}b.tail!==null&&Nt()>di&&(o.flags|=128,m=!0,fa(b,!1),o.lanes=4194304)}else{if(!m)if(i=Ho(N),i!==null){if(o.flags|=128,m=!0,h=i.updateQueue,h!==null&&(o.updateQueue=h,o.flags|=4),fa(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!ft)return Yt(o),null}else 2*Nt()-b.renderingStartTime>di&&h!==1073741824&&(o.flags|=128,m=!0,fa(b,!1),o.lanes=4194304);b.isBackwards?(N.sibling=o.child,o.child=N):(h=b.last,h!==null?h.sibling=N:o.child=N,b.last=N)}return b.tail!==null?(o=b.tail,b.rendering=o,b.tail=o.sibling,b.renderingStartTime=Nt(),o.sibling=null,h=mt.current,ot(mt,m?h&1|2:h&1),o):(Yt(o),null);case 22:case 23:return nh(),m=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==m&&(o.flags|=8192),m&&(o.mode&1)!==0?(gn&1073741824)!==0&&(Yt(o),o.subtreeFlags&6&&(o.flags|=8192)):Yt(o),null;case 24:return null;case 25:return null}throw Error(t(156,o.tag))}function F2(i,o){switch(hu(o),o.tag){case 1:return tn(o.type)&&To(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return li(),ut(en),ut(Ut),ju(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Cu(o),null;case 13:if(ut(mt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(t(340));ri()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return ut(mt),null;case 4:return li(),null;case 10:return vu(o.type._context),null;case 22:case 23:return nh(),null;case 24:return null;default:return null}}var Jo=!1,Kt=!1,H2=typeof WeakSet=="function"?WeakSet:Set,De=null;function ui(i,o){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){yt(i,o,m)}else h.current=null}function Uu(i,o,h){try{h()}catch(m){yt(i,o,m)}}var Hm=!1;function U2(i,o){if(nu=vo,i=wp(),Qc(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else{h=(h=i.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var x=m.anchorOffset,b=m.focusNode;m=m.focusOffset;var N=0,A=-1,V=-1,re=0,fe=0,pe=i,de=null;e:for(;;){for(var Se;pe!==h||x!==0&&pe.nodeType!==3||(A=N+x),pe!==b||m!==0&&pe.nodeType!==3||(V=N+m),pe.nodeType===3&&(N+=pe.nodeValue.length),(Se=pe.firstChild)!==null;)de=pe,pe=Se;for(;;){if(pe===i)break e;if(de===h&&++re===x&&(A=N),de===b&&++fe===m&&(V=N),(Se=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=Se}h=A===-1||V===-1?null:{start:A,end:V}}else h=null}h=h||{start:0,end:0}}else h=null;for(su={focusedElem:i,selectionRange:h},vo=!1,De=o;De!==null;)if(o=De,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,De=i;else for(;De!==null;){o=De;try{var Te=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Ie=Te.memoizedProps,jt=Te.memoizedState,G=o.stateNode,W=G.getSnapshotBeforeUpdate(o.elementType===o.type?Ie:Vn(o.type,Ie),jt);G.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ee=o.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(xe){yt(o,o.return,xe)}if(i=o.sibling,i!==null){i.return=o.return,De=i;break}De=o.return}return Te=Hm,Hm=!1,Te}function pa(i,o,h){var m=o.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var x=m=m.next;do{if((x.tag&i)===i){var b=x.destroy;x.destroy=void 0,b!==void 0&&Uu(o,h,b)}x=x.next}while(x!==m)}}function qo(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var h=o=o.next;do{if((h.tag&i)===i){var m=h.create;h.destroy=m()}h=h.next}while(h!==o)}}function Wu(i){var o=i.ref;if(o!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof o=="function"?o(i):o.current=i}}function Um(i){var o=i.alternate;o!==null&&(i.alternate=null,Um(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[Xn],delete o[sa],delete o[ou],delete o[j2],delete o[S2])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Wm(i){return i.tag===5||i.tag===3||i.tag===4}function Ym(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Wm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Yu(i,o,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,o?h.nodeType===8?h.parentNode.insertBefore(i,o):h.insertBefore(i,o):(h.nodeType===8?(o=h.parentNode,o.insertBefore(i,h)):(o=h,o.appendChild(i)),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=Mo));else if(m!==4&&(i=i.child,i!==null))for(Yu(i,o,h),i=i.sibling;i!==null;)Yu(i,o,h),i=i.sibling}function Ku(i,o,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,o?h.insertBefore(i,o):h.appendChild(i);else if(m!==4&&(i=i.child,i!==null))for(Ku(i,o,h),i=i.sibling;i!==null;)Ku(i,o,h),i=i.sibling}var zt=null,$n=!1;function Qs(i,o,h){for(h=h.child;h!==null;)Km(i,o,h),h=h.sibling}function Km(i,o,h){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(uo,h)}catch{}switch(h.tag){case 5:Kt||ui(h,o);case 6:var m=zt,x=$n;zt=null,Qs(i,o,h),zt=m,$n=x,zt!==null&&($n?(i=zt,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):zt.removeChild(h.stateNode));break;case 18:zt!==null&&($n?(i=zt,h=h.stateNode,i.nodeType===8?au(i.parentNode,h):i.nodeType===1&&au(i,h),Yi(i)):au(zt,h.stateNode));break;case 4:m=zt,x=$n,zt=h.stateNode.containerInfo,$n=!0,Qs(i,o,h),zt=m,$n=x;break;case 0:case 11:case 14:case 15:if(!Kt&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){x=m=m.next;do{var b=x,N=b.destroy;b=b.tag,N!==void 0&&((b&2)!==0||(b&4)!==0)&&Uu(h,o,N),x=x.next}while(x!==m)}Qs(i,o,h);break;case 1:if(!Kt&&(ui(h,o),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(A){yt(h,o,A)}Qs(i,o,h);break;case 21:Qs(i,o,h);break;case 22:h.mode&1?(Kt=(m=Kt)||h.memoizedState!==null,Qs(i,o,h),Kt=m):Qs(i,o,h);break;default:Qs(i,o,h)}}function Qm(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new H2),o.forEach(function(m){var x=X2.bind(null,i,m);h.has(m)||(h.add(m),m.then(x,x))})}}function Fn(i,o){var h=o.deletions;if(h!==null)for(var m=0;m<h.length;m++){var x=h[m];try{var b=i,N=o,A=N;e:for(;A!==null;){switch(A.tag){case 5:zt=A.stateNode,$n=!1;break e;case 3:zt=A.stateNode.containerInfo,$n=!0;break e;case 4:zt=A.stateNode.containerInfo,$n=!0;break e}A=A.return}if(zt===null)throw Error(t(160));Km(b,N,x),zt=null,$n=!1;var V=x.alternate;V!==null&&(V.return=null),x.return=null}catch(re){yt(x,o,re)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Zm(o,i),o=o.sibling}function Zm(i,o){var h=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Fn(o,i),ns(i),m&4){try{pa(3,i,i.return),qo(3,i)}catch(Ie){yt(i,i.return,Ie)}try{pa(5,i,i.return)}catch(Ie){yt(i,i.return,Ie)}}break;case 1:Fn(o,i),ns(i),m&512&&h!==null&&ui(h,h.return);break;case 5:if(Fn(o,i),ns(i),m&512&&h!==null&&ui(h,h.return),i.flags&32){var x=i.stateNode;try{ve(x,"")}catch(Ie){yt(i,i.return,Ie)}}if(m&4&&(x=i.stateNode,x!=null)){var b=i.memoizedProps,N=h!==null?h.memoizedProps:b,A=i.type,V=i.updateQueue;if(i.updateQueue=null,V!==null)try{A==="input"&&b.type==="radio"&&b.name!=null&&P(x,b),Cc(A,N);var re=Cc(A,b);for(N=0;N<V.length;N+=2){var fe=V[N],pe=V[N+1];fe==="style"?Hr(x,pe):fe==="dangerouslySetInnerHTML"?ue(x,pe):fe==="children"?ve(x,pe):I(x,fe,pe,re)}switch(A){case"input":Q(x,b);break;case"textarea":_t(x,b);break;case"select":var de=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!b.multiple;var Se=b.value;Se!=null?Ce(x,!!b.multiple,Se,!1):de!==!!b.multiple&&(b.defaultValue!=null?Ce(x,!!b.multiple,b.defaultValue,!0):Ce(x,!!b.multiple,b.multiple?[]:"",!1))}x[sa]=b}catch(Ie){yt(i,i.return,Ie)}}break;case 6:if(Fn(o,i),ns(i),m&4){if(i.stateNode===null)throw Error(t(162));x=i.stateNode,b=i.memoizedProps;try{x.nodeValue=b}catch(Ie){yt(i,i.return,Ie)}}break;case 3:if(Fn(o,i),ns(i),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Yi(o.containerInfo)}catch(Ie){yt(i,i.return,Ie)}break;case 4:Fn(o,i),ns(i);break;case 13:Fn(o,i),ns(i),x=i.child,x.flags&8192&&(b=x.memoizedState!==null,x.stateNode.isHidden=b,!b||x.alternate!==null&&x.alternate.memoizedState!==null||(Gu=Nt())),m&4&&Qm(i);break;case 22:if(fe=h!==null&&h.memoizedState!==null,i.mode&1?(Kt=(re=Kt)||fe,Fn(o,i),Kt=re):Fn(o,i),ns(i),m&8192){if(re=i.memoizedState!==null,(i.stateNode.isHidden=re)&&!fe&&(i.mode&1)!==0)for(De=i,fe=i.child;fe!==null;){for(pe=De=fe;De!==null;){switch(de=De,Se=de.child,de.tag){case 0:case 11:case 14:case 15:pa(4,de,de.return);break;case 1:ui(de,de.return);var Te=de.stateNode;if(typeof Te.componentWillUnmount=="function"){m=de,h=de.return;try{o=m,Te.props=o.memoizedProps,Te.state=o.memoizedState,Te.componentWillUnmount()}catch(Ie){yt(m,h,Ie)}}break;case 5:ui(de,de.return);break;case 22:if(de.memoizedState!==null){qm(pe);continue}}Se!==null?(Se.return=de,De=Se):qm(pe)}fe=fe.sibling}e:for(fe=null,pe=i;;){if(pe.tag===5){if(fe===null){fe=pe;try{x=pe.stateNode,re?(b=x.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(A=pe.stateNode,V=pe.memoizedProps.style,N=V!=null&&V.hasOwnProperty("display")?V.display:null,A.style.display=Xe("display",N))}catch(Ie){yt(i,i.return,Ie)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=re?"":pe.memoizedProps}catch(Ie){yt(i,i.return,Ie)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===i)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===i)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===i)break e;fe===pe&&(fe=null),pe=pe.return}fe===pe&&(fe=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:Fn(o,i),ns(i),m&4&&Qm(i);break;case 21:break;default:Fn(o,i),ns(i)}}function ns(i){var o=i.flags;if(o&2){try{e:{for(var h=i.return;h!==null;){if(Wm(h)){var m=h;break e}h=h.return}throw Error(t(160))}switch(m.tag){case 5:var x=m.stateNode;m.flags&32&&(ve(x,""),m.flags&=-33);var b=Ym(i);Ku(i,b,x);break;case 3:case 4:var N=m.stateNode.containerInfo,A=Ym(i);Yu(i,A,N);break;default:throw Error(t(161))}}catch(V){yt(i,i.return,V)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function W2(i,o,h){De=i,Gm(i)}function Gm(i,o,h){for(var m=(i.mode&1)!==0;De!==null;){var x=De,b=x.child;if(x.tag===22&&m){var N=x.memoizedState!==null||Jo;if(!N){var A=x.alternate,V=A!==null&&A.memoizedState!==null||Kt;A=Jo;var re=Kt;if(Jo=N,(Kt=V)&&!re)for(De=x;De!==null;)N=De,V=N.child,N.tag===22&&N.memoizedState!==null?Xm(x):V!==null?(V.return=N,De=V):Xm(x);for(;b!==null;)De=b,Gm(b),b=b.sibling;De=x,Jo=A,Kt=re}Jm(i)}else(x.subtreeFlags&8772)!==0&&b!==null?(b.return=x,De=b):Jm(i)}}function Jm(i){for(;De!==null;){var o=De;if((o.flags&8772)!==0){var h=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:Kt||qo(5,o);break;case 1:var m=o.stateNode;if(o.flags&4&&!Kt)if(h===null)m.componentDidMount();else{var x=o.elementType===o.type?h.memoizedProps:Vn(o.type,h.memoizedProps);m.componentDidUpdate(x,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var b=o.updateQueue;b!==null&&Qp(o,b,m);break;case 3:var N=o.updateQueue;if(N!==null){if(h=null,o.child!==null)switch(o.child.tag){case 5:h=o.child.stateNode;break;case 1:h=o.child.stateNode}Qp(o,N,h)}break;case 5:var A=o.stateNode;if(h===null&&o.flags&4){h=A;var V=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&h.focus();break;case"img":V.src&&(h.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var re=o.alternate;if(re!==null){var fe=re.memoizedState;if(fe!==null){var pe=fe.dehydrated;pe!==null&&Yi(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Kt||o.flags&512&&Wu(o)}catch(de){yt(o,o.return,de)}}if(o===i){De=null;break}if(h=o.sibling,h!==null){h.return=o.return,De=h;break}De=o.return}}function qm(i){for(;De!==null;){var o=De;if(o===i){De=null;break}var h=o.sibling;if(h!==null){h.return=o.return,De=h;break}De=o.return}}function Xm(i){for(;De!==null;){var o=De;try{switch(o.tag){case 0:case 11:case 15:var h=o.return;try{qo(4,o)}catch(V){yt(o,h,V)}break;case 1:var m=o.stateNode;if(typeof m.componentDidMount=="function"){var x=o.return;try{m.componentDidMount()}catch(V){yt(o,x,V)}}var b=o.return;try{Wu(o)}catch(V){yt(o,b,V)}break;case 5:var N=o.return;try{Wu(o)}catch(V){yt(o,N,V)}}}catch(V){yt(o,o.return,V)}if(o===i){De=null;break}var A=o.sibling;if(A!==null){A.return=o.return,De=A;break}De=o.return}}var Y2=Math.ceil,Xo=L.ReactCurrentDispatcher,Qu=L.ReactCurrentOwner,Tn=L.ReactCurrentBatchConfig,Ze=0,Rt=null,Dt=null,Bt=0,gn=0,hi=Hs(0),Lt=0,ma=null,_r=0,el=0,Zu=0,ga=null,sn=null,Gu=0,di=1/0,js=null,tl=!1,Ju=null,Zs=null,nl=!1,Gs=null,sl=0,va=0,qu=null,rl=-1,il=0;function Gt(){return(Ze&6)!==0?Nt():rl!==-1?rl:rl=Nt()}function Js(i){return(i.mode&1)===0?1:(Ze&2)!==0&&Bt!==0?Bt&-Bt:M2.transition!==null?(il===0&&(il=Wf()),il):(i=tt,i!==0||(i=window.event,i=i===void 0?16:ep(i.type)),i)}function Hn(i,o,h,m){if(50<va)throw va=0,qu=null,Error(t(185));$i(i,h,m),((Ze&2)===0||i!==Rt)&&(i===Rt&&((Ze&2)===0&&(el|=h),Lt===4&&qs(i,Bt)),rn(i,m),h===1&&Ze===0&&(o.mode&1)===0&&(di=Nt()+500,Ao&&Ws()))}function rn(i,o){var h=i.callbackNode;My(i,o);var m=po(i,i===Rt?Bt:0);if(m===0)h!==null&&Ff(h),i.callbackNode=null,i.callbackPriority=0;else if(o=m&-m,i.callbackPriority!==o){if(h!=null&&Ff(h),o===1)i.tag===0?E2(t0.bind(null,i)):Bp(t0.bind(null,i)),C2(function(){(Ze&6)===0&&Ws()}),h=null;else{switch(Yf(m)){case 1:h=Tc;break;case 4:h=Hf;break;case 16:h=co;break;case 536870912:h=Uf;break;default:h=co}h=c0(h,e0.bind(null,i))}i.callbackPriority=o,i.callbackNode=h}}function e0(i,o){if(rl=-1,il=0,(Ze&6)!==0)throw Error(t(327));var h=i.callbackNode;if(fi()&&i.callbackNode!==h)return null;var m=po(i,i===Rt?Bt:0);if(m===0)return null;if((m&30)!==0||(m&i.expiredLanes)!==0||o)o=al(i,m);else{o=m;var x=Ze;Ze|=2;var b=s0();(Rt!==i||Bt!==o)&&(js=null,di=Nt()+500,Nr(i,o));do try{Z2();break}catch(A){n0(i,A)}while(!0);gu(),Xo.current=b,Ze=x,Dt!==null?o=0:(Rt=null,Bt=0,o=Lt)}if(o!==0){if(o===2&&(x=Ic(i),x!==0&&(m=x,o=Xu(i,x))),o===1)throw h=ma,Nr(i,0),qs(i,m),rn(i,Nt()),h;if(o===6)qs(i,m);else{if(x=i.current.alternate,(m&30)===0&&!K2(x)&&(o=al(i,m),o===2&&(b=Ic(i),b!==0&&(m=b,o=Xu(i,b))),o===1))throw h=ma,Nr(i,0),qs(i,m),rn(i,Nt()),h;switch(i.finishedWork=x,i.finishedLanes=m,o){case 0:case 1:throw Error(t(345));case 2:jr(i,sn,js);break;case 3:if(qs(i,m),(m&130023424)===m&&(o=Gu+500-Nt(),10<o)){if(po(i,0)!==0)break;if(x=i.suspendedLanes,(x&m)!==m){Gt(),i.pingedLanes|=i.suspendedLanes&x;break}i.timeoutHandle=iu(jr.bind(null,i,sn,js),o);break}jr(i,sn,js);break;case 4:if(qs(i,m),(m&4194240)===m)break;for(o=i.eventTimes,x=-1;0<m;){var N=31-Pn(m);b=1<<N,N=o[N],N>x&&(x=N),m&=~b}if(m=x,m=Nt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*Y2(m/1960))-m,10<m){i.timeoutHandle=iu(jr.bind(null,i,sn,js),m);break}jr(i,sn,js);break;case 5:jr(i,sn,js);break;default:throw Error(t(329))}}}return rn(i,Nt()),i.callbackNode===h?e0.bind(null,i):null}function Xu(i,o){var h=ga;return i.current.memoizedState.isDehydrated&&(Nr(i,o).flags|=256),i=al(i,o),i!==2&&(o=sn,sn=h,o!==null&&eh(o)),i}function eh(i){sn===null?sn=i:sn.push.apply(sn,i)}function K2(i){for(var o=i;;){if(o.flags&16384){var h=o.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var x=h[m],b=x.getSnapshot;x=x.value;try{if(!zn(b(),x))return!1}catch{return!1}}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function qs(i,o){for(o&=~Zu,o&=~el,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var h=31-Pn(o),m=1<<h;i[h]=-1,o&=~m}}function t0(i){if((Ze&6)!==0)throw Error(t(327));fi();var o=po(i,0);if((o&1)===0)return rn(i,Nt()),null;var h=al(i,o);if(i.tag!==0&&h===2){var m=Ic(i);m!==0&&(o=m,h=Xu(i,m))}if(h===1)throw h=ma,Nr(i,0),qs(i,o),rn(i,Nt()),h;if(h===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,jr(i,sn,js),rn(i,Nt()),null}function th(i,o){var h=Ze;Ze|=1;try{return i(o)}finally{Ze=h,Ze===0&&(di=Nt()+500,Ao&&Ws())}}function Cr(i){Gs!==null&&Gs.tag===0&&(Ze&6)===0&&fi();var o=Ze;Ze|=1;var h=Tn.transition,m=tt;try{if(Tn.transition=null,tt=1,i)return i()}finally{tt=m,Tn.transition=h,Ze=o,(Ze&6)===0&&Ws()}}function nh(){gn=hi.current,ut(hi)}function Nr(i,o){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,_2(h)),Dt!==null)for(h=Dt.return;h!==null;){var m=h;switch(hu(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&To();break;case 3:li(),ut(en),ut(Ut),ju();break;case 5:Cu(m);break;case 4:li();break;case 13:ut(mt);break;case 19:ut(mt);break;case 10:vu(m.type._context);break;case 22:case 23:nh()}h=h.return}if(Rt=i,Dt=i=Xs(i.current,null),Bt=gn=o,Lt=0,ma=null,Zu=el=_r=0,sn=ga=null,wr!==null){for(o=0;o<wr.length;o++)if(h=wr[o],m=h.interleaved,m!==null){h.interleaved=null;var x=m.next,b=h.pending;if(b!==null){var N=b.next;b.next=x,m.next=N}h.pending=m}wr=null}return i}function n0(i,o){do{var h=Dt;try{if(gu(),Uo.current=Qo,Wo){for(var m=gt.memoizedState;m!==null;){var x=m.queue;x!==null&&(x.pending=null),m=m.next}Wo=!1}if(kr=0,Ot=At=gt=null,ca=!1,ua=0,Qu.current=null,h===null||h.return===null){Lt=1,ma=o,Dt=null;break}e:{var b=i,N=h.return,A=h,V=o;if(o=Bt,A.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var re=V,fe=A,pe=fe.tag;if((fe.mode&1)===0&&(pe===0||pe===11||pe===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Se=Sm(N);if(Se!==null){Se.flags&=-257,Em(Se,N,A,b,o),Se.mode&1&&jm(b,re,o),o=Se,V=re;var Te=o.updateQueue;if(Te===null){var Ie=new Set;Ie.add(V),o.updateQueue=Ie}else Te.add(V);break e}else{if((o&1)===0){jm(b,re,o),sh();break e}V=Error(t(426))}}else if(ft&&A.mode&1){var jt=Sm(N);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Em(jt,N,A,b,o),pu(ci(V,A));break e}}b=V=ci(V,A),Lt!==4&&(Lt=2),ga===null?ga=[b]:ga.push(b),b=N;do{switch(b.tag){case 3:b.flags|=65536,o&=-o,b.lanes|=o;var G=Cm(b,V,o);Kp(b,G);break e;case 1:A=V;var W=b.type,ee=b.stateNode;if((b.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Zs===null||!Zs.has(ee)))){b.flags|=65536,o&=-o,b.lanes|=o;var xe=Nm(b,A,o);Kp(b,xe);break e}}b=b.return}while(b!==null)}i0(h)}catch(Le){o=Le,Dt===h&&h!==null&&(Dt=h=h.return);continue}break}while(!0)}function s0(){var i=Xo.current;return Xo.current=Qo,i===null?Qo:i}function sh(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),Rt===null||(_r&268435455)===0&&(el&268435455)===0||qs(Rt,Bt)}function al(i,o){var h=Ze;Ze|=2;var m=s0();(Rt!==i||Bt!==o)&&(js=null,Nr(i,o));do try{Q2();break}catch(x){n0(i,x)}while(!0);if(gu(),Ze=h,Xo.current=m,Dt!==null)throw Error(t(261));return Rt=null,Bt=0,Lt}function Q2(){for(;Dt!==null;)r0(Dt)}function Z2(){for(;Dt!==null&&!wy();)r0(Dt)}function r0(i){var o=l0(i.alternate,i,gn);i.memoizedProps=i.pendingProps,o===null?i0(i):Dt=o,Qu.current=null}function i0(i){var o=i;do{var h=o.alternate;if(i=o.return,(o.flags&32768)===0){if(h=$2(h,o,gn),h!==null){Dt=h;return}}else{if(h=F2(h,o),h!==null){h.flags&=32767,Dt=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Lt=6,Dt=null;return}}if(o=o.sibling,o!==null){Dt=o;return}Dt=o=i}while(o!==null);Lt===0&&(Lt=5)}function jr(i,o,h){var m=tt,x=Tn.transition;try{Tn.transition=null,tt=1,G2(i,o,h,m)}finally{Tn.transition=x,tt=m}return null}function G2(i,o,h,m){do fi();while(Gs!==null);if((Ze&6)!==0)throw Error(t(327));h=i.finishedWork;var x=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(t(177));i.callbackNode=null,i.callbackPriority=0;var b=h.lanes|h.childLanes;if(Dy(i,b),i===Rt&&(Dt=Rt=null,Bt=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||nl||(nl=!0,c0(co,function(){return fi(),null})),b=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||b){b=Tn.transition,Tn.transition=null;var N=tt;tt=1;var A=Ze;Ze|=4,Qu.current=null,U2(i,h),Zm(h,i),g2(su),vo=!!nu,su=nu=null,i.current=h,W2(h),by(),Ze=A,tt=N,Tn.transition=b}else i.current=h;if(nl&&(nl=!1,Gs=i,sl=x),b=i.pendingLanes,b===0&&(Zs=null),Cy(h.stateNode),rn(i,Nt()),o!==null)for(m=i.onRecoverableError,h=0;h<o.length;h++)x=o[h],m(x.value,{componentStack:x.stack,digest:x.digest});if(tl)throw tl=!1,i=Ju,Ju=null,i;return(sl&1)!==0&&i.tag!==0&&fi(),b=i.pendingLanes,(b&1)!==0?i===qu?va++:(va=0,qu=i):va=0,Ws(),null}function fi(){if(Gs!==null){var i=Yf(sl),o=Tn.transition,h=tt;try{if(Tn.transition=null,tt=16>i?16:i,Gs===null)var m=!1;else{if(i=Gs,Gs=null,sl=0,(Ze&6)!==0)throw Error(t(331));var x=Ze;for(Ze|=4,De=i.current;De!==null;){var b=De,N=b.child;if((De.flags&16)!==0){var A=b.deletions;if(A!==null){for(var V=0;V<A.length;V++){var re=A[V];for(De=re;De!==null;){var fe=De;switch(fe.tag){case 0:case 11:case 15:pa(8,fe,b)}var pe=fe.child;if(pe!==null)pe.return=fe,De=pe;else for(;De!==null;){fe=De;var de=fe.sibling,Se=fe.return;if(Um(fe),fe===re){De=null;break}if(de!==null){de.return=Se,De=de;break}De=Se}}}var Te=b.alternate;if(Te!==null){var Ie=Te.child;if(Ie!==null){Te.child=null;do{var jt=Ie.sibling;Ie.sibling=null,Ie=jt}while(Ie!==null)}}De=b}}if((b.subtreeFlags&2064)!==0&&N!==null)N.return=b,De=N;else e:for(;De!==null;){if(b=De,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:pa(9,b,b.return)}var G=b.sibling;if(G!==null){G.return=b.return,De=G;break e}De=b.return}}var W=i.current;for(De=W;De!==null;){N=De;var ee=N.child;if((N.subtreeFlags&2064)!==0&&ee!==null)ee.return=N,De=ee;else e:for(N=W;De!==null;){if(A=De,(A.flags&2048)!==0)try{switch(A.tag){case 0:case 11:case 15:qo(9,A)}}catch(Le){yt(A,A.return,Le)}if(A===N){De=null;break e}var xe=A.sibling;if(xe!==null){xe.return=A.return,De=xe;break e}De=A.return}}if(Ze=x,Ws(),qn&&typeof qn.onPostCommitFiberRoot=="function")try{qn.onPostCommitFiberRoot(uo,i)}catch{}m=!0}return m}finally{tt=h,Tn.transition=o}}return!1}function a0(i,o,h){o=ci(h,o),o=Cm(i,o,1),i=Ks(i,o,1),o=Gt(),i!==null&&($i(i,1,o),rn(i,o))}function yt(i,o,h){if(i.tag===3)a0(i,i,h);else for(;o!==null;){if(o.tag===3){a0(o,i,h);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Zs===null||!Zs.has(m))){i=ci(h,i),i=Nm(o,i,1),o=Ks(o,i,1),i=Gt(),o!==null&&($i(o,1,i),rn(o,i));break}}o=o.return}}function J2(i,o,h){var m=i.pingCache;m!==null&&m.delete(o),o=Gt(),i.pingedLanes|=i.suspendedLanes&h,Rt===i&&(Bt&h)===h&&(Lt===4||Lt===3&&(Bt&130023424)===Bt&&500>Nt()-Gu?Nr(i,0):Zu|=h),rn(i,o)}function o0(i,o){o===0&&((i.mode&1)===0?o=1:(o=fo,fo<<=1,(fo&130023424)===0&&(fo=4194304)));var h=Gt();i=_s(i,o),i!==null&&($i(i,o,h),rn(i,h))}function q2(i){var o=i.memoizedState,h=0;o!==null&&(h=o.retryLane),o0(i,h)}function X2(i,o){var h=0;switch(i.tag){case 13:var m=i.stateNode,x=i.memoizedState;x!==null&&(h=x.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(t(314))}m!==null&&m.delete(o),o0(i,h)}var l0;l0=function(i,o,h){if(i!==null)if(i.memoizedProps!==o.pendingProps||en.current)nn=!0;else{if((i.lanes&h)===0&&(o.flags&128)===0)return nn=!1,V2(i,o,h);nn=(i.flags&131072)!==0}else nn=!1,ft&&(o.flags&1048576)!==0&&Vp(o,Oo,o.index);switch(o.lanes=0,o.tag){case 2:var m=o.type;Go(i,o),i=o.pendingProps;var x=ti(o,Ut.current);ai(o,h),x=Mu(null,o,m,i,x,h);var b=Du();return o.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,tn(m)?(b=!0,Io(o)):b=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,wu(o),x.updater=$o,o.stateNode=x,x._reactInternals=o,ku(o,m,i,h),o=zu(null,o,m,!0,b,h)):(o.tag=0,ft&&b&&uu(o),Zt(null,o,x,h),o=o.child),o;case 16:m=o.elementType;e:{switch(Go(i,o),i=o.pendingProps,x=m._init,m=x(m._payload),o.type=m,x=o.tag=tw(m),i=Vn(m,i),x){case 0:o=Pu(null,o,m,i,h);break e;case 1:o=Lm(null,o,m,i,h);break e;case 11:o=Mm(null,o,m,i,h);break e;case 14:o=Dm(null,o,m,Vn(m.type,i),h);break e}throw Error(t(306,m,""))}return o;case 0:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Vn(m,x),Pu(i,o,m,x,h);case 1:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Vn(m,x),Lm(i,o,m,x,h);case 3:e:{if(Om(o),i===null)throw Error(t(387));m=o.pendingProps,b=o.memoizedState,x=b.element,Yp(i,o),Vo(o,m,null,h);var N=o.memoizedState;if(m=N.element,b.isDehydrated)if(b={element:m,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},o.updateQueue.baseState=b,o.memoizedState=b,o.flags&256){x=ci(Error(t(423)),o),o=Rm(i,o,m,h,x);break e}else if(m!==x){x=ci(Error(t(424)),o),o=Rm(i,o,m,h,x);break e}else for(mn=Fs(o.stateNode.containerInfo.firstChild),pn=o,ft=!0,Bn=null,h=tm(o,null,m,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ri(),m===x){o=Ns(i,o,h);break e}Zt(i,o,m,h)}o=o.child}return o;case 5:return nm(o),i===null&&fu(o),m=o.type,x=o.pendingProps,b=i!==null?i.memoizedProps:null,N=x.children,ru(m,x)?N=null:b!==null&&ru(m,b)&&(o.flags|=32),Am(i,o),Zt(i,o,N,h),o.child;case 6:return i===null&&fu(o),null;case 13:return Pm(i,o,h);case 4:return _u(o,o.stateNode.containerInfo),m=o.pendingProps,i===null?o.child=oi(o,null,m,h):Zt(i,o,m,h),o.child;case 11:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Vn(m,x),Mm(i,o,m,x,h);case 7:return Zt(i,o,o.pendingProps,h),o.child;case 8:return Zt(i,o,o.pendingProps.children,h),o.child;case 12:return Zt(i,o,o.pendingProps.children,h),o.child;case 10:e:{if(m=o.type._context,x=o.pendingProps,b=o.memoizedProps,N=x.value,ot(Po,m._currentValue),m._currentValue=N,b!==null)if(zn(b.value,N)){if(b.children===x.children&&!en.current){o=Ns(i,o,h);break e}}else for(b=o.child,b!==null&&(b.return=o);b!==null;){var A=b.dependencies;if(A!==null){N=b.child;for(var V=A.firstContext;V!==null;){if(V.context===m){if(b.tag===1){V=Cs(-1,h&-h),V.tag=2;var re=b.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?V.next=V:(V.next=fe.next,fe.next=V),re.pending=V}}b.lanes|=h,V=b.alternate,V!==null&&(V.lanes|=h),xu(b.return,h,o),A.lanes|=h;break}V=V.next}}else if(b.tag===10)N=b.type===o.type?null:b.child;else if(b.tag===18){if(N=b.return,N===null)throw Error(t(341));N.lanes|=h,A=N.alternate,A!==null&&(A.lanes|=h),xu(N,h,o),N=b.sibling}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===o){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}Zt(i,o,x.children,h),o=o.child}return o;case 9:return x=o.type,m=o.pendingProps.children,ai(o,h),x=Mn(x),m=m(x),o.flags|=1,Zt(i,o,m,h),o.child;case 14:return m=o.type,x=Vn(m,o.pendingProps),x=Vn(m.type,x),Dm(i,o,m,x,h);case 15:return Tm(i,o,o.type,o.pendingProps,h);case 17:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Vn(m,x),Go(i,o),o.tag=1,tn(m)?(i=!0,Io(o)):i=!1,ai(o,h),Jp(o,m,x),ku(o,m,x,h),zu(null,o,m,!0,i,h);case 19:return Bm(i,o,h);case 22:return Im(i,o,h)}throw Error(t(156,o.tag))};function c0(i,o){return $f(i,o)}function ew(i,o,h,m){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(i,o,h,m){return new ew(i,o,h,m)}function rh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function tw(i){if(typeof i=="function")return rh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Ne)return 11;if(i===te)return 14}return 2}function Xs(i,o){var h=i.alternate;return h===null?(h=In(i.tag,o,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=o,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,o=i.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function ol(i,o,h,m,x,b){var N=2;if(m=i,typeof i=="function")rh(i)&&(N=1);else if(typeof i=="string")N=5;else e:switch(i){case E:return Sr(h.children,x,b,o);case R:N=8,x|=8;break;case F:return i=In(12,h,o,x|2),i.elementType=F,i.lanes=b,i;case Ee:return i=In(13,h,o,x),i.elementType=Ee,i.lanes=b,i;case be:return i=In(19,h,o,x),i.elementType=be,i.lanes=b,i;case Z:return ll(h,x,b,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case J:N=10;break e;case oe:N=9;break e;case Ne:N=11;break e;case te:N=14;break e;case B:N=16,m=null;break e}throw Error(t(130,i==null?i:typeof i,""))}return o=In(N,h,o,x),o.elementType=i,o.type=m,o.lanes=b,o}function Sr(i,o,h,m){return i=In(7,i,m,o),i.lanes=h,i}function ll(i,o,h,m){return i=In(22,i,m,o),i.elementType=Z,i.lanes=h,i.stateNode={isHidden:!1},i}function ih(i,o,h){return i=In(6,i,null,o),i.lanes=h,i}function ah(i,o,h){return o=In(4,i.children!==null?i.children:[],i.key,o),o.lanes=h,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function nw(i,o,h,m,x){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=m,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function oh(i,o,h,m,x,b,N,A,V){return i=new nw(i,o,h,A,V),o===1?(o=1,b===!0&&(o|=8)):o=0,b=In(3,null,null,o),i.current=b,b.stateNode=i,b.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},wu(b),i}function sw(i,o,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:m==null?null:""+m,children:i,containerInfo:o,implementation:h}}function u0(i){if(!i)return Us;i=i._reactInternals;e:{if(mr(i)!==i||i.tag!==1)throw Error(t(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(tn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(t(171))}if(i.tag===1){var h=i.type;if(tn(h))return Pp(i,h,o)}return o}function h0(i,o,h,m,x,b,N,A,V){return i=oh(h,m,!0,i,x,b,N,A,V),i.context=u0(null),h=i.current,m=Gt(),x=Js(h),b=Cs(m,x),b.callback=o??null,Ks(h,b,x),i.current.lanes=x,$i(i,x,m),rn(i,m),i}function cl(i,o,h,m){var x=o.current,b=Gt(),N=Js(x);return h=u0(h),o.context===null?o.context=h:o.pendingContext=h,o=Cs(b,N),o.payload={element:i},m=m===void 0?null:m,m!==null&&(o.callback=m),i=Ks(x,o,N),i!==null&&(Hn(i,x,N,b),Bo(i,x,N)),N}function ul(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function d0(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<o?h:o}}function lh(i,o){d0(i,o),(i=i.alternate)&&d0(i,o)}function rw(){return null}var f0=typeof reportError=="function"?reportError:function(i){console.error(i)};function ch(i){this._internalRoot=i}hl.prototype.render=ch.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(t(409));cl(i,o,null,null)},hl.prototype.unmount=ch.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Cr(function(){cl(null,i,null,null)}),o[ys]=null}};function hl(i){this._internalRoot=i}hl.prototype.unstable_scheduleHydration=function(i){if(i){var o=Zf();i={blockedOn:null,target:i,priority:o};for(var h=0;h<Bs.length&&o!==0&&o<Bs[h].priority;h++);Bs.splice(h,0,i),h===0&&qf(i)}};function uh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function dl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function p0(){}function iw(i,o,h,m,x){if(x){if(typeof m=="function"){var b=m;m=function(){var re=ul(N);b.call(re)}}var N=h0(o,m,i,0,null,!1,!1,"",p0);return i._reactRootContainer=N,i[ys]=N.current,ta(i.nodeType===8?i.parentNode:i),Cr(),N}for(;x=i.lastChild;)i.removeChild(x);if(typeof m=="function"){var A=m;m=function(){var re=ul(V);A.call(re)}}var V=oh(i,0,!1,null,null,!1,!1,"",p0);return i._reactRootContainer=V,i[ys]=V.current,ta(i.nodeType===8?i.parentNode:i),Cr(function(){cl(o,V,h,m)}),V}function fl(i,o,h,m,x){var b=h._reactRootContainer;if(b){var N=b;if(typeof x=="function"){var A=x;x=function(){var V=ul(N);A.call(V)}}cl(o,N,i,x)}else N=iw(h,o,i,x,m);return ul(N)}Kf=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var h=Vi(o.pendingLanes);h!==0&&(Lc(o,h|1),rn(o,Nt()),(Ze&6)===0&&(di=Nt()+500,Ws()))}break;case 13:Cr(function(){var m=_s(i,1);if(m!==null){var x=Gt();Hn(m,i,1,x)}}),lh(i,1)}},Oc=function(i){if(i.tag===13){var o=_s(i,134217728);if(o!==null){var h=Gt();Hn(o,i,134217728,h)}lh(i,134217728)}},Qf=function(i){if(i.tag===13){var o=Js(i),h=_s(i,o);if(h!==null){var m=Gt();Hn(h,i,o,m)}lh(i,o)}},Zf=function(){return tt},Gf=function(i,o){var h=tt;try{return tt=i,o()}finally{tt=h}},Sc=function(i,o,h){switch(o){case"input":if(Q(i,h),o=h.name,h.type==="radio"&&o!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<h.length;o++){var m=h[o];if(m!==i&&m.form===i.form){var x=Do(m);if(!x)throw Error(t(90));z(m),Q(m,x)}}}break;case"textarea":_t(i,h);break;case"select":o=h.value,o!=null&&Ce(i,!!h.multiple,o,!1)}},Lf=th,Of=Cr;var aw={usingClientEntryPoint:!1,Events:[ra,Xr,Do,If,Af,th]},xa={findFiberByHostInstance:gr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},ow={bundleType:xa.bundleType,version:xa.version,rendererPackageName:xa.rendererPackageName,rendererConfig:xa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Bf(i),i===null?null:i.stateNode},findFiberByHostInstance:xa.findFiberByHostInstance||rw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pl.isDisabled&&pl.supportsFiber)try{uo=pl.inject(ow),qn=pl}catch{}}return an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aw,an.createPortal=function(i,o){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uh(o))throw Error(t(200));return sw(i,o,null,h)},an.createRoot=function(i,o){if(!uh(i))throw Error(t(299));var h=!1,m="",x=f0;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onRecoverableError!==void 0&&(x=o.onRecoverableError)),o=oh(i,1,!1,null,null,h,!1,m,x),i[ys]=o.current,ta(i.nodeType===8?i.parentNode:i),new ch(o)},an.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(t(188)):(i=Object.keys(i).join(","),Error(t(268,i)));return i=Bf(o),i=i===null?null:i.stateNode,i},an.flushSync=function(i){return Cr(i)},an.hydrate=function(i,o,h){if(!dl(o))throw Error(t(200));return fl(null,i,o,!0,h)},an.hydrateRoot=function(i,o,h){if(!uh(i))throw Error(t(405));var m=h!=null&&h.hydratedSources||null,x=!1,b="",N=f0;if(h!=null&&(h.unstable_strictMode===!0&&(x=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onRecoverableError!==void 0&&(N=h.onRecoverableError)),o=h0(o,null,i,1,h??null,x,!1,b,N),i[ys]=o.current,ta(i),m)for(i=0;i<m.length;i++)h=m[i],x=h._getVersion,x=x(h._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[h,x]:o.mutableSourceEagerHydrationData.push(h,x);return new hl(o)},an.render=function(i,o,h){if(!dl(o))throw Error(t(200));return fl(null,i,o,!1,h)},an.unmountComponentAtNode=function(i){if(!dl(i))throw Error(t(40));return i._reactRootContainer?(Cr(function(){fl(null,null,i,!1,function(){i._reactRootContainer=null,i[ys]=null})}),!0):!1},an.unstable_batchedUpdates=th,an.unstable_renderSubtreeIntoContainer=function(i,o,h,m){if(!dl(h))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return fl(i,o,h,!1,m)},an.version="18.2.0-next-9e3b772b8-20220608",an}var C0;function yw(){if(C0)return fh.exports;C0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),fh.exports=xw(),fh.exports}/**
|
41
|
+
* @remix-run/router v1.19.1
|
42
|
+
*
|
43
|
+
* Copyright (c) Remix Software Inc.
|
44
|
+
*
|
45
|
+
* This source code is licensed under the MIT license found in the
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
47
|
+
*
|
48
|
+
* @license MIT
|
49
|
+
*/function za(){return za=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},za.apply(this,arguments)}var ir;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(ir||(ir={}));const N0="popstate";function ww(n){n===void 0&&(n={});function e(r,a){let{pathname:l="/",search:u="",hash:d=""}=Br(r.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),od("",{pathname:l,search:u,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function t(r,a){let l=r.document.querySelector("base"),u="";if(l&&l.getAttribute("href")){let d=r.location.href,f=d.indexOf("#");u=f===-1?d:d.slice(0,f)}return u+"#"+(typeof a=="string"?a:Ul(a))}function s(r,a){Vd(r.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return kw(e,t,s,n)}function St(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function Vd(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function bw(){return Math.random().toString(36).substr(2,8)}function j0(n,e){return{usr:n.state,key:n.key,idx:e}}function od(n,e,t,s){return t===void 0&&(t=null),za({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Br(e):e,{state:t,key:e&&e.key||s||bw()})}function Ul(n){let{pathname:e="/",search:t="",hash:s=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),s&&s!=="#"&&(e+=s.charAt(0)==="#"?s:"#"+s),e}function Br(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let s=n.indexOf("?");s>=0&&(e.search=n.substr(s),n=n.substr(0,s)),n&&(e.pathname=n)}return e}function kw(n,e,t,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,l=r.history,u=ir.Pop,d=null,f=p();f==null&&(f=0,l.replaceState(za({},l.state,{idx:f}),""));function p(){return(l.state||{idx:null}).idx}function g(){u=ir.Pop;let C=p(),S=C==null?null:C-f;f=C,d&&d({action:u,location:_.location,delta:S})}function y(C,S){u=ir.Push;let M=od(_.location,C,S);t&&t(M,C),f=p()+1;let I=j0(M,f),L=_.createHref(M);try{l.pushState(I,"",L)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(L)}a&&d&&d({action:u,location:_.location,delta:1})}function w(C,S){u=ir.Replace;let M=od(_.location,C,S);t&&t(M,C),f=p();let I=j0(M,f),L=_.createHref(M);l.replaceState(I,"",L),a&&d&&d({action:u,location:_.location,delta:0})}function k(C){let S=r.location.origin!=="null"?r.location.origin:r.location.href,M=typeof C=="string"?C:Ul(C);return M=M.replace(/ $/,"%20"),St(S,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,S)}let _={get action(){return u},get location(){return n(r,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(N0,g),d=C,()=>{r.removeEventListener(N0,g),d=null}},createHref(C){return e(r,C)},createURL:k,encodeLocation(C){let S=k(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:w,go(C){return l.go(C)}};return _}var S0;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(S0||(S0={}));function _w(n,e,t){return t===void 0&&(t="/"),Cw(n,e,t)}function Cw(n,e,t,s){let r=typeof e=="string"?Br(e):e,a=$d(r.pathname||"/",t);if(a==null)return null;let l=L1(n);Nw(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=Pw(a);u=Lw(l[d],f)}return u}function L1(n,e,t,s){e===void 0&&(e=[]),t===void 0&&(t=[]),s===void 0&&(s="");let r=(a,l,u)=>{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};d.relativePath.startsWith("/")&&(St(d.relativePath.startsWith(s),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(s.length));let f=lr([s,d.relativePath]),p=t.concat(d);a.children&&a.children.length>0&&(St(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),L1(a.children,e,p,f)),!(a.path==null&&!a.index)&&e.push({path:f,score:Iw(f,a.index),routesMeta:p})};return n.forEach((a,l)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))r(a,l);else for(let d of O1(a.path))r(a,l,d)}),e}function O1(n){let e=n.split("/");if(e.length===0)return[];let[t,...s]=e,r=t.endsWith("?"),a=t.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let l=O1(s.join("/")),u=[];return u.push(...l.map(d=>d===""?a:[a,d].join("/"))),r&&u.push(...l),u.map(d=>n.startsWith("/")&&d===""?"/":d)}function Nw(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Aw(e.routesMeta.map(s=>s.childrenIndex),t.routesMeta.map(s=>s.childrenIndex)))}const jw=/^:[\w-]+$/,Sw=3,Ew=2,Mw=1,Dw=10,Tw=-2,E0=n=>n==="*";function Iw(n,e){let t=n.split("/"),s=t.length;return t.some(E0)&&(s+=Tw),e&&(s+=Ew),t.filter(r=>!E0(r)).reduce((r,a)=>r+(jw.test(a)?Sw:a===""?Mw:Dw),s)}function Aw(n,e){return n.length===e.length&&n.slice(0,-1).every((s,r)=>s===e[r])?n[n.length-1]-e[e.length-1]:0}function Lw(n,e,t){let{routesMeta:s}=n,r={},a="/",l=[];for(let u=0;u<s.length;++u){let d=s[u],f=u===s.length-1,p=a==="/"?e:e.slice(a.length)||"/",g=Ow({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),y=d.route;if(!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:lr([a,g.pathname]),pathnameBase:$w(lr([a,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(a=lr([a,g.pathnameBase]))}return l}function Ow(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,s]=Rw(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let a=r[0],l=a.replace(/(.)\/+$/,"$1"),u=r.slice(1);return{params:s.reduce((f,p,g)=>{let{paramName:y,isOptional:w}=p;if(y==="*"){let _=u[g]||"";l=a.slice(0,a.length-_.length).replace(/(.)\/+$/,"$1")}const k=u[g];return w&&!k?f[y]=void 0:f[y]=(k||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:n}}function Rw(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Vd(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let s=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(s.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(s.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),s]}function Pw(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Vd(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function $d(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,s=n.charAt(t);return s&&s!=="/"?null:n.slice(t)||"/"}function zw(n,e){e===void 0&&(e="/");let{pathname:t,search:s="",hash:r=""}=typeof n=="string"?Br(n):n;return{pathname:t?t.startsWith("/")?t:Bw(t,e):e,search:Fw(s),hash:Hw(r)}}function Bw(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function gh(n,e,t,s){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Vw(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Fd(n,e){let t=Vw(n);return e?t.map((s,r)=>r===t.length-1?s.pathname:s.pathnameBase):t.map(s=>s.pathnameBase)}function Hd(n,e,t,s){s===void 0&&(s=!1);let r;typeof n=="string"?r=Br(n):(r=za({},n),St(!r.pathname||!r.pathname.includes("?"),gh("?","pathname","search",r)),St(!r.pathname||!r.pathname.includes("#"),gh("#","pathname","hash",r)),St(!r.search||!r.search.includes("#"),gh("#","search","hash",r)));let a=n===""||r.pathname==="",l=a?"/":r.pathname,u;if(l==null)u=t;else{let g=e.length-1;if(!s&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),g-=1;r.pathname=y.join("/")}u=g>=0?e[g]:"/"}let d=zw(r,u),f=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&t.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}const lr=n=>n.join("/").replace(/\/\/+/g,"/"),$w=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Fw=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Hw=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Uw(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const R1=["post","put","patch","delete"];new Set(R1);const Ww=["get",...R1];new Set(Ww);/**
|
50
|
+
* React Router v6.26.1
|
51
|
+
*
|
52
|
+
* Copyright (c) Remix Software Inc.
|
53
|
+
*
|
54
|
+
* This source code is licensed under the MIT license found in the
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
56
|
+
*
|
57
|
+
* @license MIT
|
58
|
+
*/function Ba(){return Ba=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},Ba.apply(this,arguments)}const Ud=v.createContext(null),Yw=v.createContext(null),dr=v.createContext(null),cc=v.createContext(null),cs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),P1=v.createContext(null);function Kw(n,e){let{relative:t}=e===void 0?{}:e;Ii()||St(!1);let{basename:s,navigator:r}=v.useContext(dr),{hash:a,pathname:l,search:u}=B1(n,{relative:t}),d=l;return s!=="/"&&(d=l==="/"?s:lr([s,l])),r.createHref({pathname:d,search:u,hash:a})}function Ii(){return v.useContext(cc)!=null}function Vr(){return Ii()||St(!1),v.useContext(cc).location}function z1(n){v.useContext(dr).static||v.useLayoutEffect(n)}function Ds(){let{isDataRoute:n}=v.useContext(cs);return n?lb():Qw()}function Qw(){Ii()||St(!1);let n=v.useContext(Ud),{basename:e,future:t,navigator:s}=v.useContext(dr),{matches:r}=v.useContext(cs),{pathname:a}=Vr(),l=JSON.stringify(Fd(r,t.v7_relativeSplatPath)),u=v.useRef(!1);return z1(()=>{u.current=!0}),v.useCallback(function(f,p){if(p===void 0&&(p={}),!u.current)return;if(typeof f=="number"){s.go(f);return}let g=Hd(f,JSON.parse(l),a,p.relative==="path");n==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:lr([e,g.pathname])),(p.replace?s.replace:s.push)(g,p.state,p)},[e,s,l,a,n])}const Zw=v.createContext(null);function Gw(n){let e=v.useContext(cs).outlet;return e&&v.createElement(Zw.Provider,{value:n},e)}function un(){let{matches:n}=v.useContext(cs),e=n[n.length-1];return e?e.params:{}}function B1(n,e){let{relative:t}=e===void 0?{}:e,{future:s}=v.useContext(dr),{matches:r}=v.useContext(cs),{pathname:a}=Vr(),l=JSON.stringify(Fd(r,s.v7_relativeSplatPath));return v.useMemo(()=>Hd(n,JSON.parse(l),a,t==="path"),[n,l,a,t])}function Jw(n,e){return qw(n,e)}function qw(n,e,t,s){Ii()||St(!1);let{navigator:r}=v.useContext(dr),{matches:a}=v.useContext(cs),l=a[a.length-1],u=l?l.params:{},d=l?l.pathnameBase:"/",f=Vr(),p;if(e){var g;let C=typeof e=="string"?Br(e):e;d==="/"||(g=C.pathname)!=null&&g.startsWith(d)||St(!1),p=C}else p=f;let y=p.pathname||"/",w=y;if(d!=="/"){let C=d.replace(/^\//,"").split("/");w="/"+y.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=_w(n,{pathname:w}),_=sb(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:lr([d,r.encodeLocation?r.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:lr([d,r.encodeLocation?r.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,t,s);return e&&_?v.createElement(cc.Provider,{value:{location:Ba({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:ir.Pop}},_):_}function Xw(){let n=ob(),e=Uw(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),t?v.createElement("pre",{style:r},t):null,null)}const eb=v.createElement(Xw,null);class tb extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?v.createElement(cs.Provider,{value:this.props.routeContext},v.createElement(P1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nb(n){let{routeContext:e,match:t,children:s}=n,r=v.useContext(Ud);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(cs.Provider,{value:e},s)}function sb(n,e,t,s){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),s===void 0&&(s=null),n==null){var a;if(!t)return null;if(t.errors)n=t.matches;else if((a=s)!=null&&a.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let l=n,u=(r=t)==null?void 0:r.errors;if(u!=null){let p=l.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);p>=0||St(!1),l=l.slice(0,Math.min(l.length,p+1))}let d=!1,f=-1;if(t&&s&&s.v7_partialHydration)for(let p=0;p<l.length;p++){let g=l[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=p),g.route.id){let{loaderData:y,errors:w}=t,k=g.route.loader&&y[g.route.id]===void 0&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((p,g,y)=>{let w,k=!1,_=null,C=null;t&&(w=u&&g.route.id?u[g.route.id]:void 0,_=g.route.errorElement||eb,d&&(f<0&&y===0?(k=!0,C=null):f===y&&(k=!0,C=g.route.hydrateFallbackElement||null)));let S=e.concat(l.slice(0,y+1)),M=()=>{let I;return w?I=_:k?I=C:g.route.Component?I=v.createElement(g.route.Component,null):g.route.element?I=g.route.element:I=p,v.createElement(nb,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:t!=null},children:I})};return t&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(tb,{location:t.location,revalidation:t.revalidation,component:_,error:w,children:M(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):M()},null)}function rb(n){let e=v.useContext(Ud);return e||St(!1),e}function ib(n){let e=v.useContext(Yw);return e||St(!1),e}function ab(n){let e=v.useContext(cs);return e||St(!1),e}function V1(n){let e=ab(),t=e.matches[e.matches.length-1];return t.route.id||St(!1),t.route.id}function ob(){var n;let e=v.useContext(P1),t=ib(),s=V1();return e!==void 0?e:(n=t.errors)==null?void 0:n[s]}function lb(){let{router:n}=rb(),e=V1(),t=v.useRef(!1);return z1(()=>{t.current=!0}),v.useCallback(function(r,a){a===void 0&&(a={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,Ba({fromRouteId:e},a)))},[n,e])}function cb(n){let{to:e,replace:t,state:s,relative:r}=n;Ii()||St(!1);let{future:a}=v.useContext(dr),{matches:l}=v.useContext(cs),{pathname:u}=Vr(),d=Ds(),f=Hd(e,Fd(l,a.v7_relativeSplatPath),u,r==="path"),p=JSON.stringify(f);return v.useEffect(()=>d(JSON.parse(p),{replace:t,state:s,relative:r}),[d,p,r,t,s]),null}function ub(n){return Gw(n.context)}function ke(n){St(!1)}function hb(n){let{basename:e="/",children:t=null,location:s,navigationType:r=ir.Pop,navigator:a,static:l=!1,future:u}=n;Ii()&&St(!1);let d=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:a,static:l,future:Ba({v7_relativeSplatPath:!1},u)}),[d,u,a,l]);typeof s=="string"&&(s=Br(s));let{pathname:p="/",search:g="",hash:y="",state:w=null,key:k="default"}=s,_=v.useMemo(()=>{let C=$d(p,d);return C==null?null:{location:{pathname:C,search:g,hash:y,state:w,key:k},navigationType:r}},[d,p,g,y,w,k,r]);return _==null?null:v.createElement(dr.Provider,{value:f},v.createElement(cc.Provider,{children:t,value:_}))}function db(n){let{children:e,location:t}=n;return Jw(ld(e),t)}new Promise(()=>{});function ld(n,e){e===void 0&&(e=[]);let t=[];return v.Children.forEach(n,(s,r)=>{if(!v.isValidElement(s))return;let a=[...e,r];if(s.type===v.Fragment){t.push.apply(t,ld(s.props.children,a));return}s.type!==ke&&St(!1),!s.props.index||!s.props.children||St(!1);let l={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(l.children=ld(s.props.children,a)),t.push(l)}),t}/**
|
59
|
+
* React Router DOM v6.26.1
|
60
|
+
*
|
61
|
+
* Copyright (c) Remix Software Inc.
|
62
|
+
*
|
63
|
+
* This source code is licensed under the MIT license found in the
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
65
|
+
*
|
66
|
+
* @license MIT
|
67
|
+
*/function cd(){return cd=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},cd.apply(this,arguments)}function fb(n,e){if(n==null)return{};var t={},s=Object.keys(n),r,a;for(a=0;a<s.length;a++)r=s[a],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function pb(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function mb(n,e){return n.button===0&&(!e||e==="_self")&&!pb(n)}const gb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],vb="6";try{window.__reactRouterVersion=vb}catch{}const xb="startTransition",M0=mw[xb];function yb(n){let{basename:e,children:t,future:s,window:r}=n,a=v.useRef();a.current==null&&(a.current=ww({window:r,v5Compat:!0}));let l=a.current,[u,d]=v.useState({action:l.action,location:l.location}),{v7_startTransition:f}=s||{},p=v.useCallback(g=>{f&&M0?M0(()=>d(g)):d(g)},[d,f]);return v.useLayoutEffect(()=>l.listen(p),[l,p]),v.createElement(hb,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:l,future:s})}const wb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ht=v.forwardRef(function(e,t){let{onClick:s,relative:r,reloadDocument:a,replace:l,state:u,target:d,to:f,preventScrollReset:p,unstable_viewTransition:g}=e,y=fb(e,gb),{basename:w}=v.useContext(dr),k,_=!1;if(typeof f=="string"&&bb.test(f)&&(k=f,wb))try{let I=new URL(window.location.href),L=f.startsWith("//")?new URL(I.protocol+f):new URL(f),O=$d(L.pathname,w);L.origin===I.origin&&O!=null?f=O+L.search+L.hash:_=!0}catch{}let C=Kw(f,{relative:r}),S=kb(f,{replace:l,state:u,target:d,preventScrollReset:p,relative:r,unstable_viewTransition:g});function M(I){s&&s(I),I.defaultPrevented||S(I)}return v.createElement("a",cd({},y,{href:k||C,onClick:_||a?s:M,ref:t,target:d}))});var D0;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(D0||(D0={}));var T0;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(T0||(T0={}));function kb(n,e){let{target:t,replace:s,state:r,preventScrollReset:a,relative:l,unstable_viewTransition:u}=e===void 0?{}:e,d=Ds(),f=Vr(),p=B1(n,{relative:l});return v.useCallback(g=>{if(mb(g,t)){g.preventDefault();let y=s!==void 0?s:Ul(f)===Ul(p);d(n,{replace:y,state:r,preventScrollReset:a,relative:l,unstable_viewTransition:u})}},[f,d,p,s,r,t,n,a,l,u])}var $1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},I0=q.createContext&&q.createContext($1),cr=function(){return cr=Object.assign||function(n){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},cr.apply(this,arguments)},_b=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function F1(n){return n&&n.map(function(e,t){return q.createElement(e.tag,cr({key:t},e.attr),F1(e.child))})}function ye(n){return function(e){return q.createElement(Cb,cr({attr:cr({},n.attr)},e),F1(n.child))}}function Cb(n){var e=function(t){var s=n.attr,r=n.size,a=n.title,l=_b(n,["attr","size","title"]),u=r||t.size||"1em",d;return t.className&&(d=t.className),n.className&&(d=(d?d+" ":"")+n.className),q.createElement("svg",cr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,l,{className:d,style:cr(cr({color:n.color||t.color},t.style),n.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&q.createElement("title",null,a),n.children)};return I0!==void 0?q.createElement(I0.Consumer,null,function(t){return e(t)}):e($1)}function Nb(n){return ye({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.6 222.7c-1.8-8-6.8-15.4-12.5-18.5-1.8-1-13-2.2-25-2.7-20.1-.9-22.3-1.3-28.7-5-10.1-5.9-12.8-12.3-12.9-29.5-.1-33-13.8-63.7-40.9-91.3-19.3-19.7-40.9-33-65.5-40.5-5.9-1.8-19.1-2.4-63.3-2.9-69.4-.8-84.8.6-108.4 10C45.9 59.5 14.7 96.1 3.3 142.9 1.2 151.7.7 165.8.2 246.8c-.6 101.5.1 116.4 6.4 136.5 15.6 49.6 59.9 86.3 104.4 94.3 14.8 2.7 197.3 3.3 216 .8 32.5-4.4 58-17.5 81.9-41.9 17.3-17.7 28.1-36.8 35.2-62.1 4.9-17.6 4.5-142.8 2.5-151.7zm-322.1-63.6c7.8-7.9 10-8.2 58.8-8.2 43.9 0 45.4.1 51.8 3.4 9.3 4.7 13.4 11.3 13.4 21.9 0 9.5-3.8 16.2-12.3 21.6-4.6 2.9-7.3 3.1-50.3 3.3-26.5.2-47.7-.4-50.8-1.2-16.6-4.7-22.8-28.5-10.6-40.8zm191.8 199.8l-14.9 2.4-77.5.9c-68.1.8-87.3-.4-90.9-2-7.1-3.1-13.8-11.7-14.9-19.4-1.1-7.3 2.6-17.3 8.2-22.4 7.1-6.4 10.2-6.6 97.3-6.7 89.6-.1 89.1-.1 97.6 7.8 12.1 11.3 9.5 31.2-4.9 39.4z"}}]})(n)}function jb(n){return ye({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M162.4 196c4.8-4.9 6.2-5.1 36.4-5.1 27.2 0 28.1.1 32.1 2.1 5.8 2.9 8.3 7 8.3 13.6 0 5.9-2.4 10-7.6 13.4-2.8 1.8-4.5 1.9-31.1 2.1-16.4.1-29.5-.2-31.5-.8-10.3-2.9-14.1-17.7-6.6-25.3zm61.4 94.5c-53.9 0-55.8.2-60.2 4.1-3.5 3.1-5.7 9.4-5.1 13.9.7 4.7 4.8 10.1 9.2 12 2.2 1 14.1 1.7 56.3 1.2l47.9-.6 9.2-1.5c9-5.1 10.5-17.4 3.1-24.4-5.3-4.7-5-4.7-60.4-4.7zm223.4 130.1c-3.5 28.4-23 50.4-51.1 57.5-7.2 1.8-9.7 1.9-172.9 1.8-157.8 0-165.9-.1-172-1.8-8.4-2.2-15.6-5.5-22.3-10-5.6-3.8-13.9-11.8-17-16.4-3.8-5.6-8.2-15.3-10-22C.1 423 0 420.3 0 256.3 0 93.2 0 89.7 1.8 82.6 8.1 57.9 27.7 39 53 33.4c7.3-1.6 332.1-1.9 340-.3 21.2 4.3 37.9 17.1 47.6 36.4 7.7 15.3 7-1.5 7.3 180.6.2 115.8 0 164.5-.7 170.5zm-85.4-185.2c-1.1-5-4.2-9.6-7.7-11.5-1.1-.6-8-1.3-15.5-1.7-12.4-.6-13.8-.8-17.8-3.1-6.2-3.6-7.9-7.6-8-18.3 0-20.4-8.5-39.4-25.3-56.5-12-12.2-25.3-20.5-40.6-25.1-3.6-1.1-11.8-1.5-39.2-1.8-42.9-.5-52.5.4-67.1 6.2-27 10.7-46.3 33.4-53.4 62.4-1.3 5.4-1.6 14.2-1.9 64.3-.4 62.8 0 72.1 4 84.5 9.7 30.7 37.1 53.4 64.6 58.4 9.2 1.7 122.2 2.1 133.7.5 20.1-2.7 35.9-10.8 50.7-25.9 10.7-10.9 17.4-22.8 21.8-38.5 3.2-10.9 2.9-88.4 1.7-93.9z"}}]})(n)}function Sb(n){return ye({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(n)}function H1(n){return ye({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M423.3 440.7c0 25.3-20.3 45.6-45.6 45.6s-45.8-20.3-45.8-45.6 20.6-45.8 45.8-45.8c25.4 0 45.6 20.5 45.6 45.8zm-253.9-45.8c-25.3 0-45.6 20.6-45.6 45.8s20.3 45.6 45.6 45.6 45.8-20.3 45.8-45.6-20.5-45.8-45.8-45.8zm291.7-270C158.9 124.9 81.9 112.1 0 25.7c34.4 51.7 53.3 148.9 373.1 144.2 333.3-5 130 86.1 70.8 188.9 186.7-166.7 319.4-233.9 17.2-233.9z"}}]})(n)}function Eb(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 394c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h404c3.3 0 6 2.7 6 6v340zM356.5 194.6L295.1 256l61.4 61.4c4.6 4.6 4.6 12.1 0 16.8l-22.3 22.3c-4.6 4.6-12.1 4.6-16.8 0L256 295.1l-61.4 61.4c-4.6 4.6-12.1 4.6-16.8 0l-22.3-22.3c-4.6-4.6-4.6-12.1 0-16.8l61.4-61.4-61.4-61.4c-4.6-4.6-4.6-12.1 0-16.8l22.3-22.3c4.6-4.6 12.1-4.6 16.8 0l61.4 61.4 61.4-61.4c4.6-4.6 12.1-4.6 16.8 0l22.3 22.3c4.7 4.6 4.7 12.1 0 16.8z"}}]})(n)}function U1(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 0 1-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]})(n)}function Wd(n){return ye({attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm127.978 274.82-.034.006c-.023.007-.042.018-.083.059L512 466.745l-127.86-127.86c-.042-.041-.06-.052-.084-.059a.118.118 0 0 0-.07 0c-.022.007-.041.018-.082.059l-45.02 45.019c-.04.04-.05.06-.058.083a.118.118 0 0 0 0 .07l.01.022a.268.268 0 0 0 .049.06L466.745 512l-127.86 127.862c-.041.04-.052.06-.059.083a.118.118 0 0 0 0 .07c.007.022.018.041.059.082l45.019 45.02c.04.04.06.05.083.058a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059L512 557.254l127.862 127.861c.04.041.06.052.083.059a.118.118 0 0 0 .07 0c.022-.007.041-.018.082-.059l45.02-45.019c.04-.04.05-.06.058-.083a.118.118 0 0 0 0-.07l-.01-.022a.268.268 0 0 0-.049-.06L557.254 512l127.861-127.86c.041-.042.052-.06.059-.084a.118.118 0 0 0 0-.07c-.007-.022-.018-.041-.059-.082l-45.019-45.02c-.04-.04-.06-.05-.083-.058a.118.118 0 0 0-.07 0Z"}}]})(n)}function Mb(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M880 112c-3.8 0-7.7.7-11.6 2.3L292 345.9H128c-8.8 0-16 7.4-16 16.6v299c0 9.2 7.2 16.6 16 16.6h101.6c-3.7 11.6-5.6 23.9-5.6 36.4 0 65.9 53.8 119.5 120 119.5 55.4 0 102.1-37.6 115.9-88.4l408.6 164.2c3.9 1.5 7.8 2.3 11.6 2.3 16.9 0 32-14.2 32-33.2V145.2C912 126.2 897 112 880 112zM344 762.3c-26.5 0-48-21.4-48-47.8 0-11.2 3.9-21.9 11-30.4l84.9 34.1c-2 24.6-22.7 44.1-47.9 44.1z"}}]})(n)}function Db(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M863.1 518.5H505.5V160.9c0-4.4-3.6-8-8-8h-26a398.57 398.57 0 0 0-282.5 117 397.47 397.47 0 0 0-85.6 127C82.6 446.2 72 498.5 72 552.5S82.6 658.7 103.4 708c20.1 47.5 48.9 90.3 85.6 127 36.7 36.7 79.4 65.5 127 85.6a396.64 396.64 0 0 0 155.6 31.5 398.57 398.57 0 0 0 282.5-117c36.7-36.7 65.5-79.4 85.6-127a396.64 396.64 0 0 0 31.5-155.6v-26c-.1-4.4-3.7-8-8.1-8zM951 463l-2.6-28.2c-8.5-92-49.3-178.8-115.1-244.3A398.5 398.5 0 0 0 588.4 75.6L560.1 73c-4.7-.4-8.7 3.2-8.7 7.9v383.7c0 4.4 3.6 8 8 8l383.6-1c4.7-.1 8.4-4 8-8.6z"}}]})(n)}function W1(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 0 0 0 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM699 387c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64z"}}]})(n)}function Tb(n){return ye({attr:{t:"1569683928793",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}}]})(n)}function Ib(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M864 248H728l-32.4-90.8a32.07 32.07 0 0 0-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z"}}]})(n)}function Ab(n){return ye({attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64Zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372Zm128.013 198.826c.023.007.042.018.083.059l45.02 45.019c.04.04.05.06.058.083a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082L557.254 512l127.861 127.862a.268.268 0 0 1 .05.06l.009.023a.118.118 0 0 1 0 .07c-.007.022-.018.041-.059.082l-45.019 45.02c-.04.04-.06.05-.083.058a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059L512 557.254 384.14 685.115c-.042.041-.06.052-.084.059a.118.118 0 0 1-.07 0c-.022-.007-.041-.018-.082-.059l-45.02-45.019c-.04-.04-.05-.06-.058-.083a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082L466.745 512l-127.86-127.86a.268.268 0 0 1-.05-.061l-.009-.023a.118.118 0 0 1 0-.07c.007-.022.018-.041.059-.082l45.019-45.02c.04-.04.06-.05.083-.058a.118.118 0 0 1 .07 0c.022.007.041.018.082.059L512 466.745l127.862-127.86c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"}}]})(n)}function Lb(n){return ye({attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M799.855 166.312c.023.007.043.018.084.059l57.69 57.69c.041.041.052.06.059.084a.118.118 0 0 1 0 .069c-.007.023-.018.042-.059.083L569.926 512l287.703 287.703c.041.04.052.06.059.083a.118.118 0 0 1 0 .07c-.007.022-.018.042-.059.083l-57.69 57.69c-.041.041-.06.052-.084.059a.118.118 0 0 1-.069 0c-.023-.007-.042-.018-.083-.059L512 569.926 224.297 857.629c-.04.041-.06.052-.083.059a.118.118 0 0 1-.07 0c-.022-.007-.042-.018-.083-.059l-57.69-57.69c-.041-.041-.052-.06-.059-.084a.118.118 0 0 1 0-.069c.007-.023.018-.042.059-.083L454.073 512 166.371 224.297c-.041-.04-.052-.06-.059-.083a.118.118 0 0 1 0-.07c.007-.022.018-.042.059-.083l57.69-57.69c.041-.041.06-.052.084-.059a.118.118 0 0 1 .069 0c.023.007.042.018.083.059L512 454.073l287.703-287.702c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"}}]})(n)}function Yd(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]})(n)}function Ob(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]})(n)}function Y1(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874c-47-47-84-101.7-109.8-162.7C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3 22.2 52.4 53.9 99.5 94.3 139.9 40.4 40.4 87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952c59.4 0 117-11.6 171.3-34.6 52.4-22.2 99.5-53.9 139.9-94.3 40.4-40.4 72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874c-47 47-101.8 83.9-162.7 109.7-63.1 26.8-130.2 40.3-199.3 40.3z"}}]})(n)}function Rb(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"}}]})(n)}function Pb(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 0 0 0 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1 0 67.88-67.89 48 48 0 1 0-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 0 0-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 0 0-11.3 0l-39.6 39.5a8.03 8.03 0 0 0 0 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]})(n)}function K1(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]})(n)}function Kd(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M464 720a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]})(n)}function Q1(n){return ye({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M9 15l6 -6"}},{tag:"circle",attr:{cx:"9.5",cy:"9.5",r:".5",fill:"currentColor"}},{tag:"circle",attr:{cx:"14.5",cy:"14.5",r:".5",fill:"currentColor"}},{tag:"path",attr:{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7a2.2 2.2 0 0 0 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1a2.2 2.2 0 0 0 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"}}]})(n)}function zb(n){return ye({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19 5h-7l-4 14l-3 -6h-2"}},{tag:"path",attr:{d:"M14 13l6 6"}},{tag:"path",attr:{d:"M14 19l6 -6"}}]})(n)}function Bb(n){return ye({attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}},{tag:"path",attr:{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"}},{tag:"path",attr:{d:"M20 4v5h-5"}}]})(n)}function Z1(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 2H8c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM8 16V4h12l.002 12H8z"}},{tag:"path",attr:{d:"M4 8H2v12c0 1.103.897 2 2 2h12v-2H4V8zm11-2h-2v3h-3v2h3v3h2v-3h3V9h-3z"}}]})(n)}function Vb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 7c0-1.103-.897-2-2-2H7V2H5v3H2v2h15v15h2v-3h3v-2h-3V7z"}},{tag:"path",attr:{d:"M5 9v8c0 1.103.897 2 2 2h8v-2H7V9H5z"}}]})(n)}function $b(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"}}]})(n)}function G1(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z"}},{tag:"path",attr:{d:"M11 7h2v7h-2zm0 8h2v2h-2z"}}]})(n)}function Fb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.937 7.53C19.227 4.119 15.803 2 12 2 6.486 2 2 6.486 2 12s4.486 10 10 10c3.803 0 7.227-2.119 8.937-5.53a1 1 0 0 0-.397-1.316L15.017 12l5.522-3.153c.461-.264.636-.842.398-1.317zm-8.433 3.602a.999.999 0 0 0 0 1.736l6.173 3.525A7.949 7.949 0 0 1 12 20c-4.411 0-8-3.589-8-8s3.589-8 8-8a7.95 7.95 0 0 1 6.677 3.606l-6.173 3.526z"}},{tag:"circle",attr:{cx:"11.5",cy:"7.5",r:"1.5"}}]})(n)}function Hb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 2H8c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM8 16V4h12l.002 12H8z"}},{tag:"path",attr:{d:"M4 8H2v12c0 1.103.897 2 2 2h12v-2H4V8z"}},{tag:"path",attr:{d:"m12 12-1-1-2 3h10l-4-6z"}}]})(n)}function J1(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 2H8C4.691 2 2 4.691 2 8v13a1 1 0 0 0 1 1h13c3.309 0 6-2.691 6-6V8c0-3.309-2.691-6-6-6zm4 14c0 2.206-1.794 4-4 4H4V8c0-2.206 1.794-4 4-4h8c2.206 0 4 1.794 4 4v8z"}},{tag:"path",attr:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}}]})(n)}function Ub(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 11h-5V6h3l-4-4-4 4h3v5H6V8l-4 4 4 4v-3h5v5H8l4 4 4-4h-3v-5h5v3l4-4-4-4z"}}]})(n)}function Wb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(n)}function ud(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}},{tag:"path",attr:{d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.977 3.977 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002z"}}]})(n)}function Yb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9a3.02 3.02 0 0 0-3 3c0 1.642 1.358 3 3 3 1.641 0 3-1.358 3-3 0-1.641-1.359-3-3-3z"}},{tag:"path",attr:{d:"M12 5c-7.633 0-9.927 6.617-9.948 6.684L1.946 12l.105.316C2.073 12.383 4.367 19 12 19s9.927-6.617 9.948-6.684l.106-.316-.105-.316C21.927 11.617 19.633 5 12 5zm0 12c-5.351 0-7.424-3.846-7.926-5C4.578 10.842 6.652 7 12 7c5.351 0 7.424 3.846 7.926 5-.504 1.158-2.578 5-7.926 5z"}}]})(n)}function Kb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m10 10.414 4 4 5.707-5.707L22 11V5h-6l2.293 2.293L14 11.586l-4-4-7.707 7.707 1.414 1.414z"}}]})(n)}function Qb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}}]})(n)}function Zb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}}]})(n)}function Gb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"}}]})(n)}function Jb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M14 2c1.82 0 3.53.5 5 1.35-2.99 1.73-5 4.95-5 8.65s2.01 6.92 5 8.65A9.973 9.973 0 0114 22C8.48 22 4 17.52 4 12S8.48 2 14 2z"}}]})(n)}function q1(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}}]})(n)}function qb(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.5 3C15.57 3 14 4.57 14 6.5V8h-4V6.5C10 4.57 8.43 3 6.5 3S3 4.57 3 6.5 4.57 10 6.5 10H8v4H6.5C4.57 14 3 15.57 3 17.5S4.57 21 6.5 21s3.5-1.57 3.5-3.5V16h4v1.5c0 1.93 1.57 3.5 3.5 3.5s3.5-1.57 3.5-3.5-1.57-3.5-3.5-3.5H16v-4h1.5c1.93 0 3.5-1.57 3.5-3.5S19.43 3 17.5 3zM16 8V6.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S18.33 8 17.5 8H16zM6.5 8C5.67 8 5 7.33 5 6.5S5.67 5 6.5 5 8 5.67 8 6.5V8H6.5zm3.5 6v-4h4v4h-4zm7.5 5c-.83 0-1.5-.67-1.5-1.5V16h1.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5zm-11 0c-.83 0-1.5-.67-1.5-1.5S5.67 16 6.5 16H8v1.5c0 .83-.67 1.5-1.5 1.5z"}}]})(n)}function Wl(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}]})(n)}function X1(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(n)}function ev(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21.9 8.89l-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89zm-2.99-3.9l1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5l1.93-.01zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31V5zM8.49 9.52L9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41a1.42 1.42 0 01-.33-1.07zm-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17zM5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19H5z"}}]})(n)}function Yn(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M13 4v2.67l-1 1-1-1V4h2m7 7v2h-2.67l-1-1 1-1H20M6.67 11l1 1-1 1H4v-2h2.67M12 16.33l1 1V20h-2v-2.67l1-1M15 2H9v5.5l3 3 3-3V2zm7 7h-5.5l-3 3 3 3H22V9zM7.5 9H2v6h5.5l3-3-3-3zm4.5 4.5l-3 3V22h6v-5.5l-3-3z"}}]})(n)}function tv(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-3 2v5l-1-.75L15 9V4h2zm3 12H8V4h5v9l3-2.25L19 13V4h1v12z"}}]})(n)}function nv(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zm-.5 1.5l1.96 2.5H17V9.5h2.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9H8.22zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}}]})(n)}const _e=({show:n,children:e})=>n?e:null,Xb=({index:n=0,children:e,...t})=>{if(n>=q.Children.count(e))return null;const s=v.useMemo(()=>q.Children.toArray(e),[e]);return c.jsx("div",{...t,children:s[n]})},Qd=({toggle:n=!0,children:e,...t})=>c.jsx(Xb,{index:n?0:1,children:e,...t});function e4(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"rect",attr:{width:"80",height:"80",x:"64",y:"64",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"216",y:"64",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"368",y:"64",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"64",y:"216",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"216",y:"216",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"368",y:"216",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"64",y:"368",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"216",y:"368",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}},{tag:"rect",attr:{width:"80",height:"80",x:"368",y:"368",fill:"none",strokeMiterlimit:"10",strokeWidth:"32",rx:"40",ry:"40"}}]})(n)}function t4(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"}}]})(n)}function Yl(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 145.49L366.51 112 256 222.51 145.49 112 112 145.49 222.51 256 112 366.51 145.49 400 256 289.49 366.51 400 400 366.51 289.49 256 400 145.49z"}}]})(n)}function n4(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"}}]})(n)}function s4(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48"}},{tag:"path",attr:{d:"M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z"}}]})(n)}function A0(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm120 182.15a8.62 8.62 0 01-8.62 8.62h-59.54a8.61 8.61 0 01-6.09-14.71l22.17-22.17-5.6-6.51a87.38 87.38 0 10-62.94 148 87.55 87.55 0 0082.42-58.25A16 16 0 11368 295.8a119.4 119.4 0 11-112.62-159.18 118.34 118.34 0 0186.36 36.95l.56.62 4.31 5 14.68-14.68a8.44 8.44 0 016-2.54 8.61 8.61 0 018.68 8.63z"}}]})(n)}function sv(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"32",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}},{tag:"path",attr:{d:"M464 68.45V220a4 4 0 01-4 4H308.45a4 4 0 01-2.83-6.83L457.17 65.62a4 4 0 016.83 2.83z"}}]})(n)}function r4(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M104 496H72a24 24 0 01-24-24V328a24 24 0 0124-24h32a24 24 0 0124 24v144a24 24 0 01-24 24zm224 0h-32a24 24 0 01-24-24V232a24 24 0 0124-24h32a24 24 0 0124 24v240a24 24 0 01-24 24zm112 0h-32a24 24 0 01-24-24V120a24 24 0 0124-24h32a24 24 0 0124 24v352a24 24 0 01-24 24zm-224 0h-32a24 24 0 01-24-24V40a24 24 0 0124-24h32a24 24 0 0124 24v432a24 24 0 01-24 24z"}}]})(n)}const rv="pubsub.on_change",iv="pubsub.on_refresh";class i4{constructor(){this._subscribers=new Set,this.add_sub=e=>(this._subscribers.add(e),()=>{this._subscribers.delete(e)}),this.dispatch=(e,t=void 0)=>{this._subscribers.forEach(s=>s(e,t))}}}const is=new i4,a4={text:n=>typeof n!="string"?[!1,"Value is not a string"]:!n&&n.trim()===""?[!1,"Empty value"]:[!0,"All good"],number:n=>isNaN(parseFloat(n))?[!1,"Value is not a number"]:[!0,"parseFloat(value)!==NaN"],email:n=>{let t=/\S+@\S+\.\S+/.test(n);return[t,t?"Email ok":"Email is not valid format"]},unknown:n=>[!0,`type ${n} is not known in Validator`]},uc=(n,e,t=void 0)=>e.hasOwnProperty(n)?e[n]:t,o4=n=>uc("editable",n,!0),l4=n=>uc("validate",n,!0),c4=(n,e)=>{const s=l4(n)?uc("validator",n,a4[n.type]):void 0;return s?s(e):[!0,void 0]},av=(n,e)=>{let t=n??"";return e&&(n&&(t+="."),t+=e),t},u4=v.forwardRef(({field:n,value:e,context:t,running_key:s,isViewMode:r,...a},l)=>{s=av(s,n.key);const[u,d]=v.useState(void 0),[f,p]=v.useState(e??n.defaultValue),g=v.useCallback(()=>o4(n)&&!r,[n,r]),y=v.useCallback(k=>{g()&&(p(k),is.dispatch(rv),is.dispatch(s,k))},[g,is,s]);v.useEffect(()=>{is.dispatch(s,f)},[is,s,f]),v.useEffect(()=>{n.key&&(t.query[s]={get:()=>f,set:k=>y(k)})},[n,t,f,y]),v.useImperativeHandle(l,()=>({get:(k=!0)=>{const C=uc("autoGenerate",n,()=>f)(n),[S,M]=c4(n,C);return k&&d(S?void 0:M),n.key?{data:{[n.key]:C},validation:{fine:{[n.key]:[S,M,n.name]},has_errors:!S}}:{data:void 0}}}),[n,f,g]);const w=v.useMemo(()=>({...t,running_key:s,pubsub:is}),[t,s,is]);return v.useEffect(()=>()=>{},[]),c.jsx(n.comp,{field:n,value:f,error:u,setError:d,onChange:y,context:w,disabled:!g(),...n.comp_params})}),h4=({...n})=>c.jsx("div",{...n}),ov=v.forwardRef(({field:n,value:e,className:t,context:s,running_key:r,isViewMode:a=!1,...l},u)=>{r=av(r,n.key);const d=v.useRef([]);v.useImperativeHandle(u,()=>({get:(k=!0)=>{const _=d.current.map(I=>I.get(k)).filter(I=>I.data&&I.data!==void 0),C=_.reduce((I,L)=>({...I,...L==null?void 0:L.data}),{}),S=_.reduce((I,L)=>({...I,...L==null?void 0:L.validation.fine}),{}),M=_.reduce((I,L)=>I||L.validation.has_errors,!1);return{data:n.key?{[n.key]:C}:C,validation:{fine:n.key?{[n.key]:S}:S,has_errors:M}}}}),[n]);let f=n.fields.map((k,_)=>{let C=k.key?e==null?void 0:e[k.key]:e;const S=k.fields?ov:u4;return c.jsx(S,{ref:M=>d.current[_]=M,running_key:r,field:k,value:C,isViewMode:a,context:s},`${r}_${_}`)});const p=n.comp??h4,{className:g,...y}=n.comp_params??{},w=`${t} ${g}
|
68
|
+
${a?"pointer-events-none":""}`;return v.useEffect(()=>()=>{},[]),c.jsx(p,{...y,field:n,value:e,children:f,className:w})}),Ln=v.forwardRef(({field:n,value:e,className:t,context:s,isViewMode:r=!1,...a},l)=>{v.useEffect(()=>{is.dispatch(iv)},[e]);const u=v.useMemo(()=>({...s??{},query:{all:{get:(d=!1)=>l.current.get(d)}},data:e}),[s,e]);return c.jsx(ov,{ref:l,field:n,value:e,className:t,context:u,running_key:void 0,isViewMode:r,...a})});function Zd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let $r=Zd();function lv(n){$r=n}const Ma={exec:()=>null};function et(n,e=""){let t=typeof n=="string"?n:n.source;const s={replace:(r,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(qt.caret,"$1"),t=t.replace(r,l),s},getRegex:()=>new RegExp(t,e)};return s}const qt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},d4=/^(?:[ \t]*(?:\n|$))+/,f4=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p4=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ga=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,m4=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gd=/(?:[*+-]|\d{1,9}[.)])/,cv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uv=et(cv).replace(/bull/g,Gd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g4=et(cv).replace(/bull/g,Gd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v4=/^[^\n]+/,qd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,x4=et(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y4=et(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gd).getRegex(),hc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,w4=et("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Xd).replace("tag",hc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hv=et(Jd).replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hc).getRegex(),b4=et(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hv).getRegex(),ef={blockquote:b4,code:f4,def:x4,fences:p4,heading:m4,hr:Ga,html:w4,lheading:uv,list:y4,newline:d4,paragraph:hv,table:Ma,text:v4},L0=et("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hc).getRegex(),k4={...ef,lheading:g4,table:L0,paragraph:et(Jd).replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",L0).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",hc).getRegex()},_4={...ef,html:et(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ma,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:et(Jd).replace("hr",Ga).replace("heading",` *#{1,6} *[^
|
69
|
+
]`).replace("lheading",uv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,N4=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dv=/^( {2,}|\\)\n(?!\s*$)/,j4=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,dc=/[\p{P}\p{S}]/u,tf=/[\s\p{P}\p{S}]/u,fv=/[^\s\p{P}\p{S}]/u,S4=et(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,tf).getRegex(),pv=/(?!~)[\p{P}\p{S}]/u,E4=/(?!~)[\s\p{P}\p{S}]/u,M4=/(?:[^\s\p{P}\p{S}]|~)/u,D4=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,mv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T4=et(mv,"u").replace(/punct/g,dc).getRegex(),I4=et(mv,"u").replace(/punct/g,pv).getRegex(),gv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",A4=et(gv,"gu").replace(/notPunctSpace/g,fv).replace(/punctSpace/g,tf).replace(/punct/g,dc).getRegex(),L4=et(gv,"gu").replace(/notPunctSpace/g,M4).replace(/punctSpace/g,E4).replace(/punct/g,pv).getRegex(),O4=et("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fv).replace(/punctSpace/g,tf).replace(/punct/g,dc).getRegex(),R4=et(/\\(punct)/,"gu").replace(/punct/g,dc).getRegex(),P4=et(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),z4=et(Xd).replace("(?:-->|$)","-->").getRegex(),B4=et("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",z4).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V4=et(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Kl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vv=et(/^!?\[(label)\]\[(ref)\]/).replace("label",Kl).replace("ref",qd).getRegex(),xv=et(/^!?\[(ref)\](?:\[\])?/).replace("ref",qd).getRegex(),$4=et("reflink|nolink(?!\\()","g").replace("reflink",vv).replace("nolink",xv).getRegex(),nf={_backpedal:Ma,anyPunctuation:R4,autolink:P4,blockSkip:D4,br:dv,code:N4,del:Ma,emStrongLDelim:T4,emStrongRDelimAst:A4,emStrongRDelimUnd:O4,escape:C4,link:V4,nolink:xv,punctuation:S4,reflink:vv,reflinkSearch:$4,tag:B4,text:j4,url:Ma},F4={...nf,link:et(/^!?\[(label)\]\((.*?)\)/).replace("label",Kl).getRegex(),reflink:et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kl).getRegex()},hd={...nf,emStrongRDelimAst:L4,emStrongLDelim:I4,url:et(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},H4={...hd,br:et(dv).replace("{2,}","*").getRegex(),text:et(hd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ml={normal:ef,gfm:k4,pedantic:_4},wa={normal:nf,gfm:hd,breaks:H4,pedantic:F4},U4={"&":"&","<":"<",">":">",'"':""","'":"'"},O0=n=>U4[n];function rs(n,e){if(e){if(qt.escapeTest.test(n))return n.replace(qt.escapeReplace,O0)}else if(qt.escapeTestNoEncode.test(n))return n.replace(qt.escapeReplaceNoEncode,O0);return n}function R0(n){try{n=encodeURI(n).replace(qt.percentDecode,"%")}catch{return null}return n}function P0(n,e){var a;const t=n.replace(qt.findPipe,(l,u,d)=>{let f=!1,p=u;for(;--p>=0&&d[p]==="\\";)f=!f;return f?"|":" |"}),s=t.split(qt.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!((a=s.at(-1))!=null&&a.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(qt.slashPipe,"|");return s}function ba(n,e,t){const s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function W4(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return-1}function z0(n,e,t,s,r){const a=e.href,l=e.title||null,u=n[1].replace(r.other.outputLinkReplace,"$1");if(n[0].charAt(0)!=="!"){s.state.inLink=!0;const d={type:"link",raw:t,href:a,title:l,text:u,tokens:s.inlineTokens(u)};return s.state.inLink=!1,d}return{type:"image",raw:t,href:a,title:l,text:u}}function Y4(n,e,t){const s=n.match(t.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
|
70
|
+
`).map(a=>{const l=a.match(t.other.beginningSpace);if(l===null)return a;const[u]=l;return u.length>=r.length?a.slice(r.length):a}).join(`
|
71
|
+
`)}class Ql{constructor(e){we(this,"options");we(this,"rules");we(this,"lexer");this.options=e||$r}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ba(s,`
|
72
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],r=Y4(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){const r=ba(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ba(t[0],`
|
73
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=ba(t[0],`
|
74
|
+
`).split(`
|
75
|
+
`),r="",a="";const l=[];for(;s.length>0;){let u=!1;const d=[];let f;for(f=0;f<s.length;f++)if(this.rules.other.blockquoteStart.test(s[f]))d.push(s[f]),u=!0;else if(!u)d.push(s[f]);else break;s=s.slice(f);const p=d.join(`
|
76
|
+
`),g=p.replace(this.rules.other.blockquoteSetextReplace,`
|
77
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
78
|
+
${p}`:p,a=a?`${a}
|
79
|
+
${g}`:g;const y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,l,!0),this.lexer.state.top=y,s.length===0)break;const w=l.at(-1);if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){const k=w,_=k.raw+`
|
80
|
+
`+s.join(`
|
81
|
+
`),C=this.blockquote(_);l[l.length-1]=C,r=r.substring(0,r.length-k.raw.length)+C.raw,a=a.substring(0,a.length-k.text.length)+C.text;break}else if((w==null?void 0:w.type)==="list"){const k=w,_=k.raw+`
|
82
|
+
`+s.join(`
|
83
|
+
`),C=this.list(_);l[l.length-1]=C,r=r.substring(0,r.length-w.raw.length)+C.raw,a=a.substring(0,a.length-k.raw.length)+C.raw,s=_.substring(l.at(-1).raw.length).split(`
|
84
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const r=s.length>1,a={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");const l=this.rules.other.listItemRegex(s);let u=!1;for(;e;){let f=!1,p="",g="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let y=t[2].split(`
|
85
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),w=e.split(`
|
86
|
+
`,1)[0],k=!y.trim(),_=0;if(this.options.pedantic?(_=2,g=y.trimStart()):k?_=t[1].length+1:(_=t[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,g=y.slice(_),_+=t[1].length),k&&this.rules.other.blankLine.test(w)&&(p+=w+`
|
87
|
+
`,e=e.substring(w.length+1),f=!0),!f){const M=this.rules.other.nextBulletRegex(_),I=this.rules.other.hrRegex(_),L=this.rules.other.fencesBeginRegex(_),O=this.rules.other.headingBeginRegex(_),K=this.rules.other.htmlBeginRegex(_);for(;e;){const E=e.split(`
|
88
|
+
`,1)[0];let R;if(w=E,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),R=w):R=w.replace(this.rules.other.tabCharGlobal," "),L.test(w)||O.test(w)||K.test(w)||M.test(w)||I.test(w))break;if(R.search(this.rules.other.nonSpaceChar)>=_||!w.trim())g+=`
|
89
|
+
`+R.slice(_);else{if(k||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(y)||O.test(y)||I.test(y))break;g+=`
|
90
|
+
`+w}!k&&!w.trim()&&(k=!0),p+=E+`
|
91
|
+
`,e=e.substring(E.length+1),y=R.slice(_)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(u=!0));let C=null,S;this.options.gfm&&(C=this.rules.other.listIsTask.exec(g),C&&(S=C[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:p,task:!!C,checked:S,loose:!1,text:g,tokens:[]}),a.raw+=p}const d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let f=0;f<a.items.length;f++)if(this.lexer.state.top=!1,a.items[f].tokens=this.lexer.blockTokens(a.items[f].text,[]),!a.loose){const p=a.items[f].tokens.filter(y=>y.type==="space"),g=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));a.loose=g}if(a.loose)for(let f=0;f<a.items.length;f++)a.items[f].loose=!0;return a}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:r,title:a}}}table(e){var u;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const s=P0(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(u=t[3])!=null&&u.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
92
|
+
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===r.length){for(const d of r)this.rules.other.tableAlignRight.test(d)?l.align.push("right"):this.rules.other.tableAlignCenter.test(d)?l.align.push("center"):this.rules.other.tableAlignLeft.test(d)?l.align.push("left"):l.align.push(null);for(let d=0;d<s.length;d++)l.header.push({text:s[d],tokens:this.lexer.inline(s[d]),header:!0,align:l.align[d]});for(const d of a)l.rows.push(P0(d,l.header.length).map((f,p)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:l.align[p]})));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
|
93
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const l=ba(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{const l=W4(t[2],"()");if(l>-1){const d=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,d).trim(),t[3]=""}}let r=t[2],a="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),z0(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[r.toLowerCase()];if(!a){const l=s[0].charAt(0);return{type:"text",raw:l,text:l}}return z0(s,a,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const l=[...r[0]].length-1;let u,d,f=l,p=0;const g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,t=t.slice(-1*e.length+l);(r=g.exec(t))!=null;){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(d=[...u].length,r[3]||r[4]){f+=d;continue}else if((r[5]||r[6])&&l%3&&!((l+d)%3)){p+=d;continue}if(f-=d,f>0)continue;d=Math.min(d,d+f+p);const y=[...r[0]][0].length,w=e.slice(0,l+r.index+y+d);if(Math.min(l,d)%2){const _=w.slice(1,-1);return{type:"em",raw:w,text:_,tokens:this.lexer.inlineTokens(_)}}const k=w.slice(2,-2);return{type:"strong",raw:w,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let r,a;if(t[2]==="@")r=t[0],a="mailto:"+r;else{let l;do l=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(l!==t[0]);r=t[0],t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}}class Kn{constructor(e){we(this,"tokens");we(this,"options");we(this,"state");we(this,"tokenizer");we(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$r,this.options.tokenizer=this.options.tokenizer||new Ql,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:qt,block:ml.normal,inline:wa.normal};this.options.pedantic?(t.block=ml.pedantic,t.inline=wa.pedantic):this.options.gfm&&(t.block=ml.gfm,this.options.breaks?t.inline=wa.breaks:t.inline=wa.gfm),this.tokenizer.rules=t}static get rules(){return{block:ml,inline:wa}}static lex(e,t){return new Kn(t).lex(e)}static lexInline(e,t){return new Kn(t).inlineTokens(e)}lex(e){e=e.replace(qt.carriageReturn,`
|
94
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var r,a,l;for(this.options.pedantic&&(e=e.replace(qt.tabCharGlobal," ").replace(qt.spaceLine,""));e;){let u;if((a=(r=this.options.extensions)==null?void 0:r.block)!=null&&a.some(f=>(u=f.call({lexer:this},e,t))?(e=e.substring(u.raw.length),t.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);const f=t.at(-1);u.raw.length===1&&f!==void 0?f.raw+=`
|
95
|
+
`:t.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.raw.length);const f=t.at(-1);(f==null?void 0:f.type)==="paragraph"||(f==null?void 0:f.type)==="text"?(f.raw+=`
|
96
|
+
`+u.raw,f.text+=`
|
97
|
+
`+u.text,this.inlineQueue.at(-1).src=f.text):t.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.raw.length);const f=t.at(-1);(f==null?void 0:f.type)==="paragraph"||(f==null?void 0:f.type)==="text"?(f.raw+=`
|
98
|
+
`+u.raw,f.text+=`
|
99
|
+
`+u.raw,this.inlineQueue.at(-1).src=f.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title});continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),t.push(u);continue}let d=e;if((l=this.options.extensions)!=null&&l.startBlock){let f=1/0;const p=e.slice(1);let g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(d=e.substring(0,f+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){const f=t.at(-1);s&&(f==null?void 0:f.type)==="paragraph"?(f.raw+=`
|
100
|
+
`+u.raw,f.text+=`
|
101
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):t.push(u),s=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);const f=t.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=`
|
102
|
+
`+u.raw,f.text+=`
|
103
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):t.push(u);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var u,d,f;let s=e,r=null;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)p.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,l="";for(;e;){a||(l=""),a=!1;let p;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(y=>(p=y.call({lexer:this},e,t))?(e=e.substring(p.raw.length),t.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);const y=t.at(-1);p.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=p.raw,y.text+=p.text):t.push(p);continue}if(p=this.tokenizer.emStrong(e,s,l)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),t.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),t.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let y=1/0;const w=e.slice(1);let k;this.options.extensions.startInline.forEach(_=>{k=_.call({lexer:this},w),typeof k=="number"&&k>=0&&(y=Math.min(y,k))}),y<1/0&&y>=0&&(g=e.substring(0,y+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(l=p.raw.slice(-1)),a=!0;const y=t.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=p.raw,y.text+=p.text):t.push(p);continue}if(e){const y="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return t}}class Zl{constructor(e){we(this,"options");we(this,"parser");this.options=e||$r}space(e){return""}code({text:e,lang:t,escaped:s}){var l;const r=(l=(t||"").match(qt.notSpaceStart))==null?void 0:l[0],a=e.replace(qt.endingNewline,"")+`
|
104
|
+
`;return r?'<pre><code class="language-'+rs(r)+'">'+(s?a:rs(a,!0))+`</code></pre>
|
105
|
+
`:"<pre><code>"+(s?a:rs(a,!0))+`</code></pre>
|
106
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
107
|
+
${this.parser.parse(e)}</blockquote>
|
108
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
109
|
+
`}hr(e){return`<hr>
|
110
|
+
`}list(e){const t=e.ordered,s=e.start;let r="";for(let u=0;u<e.items.length;u++){const d=e.items[u];r+=this.listitem(d)}const a=t?"ol":"ul",l=t&&s!==1?' start="'+s+'"':"";return"<"+a+l+`>
|
111
|
+
`+r+"</"+a+`>
|
112
|
+
`}listitem(e){var s;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((s=e.tokens[0])==null?void 0:s.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+rs(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
113
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
114
|
+
`}table(e){let t="",s="";for(let a=0;a<e.header.length;a++)s+=this.tablecell(e.header[a]);t+=this.tablerow({text:s});let r="";for(let a=0;a<e.rows.length;a++){const l=e.rows[a];s="";for(let u=0;u<l.length;u++)s+=this.tablecell(l[u]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
115
|
+
<thead>
|
116
|
+
`+t+`</thead>
|
117
|
+
`+r+`</table>
|
118
|
+
`}tablerow({text:e}){return`<tr>
|
119
|
+
${e}</tr>
|
120
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
|
121
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${rs(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){const r=this.parser.parseInline(s),a=R0(e);if(a===null)return r;e=a;let l='<a href="'+e+'"';return t&&(l+=' title="'+rs(t)+'"'),l+=">"+r+"</a>",l}image({href:e,title:t,text:s}){const r=R0(e);if(r===null)return rs(s);e=r;let a=`<img src="${e}" alt="${s}"`;return t&&(a+=` title="${rs(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:rs(e.text)}}class sf{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Qn{constructor(e){we(this,"options");we(this,"renderer");we(this,"textRenderer");this.options=e||$r,this.options.renderer=this.options.renderer||new Zl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sf}static parse(e,t){return new Qn(t).parse(e)}static parseInline(e,t){return new Qn(t).parseInline(e)}parse(e,t=!0){var r,a;let s="";for(let l=0;l<e.length;l++){const u=e[l];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){const f=u,p=this.options.extensions.renderers[f.type].call({parser:this},f);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type)){s+=p||"";continue}}const d=u;switch(d.type){case"space":{s+=this.renderer.space(d);continue}case"hr":{s+=this.renderer.hr(d);continue}case"heading":{s+=this.renderer.heading(d);continue}case"code":{s+=this.renderer.code(d);continue}case"table":{s+=this.renderer.table(d);continue}case"blockquote":{s+=this.renderer.blockquote(d);continue}case"list":{s+=this.renderer.list(d);continue}case"html":{s+=this.renderer.html(d);continue}case"paragraph":{s+=this.renderer.paragraph(d);continue}case"text":{let f=d,p=this.renderer.text(f);for(;l+1<e.length&&e[l+1].type==="text";)f=e[++l],p+=`
|
122
|
+
`+this.renderer.text(f);t?s+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):s+=p;continue}default:{const f='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return s}parseInline(e,t=this.renderer){var r,a;let s="";for(let l=0;l<e.length;l++){const u=e[l];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){const f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){s+=f||"";continue}}const d=u;switch(d.type){case"escape":{s+=t.text(d);break}case"html":{s+=t.html(d);break}case"link":{s+=t.link(d);break}case"image":{s+=t.image(d);break}case"strong":{s+=t.strong(d);break}case"em":{s+=t.em(d);break}case"codespan":{s+=t.codespan(d);break}case"br":{s+=t.br(d);break}case"del":{s+=t.del(d);break}case"text":{s+=t.text(d);break}default:{const f='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return s}}class Da{constructor(e){we(this,"options");we(this,"block");this.options=e||$r}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Kn.lex:Kn.lexInline}provideParser(){return this.block?Qn.parse:Qn.parseInline}}we(Da,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class K4{constructor(...e){we(this,"defaults",Zd());we(this,"options",this.setOptions);we(this,"parse",this.parseMarkdown(!0));we(this,"parseInline",this.parseMarkdown(!1));we(this,"Parser",Qn);we(this,"Renderer",Zl);we(this,"TextRenderer",sf);we(this,"Lexer",Kn);we(this,"Tokenizer",Ql);we(this,"Hooks",Da);this.use(...e)}walkTokens(e,t){var r,a;let s=[];for(const l of e)switch(s=s.concat(t.call(this,l)),l.type){case"table":{const u=l;for(const d of u.header)s=s.concat(this.walkTokens(d.tokens,t));for(const d of u.rows)for(const f of d)s=s.concat(this.walkTokens(f.tokens,t));break}case"list":{const u=l;s=s.concat(this.walkTokens(u.items,t));break}default:{const u=l;(a=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&a[u.type]?this.defaults.extensions.childTokens[u.type].forEach(d=>{const f=u[d].flat(1/0);s=s.concat(this.walkTokens(f,t))}):u.tokens&&(s=s.concat(this.walkTokens(u.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const l=t.renderers[a.name];l?t.renderers[a.name]=function(...u){let d=a.renderer.apply(this,u);return d===!1&&(d=l.apply(this,u)),d}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[a.level];l?l.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),r.extensions=t),s.renderer){const a=this.defaults.renderer||new Zl(this.defaults);for(const l in s.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const u=l,d=s.renderer[u],f=a[u];a[u]=(...p)=>{let g=d.apply(a,p);return g===!1&&(g=f.apply(a,p)),g||""}}r.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new Ql(this.defaults);for(const l in s.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const u=l,d=s.tokenizer[u],f=a[u];a[u]=(...p)=>{let g=d.apply(a,p);return g===!1&&(g=f.apply(a,p)),g}}r.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Da;for(const l in s.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const u=l,d=s.hooks[u],f=a[u];Da.passThroughHooks.has(l)?a[u]=p=>{if(this.defaults.async)return Promise.resolve(d.call(a,p)).then(y=>f.call(a,y));const g=d.call(a,p);return f.call(a,g)}:a[u]=(...p)=>{let g=d.apply(a,p);return g===!1&&(g=f.apply(a,p)),g}}r.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,l=s.walkTokens;r.walkTokens=function(u){let d=[];return d.push(l.call(this,u)),a&&(d=d.concat(a.call(this,u))),d}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Kn.lex(e,t??this.defaults)}parser(e,t){return Qn.parse(e,t??this.defaults)}parseMarkdown(e){return(s,r)=>{const a={...r},l={...this.defaults,...a},u=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&a.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=e);const d=l.hooks?l.hooks.provideLexer():e?Kn.lex:Kn.lexInline,f=l.hooks?l.hooks.provideParser():e?Qn.parse:Qn.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(s):s).then(p=>d(p,l)).then(p=>l.hooks?l.hooks.processAllTokens(p):p).then(p=>l.walkTokens?Promise.all(this.walkTokens(p,l.walkTokens)).then(()=>p):p).then(p=>f(p,l)).then(p=>l.hooks?l.hooks.postprocess(p):p).catch(u);try{l.hooks&&(s=l.hooks.preprocess(s));let p=d(s,l);l.hooks&&(p=l.hooks.processAllTokens(p)),l.walkTokens&&this.walkTokens(p,l.walkTokens);let g=f(p,l);return l.hooks&&(g=l.hooks.postprocess(g)),g}catch(p){return u(p)}}}onError(e,t){return s=>{if(s.message+=`
|
123
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+rs(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}}const Lr=new K4;function ht(n,e){return Lr.parse(n,e)}ht.options=ht.setOptions=function(n){return Lr.setOptions(n),ht.defaults=Lr.defaults,lv(ht.defaults),ht};ht.getDefaults=Zd;ht.defaults=$r;ht.use=function(...n){return Lr.use(...n),ht.defaults=Lr.defaults,lv(ht.defaults),ht};ht.walkTokens=function(n,e){return Lr.walkTokens(n,e)};ht.parseInline=Lr.parseInline;ht.Parser=Qn;ht.parser=Qn.parse;ht.Renderer=Zl;ht.TextRenderer=sf;ht.Lexer=Kn;ht.lexer=Kn.lex;ht.Tokenizer=Ql;ht.Hooks=Da;ht.parse=ht;const It=({value:n,...e})=>c.jsx("div",{...e,children:c.jsx("p",{className:"--mdx md-view overflow-auto",dangerouslySetInnerHTML:{__html:ht.parse(n??"",{})}})}),Q4="💡 changes made, don't forget to save",us=v.forwardRef(({time:n,changes_made:e=!1,rightText:t="created at: ",...s},r)=>{const[a,l]=v.useState(e),u=n?t+new Date(n).toLocaleString():"*";return v.useEffect(()=>is.add_sub(d=>{switch(d){case rv:l(!0);return;case iv:return;default:return}}),[is]),v.useImperativeHandle(r,()=>({get:()=>a,set:(d=!1)=>l(d)}),[a]),c.jsx("div",{...s,children:c.jsxs("div",{className:`relative w-full flex flex-row
|
124
|
+
justify-between items-center`,children:[a&&c.jsx("p",{children:Q4,className:`absolute left-0 -top-full shelf-border-color
|
125
|
+
border rounded-md px-1 py-0
|
126
|
+
bg-lime-50/50 text-green-700
|
127
|
+
dark:bg-white/10 dark:text-green-300
|
128
|
+
dark:border-none`}),c.jsx("span",{className:"flex-1 border-t shelf-border-color mr-3"}),c.jsx("p",{children:u,className:`text-gray-500 dark:text-gray-400
|
129
|
+
text-sm italic flex-shrink-0`})]})})}),lt=({dashed:n=!1,...e})=>{const s="shelf-border-color"+(n?" border-dashed":"");return c.jsx("div",{...e,children:c.jsx("hr",{className:s})})},ka=({className:n,...e})=>c.jsx("p",{...e,className:`${n} text-4xl shelf-text-title-color `}),bi=({...n})=>c.jsx("div",{className:`text-base shelf-text-label-color
|
130
|
+
font-medium underline w-fit
|
131
|
+
max-w-max overflow-x-auto inline`,children:c.jsx("span",{...n})}),Z4=`rounded-md pl-3
|
132
|
+
w-full block text-base
|
133
|
+
hover:ring-pink-400 hover:ring-2
|
134
|
+
shelf-input-color
|
135
|
+
focus:outline-none
|
136
|
+
font-normal transition-none`,yv=v.forwardRef(({className:n="h-10 px-3",overrideClass:e=!1,...t},s)=>{const r=e?n:`${Z4} ${n}`;return c.jsx("input",{...t,ref:s,onWheel:a=>a.target.blur(),className:r})}),Qe=v.forwardRef(({from:n,to:e,rounded:t="rounded-md",stroke:s,className:r,inputClsName:a="h-10 rounded-md px-3",...l},u)=>c.jsx(Je,{from:n,to:e,rounded:t,stroke:s,className:r,children:c.jsx(yv,{ref:u,className:a,...l})})),Je=({className:n,rounded:e="rounded-md",children:t,stroke:s="border",from:r="from-pink-500 dark:from-pink-600",to:a="to-kf-500 dark:to-kf-500",...l})=>c.jsx("div",{className:`bg-gradient-to-r
|
137
|
+
${r} ${a} ${s}
|
138
|
+
${e} ${n}`,...l,style:{backgroundClip:"border-box",borderColor:"transparent",backgroundOrigin:"border-box"},children:t}),$e=(n,e={})=>({...t})=>c.jsx(Je,{...e,children:c.jsx(n,{...t})}),We=({setError:n,...e})=>c.jsx("div",{...e}),Ts=({name:n,setError:e,error:t=void 0,children:s,border:r=!0,desc:a=void 0,rightView:l,cardClass:u="shelf-card",...d})=>c.jsx("div",{...d,children:c.jsxs("div",{className:`w-full text-left
|
139
|
+
${r?"border rounded-lg shadow-sm dark:shadow-xl p-5 "+u:""}
|
140
|
+
`,children:[(n||l)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[n&&c.jsx("div",{children:n,className:"text-base w-fit"}),l]}),c.jsx(lt,{className:"mt-3 --mb-5"})]}),c.jsxs(_e,{show:a,children:[c.jsx(It,{value:a,className:`text-sm shelf-text-minor-light mt-3
|
141
|
+
tracking-wider --whitespace-pre-line`}),c.jsx(lt,{className:"mt-3 --mb-5"})]}),c.jsx("div",{children:s,className:"mt-5"}),t&&c.jsxs("div",{className:`flex relative flex-row flex-nowrap items-center text-base
|
142
|
+
text-red-700 dark:text-red-400
|
143
|
+
bg-red-400/25 border border-red-400 rounded-md p-3 mt-5 `,children:[c.jsx(G1,{className:"flex-inline text-2xl flex-shrink-0 opacity-70"}),c.jsx(It,{value:t,className:"mx-3 overflow-auto"}),c.jsx(n4,{className:`flex-inline absolute top-1 right-1
|
144
|
+
cursor-pointer text-2xl flex-shrink-0 opacity-90`,onClick:()=>e&&e(void 0)})]})]})}),B0=({text:n,icon:e=void 0,className:t,classNameSpan:s,children:r,rightView:a,...l})=>c.jsxs("button",{className:`flex flex-row items-center rounded-md cursor-pointer
|
145
|
+
py-2 justify-between ${t}`,...l,children:[c.jsxs("div",{className:"flex flex-row items-center",children:[e,c.jsx("div",{children:n,className:`px-3 ${s}`})]}),a??r]}),G4=({text:n,icon:e=void 0,className:t,classNameSpan:s,children:r,...a})=>c.jsxs("button",{className:`flex flex-row items-center gap-1 rounded-md
|
146
|
+
shelf-button-color-hard justify-center cursor-pointer
|
147
|
+
${t}`,...a,children:[e,c.jsx("span",{children:r??n,className:s})]}),J4=`h-fit px-2 py-1 rounded-lg border
|
148
|
+
w-fit flex flex-row items-center
|
149
|
+
transition-colors duration-300`,Ja=({Icon:n=null,show:e=!0,text:t="",keep_text_on_load:s=!1,className:r=J4,classNameLoading:a="inline text-sm",classNameLeft:l="w-4",loading:u,...d})=>{if(!e)return null;t=u&&!s?"":t;const f="animate-spin "+a;return c.jsxs("button",{className:`flex flex-row items-center gap-1 cursor-pointer ${r}`,...d,children:[c.jsx("div",{className:"h-full flex flex-row items-center "+l,children:u?c.jsx(Y1,{className:f}):n}),t&&c.jsx("span",{children:t,className:"whitespace-nowrap "})]})},ls=({onClick:n,loading:e,...t})=>{const[s,r]=v.useState(e),a=v.useCallback(()=>{const l=()=>r(!1);r(!0),n().then(l).catch(l)},[n]);return c.jsx(Ja,{...t,loading:s,onClick:a})},Zn=({onClick:n,show:e=!0,className:t="h-6",loading:s,stroke:r="border",rounded:a="rounded-full",from:l="from-pink-300 dark:from-pink-500",to:u="to-kf-300 dark:to-kf-500",...d})=>{const[f,p]=v.useState(s),g=v.useCallback(()=>{const y=()=>p(!1);p(!0),n().catch(()=>{}).finally(y)},[n]);return e?c.jsx(Je,{stroke:r,className:t,rounded:a,from:l,to:u,children:c.jsx(Ja,{className:`${a} px-2 h-full bg-slate-50 dark:bg-slate-800
|
150
|
+
text-gray-600 dark:text-gray-400
|
151
|
+
text-base font-semibold tracking-tight`,loading:f,onClick:g,...d})}):null},Xt=({from:n,to:e,rounded:t="rounded-lg",stroke:s="border-2",children:r,text:a="what",className:l="h-10",btnClassName:u="",...d})=>c.jsx(Je,{from:n,to:e,rounded:t,stroke:s,className:l,children:c.jsx("button",{className:`h-full w-full align-middle text-center px-3
|
152
|
+
rounded-md shelf-button-color-soft
|
153
|
+
whitespace-nowrap ${u}`,children:r??a,...d})}),q4=({from:n,to:e,rounded:t="rounded-lg",stroke:s,...r})=>c.jsx(Je,{from:n,to:e,rounded:t,stroke:s,className:"w-fit h-fit",children:c.jsx(G4,{...r})}),qa=({Icon:n,from:e="#973cff",to:t="rgb(236 72 153)",...s})=>{const r=btoa(`gradient_${e}_${t}`);return c.jsxs(c.Fragment,{children:[c.jsx("svg",{width:"0",height:"0",className:"absolute",children:c.jsxs("linearGradient",{id:r,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[c.jsx("stop",{stopColor:e,offset:"0%"}),c.jsx("stop",{stopColor:t,offset:"100%"})]})}),c.jsx(n,{style:{fill:`url(#${r})`},...s})]})},wv="3.7.7",X4=wv,Ai=typeof Buffer=="function",V0=typeof TextDecoder=="function"?new TextDecoder:void 0,$0=typeof TextEncoder=="function"?new TextEncoder:void 0,e3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ja=Array.prototype.slice.call(e3),gl=(n=>{let e={};return n.forEach((t,s)=>e[t]=s),e})(ja),t3=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ft=String.fromCharCode.bind(String),F0=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):n=>new Uint8Array(Array.prototype.slice.call(n,0)),bv=n=>n.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),kv=n=>n.replace(/[^A-Za-z0-9\+\/]/g,""),_v=n=>{let e,t,s,r,a="";const l=n.length%3;for(let u=0;u<n.length;){if((t=n.charCodeAt(u++))>255||(s=n.charCodeAt(u++))>255||(r=n.charCodeAt(u++))>255)throw new TypeError("invalid character found");e=t<<16|s<<8|r,a+=ja[e>>18&63]+ja[e>>12&63]+ja[e>>6&63]+ja[e&63]}return l?a.slice(0,l-3)+"===".substring(l):a},rf=typeof btoa=="function"?n=>btoa(n):Ai?n=>Buffer.from(n,"binary").toString("base64"):_v,dd=Ai?n=>Buffer.from(n).toString("base64"):n=>{let t=[];for(let s=0,r=n.length;s<r;s+=4096)t.push(Ft.apply(null,n.subarray(s,s+4096)));return rf(t.join(""))},Ol=(n,e=!1)=>e?bv(dd(n)):dd(n),n3=n=>{if(n.length<2){var e=n.charCodeAt(0);return e<128?n:e<2048?Ft(192|e>>>6)+Ft(128|e&63):Ft(224|e>>>12&15)+Ft(128|e>>>6&63)+Ft(128|e&63)}else{var e=65536+(n.charCodeAt(0)-55296)*1024+(n.charCodeAt(1)-56320);return Ft(240|e>>>18&7)+Ft(128|e>>>12&63)+Ft(128|e>>>6&63)+Ft(128|e&63)}},s3=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Cv=n=>n.replace(s3,n3),H0=Ai?n=>Buffer.from(n,"utf8").toString("base64"):$0?n=>dd($0.encode(n)):n=>rf(Cv(n)),ki=(n,e=!1)=>e?bv(H0(n)):H0(n),U0=n=>ki(n,!0),r3=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,i3=n=>{switch(n.length){case 4:var e=(7&n.charCodeAt(0))<<18|(63&n.charCodeAt(1))<<12|(63&n.charCodeAt(2))<<6|63&n.charCodeAt(3),t=e-65536;return Ft((t>>>10)+55296)+Ft((t&1023)+56320);case 3:return Ft((15&n.charCodeAt(0))<<12|(63&n.charCodeAt(1))<<6|63&n.charCodeAt(2));default:return Ft((31&n.charCodeAt(0))<<6|63&n.charCodeAt(1))}},Nv=n=>n.replace(r3,i3),jv=n=>{if(n=n.replace(/\s+/g,""),!t3.test(n))throw new TypeError("malformed base64.");n+="==".slice(2-(n.length&3));let e,t="",s,r;for(let a=0;a<n.length;)e=gl[n.charAt(a++)]<<18|gl[n.charAt(a++)]<<12|(s=gl[n.charAt(a++)])<<6|(r=gl[n.charAt(a++)]),t+=s===64?Ft(e>>16&255):r===64?Ft(e>>16&255,e>>8&255):Ft(e>>16&255,e>>8&255,e&255);return t},af=typeof atob=="function"?n=>atob(kv(n)):Ai?n=>Buffer.from(n,"base64").toString("binary"):jv,Sv=Ai?n=>F0(Buffer.from(n,"base64")):n=>F0(af(n).split("").map(e=>e.charCodeAt(0))),Ev=n=>Sv(Mv(n)),a3=Ai?n=>Buffer.from(n,"base64").toString("utf8"):V0?n=>V0.decode(Sv(n)):n=>Nv(af(n)),Mv=n=>kv(n.replace(/[-_]/g,e=>e=="-"?"+":"/")),fd=n=>a3(Mv(n)),o3=n=>{if(typeof n!="string")return!1;const e=n.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},Dv=n=>({value:n,enumerable:!1,writable:!0,configurable:!0}),Tv=function(){const n=(e,t)=>Object.defineProperty(String.prototype,e,Dv(t));n("fromBase64",function(){return fd(this)}),n("toBase64",function(e){return ki(this,e)}),n("toBase64URI",function(){return ki(this,!0)}),n("toBase64URL",function(){return ki(this,!0)}),n("toUint8Array",function(){return Ev(this)})},Iv=function(){const n=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Dv(t));n("toBase64",function(e){return Ol(this,e)}),n("toBase64URI",function(){return Ol(this,!0)}),n("toBase64URL",function(){return Ol(this,!0)})},l3=()=>{Tv(),Iv()},c3={version:wv,VERSION:X4,atob:af,atobPolyfill:jv,btoa:rf,btoaPolyfill:_v,fromBase64:fd,toBase64:ki,encode:ki,encodeURI:U0,encodeURL:U0,utob:Cv,btou:Nv,decode:fd,isValid:o3,fromUint8Array:Ol,toUint8Array:Ev,extendString:Tv,extendUint8Array:Iv,extendBuiltins:l3},W0=n=>n.toLowerCase().split(" ").join("-"),pd=async()=>{let n;try{n=await navigator.clipboard.readText(),console.log("Content read from clipboard: ",n)}catch(e){console.error("Failed to read: ",e)}return n},md=async n=>{try{await navigator.clipboard.writeText(n),console.log("Content copied to clipboard")}catch(e){console.error("Failed to copy: ",e)}},Av=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,u3=n=>JSON.parse(c3.decode(decodeURIComponent(n)));function h3(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.00488 4C2.00488 3.44772 2.4526 3 3.00488 3H21.0049C21.5572 3 22.0049 3.44772 22.0049 4V9.5C20.6242 9.5 19.5049 10.6193 19.5049 12C19.5049 13.3807 20.6242 14.5 22.0049 14.5V20C22.0049 20.5523 21.5572 21 21.0049 21H3.00488C2.4526 21 2.00488 20.5523 2.00488 20V4ZM8.09024 19C8.29615 18.4174 8.85177 18 9.50488 18C10.158 18 10.7136 18.4174 10.9195 19H20.0049V16.0322C18.5232 15.2959 17.5049 13.7669 17.5049 12C17.5049 10.2331 18.5232 8.70411 20.0049 7.96776V5H10.9195C10.7136 5.5826 10.158 6 9.50488 6C8.85177 6 8.29615 5.5826 8.09024 5H4.00488V19H8.09024ZM9.50488 11C8.67646 11 8.00488 10.3284 8.00488 9.5C8.00488 8.67157 8.67646 8 9.50488 8C10.3333 8 11.0049 8.67157 11.0049 9.5C11.0049 10.3284 10.3333 11 9.50488 11ZM9.50488 16C8.67646 16 8.00488 15.3284 8.00488 14.5C8.00488 13.6716 8.67646 13 9.50488 13C10.3333 13 11.0049 13.6716 11.0049 14.5C11.0049 15.3284 10.3333 16 9.50488 16Z"}}]})(n)}function d3(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 13C18.3221 13 16.7514 13.4592 15.4068 14.2587C16.5908 15.6438 17.5269 17.2471 18.1465 19H20V13ZM16.0037 19C14.0446 14.3021 9.4079 11 4 11V19H16.0037ZM4 9C7.82914 9 11.3232 10.4348 13.9738 12.7961C15.7047 11.6605 17.7752 11 20 11V3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H6V1H8V5H4V9ZM18 1V5H10V3H16V1H18ZM16.5 10C15.6716 10 15 9.32843 15 8.5C15 7.67157 15.6716 7 16.5 7C17.3284 7 18 7.67157 18 8.5C18 9.32843 17.3284 10 16.5 10Z"}}]})(n)}function f3(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(n)}function p3(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM5 10V20H19V10H5ZM11 14H13V16H11V14ZM7 14H9V16H7V14ZM15 14H17V16H15V14ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16Z"}}]})(n)}function m3(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(n)}function g3(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"16"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(n)}function v3(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"}},{tag:"polyline",attr:{points:"7 3 7 8 15 8"}}]})(n)}function x3(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(n)}const y3="1.0.36",w3={version:y3},b3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA9CAYAAAD1VdrqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAGJhJREFUeJzlOwmYXEWZf9V7r+/p6ZmeycxkkplJyIRcJCbhygFyHyqnsKgICyYgsIKurqirn4uCH3gsuwt8uPst64qfLrriwSEYXYEoIkeQKxByTJK5JzM9ffe7X9X+Ve+9np4k4OfuurrZ6unp1/XqVdV/H/W3CkG79sxPX8+rymZFU5KEEIUAvgihgJ8A/hf/AhuXf/71zF1S7yLhHS6bnIeTcCyQYBbO5VzMf4QQxpjHPO64jmtP6Ptr03yIEaqomqpGxJ7EOEVRIpRSRUxBcV4xB6HiM5hNzo7X4gFKVXkfb3jYEk2pN3+w5TvvEvOo4d6ppS2tTjtrOLjhxoK9Ewnk4dvh75BZd3kjsA13yaFP8fA5DgnohIJXhCrP4x3zkKGk4Uvj9eH2xoPLdqJ4YV8dcMIQiRz7SUDOw059MKAHb76x8ZD8DY/VGac+HZ+5U39KXCn4mqsshRG2HXReBNI4mB+0LmmY8G0aAVq/loDfcOqX/tqteuf5myQN25i9ydkXhwOaH/SNNwwNGbyR4nw2tXhdVuQrgsDPpysl8DVegNm8d9DeyEF9hxlZLVXnnrHmwrvuuu+rN0nArZJztV12+sIF3xqwxoXIQYvOAHPI1mZRaAY0fsga5JD/Go9CF10Go952MElpZsGQKw+7zcNzhFEzE6bu3IgdN6lbPz/+0W3Pb+vU46bUM+Il5+ShhB7MPnwWtHVEvR3Xv8XGZuGrzuqhoAdEIET29ZGjIO8NQb425Q8lwciZf7NXaOAsMZLXGZXAQ3/3wudUtRa9fnXHhhTrwJvUxTssGNQwWaCcOOGS0CSYgNTFdwZqKaOS8A0b440o4nVA6/AGEiaHisW5v1GhD3gApK+oObw28goYni6JJA0C5zPzcAiADN9IRub3CYKiGQCGY8ySe4sK88tnPTn8xL5qyaEJop7Z07Rwf100Z8mND7FYPFRS/iIBonxogw37iwmsi3FUzkFx3RnlIoHFXYWEERsVoHDm4eaYP2+AFLEmpwxNkgsHjBEwXB3HeP4a0qxRYdJ8LpGcEO6Lg8f8aw9fibaWBz1GVh29vvdcdcPH+ob+6tK7TYuxxERtdPBLP9205xC+OULaTRf9gyWQqbWo+6VyQxamnHjChhzRjQXcaVlOYMcJRKVSCzT1449uW93dO/f2TEuKu56DzhL1hPgI9vJcwXIMpgoVqOk62LYFpmlBcTL32LWbLrrnySdfvGrxkoWXIcshGim3HYd6rgeGYavjk9MKfnc8xlzbtr1qvlz63v3fufLxJx5wnvrJC+d1dc25njscjGmr/OzWl264/svvy2/9wbZYd1/n17nDOpjD9ddf3v33F994xtNin799ZscnMsns6bZpQyVnPHPcu/tv+12ACzcRXcO6A0PqWgZbreZuHB3Pn204Ftj4pig/ihBPlB/GfDkuFMqgGwY4josTeeB4bhZH3DNdrL1nYP/oOc2ZJOg1QyKJB3JWrlTBRGy7risXF/KsaspH8Lnp9qns6uxwy7nmPgdq+02rMJm7GfvzE2/kEktKi8+HcWgtDlZhIj/xgxCQ5r3NJ6cmms7Vhy0Ym5hOYNfbAs4DmyH+qz4mfOsV6t1LLjvx7s1X3nTfyg0bXnn8sa39PYkCzEvrEKFIOYvC7gkNxs1oXWkJV3xuT8e0ePart95+W0RTL7rsikvoQw88gh4hAY9KcZJLSqaSIQCBTCYDj2z5tnzuwXu2DXSTFcgZBhQgZ7xQ2qGL/vu//hAr9rZ7rqFCxavA89VXayEgj9+3d8irJMFyDBiz99lh/2Vrb1bmJXpP0oiml42pHfe+8NlKCHr44VNc0J/71BRt/ZILybqN6z++YHFP/1nROPTDHqAazhuLglcxwZiqwj0vtcJ/jGfrLqjQyceuPhU8zvvWrdvAl3T1Q6zlJPBQDEagAi9VB8BQLZjlFfIZk7m2a8Wao9lSEKqm6uqZsrdr/SMAD5/df8bCDZllrXEvBsggMKfqbvzhvq88LJ45tmXR8e3pDiAoHqPW/IVjtRsz/z58d3FtelXnRa0XPKbU1PgO+vpN98Jn724g+wzF5SaQMqHR//An/uz4Jcvm/82yFYshsnwzsK2344aQMEg6XtMhqnLY/I4aGIlOeGPMhaIlTRtFsW465pglH7n8iguVvp4uKDyyC9SSCRo6XKrdBa+ycVCaYlB1TLDRvLAGp6ezO3sqHfeZIaUk4PjsyR8/cd75j6w5ZvUH4uMxKWlimz2RhZvWd1x2y9pVSyDT2nQ8FfyiEWinHUed1nnedQj4Ha8MPzsxOv7rvY5rLKp67PFZ7B7gWq1zgACaAd18xQ3Kgt72Tx69ZJEWiUYBIvOAr3wf8NfvB0imQWntAGdkErI9C+GWU1qhmsvDHd8bhxHCYtnW9KWbP/T+vv6je1B8OKy4aA3s+eZvYE42C47twtqj18L83l6YrhTgX15+FKwA7e/p+fOOzAl0NfwEN+L6oURvonv9otjqxa3r4GxtmwfuoOIDHp/Xetbc865dtCq7O7MC47aH/a1r+FqQOuqqU1o/eCco0+ipxNIUWJSq7gKcbk8d6sCZCgD33SZUOPF3rVvZ3NeVXpVMxGQ3MTA4SM0FSHShvFrAHQ+URAu6Pw6irQgpcxo+u0GHH45WSKHvxFXLF80/ior9TzvQMb8TRuJRiMUSiAgK2TSKBjohxLBho9MLu5UinLjoPWTzBzb3pVepUH3RAzKqCrUB2WiLZlP7uzzJlkVXoiVBwKWzohJY0bzqTFudzmbPjsHoz/GZmoIKGMPOeFv/kvZV/ZH4YOuC5jndDnLWrtzEpvP7L3ri4d0/8njgEdI64AHwHGP1id/+uo0j7KSS8KVxdCtQIwckGcf7iHXdBKUjjRrZBTY4gjJfAzUdg56sfvL4SOFkdXISvAJq32cnYOS5YUg2p6Clsx3SiKjBfSMwPGyitq9BX2cv9GkLIT0/eopt662oHBAoFnhqguUpJJTEOyJKBPvxnhLqIpFUsBY5tsmkVsbnpEOIlzE1gv4dXz6/Zc6mozrnUcu1YLiQu7iFJ0/AEc8I68IC11INRCdUeGqEqBGVEVUqfuECMlSuBE2PQCmyE/AqcB3faL9pjMkQwJ6YAm2SgEYX48QCXQycmgVRTYN4UzIQLAaaRiEez4BInwwM7gYbTZpZLX6wUMxvR5HHOWmg9QM55Ip/6cIMQvDS8ox2Xa/iwkKlEkltgkhR0OwmIryvOZraQBXsRy6LqVGtZlsXh4CLtzDPPuCBUmOMRV8bqK48V7hwMlukIms2aF9kHVItiPgOiKoBacf7MRVoiYGK/K1Q/K6pwDXcMKojRVWgWizDgeFRcB0HEuk20LCPNmVgyBlEuUcVx93FES3ypsS95+NfuN2Cmhzl3eMzJkg2BNJwjZZSpdYiYwIWIIqCtEq4/NyYpiZJEERpRKQ0yIkXLrooKsYKiqu4B99lDWScMa85V7SPcfQcyvA0IgQZBwHl4juilOionpHSXPAdAs8LGrCaDRydEs9VwS0ZwMarEnhmmGCiA+OiTsAYGE0REsgtgBZVoVAugC6QKDYCbF9Ui3MRsIgXoUHQI3xFRnxkiD70LUFYapfIcaob8eOzqOfDbRORV8PHzF5NSUlioqcnEYhBTEcmmU7iGqoANBLVQjtOpKPhuPa8KcM9fepAGboXFlGRISCRNvSrhkCxyjiRIoQBlDgFz6iAMzgtxQERBqUagQNTJXDKBtCIChFkax3H1NBbI2pKcs/U5DhMVqbARQUnsI/eL9QU51HX8jqfeXQnmLhPpQXnthGROGcRSrDr2SGEdQyclAtRngRbt2BAGYT2ahy23P8STCk1iCY09BdwLtBhxMidv9RE/YTYG5+cQh3sSiWtKirxPAe1q4oUp6D+5vYD1zz9/MtgpSxI0ti1utfX+evHNOi0xlBG8kBM4Sj1IOZVBEpFsUJlE3GAsiKykiMXoKj0DlRaMM5NwjM/L0A7Krt8rgJVMwUO2mTdspHa6NZGs5BSMz57ogihXYD5ncv7h3YX1pt5VIouAi2UJrNBQRxnm7pg29ZxJEBCIsLjE8AoIoUkYGqKwwuPTCCVKTjcEpTGey60NS2k4+injRdNJGQM1EQ7xBSnmabar7GIN58QDSo7yeUqz8c+c0LbSX5Qr7ClXGoJDwa2c/mJUIHoE5vlzM96MdKQXsI+AXhPswK9zX46yTAYxJIcYonQVRL9dCZbFyYzRD/nt2FwCEovKjbmq2cSJCt4Qz6gnooM4nYZaYk9eTwIPgRiHLDQ5IpEhemaqAQx1nAR6dxpd4lzu4WodrkLU7uqn1O9bO3sreNP7TQqHinmh/8xFUm/QSmVAT0jyCbgBUm+AIDGrEvoEDAxXpHJAOl+NGRf/PwEafAf/ATBTIrJB8pPQtTT7A19TCokmf2Bxowv83UA86cnATE8iQD/jcpaKE8fSXi/ub3zLlVLQHZByznqSZ+eu/tTl9/r6q6rDZRef3jLq9+Z5eIdSW3TOV+8K44mNjU/OhgmIlRGeB3bR2qTXIBvEUoHYamQYjYraDgSm0w+IuB2mIiQMuQrmj/23v6gjQf5VqF3GqIzOOIBD7PAiqLMAH7kAw0BnGih0WrNCksPOYw7whoPCNwAOAT2lL79k//HG/MPXmTw5Jsz8DFBjmyC+xEfkzUDYSLi0DPxI7ZxH/gG5fZH3tD/WuMNWVZO/l/IOASHmYpKw0QESOApPbIB9wMogFgsGlDc8xMR9AinuDjxEYotFouAOvaGqXz55m/Is3eKQfqR3BSEj3IVYlpEUfd8v/CL0zrPBZjDIR695L6bT75Nj0QotLaKyNeV6QORKOBcQW0YAd2gGH570JzBSCdIIYkEBfNECopiAED9pCgyTzptI4ZtmaeT560yeajhmDgYXkTGyxxvMwdk8MCI//bP2GbOMcWHChHwRP5NJuH8hAQNKOjH9grY4oASHL8ogHkyxWU5DtQcAwp2GXJuAVxcc9ej+hYV5brMKD6CkJk40iUW6AhM6QAuqLCgREe8FJdzv54OHQAzPyVy3cRD3FliCPO44rmehhNRTVXEATypTcuUL9PUpM08jzq2E3VxjOOWYug3KFK1eH6mVCYLxLEDYhsBcnE/KvapSCIfziDpgPcdTdEMlSgiS0I85kYwpCaOy2JibYEYLpMQeMd1qcjAWJ6NKHBrOFfVYU7K9Zxhde7J8L4f3v3T/Y5B2wv50UuqeX3A8WzwBDVENkMc54KMZf0zRZnDdz2/9ga3jxBJi8BRgogiEuFEdIoMNZOWwh+DCBYFiCpXFCoSzxElSsShgZ+zUZASIk628BlBEyY0jihcpEGdop8JJqKGxWEux01JdsERCqIfR6GYqmIHQk+JNJSguhIUZnIiktSuvWrtxicdyo878Zy5H1IXvrND/8tL71SZyKvFePHHO+/K/wHFzPoDzv072zFr1ot8M5SrOpdanWpKihtucIb9p9deen7gpFhcvXJkoLripSdG6G9+8fSOH71+61Xh/Vs+9uPM2rXHfrK9r7hu1zY2+uJThZLlVvZNTA38amzqhRef3/dtWcrJA04QhxvBERLRWFAi9afWHvveL7s657Y/NrlHS+Vf7QaW86Bi5F4L7y+ZewHpbF7+RV7svLEl1Q6l8SGIqSqotBmSqKN621JPtjcvvvgnL3++GFZCucxtdGBQ6XreW27gj9VSmbY2SqIpkd6nUQo9S1fAZX1f3nSe85lNYveJRBJamzJC0YJRAXBsv0JDKmQEVIPkqZ7NxaHhlrAMRIh+HXChPBh/62Rjb+JoMZYN6jv/RzOSu3YMfA1N2bKKYcqaGV03QBTzGPi9WCzBeGFo7lKlH80Dh/Q8Bpn5SCArDqXJJMSbOETxXR5G9q0paO7CRHhwwhhQlIa+eMDV9UPDsDX66u9fc90xHPT8d3/7rdGPrrvx3Vdc8d5/Gts38bNfvrLtL85YtfqadDJ1yd7J0as+eO8Ne/87gKO+Pb25Nf0OxUBvCv0HNULAtjWImMiuMQJNySSEdt1z8F4Vtb+JRNLRZ+DywA+4cBwE4YLPsPkZNmH1XBNChIDvwTWcj0O98vDBTzyw8dgVy7cUk5bX+80VP/rQR9516gIl3d0fa746a7IL+ro7WrPxZsgNDN/5b5fe8cKCzu7rdu/ac/OVW77wwO8LeKopcSDb0oJXBXSgNPAyaUBbDxY6PaKKIqIm6qkxu0phqkQhLL63qwRqOb8oQBw5Men7yPIs+fY9Axei0abxRjhJneJhSgbt6c2XfCGyoveoT8/NtiTmbMzCp1b2XZmqoWv19H5Zz7K0qaU1yhRgpRqs7+q9gBjOBeLUCZrajsX/vzfg2FRZ6UB9StDgeJeQqDx2Vqjmn7wwMlPJEX4GjckqB98RmqWfxXGTOFVhlgsNz5GwIiJUbmKh6X2D8aYzIwtoAtktio7TRBVoBJUGzkzjCqQ7s2DuzUFkcTukbBtNgzzchVylPPFfABpi8agjz8Rx/srQEOT3DUCio0seRZenc9C9/Lgg9T0DdCMQogVltH5qifF6fiFIJ6O3ZtkzK/q6rM7q4eTDk2PlRDQ6hMpkGSvbYD83DKQ7DcywJEqdig6ebYI3VQZjqoQbVmUJWKkzMW9sMH8u+l0UHV9u6jbfs2sYdrwxAO++cCN0dc+BCj5rmQ7sGx6Gob0TsOO1198QVPZMA7ihw/TO12DwuaeFSw9LTj8Lim/ugPyeEVjz3uvk/mhYotdAOcm6guNEZTKbkeOZEz71gEKj9do4gST0ZhtST+Af0v1s+Ke8Uv6ikdaT0k+PtyaBjVVATUdAcIH+8igk+juAIwBqNAIKcoWr2+C0JW8yK8ZN4mc8pek85KeKUJ3K4zjUK6I4oGRAZbIE5XIFiuPT4FR10Di5WlUUMvSzB6HjhHcCs6ugxGMw/sZ22PHLX6Gce7D83MuRq3DDLoP+Dh2SESIBJR6VB//iU0d23F+OykBpJnHoExJdXF7T83UBEBeuy2Zr9fAEM6VERngeqeCmAaKIs440VLYPgtockaxU3TkORMVowkCOGDFB0WLw9CNbYN4+A+a0NMHYzgHYNTkIebsGOYyM3txRggXJDEwMDcLe6f0waeegwmyYxqBBueOjzMlPwivf+ApM7NgBo8NjYJiuDF78E1DU3pZf/s1qVBYAsiBpKMfYDO/7UZrvhtTrwCVEjDlMtwoBLnx+8A4GPKR83ihDuistVSVtjgOpOKBhLKtmkyjnEai9NgbRniaIoLlhRQtZkyELm6AZDBJxdCpQKhRL7NCVP/ChqAc03YMISpriuqKuDBeWh9uqOPDnkSiGrZ4MK/041K/mkRKKW7JNClorQLGQQCfF3zzjftG9ALaG117Mr7CQUAS/XvAzx3TK8aq1kLB+fwh4qN2C01L0FaYwaPYNflEXNZayGMCZrIGHTka8OwN2Xod4RxIMDVm7UpYlK1TxD/alWZSL+7G1iDXDgntZYC8+8QGF+Od12ZXrYPCZX0C1VEGcMFnLYiKbFxF5NkSq2JUSc/A2VKJTIK1yXYOLeSOi/s1HAq8DGBQPA68wz7Fm6MpnmTOBXoxlfa3PomqRxKN+OiqNJHR1iC1rk+Jj7ZgArS0FAjFODkNclCsdba4HQWonQKT8xQGf0bC+Vgk2xcOKCGl0IbtsNSzd9Jl/LX7rn18r7hmIKVq0w8oVJuMdqbF5x17aMz0JX3BFOXeZo9yjiLkzcbzkYGFxHMFNaOsRWSIIcV0rMGUOf2X8oRmeDooVJOCO7aGXy5s98AGvWcaILDmueVB7Du13TAOmIsuqqEgmKmCPTUOqIwNaCilesiFXKoNLRZYAZ1Wp/5MIyaYEucevlPArRiEs9PBTG1TRhPbBEH17csHS2878/N8OdnZkZwUMp1zd+bUDO/3qJ8/xOUVarKDYb6ZIzz8QqaElMtF6OOJ3K0xGY8VGoP1nOKhP3Tr6/bG9uThv5ZCJNX//wys+aY0M1tqYWYHEfotBcj6VVRfoLjJLg1p2IXioYVpbRR0aorm3B7LtS+AG5wxIxZqhDKj9jzsWlqNSOyFj4yYtaNbiEMM5unuWQMY5DSUnClUHpZxod26/1R5jNUf3uPuAKD3Zcs0+RCBTaYTEUe03OS/n2qhdwGAjLrWxJ/JUwQ92aODwSFlGJWghoJk4Ir1LFAtFwGmPIy0Wn3bJoueeKzhlQFuzzOYO2NubH1AVph7dFmuP+HUpzipRU6bSOOTyiJgSShZJypoxHrz9ZBQG81NCqLXgl1AJ6YFMWwFWFXxGTULNFpkRVBgeC4ri8UPoAdxwXJO5slbTqbUyNQyQmEwbSVHEZ4lDJBdFZA7NBZ+p/F8f0eDkJ+Qmsbco9kSE64p7YcixLu7Pcu0O0zU7gIpyMRRbooKtux3/CRMitNFcerR3AAAAAElFTkSuQmCC",Xa="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6Yng9Imh0dHBzOi8vYm94eS1zdmcuY29tIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQtMC0wIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjEyOCIgeTE9IjAiIHgyPSIxMjgiIHkyPSIyNTYiIHhsaW5rOmhyZWY9IiNncmFkaWVudC0wIi8+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImdyYWRpZW50LTAiIGJ4OnBpbm5lZD0idHJ1ZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6IHJnYig2LCAyLCA4KTsiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjogcmdiKDIwMywgNjAsIDE3OCk7Ii8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGZpbHRlciBpZD0iZHJvcC1zaGFkb3ctZmlsdGVyLTEiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgeD0iLTUwJSIgeT0iLTUwJSIgd2lkdGg9IjIwMCUiIGhlaWdodD0iMjAwJSIgYng6cHJlc2V0PSJkcm9wLXNoYWRvdyAxIDAgMCA5IDAuMzIgI2QzMDJkZCI+CiAgICAgIDxmZUdhdXNzaWFuQmx1ciBpbj0iU291cmNlQWxwaGEiIHN0ZERldmlhdGlvbj0iOSIvPgogICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIwIi8+CiAgICAgIDxmZUNvbXBvbmVudFRyYW5zZmVyIHJlc3VsdD0ib2Zmc2V0Ymx1ciI+CiAgICAgICAgPGZlRnVuY0EgaWQ9InNwcmVhZC1jdHJsIiB0eXBlPSJsaW5lYXIiIHNsb3BlPSIwLjY0Ii8+CiAgICAgIDwvZmVDb21wb25lbnRUcmFuc2Zlcj4KICAgICAgPGZlRmxvb2QgZmxvb2QtY29sb3I9IiNkMzAyZGQiLz4KICAgICAgPGZlQ29tcG9zaXRlIGluMj0ib2Zmc2V0Ymx1ciIgb3BlcmF0b3I9ImluIi8+CiAgICAgIDxmZU1lcmdlPgogICAgICAgIDxmZU1lcmdlTm9kZS8+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJTb3VyY2VHcmFwaGljIi8+CiAgICAgIDwvZmVNZXJnZT4KICAgIDwvZmlsdGVyPgogIDwvZGVmcz4KICA8cmVjdCBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwgMCwgMCk7IGZpbGw6IHVybCgnI2dyYWRpZW50LTAtMCcpOyBzdHJva2Utd2lkdGg6IDBweDsgdHJhbnNmb3JtLW9yaWdpbjogMTI4cHggMTI4cHg7IiB4PSIwIiB5PSIwIiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgcng9IjQwIiByeT0iNDAiLz4KICA8ZyBzdHlsZT0iZmlsdGVyOiB1cmwoJyNkcm9wLXNoYWRvdy1maWx0ZXItMScpOyBpc29sYXRpb246IGlzb2xhdGU7IiB0cmFuc2Zvcm09Im1hdHJpeCgxLjAwNDY0MjAwOTczNTEwNzQsIDAsIDAsIDEuMDI4NjE0MDQ0MTg5NDUzMSwgMCwgLTIuNTU4NDI4MDQ5MDg3NTI0NCkiPgogICAgPGcgc3R5bGU9ImZpbHRlcjogbm9uZTsiIHRyYW5zZm9ybT0ibWF0cml4KDEsIDAsIDAsIDEuMTkyMjc1LCAwLCAtMzguNDEyMjczKSI+CiAgICAgIDxnPgogICAgICAgIDxyZWN0IHk9IjEyOCIgd2lkdGg9IjI1NiIgaGVpZ2h0PSI0IiBzdHlsZT0ic3Ryb2tlLW9wYWNpdHk6IDA7IHN0cm9rZTogcmdiKDAsIDAsIDApOyBwYWludC1vcmRlcjogbWFya2VycyBzdHJva2U7IGZpbGw6IHJnYmEoMjQ1LCAwLCAyNTUsIDAuOTg0KTsiLz4KICAgICAgICA8cmVjdCB5PSIxMzEuNzc4IiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjQiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTogMDsgc3Ryb2tlOiByZ2IoMCwgMCwgMCk7IHBhaW50LW9yZGVyOiBtYXJrZXJzIHN0cm9rZTsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIvPgogICAgICA8L2c+CiAgICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsIDAsIDAsIDEsIDAsIDY0KSI+CiAgICAgICAgPHJlY3QgeT0iMTI4IiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjQiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTogMDsgc3Ryb2tlOiByZ2IoMCwgMCwgMCk7IHBhaW50LW9yZGVyOiBtYXJrZXJzOyBmaWxsOiByZ2JhKDI0NSwgMCwgMjU1LCAwLjk4NCk7Ii8+CiAgICAgICAgPHJlY3QgeT0iMTMxLjc3OCIgd2lkdGg9IjI1NiIgaGVpZ2h0PSI0IiBzdHlsZT0ic3Ryb2tlLW9wYWNpdHk6IDA7IHN0cm9rZTogcmdiKDAsIDAsIDApOyBwYWludC1vcmRlcjogbWFya2VycyBzdHJva2U7IGZpbGw6IHJnYmEoMjQ1LCAwLCAyNTUsIDAuOTg0KTsiLz4KICAgICAgPC9nPgogICAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLCAwLCAwLCAxLCAwLCAtNjQpIj4KICAgICAgICA8cmVjdCB5PSIxMjgiIHdpZHRoPSIyNTYiIGhlaWdodD0iNCIgc3R5bGU9InN0cm9rZS1vcGFjaXR5OiAwOyBzdHJva2U6IHJnYigwLCAwLCAwKTsgcGFpbnQtb3JkZXI6IG1hcmtlcnMgc3Ryb2tlOyBmaWxsOiByZ2JhKDI0NSwgMCwgMjU1LCAwLjk4NCk7Ii8+CiAgICAgICAgPHJlY3QgeT0iMTMxLjc3OCIgd2lkdGg9IjI1NiIgaGVpZ2h0PSI0IiBzdHlsZT0ic3Ryb2tlLW9wYWNpdHk6IDA7IHN0cm9rZTogcmdiKDAsIDAsIDApOyBwYWludC1vcmRlcjogbWFya2VycyBzdHJva2U7IGZpbGw6IHJnYmEoMjQ1LCAwLCAyNTUsIDAuOTg0KTsiLz4KICAgICAgPC9nPgogICAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLCAwLCAwLCAxLCAwLCAtOTYpIi8+CiAgICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsIDAsIDAsIDEsIDAsIC0zMikiPgogICAgICAgIDxyZWN0IHk9IjEyOCIgd2lkdGg9IjI1NiIgaGVpZ2h0PSI0IiBzdHlsZT0ic3Ryb2tlLW9wYWNpdHk6IDA7IHN0cm9rZTogcmdiKDAsIDAsIDApOyBwYWludC1vcmRlcjogbWFya2VycyBzdHJva2U7IGZpbGw6IHJnYmEoMjQ1LCAwLCAyNTUsIDAuOTg0KTsiLz4KICAgICAgICA8cmVjdCB5PSIxMzEuNzc4IiB3aWR0aD0iMjU2IiBoZWlnaHQ9IjQiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTogMDsgc3Ryb2tlOiByZ2IoMCwgMCwgMCk7IHBhaW50LW9yZGVyOiBtYXJrZXJzIHN0cm9rZTsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgICA8ZyBzdHlsZT0iIj4KICAgICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCwgMSwgLTEsIDAsIC0yMjguMjM1OTkyLCAxNi4zNDIwMDMpIiBzdHlsZT0idHJhbnNmb3JtLW9yaWdpbjogMzU2LjIzNnB4IDExMS42NThweDsiPgogICAgICAgIDxyZWN0IHk9IjEwNy43NjkiIHdpZHRoPSIyNTYiIGhlaWdodD0iNCIgc3R5bGU9InN0cm9rZTogcmdiKDAsIDAsIDApOyBzdHJva2Utb3BhY2l0eTogMDsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIgeD0iMjI4LjIzNiIvPgogICAgICAgIDxyZWN0IHk9IjExMS41NDciIHdpZHRoPSIyNTYiIGhlaWdodD0iNCIgc3R5bGU9InN0cm9rZTogcmdiKDAsIDAsIDApOyBzdHJva2Utb3BhY2l0eTogMDsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIgeD0iMjI4LjIzNiIvPgogICAgICA8L2c+CiAgICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDAuMTg0NTAxLCAxLjA0NjM1OCwgLTAuOTg0ODA3LCAwLjE3MzY0OCwgLTEzNi4zNDcsIDE2LjM0MjAxNikiIHN0eWxlPSJ0cmFuc2Zvcm0tb3JpZ2luOiAzNTYuMjM2cHggMTExLjY1OHB4OyI+CiAgICAgICAgPHJlY3QgeT0iMTA3Ljc2OSIgd2lkdGg9IjIzNC40MDIiIGhlaWdodD0iMy42NjMiIHN0eWxlPSJzdHJva2U6IHJnYigwLCAwLCAwKTsgc3Ryb2tlLW9wYWNpdHk6IDA7IGZpbGw6IHJnYmEoMjQ1LCAwLCAyNTUsIDAuOTg0KTsiIHg9IjIyOC4yMzYiLz4KICAgICAgICA8cmVjdCB5PSIxMTEuNTQ3IiB3aWR0aD0iMjM3LjE0OSIgaGVpZ2h0PSIzLjcwNiIgc3R5bGU9InN0cm9rZTogcmdiKDAsIDAsIDApOyBwYWludC1vcmRlcjogc3Ryb2tlOyBzdHJva2Utb3BhY2l0eTogMDsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIgeD0iMjI4LjIzNiIgcng9IjIiIHJ5PSIyIi8+CiAgICAgIDwvZz4KICAgICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoLTAuMTg0NTAyLCAxLjA0NjM1OCwgLTAuOTg0ODA3LCAtMC4xNzM2NDgsIC0zMjEuNTAyODM4LCAxNy45NzE2NDkpIiBzdHlsZT0idHJhbnNmb3JtLW9yaWdpbjogMzU2LjIzNnB4IDExMS42NThweDsiPgogICAgICAgIDxyZWN0IHk9IjEwNy43NjkiIHdpZHRoPSIyMzQuNDAyIiBoZWlnaHQ9IjMuNjYzIiBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwgMCwgMCk7IHN0cm9rZS1vcGFjaXR5OiAwOyBmaWxsOiByZ2JhKDI0NSwgMCwgMjU1LCAwLjk4NCk7IiB4PSIyMjguMjM2Ii8+CiAgICAgICAgPHJlY3QgeT0iMTExLjU0NyIgd2lkdGg9IjIzMS42NTUiIGhlaWdodD0iMy42MiIgc3R5bGU9InN0cm9rZTogcmdiKDAsIDAsIDApOyBzdHJva2Utb3BhY2l0eTogMDsgZmlsbDogcmdiYSgyNDUsIDAsIDI1NSwgMC45ODQpOyIgeD0iMjI4LjIzNiIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgogIDxwYXRoIGQ9Ik0gMTY3LjEyNCA5MS43MiBDIDE2OC4xMTcgODUuNDU1IDE2Ni44MTQgODAuNTcyIDE2My4yMTcgNzcuMDcgQyAxNTkuNjIxIDczLjU2OCAxNTMuNjkzIDcxLjgxNyAxNDUuNDM3IDcxLjgxNyBDIDEzOS45NzEgNzEuODE3IDEzNS4yMzcgNzIuNTI4IDEzMS4yMzggNzMuOTUyIEMgMTI3LjIzOCA3NS4zNzYgMTI0LjAxOCA3Ny4zMjYgMTIxLjU3OCA3OS44MDMgQyAxMTkuMTM4IDgyLjI4MSAxMTcuNDkzIDg1LjExMyAxMTYuNjQxIDg4LjMwMiBDIDExNS44NzMgOTAuOTIyIDExNS44MjYgOTMuMjI3IDExNi40OTYgOTUuMjIxIEMgMTE3LjE2NiA5Ny4yMTUgMTE4LjQzOCA5OC45NjUgMTIwLjMxMSAxMDAuNDc1IEMgMTIyLjE4NCAxMDEuOTgzIDEyNC41NzMgMTAzLjMwNyAxMjcuNDc4IDEwNC40NDcgQyAxMzAuMzgzIDEwNS41ODUgMTMzLjcyMyAxMDYuNTgxIDEzNy40OTYgMTA3LjQzNSBMIDE1MS42NzcgMTEwLjg1MiBDIDE1OS44NjQgMTEyLjczMiAxNjYuODg0IDExNS4yMzcgMTcyLjczNyAxMTguMzcgQyAxNzguNTg5IDEyMS41MDEgMTgzLjI0MSAxMjUuMjMxIDE4Ni42ODkgMTI5LjU2IEMgMTkwLjEzNyAxMzMuODg2IDE5Mi4zMjYgMTM4Ljg2OCAxOTMuMjU0IDE0NC41MDYgQyAxOTQuMTg0IDE1MC4xNDMgMTkzLjgwNCAxNTYuNDY1IDE5Mi4xMTQgMTYzLjQ2OCBDIDE4OS4zMDIgMTc0LjUxNiAxODQuMTQ4IDE4My45OTcgMTc2LjY1MiAxOTEuOTEzIEMgMTY5LjE1NCAxOTkuODI4IDE1OS43MTMgMjA1Ljg5MyAxNDguMzI3IDIxMC4xMDYgQyAxMzYuOTQxIDIxNC4zMjEgMTIzLjk1OSAyMTYuNDI4IDEwOS4zODEgMjE2LjQyOCBDIDk0Ljc0NiAyMTYuNDI4IDgyLjUzOCAyMTQuMjM2IDcyLjc1NSAyMDkuODUxIEMgNjIuOTcxIDIwNS40NjYgNTYuMTc2IDE5OC44MDMgNTIuMzY4IDE4OS44NjMgQyA0OC41NjEgMTgwLjkyMyA0OC4yNzYgMTY5LjYxOCA1MS41MTMgMTU1Ljk1MiBMIDkyLjAwMSAxNTUuOTUyIEMgOTAuOTM3IDE2MS41OSA5MS4yNzUgMTY2LjI4OCA5My4wMTMgMTcwLjA0NiBDIDk0Ljc1MyAxNzMuODA1IDk3LjczMSAxNzYuNjUxIDEwMS45NDYgMTc4LjU4NyBDIDEwNi4xNjEgMTgwLjUyMyAxMTEuMzcyIDE4MS40OTEgMTE3LjU3OCAxODEuNDkxIEMgMTIzLjI3MyAxODEuNDkxIDEyOC4zMTkgMTgwLjcyMyAxMzIuNzE4IDE3OS4xODYgQyAxMzcuMTE2IDE3Ny42NDggMTQwLjczNyAxNzUuNTEzIDE0My41ODMgMTcyLjc4IEMgMTQ2LjQyNyAxNzAuMDQ2IDE0OC4zMTkgMTY2LjkxMyAxNDkuMjU2IDE2My4zODMgQyAxNTAuMDIyIDE2MC4wODEgMTQ5LjcwNCAxNTcuMjQ3IDE0OC4yOTkgMTU0Ljg4NSBDIDE0Ni44OTcgMTUyLjUyMSAxNDQuMzQ3IDE1MC40NzEgMTQwLjY1MSAxNDguNzM1IEMgMTM2Ljk1NiAxNDYuOTk4IDEzMi4xMDQgMTQ1LjM4OCAxMjYuMDk2IDE0My45MDggTCAxMDguODgxIDEzOS42MzggQyA5NC42IDEzNi4xNjMgODQuMDcyIDEzMC41NDEgNzcuMjk3IDEyMi43NjcgQyA3MC41MjMgMTE0Ljk5NSA2OC44MTggMTA0LjQ3NSA3Mi4xODMgOTEuMjA3IEMgNzQuODIzIDgwLjM4NyA4MC4wOTIgNzAuOTA1IDg3Ljk4NyA2Mi43NjIgQyA5NS44ODMgNTQuNjIgMTA1LjU4MSA0OC4yNyAxMTcuMDgxIDQzLjcxNSBDIDEyOC41ODEgMzkuMTU4IDE0MC45NjQgMzYuODgxIDE1NC4yMzIgMzYuODgxIEMgMTY3Ljc4NCAzNi44ODEgMTc4Ljk4NyAzOS4xNzIgMTg3LjgzNyA0My43NTcgQyAxOTYuNjg5IDQ4LjM0MSAyMDIuODQ3IDU0Ljc2MiAyMDYuMzEyIDYzLjAyIEMgMjA5Ljc3NyA3MS4yNzYgMjEwLjIwOSA4MC44NDIgMjA3LjYxMiA5MS43MiBMIDE2Ny4xMjQgOTEuNzIgWiIgc3R5bGU9ImZpbGw6IHJnYigyNTUsIDI1NSwgMjU1KTsiLz4KPC9zdmc+",k3=({children:n,...e})=>c.jsxs("svg",{viewBox:"0 0 302 53",...e,children:[n,c.jsxs("g",{className:"",children:[c.jsx("path",{d:"M 29.756 18.948 C 29.962 17.646 29.691 16.631 28.944 15.903 C 28.196 15.175 26.964 14.811 25.248 14.811 C 24.111 14.811 23.127 14.959 22.296 15.255 C 21.465 15.551 20.795 15.956 20.288 16.471 C 19.781 16.986 19.439 17.575 19.262 18.238 C 19.103 18.783 19.093 19.262 19.232 19.676 C 19.371 20.091 19.636 20.455 20.025 20.768 C 20.414 21.082 20.911 21.357 21.515 21.594 C 21.883 21.738 22.285 21.872 22.72 21.994 L 9.695 21.994 C 9.62 21.043 9.728 19.992 10.02 18.842 C 10.569 16.593 11.665 14.622 13.306 12.929 C 14.947 11.236 16.963 9.917 19.353 8.97 C 21.744 8.023 24.318 7.549 27.076 7.549 C 29.893 7.549 32.222 8.026 34.062 8.979 C 35.901 9.932 37.181 11.266 37.902 12.982 C 38.622 14.699 38.712 16.687 38.172 18.948 Z M 30.923 24.488 C 32.14 25.139 33.106 25.915 33.823 26.814 C 34.346 27.47 34.729 28.199 34.974 29 L 18.016 29 L 17.649 28.909 C 14.68 28.187 12.492 27.018 11.084 25.403 C 10.7 24.963 10.395 24.48 10.167 23.955 L 29.804 23.955 C 30.197 24.122 30.57 24.299 30.923 24.488 Z M 34.951 33.863 C 34.761 34.61 34.519 35.322 34.226 36 L 24.639 36 C 24.716 35.935 24.79 35.867 24.862 35.798 C 25.453 35.23 25.847 34.579 26.042 33.845 C 26.201 33.159 26.135 32.57 25.843 32.079 C 25.593 31.659 25.169 31.286 24.572 30.961 L 35.287 30.961 C 35.313 31.856 35.201 32.823 34.951 33.863 Z M 31.736 39.776 C 30.178 41.421 28.216 42.682 25.849 43.558 C 23.482 44.434 20.783 44.872 17.753 44.872 C 14.711 44.872 12.173 44.416 10.139 43.504 C 8.106 42.593 6.693 41.208 5.902 39.35 C 5.716 38.914 5.571 38.451 5.466 37.961 L 33.173 37.961 C 32.751 38.605 32.273 39.21 31.736 39.776 Z M 5.724 32.301 L 14.14 32.301 C 13.919 33.472 13.989 34.449 14.351 35.23 C 14.481 35.511 14.644 35.768 14.841 36 L 5.261 36 C 5.252 34.877 5.406 33.644 5.724 32.301 Z M 38.769 15.184 L 40.549 8.046 L 71.284 8.046 L 69.504 15.184 L 58.478 15.184 L 56.78 21.994 L 48.115 21.994 L 49.813 15.184 Z M 51.191 44.41 L 42.526 44.41 L 44.134 37.961 L 52.799 37.961 Z M 99.63 26.228 C 99.391 27.187 99.116 28.111 98.806 29 L 89.779 29 C 90.11 28.14 90.399 27.216 90.645 26.228 C 90.844 25.428 90.995 24.671 91.098 23.955 L 100.109 23.955 C 99.984 24.689 99.825 25.447 99.63 26.228 Z M 86.963 42.741 C 83.981 44.185 80.862 44.907 77.607 44.907 C 74.34 44.907 71.58 44.179 69.327 42.723 C 67.525 41.558 66.174 39.971 65.276 37.961 L 93.429 37.961 C 91.516 39.987 89.36 41.58 86.963 42.741 Z M 64.917 26.228 C 65.112 25.447 65.33 24.689 65.572 23.955 L 74.565 23.955 C 74.31 24.671 74.083 25.428 73.884 26.228 C 73.638 27.216 73.466 28.14 73.368 29 L 64.359 29 C 64.492 28.111 64.678 27.187 64.917 26.228 Z M 69.753 16.054 C 71.98 13.273 74.581 11.16 77.557 9.715 C 80.533 8.271 83.655 7.549 86.922 7.549 C 90.177 7.549 92.936 8.271 95.197 9.715 C 97.459 11.16 99.013 13.273 99.858 16.054 C 100.387 17.795 100.555 19.775 100.362 21.994 L 91.258 21.994 C 91.266 21.364 91.226 20.775 91.138 20.227 C 90.877 18.593 90.226 17.356 89.187 16.516 C 88.148 15.675 86.752 15.255 85 15.255 C 83.26 15.255 81.658 15.675 80.194 16.516 C 78.73 17.356 77.46 18.593 76.383 20.227 C 76.022 20.775 75.689 21.364 75.382 21.994 L 66.295 21.994 C 67.207 19.775 68.36 17.795 69.753 16.054 Z M 73.391 32.23 C 73.652 33.863 74.306 35.1 75.351 35.941 C 75.376 35.961 75.401 35.981 75.426 36 L 64.58 36 C 64.175 34.492 64.031 32.813 64.148 30.961 L 73.276 30.961 C 73.288 31.406 73.327 31.829 73.391 32.23 Z M 84.344 35.941 C 85.803 35.1 87.07 33.863 88.146 32.23 C 88.41 31.829 88.659 31.406 88.894 30.961 L 98.04 30.961 C 97.234 32.813 96.254 34.492 95.1 36 L 84.24 36 C 84.275 35.981 84.309 35.961 84.344 35.941 Z M 96.11 44.41 L 97.718 37.961 L 106.507 37.961 L 104.899 44.41 Z M 105.177 8.046 L 120.198 8.046 C 122.921 8.046 125.152 8.534 126.891 9.511 C 128.63 10.488 129.811 11.885 130.436 13.702 C 131.06 15.519 131.062 17.67 130.442 20.156 C 130.283 20.793 130.095 21.406 129.878 21.994 L 120.615 21.994 C 120.922 21.458 121.162 20.845 121.334 20.156 C 121.614 19.031 121.615 18.099 121.338 17.359 C 121.061 16.619 120.52 16.063 119.713 15.69 C 118.906 15.317 117.846 15.131 116.532 15.131 L 112.199 15.131 L 110.488 21.994 L 101.699 21.994 Z M 127.191 26.574 C 126.381 27.499 125.472 28.308 124.465 29 L 99.952 29 L 101.21 23.955 L 109.999 23.955 L 109.729 25.039 L 114.061 25.039 C 115.387 25.039 116.54 24.864 117.521 24.515 C 117.948 24.363 118.342 24.176 118.704 23.955 L 129 23.955 C 128.49 24.906 127.887 25.779 127.191 26.574 Z M 125.347 43.426 L 126.71 37.961 L 152.065 37.961 L 150.457 44.41 L 125.102 44.41 L 125.347 43.426 L 125.638 44.41 L 116.05 44.41 L 114.213 37.961 L 123.732 37.961 Z M 134.168 8.046 L 159.523 8.046 L 157.744 15.184 L 141.178 15.184 L 139.48 21.994 L 130.691 21.994 Z M 112.504 31.963 L 108.002 31.963 L 106.996 36 L 98.207 36 L 99.463 30.961 L 121.663 30.961 L 123.152 36 L 113.654 36 Z M 56.291 23.955 L 55.033 29 L 46.368 29 L 47.626 23.955 Z M 54.544 30.961 L 53.288 36 L 44.623 36 L 45.879 30.961 Z M 127.199 36 L 128.455 30.961 L 137.244 30.961 L 135.987 36 Z M 128.944 29 L 130.202 23.955 L 154.261 23.955 L 153.003 29 Z",sstyle:"fill: rgb(51, 51, 51);"}),c.jsx("path",{d:"M 188.795 19.736 L 185.933 19.736 Q 185.571 17.852 184.575 16.15 Q 183.579 14.448 182.058 13.135 Q 180.536 11.822 178.562 11.061 Q 176.588 10.3 174.234 10.3 Q 170.648 10.3 167.668 12.193 Q 164.689 14.085 162.905 17.744 Q 161.121 21.402 161.121 26.691 Q 161.121 32.015 162.905 35.664 Q 164.689 39.314 167.668 41.197 Q 170.648 43.081 174.234 43.081 Q 176.588 43.081 178.562 42.329 Q 180.536 41.578 182.058 40.265 Q 183.579 38.952 184.575 37.24 Q 185.571 35.529 185.933 33.645 L 188.795 33.645 Q 188.36 36.036 187.174 38.218 Q 185.988 40.4 184.122 42.094 Q 182.257 43.787 179.766 44.765 Q 177.276 45.743 174.234 45.743 Q 169.579 45.743 166.002 43.389 Q 162.425 41.034 160.397 36.751 Q 158.369 32.468 158.369 26.691 Q 158.369 20.913 160.397 16.63 Q 162.425 12.347 166.002 9.992 Q 169.579 7.638 174.234 7.638 Q 177.276 7.638 179.766 8.607 Q 182.257 9.576 184.122 11.269 Q 185.988 12.963 187.174 15.136 Q 188.36 17.309 188.795 19.736 Z M 192.123 45.236 L 192.123 8.145 L 203.823 8.145 Q 207.554 8.145 210.143 9.54 Q 212.733 10.934 214.092 13.406 Q 215.45 15.878 215.45 19.12 Q 215.45 22.326 214.092 24.78 Q 212.733 27.234 210.152 28.61 Q 207.572 29.987 203.859 29.987 L 193.644 29.987 L 193.644 27.379 L 203.787 27.379 Q 206.666 27.379 208.649 26.365 Q 210.632 25.35 211.647 23.494 Q 212.661 21.638 212.661 19.12 Q 212.661 16.585 211.638 14.692 Q 210.614 12.8 208.631 11.749 Q 206.648 10.699 203.75 10.699 L 194.948 10.699 L 194.948 45.236 Z M 207.916 28.465 L 217.044 45.236 L 213.784 45.236 L 204.728 28.465 Z M 218.397 45.236 L 215.445 45.236 L 228.883 8.145 L 231.98 8.145 L 245.418 45.236 L 242.466 45.236 L 230.549 11.785 L 230.332 11.785 Z M 221.385 31.146 L 239.496 31.146 L 239.496 33.718 L 221.385 33.718 Z M 247.05 45.236 L 247.05 8.145 L 268.131 8.145 L 268.131 10.699 L 249.876 10.699 L 249.876 25.387 L 266.429 25.387 L 266.429 27.958 L 249.876 27.958 L 249.876 45.236 Z M 269.583 10.699 L 269.583 8.145 L 296.024 8.145 L 296.024 10.699 L 284.216 10.699 L 284.216 45.236 L 281.391 45.236 L 281.391 10.699 Z",transform:"matrix(0.998892068862915, 0, 0, 1, 0.17177101969718933, 0)",sstyle:"fill: rgb(51, 51, 51);"})]})]}),Lv=({className:n})=>c.jsx(k3,{className:"fill-[url(#a)] text-pink-500 "+n,children:c.jsx("defs",{children:c.jsxs("linearGradient",{id:"a",children:[c.jsx("stop",{offset:"0%",stopColor:"rgb(236 72 153)"}),c.jsx("stop",{offset:"100%",stopColor:"rgb(151 60 255)"})]})})}),Li=()=>{const[n,e]=v.useState(0);return v.useCallback(()=>{e(s=>++s)},[])};function _3(n,e,t){const s=!(e!=null&&e.group||t!=null&&t.group),r=((e==null?void 0:e.op)!=="LEAF"?e.op===n:!0)&&((t==null?void 0:t.op)!=="LEAF"?t.op===n:!0);return s&&r?[...(e==null?void 0:e.args)??[e],...(t==null?void 0:t.args)??[t]]:[e,t]}function Y0(n,e,t){return{op:n,args:_3(n,e,t)}}function C3(n,e){function t(){this.constructor=n}t.prototype=e.prototype,n.prototype=new t}function Si(n,e,t,s){var r=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Si.prototype),r.expected=e,r.found=t,r.location=s,r.name="SyntaxError",r}C3(Si,Error);function vh(n,e,t){return t=t||" ",n.length>e?n:(e-=n.length,t+=t.repeat(e),n+t.slice(0,e))}Si.prototype.format=function(n){var e="Error: "+this.message;if(this.location){var t=null,s;for(s=0;s<n.length;s++)if(n[s].source===this.location.source){t=n[s].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,l=this.location.source+":"+a.line+":"+a.column;if(t){var u=this.location.end,d=vh("",a.line.toString().length," "),f=t[r.line-1],p=r.line===u.line?u.column:f.length+1,g=p-r.column||1;e+=`
|
154
|
+
--> `+l+`
|
155
|
+
`+d+` |
|
156
|
+
`+a.line+" | "+f+`
|
157
|
+
`+d+" | "+vh("",r.column-1," ")+vh("",g,"^")}else e+=`
|
158
|
+
at `+l}return e};Si.buildMessage=function(n,e){var t={literal:function(f){return'"'+r(f.text)+'"'},class:function(f){var p=f.parts.map(function(g){return Array.isArray(g)?a(g[0])+"-"+a(g[1]):a(g)});return"["+(f.inverted?"^":"")+p.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(f){return f.description}};function s(f){return f.charCodeAt(0).toString(16).toUpperCase()}function r(f){return f.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+s(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+s(p)})}function a(f){return f.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+s(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+s(p)})}function l(f){return t[f.type](f)}function u(f){var p=f.map(l),g,y;if(p.sort(),p.length>0){for(g=1,y=1;g<p.length;g++)p[g-1]!==p[g]&&(p[y]=p[g],y++);p.length=y}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function d(f){return f?'"'+r(f)+'"':"end of input"}return"Expected "+u(n)+" but "+d(e)+" found."};function N3(n,e){e=e!==void 0?e:{};var t={},s=e.grammarSource,r={expression:Ce},a=Ce,l="|",u="-",d="(",f=")",p="'",g='"',y=/^[^"' ()|&]/,w=/^[^']/,k=/^[^"]/,_=/^[ ]/,C=P("expression"),S=P("sum term"),M=T("|",!1),I=P("product term"),L=T("&",!1),O=P("subexpression"),K=T("-",!1),E=P("term"),R=T("(",!1),F=T(")",!1),J=P("variable"),oe=U(['"',"'"," ","(",")","|","&"],!0,!1),Ne=P("variable 1"),Ee=T("'",!1),be=U(["'"],!0,!1),te=T('"',!1),B=U(['"'],!0,!1),Z=P("whitespace character(s)"),X=U([" "],!1,!1),ne=function(ue,ve){return Y0("|",ue,ve)},D=function(ue,ve){return Y0("&",ue,ve)},$=function(ue){return{op:"!",args:[ue]}},ie=function(ue){return ue.group=!0,ue},ge=function(ue){return{op:"LEAF",value:z().trim()}},le=function(ue){return{op:"LEAF",value:z().trim().slice(1,-1)}},se=0,Me=0,He=[{line:1,column:1}],Re=0,pt=[],Y=0,j;if("startRule"in e){if(!(e.startRule in r))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=r[e.startRule]}function z(){return n.substring(Me,se)}function T(ue,ve){return{type:"literal",text:ue,ignoreCase:ve}}function U(ue,ve,Ae){return{type:"class",parts:ue,inverted:ve,ignoreCase:Ae}}function H(){return{type:"end"}}function P(ue){return{type:"other",description:ue}}function Q(ue){var ve=He[ue],Ae;if(ve)return ve;for(Ae=ue-1;!He[Ae];)Ae--;for(ve=He[Ae],ve={line:ve.line,column:ve.column};Ae<ue;)n.charCodeAt(Ae)===10?(ve.line++,ve.column=1):ve.column++,Ae++;return He[ue]=ve,ve}function ae(ue,ve,Ae){var nt=Q(ue),Xe=Q(ve),Hr={source:s,start:{offset:ue,line:nt.line,column:nt.column},end:{offset:ve,line:Xe.line,column:Xe.column}};return Hr}function he(ue){se<Re||(se>Re&&(Re=se,pt=[]),pt.push(ue))}function je(ue,ve,Ae){return new Si(Si.buildMessage(ue,ve),ue,ve,Ae)}function Ce(){var ue;return Y++,ue=Oe(),Y--,ue===t&&Y===0&&he(C),ue}function Oe(){var ue,ve,Ae,nt;return Y++,ue=se,ve=qe(),ve!==t?(n.charCodeAt(se)===124?(Ae=l,se++):(Ae=t,Y===0&&he(M)),Ae!==t?(nt=Oe(),nt!==t?(Me=ue,ue=ne(ve,nt)):(se=ue,ue=t)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=qe()),Y--,ue===t&&(ve=t,Y===0&&he(S)),ue}function qe(){var ue,ve,Ae;return Y++,ue=se,ve=_t(),ve!==t?(n.charCodeAt(se)===38?se++:Y===0&&he(L),Ae=qe(),Ae!==t?(Me=ue,ue=D(ve,Ae)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=_t()),Y--,ue===t&&(ve=t,Y===0&&he(I)),ue}function _t(){var ue,ve,Ae;return Y++,ue=se,Ct(),n.charCodeAt(se)===45?(ve=u,se++):(ve=t,Y===0&&he(K)),ve!==t?(Ae=dt(),Ae!==t?(Ct(),Me=ue,ue=$(Ae)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=dt()),Y--,ue===t&&Y===0&&he(O),ue}function dt(){var ue,ve,Ae,nt;return Y++,ue=Rn(),ue===t&&(ue=xs()),ue===t&&(ue=se,Ct(),n.charCodeAt(se)===40?(ve=d,se++):(ve=t,Y===0&&he(R)),ve!==t?(Ae=Ce(),Ae!==t?(n.charCodeAt(se)===41?(nt=f,se++):(nt=t,Y===0&&he(F)),nt!==t?(Ct(),Me=ue,ue=ie(Ae)):(se=ue,ue=t)):(se=ue,ue=t)):(se=ue,ue=t)),Y--,ue===t&&Y===0&&he(E),ue}function xs(){var ue,ve,Ae;if(Y++,ue=se,Ct(),ve=[],y.test(n.charAt(se))?(Ae=n.charAt(se),se++):(Ae=t,Y===0&&he(oe)),Ae!==t)for(;Ae!==t;)ve.push(Ae),y.test(n.charAt(se))?(Ae=n.charAt(se),se++):(Ae=t,Y===0&&he(oe));else ve=t;return ve!==t?(Ae=Ct(),Me=ue,ue=ge()):(se=ue,ue=t),Y--,ue===t&&Y===0&&he(J),ue}function Rn(){var ue,ve,Ae,nt,Xe;if(Y++,ue=se,Ct(),ve=se,n.charCodeAt(se)===39?(Ae=p,se++):(Ae=t,Y===0&&he(Ee)),Ae!==t){if(nt=[],w.test(n.charAt(se))?(Xe=n.charAt(se),se++):(Xe=t,Y===0&&he(be)),Xe!==t)for(;Xe!==t;)nt.push(Xe),w.test(n.charAt(se))?(Xe=n.charAt(se),se++):(Xe=t,Y===0&&he(be));else nt=t;nt!==t?(n.charCodeAt(se)===39?(Xe=p,se++):(Xe=t,Y===0&&he(Ee)),Xe!==t?(Ae=[Ae,nt,Xe],ve=Ae):(se=ve,ve=t)):(se=ve,ve=t)}else se=ve,ve=t;if(ve===t)if(ve=se,n.charCodeAt(se)===34?(Ae=g,se++):(Ae=t,Y===0&&he(te)),Ae!==t){if(nt=[],k.test(n.charAt(se))?(Xe=n.charAt(se),se++):(Xe=t,Y===0&&he(B)),Xe!==t)for(;Xe!==t;)nt.push(Xe),k.test(n.charAt(se))?(Xe=n.charAt(se),se++):(Xe=t,Y===0&&he(B));else nt=t;nt!==t?(n.charCodeAt(se)===34?(Xe=g,se++):(Xe=t,Y===0&&he(te)),Xe!==t?(Ae=[Ae,nt,Xe],ve=Ae):(se=ve,ve=t)):(se=ve,ve=t)}else se=ve,ve=t;return ve!==t?(Ae=Ct(),Me=ue,ue=le()):(se=ue,ue=t),Y--,ue===t&&Y===0&&he(Ne),ue}function Ct(){var ue,ve;for(Y++,ue=[],_.test(n.charAt(se))?(ve=n.charAt(se),se++):(ve=t,Y===0&&he(X));ve!==t;)ue.push(ve),_.test(n.charAt(se))?(ve=n.charAt(se),se++):(ve=t,Y===0&&he(X));return Y--,ve=t,Y===0&&he(Z),ue}if(j=a(),j!==t&&se===n.length)return j;throw j!==t&&se<n.length&&he(H()),je(pt,Re<n.length?n.charAt(Re):null,Re<n.length?ae(Re,Re+1):ae(Re,Re))}var Ir;class j3 extends Error{constructor(t,s=400){super();An(this,Ir);this.code=s,this.message=t;try{Un(this,Ir,JSON.stringify(this.message,null,2))}catch{Un(this,Ir,":(")}(this.message!==void 0||this.message!==null)&&(this.message.toString=()=>Ue(this,Ir))}toString(){return Ue(this,Ir)}}Ir=new WeakMap;const vl=(n,e,t=400)=>{if(!n)throw new j3([{message:e}],t)},S3=(n,e="-")=>{if(typeof n!="string")return;let t=n.trim();if(t!==""&&(t=t.toLowerCase().match(/[\p{L}\d]+/gu).join(e),t.length!=0))return t},Ov="sortBy",Rv="order",gd="limit",vd="limitToLast",xd="vql",Rl="equals",yd="startAt",Pv="startAfter",wd="endAt",zv="endBefore",Bv="expand",Vv=/[a-zA-Z0-9\_\:\-\+\*\s\'\"\.]+/g;function E3(n=""){return typeof n!="string"?!1:!isNaN(n)&&!isNaN(parseFloat(n))}const M3=(n="")=>n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):E3(n)?parseFloat(n):n==="true"?!0:n==="false"?!1:n,xl=(n="")=>n?n.match(Vv).map(t=>{const s=t.split(":"),r=s[0].trim(),a=s.slice(1).join(":").trim(),l=M3(a);return[r,l]}):void 0,D3=(n,e=["*"])=>$v(n.get(Bv),e),T3=n=>$v(n??"(updated_at, id)"),I3=(n="desc")=>n==="asc"?"asc":"desc",$v=(n="",e=[])=>{var s;return((s=n==null?void 0:n.match(Vv).map(r=>r.trim()))==null?void 0:s.filter(Boolean))??e},A3=n=>{n=n instanceof URLSearchParams?n:new URLSearchParams(n);const e={};e.expand=D3(n),e.limit=parseInt(n.get(gd))?Math.abs(parseInt(n.get(gd))):void 0,e.limitToLast=parseInt(n.get(vd))?Math.abs(parseInt(n.get(vd))):void 0,!e.limitToLast&&!e.limit&&(e.limit=5);try{const l=n.get(xd);l&&(e.vqlParsed=N3(l))}catch(l){console.log(l),vl(!1,"VQL parsing failed",401)}e.vql=n.get(xd),n.get(Rl)&&(n.set(yd,n.get(Rl)),n.set(wd,n.get(Rl))),e.startAt=xl(n.get(yd)),e.startAfter=xl(n.get(Pv)),vl(!(e.startAt&&e.startAfter),"Cannot set both startAt and startAfter",401),e.endAt=xl(n.get(wd)),e.endBefore=xl(n.get(zv)),vl(!(e.endAt&&e.endBefore),"Cannot set both endAt and endAfter",401);const t=e.startAt||e.startAfter,s=e.endAt||e.endBefore,r=((t==null?void 0:t.length)??0)<((s==null?void 0:s.length)??0)?t:s,a=r===t?s:t;if(t&&s)for(let l=0;l<r.length;l++){const u=r[l][0],d=a[l][0];vl(u===d,`non matching keys \`${u}\`!==\`${d}\` in range cursors`,401)}return e.sortBy=T3(n.get(Ov)),e.order=I3(n.get(Rv)),a&&(a!=null&&a.length)&&(e.sortBy=a.map(([l,u],d)=>l)),e},Gl=(n,e)=>Array.isArray(n)?"("+n.join(",")+")":e,L3=n=>{const e=n.map(t=>typeof t[1]=="string"?`${t[0]}:'${t[1]}'`:`${t[0]}:${t[1]}`);return Gl(e)},yn=n=>{const e=new URLSearchParams;return n.order=(n==null?void 0:n.order)??"desc",n.sortBy=(n==null?void 0:n.sortBy)??["updated_at","id"],n.expand=(n==null?void 0:n.expand)??["*"],!n.limit&&!n.limitToLast&&(n.limit=5),[{cursor:n.equals,key:Rl},{cursor:n.endAt,key:wd},{cursor:n.endBefore,key:zv},{cursor:n.startAt,key:yd},{cursor:n.startAfter,key:Pv}].filter(t=>{var s;return!!t.cursor&&((s=t.cursor)==null?void 0:s.length)}).forEach(t=>{e.set(t.key,L3(t.cursor))}),e.set(Rv,n.order),e.set(Ov,Gl(n.sortBy)),e.set(Bv,Gl(n.expand)),n.vql&&e.set(xd,n.vql),n.limit&&e.set(gd,n.limit.toString()),n.limitToLast&&e.set(vd,n.limitToLast.toString()),e},O3=n=>new URLSearchParams(n),Dr=(n,e,t)=>{var r;let s=(r=n==null?void 0:n.endpoint)==null?void 0:r.trim();return s=s!=null&&s.endsWith("/")?s.slice(0,-1):s,e=e!=null&&e.startsWith("/")?e.slice(1):e,t!=null&&t.size&&(e=e!=null&&e.endsWith("/")?e.slice(0,-1):e,e+="?"+t.toString()),s?`${s}/api/${e}`:`/api/${e}`},rr=async(n,e,t={},s=void 0)=>{const r=await n.auth.working_auth_token(),a=(n.auth.currentAuthStrategy==="apikey"?"Basic":"Bearer")+` ${r}`;return await n.fetcher(Dr(n.config,e,s),{...t,headers:{...(t==null?void 0:t.headers)??{},Authorization:a}})},Ke=async(n,e,t={},s=void 0)=>{var d;const r=await rr(n,e,t,s),a=r.ok;let l;const u=(d=r==null?void 0:r.headers)==null?void 0:d.get("content-type");try{u!=null&&u.includes("application/json")?l=await r.json():u!=null&&u.includes("text/plain")?l=await r.text():u!=null&&u.includes("text/html")?l=await r.text():l=await r.blob()}catch(f){console.log("fetchApiWithAuth.json()",f)}if(!a)throw l;return l};async function Mr(n,e,t){return Ke(n,`${e}/${t}`,{method:"get"})}async function Fv(n,e,t){return Ke(n,`${e}`,{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async function hr(n,e,t){const s=yn(t);return Ke(n,`${e}/count_query?${s.toString()}`,{method:"get"})}async function of(n,e,t){return Ke(n,`${e}/${t}`,{method:"delete"})}async function Fr(n,e,t={}){const s=yn(t);return Ke(n,`${e}?${s.toString()}`,{method:"get"})}var Ua,Wa;class kn{constructor(e,t){An(this,Ua);An(this,Wa);Un(this,Ua,e),Un(this,Wa,t)}async get(e){return Mr(this.sdk,this.base_name,e)}async upsert(e){return Fv(this.sdk,this.base_name,e)}async remove(e){return of(this.sdk,this.base_name,e)}async list(e){return Fr(this.sdk,this.base_name,e)}async count_query(e){return hr(this.sdk,this.base_name,e)}get base_name(){return Ue(this,Wa)}get sdk(){return Ue(this,Ua)}}Ua=new WeakMap,Wa=new WeakMap;const Ei={Auto:{id:0,name:"Automatic",name2:"automatic"},Manual:{id:1,name:"Manual",name2:"manual"}},Tt={p_in_collections:{id:0,type:"product",op:"p-in-collections",name:"Product In Collection"},p_not_in_collections:{id:1,type:"product",op:"p-not-in-collections",name:"Product not in Collection"},p_in_products:{id:2,type:"product",op:"p-in-products",name:"Product belongs to"},p_not_in_products:{id:3,type:"product",op:"p-not-in-products",name:"Product does not belong to"},p_in_tags:{id:4,type:"product",op:"p-in-tags",name:"Product has Tag"},p_not_in_tags:{id:5,type:"product",op:"p-not-in-tags",name:"Product excludes Tag"},p_all:{id:6,type:"product",op:"p-all",name:"All Products"},p_in_price_range:{id:7,type:"product",op:"p-in-price-range",name:"Product in Price range"},o_subtotal_in_range:{id:100,type:"order",op:"o-subtotal-in-range",name:"Order subtotal in range"},o_items_count_in_range:{id:101,type:"order",op:"o-items-count-in-range",name:"Order items count in range"},o_date_in_range:{id:102,type:"order",op:"o-date-in-range",name:"Order in dates"},o_has_customer:{id:103,type:"order",op:"o-has-customer",name:"Order has Customers"}},xn={any:{id:void 0,type:void 0,name:void 0},regular:{id:0,type:"regular",name:"Regular Discount"},bulk:{id:1,type:"bulk",name:"Bulk Discount"},buy_x_get_y:{id:2,type:"buy_x_get_y",name:"Buy X Get Y"},order:{id:3,type:"order",name:"Order Discount"},bundle:{id:4,type:"bundle",name:"Bundle Discount"}},K0={created:{id:0,name2:"created",name:"Created"},requires_action:{id:1,name2:"requires_action",name:"Requires Action"},failed:{id:2,name2:"failed",name:"Failed"},complete:{id:3,name2:"complete",name:"Complete"},unknown:{id:4,name2:"unknown",name:"Unknown"}},bd={draft:{id:0,name2:"draft",name:"Draft"},processing:{id:1,name2:"processing",name:"Processing (Stock Reserved)"},shipped:{id:2,name2:"shipped",name:"Shipped"},fulfilled:{id:3,name2:"fulfilled",name:"Fulfilled"},cancelled:{id:4,name2:"cancelled",name:"Cancelled (Stock returned)"}},kd={unpaid:{id:0,name:"Unpaid",name2:"unpaid"},authorized:{id:1,name:"Authorized",name2:"authorized"},captured:{id:2,name:"Captured",name2:"captured"},requires_auth:{id:3,name:"Requires Authentication",name2:"requires_auth"},voided:{id:4,name:"Voided",name2:"voided"},failed:{id:5,name:"Failed",name2:"failed"},partially_paid:{id:6,name:"Partially paid",name2:"partially_paid"},refunded:{id:7,name:"Refunded",name2:"refunded"},partially_refunded:{id:8,name:"Partially Refunded",name2:"partially_refunded"},cancelled:{id:9,name:"Cancelled",name2:"cancelled"}};String.prototype.replaceAll=function(n,e){var t=this;return t.split(n).join(e)};const Be={scope:"data",stack:[],tokenize:function(n=""){n=n.replace(/[ \t]*{{!--(.|\n|\r)*--}}[ \t]*[\n]?/g,""),n=n.replace(/[ \t]*{{!(.|\n|\r)*}}[ \t]*[\n]?/g,"");for(var e=[],t=0;t<n.length;t++){var s=n.indexOf("{{",t);if(s===-1)e.push({type:"text",val:n.slice(t)}),t=n.length;else{var r=n.substring(s,s+3)==="{{{",a="}}"+(r?"}":""),l=n.indexOf(a,s);if(l===-1)e.push({type:"text",val:n.slice(t)}),t=n.length;else{t<s&&e.push({type:"text",val:n.slice(t,s),__debug:{i:t,tkPos:s}});var u={type:"field",raw:r,val:n.slice(s+a.length,l)},d=u.val.indexOf(" ");if(d!==-1){u.params=u.val.slice(d+1),u.val=u.val.slice(0,d);var f=u.params.indexOf("|");f!==-1&&(u.mapTo=u.params.slice(f+1).trim().split(" "),u.params=u.params.slice(0,f))}var p=u.val.substring(0,1);p==="#"?(u.block="start",u.val=u.val.slice(1)):p==="/"&&(u.block="end",u.val=u.val.slice(1)),e.push(u),t=l+a.length-1}}}return e},utils:{vnCounter:0,getName:function(){return"v"+Be.utils.vnCounter++},safe:function(n){return n==null&&(n=""),(n+"").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")},unsafe:function(n){return n||""},field:function(n){if(n=(n||"").trim(),n[0]=='"'&&n[n.length-1]=='"')return JSON.stringify(n.slice(1,-1));if(n=="this")return Be.scope;if(n[0]=="@")return n.slice(1);for(var e=Be.scope,t=0;n[0]==".";)t>0&&Be.stack.length>=t&&(e=Be.stack[Be.stack.length-t]),t++,n=n.slice(1);var s=n.split("."),r="";return s.forEach(function(a){a[0]=="/"&&(a=a.slice(1)),r+="?.["+JSON.stringify(a)+"]"}),e+r},pushScope:function(){return Be.stack.push(Be.scope),Be.scope=Be.utils.getName(),Be.scope},popScope:function(){return Be.scope=Be.stack.pop()||"data",Be.scope}},gen:{if_start:function(n){return"if("+Be.utils.field(n.params.trim())+") {"},if_end:function(n){return"}"},unless_start:function(n){return"if(!"+Be.utils.field(n.params.trim())+") {"},unless_end:function(n){return"}"},each_start:function(n){var e=Be.utils.field(n.params.trim()),t=Be.utils.getName(),s=Be.utils.pushScope();return"if("+e+"&&"+e+".length>0) for(var "+t+"=0;"+t+"<"+e+".length;"+t+"++) {var index="+t+";var "+s+"="+e+"["+t+"];"},each_end:function(n){return Be.utils.popScope(),"}"},local_mapping:function(n,e){if(n.mapTo&&n.mapTo.length>0){for(var t="",s=0;s<n.mapTo.length;s++){var r=n.mapTo[s],a=e[s];r&&a&&(t+="var "+r+" = "+a+";")}return t}else return""},properties_start:function(n){var e=Be.utils.field(n.params.trim()),t=Be.utils.getName(),s=Be.utils.getName(),r=Be.utils.pushScope();return"var "+s+"=Object.keys("+e+");if("+e+"&&"+s+".length>0) for(var "+t+"=0; "+t+"<"+s+".length;"+t+"++) {var index="+t+";var key="+s+"["+t+"];var "+r+"="+e+"[key];"+Be.gen.local_mapping(n,[r,"key"])},properties_end:function(n){return Be.utils.popScope(),"}"},with_start:function(n){var e=Be.utils.field(n.params.trim()),t=Be.utils.pushScope();return"if("+e+") { var "+t+"="+e+";"+Be.gen.local_mapping(n,[t])},with_end:function(n){return Be.utils.popScope(),"}"},else:function(n){return"} else {"},log:function(n){return"console.log(_m.utils.safe("+Be.utils.field(n.params)+"));"},_text_f:function(n){return"o += "+JSON.stringify(Be.opt.trim?n.val.trim():n.val)+";"},_invoke_synth:function(n,e){return"o += _m.utils."+(e.raw?"unsafe":"safe")+"("+n+"["+JSON.stringify(e.val)+"]("+Be.utils.field(e.params||"this")+", "+Be.utils.field("this")+", "+JSON.stringify(e.params)+", data));"},_field_f:function(n,e){if(n.block=="start"||n.block=="end"){var t=n.val+"_"+n.block;return Be.gen[t]?Be.gen[t](n):(console.log("unrecognized field type",t),"")}return Be.gen[n.val]?Be.gen[n.val](n):typeof e[n.val]=="function"?Be.gen._invoke_synth("opt",n):"o += _m.utils."+(n.raw?"unsafe":"safe")+"("+Be.utils.field(n.val)+");"}},tokensToCode:function(n,e){var t=[];return n.forEach(function(s){var r=Be.gen["_"+s.type+"_f"];typeof r!="function"?console.log("unrecognized field type",s.type):t.push(r(s,e))}),t.join(";")},compile:function(n,e){e||(e={}),Be.opt=e,Be.stack=[],Be.scope="data";var t=Be.tokenize((n||"").trim()),s=Be.tokensToCode(t,e);if(Be.stack.length!=0){var r=function(){return"template error: un-closed blocks"};return r.error=r(),r}else{const a=new Function("data","_m",'"use strict"; if (!data) data = {}; var o = ""; '+s+" return(o);");return function(l){return a(l,Be)}}}},R3=Be,Q0=n=>{if(typeof n!="string")return;let e=n.trim();if(e!==""&&(e=e.toLowerCase().match(/[\p{L}\d]+/gu).join("-"),e.length!=0))return e},P3=(n,e)=>{if(!n)throw e};var Ci,vt,Ss;class z3{constructor(e){An(this,Ci,new Set);An(this,vt);we(this,"notify_subscribers",()=>{for(let e of Ue(this,Ci))e({auth:this.currentAuth,isAuthenticated:this.isAuthenticated})});we(this,"add_sub",e=>(Ue(this,Ci).add(e),()=>{Ue(this,Ci).delete(e)}));An(this,Ss,e=>{this.currentAuth=e,this.notify_subscribers()});we(this,"signin",async(e,t)=>{const s={email:e,password:t},r=await Ue(this,vt).fetcher(Dr(Ue(this,vt).config,"/auth/signin"),{method:"post",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}});if(!r.ok){let l={messages:[{message:"auth/error"}]};try{l=await r.json()}catch{}throw l}const a=await r.json();return Ue(this,Ss).call(this,a),a});we(this,"signup",async(e,t,s,r)=>{const a={email:e,password:t,firstname:s,lastname:r},l=await Ue(this,vt).fetcher(Dr(Ue(this,vt).config,"/auth/signup"),{method:"post",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}});P3(l.ok,"auth/error");const u=await l.json();return Ue(this,Ss).call(this,u),u});we(this,"changePassword",async e=>{const t=await Ue(this,vt).fetcher(Dr(Ue(this,vt).config,"/auth/change-password"),{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(!t.ok){let r={messages:[{message:"auth/error"}]};try{r=await t.json()}catch{}throw r}const s=await t.json();return Ue(this,Ss).call(this,s),s});we(this,"signout",async()=>{console.log("signout"),Ue(this,Ss).call(this,void 0)});we(this,"create_api_key",async()=>await Ke(Ue(this,vt),"/auth/apikeys",{method:"post"}));we(this,"get_auth_user",async e=>await Ke(Ue(this,vt),`/auth/users/${e}`,{method:"get"}));we(this,"remove_auth_user",async e=>Ke(Ue(this,vt),`/auth/users/${e}`,{method:"delete"}));we(this,"list_auth_users",async e=>{const t=yn(e);return await Ke(Ue(this,vt),`/auth/users?${t.toString()}`,{method:"get"})});we(this,"count_auth_users_query",async e=>hr(Ue(this,vt),"/auth/users",e));we(this,"list_api_keys_auth_users",async()=>await Ke(Ue(this,vt),"/auth/apikeys",{method:"get"}));we(this,"identity_providers_list",async()=>await Ke(Ue(this,vt),"/auth/identity-providers",{method:"get"}));we(this,"identity_provider_get_authorization_uri",async e=>await Ke(Ue(this,vt),"/auth/identity-providers/create-authorization-uri",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));we(this,"identity_provider_sign",async e=>{const t=await Ke(Ue(this,vt),"/auth/identity-providers/sign",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});return Ue(this,Ss).call(this,t),t});Un(this,vt,e)}get currentAuth(){var e,t;return(t=(e=Ue(this,vt))==null?void 0:e.config)==null?void 0:t.auth}set currentAuth(e){Ue(this,vt).config.auth=e}init(){}async working_auth_token(e=!1){var t;switch(this.currentAuthStrategy){case"apikey":{const s=this.currentAuth;return s==null?void 0:s.apikey}case"jwt":{const s=this.currentAuth;return(e||!this.isAuthenticated)&&await this.reAuthenticateIfNeeded(e),(t=s==null?void 0:s.access_token)==null?void 0:t.token}}}async reAuthenticateIfNeeded(e=!1){if(this.currentAuth&&!(this.isAuthenticated&&!e)&&"access_token"in this.currentAuth){const t=await Ue(this,vt).fetcher(Dr(Ue(this,vt).config,"/auth/refresh"),{method:"post",body:JSON.stringify({refresh_token:this.currentAuth.refresh_token.token}),headers:{"Content-Type":"application/json"}});let s;return t.ok&&(s=await t.json()),Ue(this,Ss).call(this,s),s}}get currentAuthStrategy(){if(this.currentAuth&&typeof this.currentAuth=="object"){if("apikey"in this.currentAuth)return"apikey";if("access_token"in this.currentAuth)return"jwt"}return"unknown"}get isAuthenticated(){var e,t;switch(this.currentAuthStrategy){case"apikey":return!!this.currentAuth.apikey;case"jwt":{const s=this.currentAuth,r=(t=(e=s==null?void 0:s.access_token)==null?void 0:e.claims)==null?void 0:t.exp;return r&&Date.now()<(r-60)*1e3}default:return!1}}}Ci=new WeakMap,vt=new WeakMap,Ss=new WeakMap;let B3=class extends kn{constructor(t){super(t,"customers");we(this,"query_customer_orders",async(t,s)=>Fr(this.sdk,`customers/${t}/orders`,s));we(this,"count_customer_orders_query",async(t,s)=>hr(this.sdk,`customers/${t}/orders`,s))}},V3=class extends kn{constructor(e){super(e,"tags")}},$3=class extends kn{constructor(e){super(e,"templates")}},F3=class extends kn{constructor(t){super(t,"products");we(this,"list_used_tags",async()=>await Ke(this.sdk,"products/used_tags",{method:"get"}));we(this,"changeStockOfBy",async(t,s)=>await Ke(this.sdk,`products/${t}?quantityBy=${s}`,{method:"put"}));we(this,"batchAddProductsToCollection",async(t,s)=>{for(const r of t)await this.upsert({...r,collections:[...r.collections??[],s]})});we(this,"batchRemoveProductsFromCollection",async(t,s)=>{for(const r of t)await this.upsert({...r,collections:(r.collections??[]).filter(a=>a.id!==s.id)})})}},H3=class extends kn{constructor(e){super(e,"orders")}list_my_orders(e={}){const t=yn(e);return Ke(this.sdk,`${this.base_name}/me?${t.toString()}`,{method:"get"})}},U3=class extends kn{constructor(t){super(t,"discounts");we(this,"query_discount_products",async(t,s)=>Fr(this.sdk,`discounts/${t}/products`,s));we(this,"count_discount_products_query",async(t,s)=>hr(this.sdk,`discounts/${t}/products`,s));we(this,"list_used_discount_products_tags",async t=>await Ke(this.sdk,`discounts/${t}/products/used_tags`,{method:"get"}))}},W3=class extends kn{constructor(t){super(t,"collections");we(this,"publish",async(t,s=1e3)=>await Ke(this.sdk,`collections/${t}/export`,{method:"post"}));we(this,"list_used_products_tags",async t=>await Ke(this.sdk,`collections/${t}/products/used_tags`,{method:"get"}));we(this,"query_collection_products",async(t,s)=>Fr(this.sdk,`collections/${t}/products`,s));we(this,"count_collection_products_query",async(t,s)=>hr(this.sdk,`collections/${t}/products`,s))}};class Y3 extends kn{constructor(e){super(e,"shipping")}}let K3=class extends kn{constructor(t){super(t,"storefronts");we(this,"publish",async t=>await Ke(this.sdk,`storefronts/${t}/export`,{method:"post"}));we(this,"get_default_auto_generated_storefront",async()=>await Ke(this.sdk,"storefronts/auto-generated",{method:"get"}))}};var Ya;class Q3{constructor(e){An(this,Ya);we(this,"orders",async(e,t)=>{const s=new URLSearchParams;return e&&s.set("fromDay",new Date(e).toISOString()),t&&s.set("toDay",new Date(t).toISOString()),Ke(this.sdk,`statistics/orders?${s.toString()}`)});we(this,"countOf",async(e,t)=>{const s=yn(t);return Ke(this.sdk,`statistics/count/${e}?${s.toString()}`)});Un(this,Ya,e)}get sdk(){return Ue(this,Ya)}}Ya=new WeakMap;let Z3=class extends kn{constructor(e){super(e,"images")}},G3=class extends kn{constructor(e){super(e,"posts")}};class J3{constructor(e){we(this,"create",async(e,t)=>await Ke(this.sdk,`checkout/create?gateway=${t}`,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));we(this,"complete",async e=>await Ke(this.sdk,`checkout/${e}/complete`,{method:"post"}));we(this,"pricing",async e=>await Ke(this.sdk,"checkout/pricing",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}var Ka;class q3{constructor(e){An(this,Ka);Un(this,Ka,e)}get(e){return Mr(this.sdk,"payments/gateways",e)}list(){return Fr(this.sdk,"payments/gateways")}paymentStatusOfOrder(e){return Ke(this.sdk,`/payments/status/${e}`,{method:"get"})}invokeAction(e,t){return Ke(this.sdk,`/payments/${e}/${t}`,{method:"post"})}getBuyUI(e){return Ke(this.sdk,`/payments/buy_ui/${e}`,{method:"get"})}webhook(e,t={}){return Ke(this.sdk,`/payments/gateways/${e}/webhook`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}get sdk(){return Ue(this,Ka)}}Ka=new WeakMap;let X3=class extends kn{constructor(e){super(e,"reference/settings")}},e5=class extends kn{constructor(t){super(t,"notifications");we(this,"upsertBulk",t=>Ke(this.sdk,`${this.base_name}`,{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}));we(this,"meta",()=>this.get("_meta"))}};var Ni;class t5{constructor(e){An(this,Ni,{features:void 0});we(this,"features",async()=>{if(Ue(this,Ni).features)return Ue(this,Ni).features;try{const e=await rr(this.sdk,"storage",{method:"get"});if(!e.ok)throw new Error;const t=await e.json();return Ue(this,Ni).features=t,t}catch(e){console.log(e)}return{supports_signed_urls:!1}});we(this,"getBlobSigned",async e=>{const t=await rr(this.sdk,`storage/${e}?signed=true`,{method:"get"}),s=t.headers.get("Content-Type");if(!t.ok)throw await t.json();if(s==="application/json"){const r=await t.json();return(await this.sdk.fetcher(r.url,{method:r.method,headers:r.headers})).blob()}throw"unknown"});we(this,"getBlobUnsigned",async e=>{const t=await rr(this.sdk,`storage/${e}?signed=false`,{method:"get"});if(t.headers.get("Content-Type"),!t.ok)throw await t.json();return t.blob()});we(this,"getBlob",async e=>(await this.features()).supports_signed_urls?this.getBlobSigned(e):this.getBlobUnsigned(e));we(this,"getText",e=>this.getBlob(e).then(t=>t.text()));we(this,"getJson",e=>this.getBlob(e).then(t=>t.text().then(JSON.parse)));we(this,"getImageObjectURL",e=>this.getBlob(e).then(t=>URL.createObjectURL(t)));we(this,"getSource",async(e,t=!0)=>{try{if(!e.startsWith("storage://"))return e;const r=e.split("storage://").at(-1),a=await this.getBlob(r);return t?URL.createObjectURL(a):a.text().then(JSON.parse)}catch(s){console.log(s)}return e});we(this,"putBytesSigned",async(e,t)=>{const s=await rr(this.sdk,`storage/${e}?signed=true`,{method:"put"}),r=s.headers.get("Content-Type");if(!s.ok)throw await s.json();if(r==="application/json"){const a=await s.json();return(await this.sdk.fetcher(a.url,{method:a.method,headers:a.headers,body:t})).ok}throw"unknown"});we(this,"putBytesUnsigned",async(e,t)=>{const s=await rr(this.sdk,`storage/${e}?signed=false`,{method:"put",body:t});if(s.headers.get("Content-Type"),!s.ok)throw await s.json();return s.ok});we(this,"putBytes",async(e,t)=>(await this.features()).supports_signed_urls?this.putBytesSigned(e,t):this.putBytesUnsigned(e,t));we(this,"delete",async e=>{const t=await rr(this.sdk,`storage/${e}`,{method:"delete"});if(!t.ok)throw await t.json();return t.ok});this.sdk=e}}Ni=new WeakMap;const n5="X-STORECRAFT-THREAD-ID";class s5{constructor(e){we(this,"speak",async(e,t)=>(await this.sdk.fetcher(Dr(this.sdk.config,`ai/agents/${e}/run`),{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json());we(this,"streamSpeak",async(e,t)=>{const s=await this.sdk.fetcher(Dr(this.sdk.config,`ai/agents/${e}/stream`),{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}),r=s.headers.get(n5);if(!r)throw new Error(`X-Storecraft-Thread-Id is missing, please tell the backend admin to
|
159
|
+
change the cors' Access-Control-Expose-Headers to accept the header`);return{threadId:r,generator:()=>r5(s.body)}});this.sdk=e}}const r5=async function*(n){for await(const e of i5(n))yield JSON.parse(e.data)},i5=async function*(n){let e=[],t="";const s=n.getReader();let r=await s.read();for(;!r.done;){let a=new TextDecoder().decode(r.value);t&&(a=t+a,t="");const l=a.split(/\r\n|\n|\r/).map(u=>u.trim());for(const u of l)u===""&&e.length?(yield a5(e),e=[]):e.push(u);t=e.pop(),r=await s.read()}},a5=n=>Object.fromEntries(n.map(e=>{const t=e.indexOf(":");return[e.slice(0,t).trim(),e.slice(t+1).trim()]}));class o5{constructor(e){we(this,"quick",async e=>await Ke(this.sdk,"search",{method:"get"},yn(e)));we(this,"similarity",async e=>await Ke(this.sdk,"similarity-search",{method:"get"},O3({q:e.q,namespaces:Gl(e.namespaces),limit:e.limit??5})));this.sdk=e}}class l5{constructor(e){we(this,"send",async e=>await Ke(this.sdk,"emails/send",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));we(this,"sendWithTemplate",async e=>await Ke(this.sdk,"emails/send-with-template",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}var ji,Qa;class c5{constructor(e,t){An(this,ji);An(this,Qa);we(this,"fetchApiWithAuth",(e,t,s)=>Ke(this,e,t,s));we(this,"fetchOnlyApiResponseWithAuth",(e,t,s)=>rr(this,e,t,s));Un(this,ji,e),Un(this,Qa,t??((s,r)=>fetch(s,r))),this.ai=new s5(this),this.search=new o5(this),this.auth=new z3(this),this.storage=new t5(this),this.customers=new B3(this),this.tags=new V3(this),this.templates=new $3(this),this.products=new F3(this),this.orders=new H3(this),this.collections=new W3(this),this.discounts=new U3(this),this.shipping=new Y3(this),this.storefronts=new K3(this),this.statistics=new Q3(this),this.images=new Z3(this),this.posts=new G3(this),this.payments=new q3(this),this.checkout=new J3(this),this.settings=new X3(this),this.notifications=new e5(this),this.emails=new l5(this)}get fetcher(){return Ue(this,Qa)}updateConfig(e){Un(this,ji,{...e})}get config(){return Ue(this,ji)}}ji=new WeakMap,Qa=new WeakMap;const u5=()=>typeof window<"u",h5=n=>({get:e=>{if(typeof window>"u")return null;const t=n.getItem(e);return t?JSON.parse(t):null},set:(e,t)=>{if(!(typeof window>"u"))try{typeof window<"u"&&n.setItem(e,JSON.stringify(typeof t>"u"?null:t))}catch(s){console.error(`local_storage_adapter ${e} `,s)}},remove:e=>{typeof window<"u"&&n.removeItem(e)}}),Jl=h5(u5()?window.localStorage:void 0),Hv="storecraft_latest_config",Z0=()=>(os==null?void 0:os.config)??Jl.get(Hv),os=new c5,d5=(n={})=>{Jl.set(Hv,n)},f5=n=>{os.updateConfig(n),d5(n)},bt=(n=Z0())=>{const[e,t]=v.useState(void 0),s=Li(),r=os.auth.isAuthenticated,a=v.useCallback(l=>{f5(l),s()},[s]);return v.useEffect(()=>{a(n)},[]),v.useEffect(()=>{const l=os.auth.add_sub(({auth:u})=>{a({...os.config,auth:u})});return os.auth.reAuthenticateIfNeeded(),l},[]),{config:os.config??Z0(),sdk:os,isAuthenticated:r,error:e,actions:{updateConfig:a,trigger:s}}},fc=n=>new Promise((e,t)=>{let s=indexedDB.open(n,1);s.onupgradeneeded=function(r){r.target.result.createObjectStore("main")},s.onsuccess=function(r){e(r.target.result)},s.onerror=function(r){t(r.target.errorCode)}}),p5=(n,e="main")=>(t,s)=>new Promise((r,a)=>{fc(n).then(l=>{let f=l.transaction(e,"readwrite").objectStore(e).put(s,t);f.onsuccess=function(p){const g=p.target.result;t===g?r(t):a()},f.onerror=function(p){a(p.target.errorCode)}}).catch(a)}),m5=(n,e="main")=>t=>new Promise((s,r)=>{fc(n).then(a=>{let d=a.transaction(e,"readwrite").objectStore(e).get(t);d.onsuccess=function(f){const p=f.target.result;p?s(p):r()},d.onerror=function(f){r(f.target.errorCode)}}).catch(r)}),g5=(n,e="main")=>t=>new Promise((s,r)=>{fc(n).then(a=>{let d=a.transaction(e,"readwrite").objectStore(e).delete(t);d.onsuccess=function(f){s(t)},d.onerror=function(f){r(f.target.errorCode)}}).catch(r)}),lf=n=>{const[e,t]=v.useState(),[s,r]=v.useState();v.useEffect(()=>{fc(n).then(t).catch(r)},[n]);const a=v.useCallback(async(d,f)=>{try{return await p5(n,"main")(d,f)}catch(p){r(p)}},[]),l=v.useCallback(async d=>{try{return await m5(n,"main")(d)}catch(f){r(f)}},[]),u=v.useCallback(async d=>{try{return await g5(n,"main")(d)}catch(f){r(f)}},[]);return{db:e,error:s,actions:{get:l,put:a,remove:u}}},Uv=()=>{const{db:n,error:e,actions:{get:t,put:s,remove:r}}=lf("storecraft_document_cache"),a=v.useCallback(f=>t(f),[t]),l=v.useCallback(async f=>{try{const p=[];f&&"handle"in f&&p.push(s(String(f.handle),f)),f&&"id"in f&&p.push(s(f.id,f)),await Promise.all(p)}catch{}return f.id},[s]),u=v.useCallback(async(f,p)=>{try{await s(f,p)}catch{}return p.id},[s]),d=v.useCallback(f=>{try{return r(f)}catch{}},[r]);return{db:n,error:e,actions:{get:a,put:l,putWithKey:u,remove:d}}},v5=()=>lf("storecraft_misc_cache"),x5=()=>{const{db:n,error:e,actions:{get:t,put:s,remove:r}}=lf("storecraft_query_cache"),a=v.useCallback((d,f)=>{const p=d+"_"+yn(f).toString();return t(p)},[t]),l=v.useCallback((d,f,p)=>{const g=d+"_"+yn(f).toString();return s(g,p)},[s]),u=v.useCallback((d,f)=>{try{const p=d+"_"+yn(f).toString();return r(p)}catch{}},[r]);return{db:n,error:e,actions:{get:a,put:l,remove:u}}},y5=n=>n==="shipping"?"shipping_methods":n,w5=(n,e,t,s)=>e&&!t&&s!==void 0&&s<=0&&n&&!n.vql&&!n.endAt&&!n.endBefore&&!n.startAt&&!n.startAfter,b5=(n,e,t)=>{const s=e;s.sortBy=s.sortBy??["updated_at","id"];let r=s.startAfter;return async()=>{const l={...s,startAfter:r},u=await Fr(n,t,l);return u!=null&&u.length&&(r=l.sortBy.map((d,f)=>{var p;return[d,(p=u.at(-1))==null?void 0:p[d]]})),u}},Oi={sortBy:["updated_at","id"],order:"desc",limit:5},fr=(n,e={sortBy:["updated_at","id"],order:"desc",limit:5},t=!0)=>{const{actions:{get:s,put:r}}=x5(),{actions:{get:a,put:l,putWithKey:u,remove:d}}=Uv(),{sdk:f}=bt(),p=v.useRef(e),g=v.useRef(!1),y=v.useRef(),[w,k]=v.useState(void 0),[_,C]=v.useState([]),[S,M]=v.useState(-1),[I,L]=v.useState(t),[O,K]=v.useState(!1),[E,R]=v.useState(-1),F=E==-1||E>0&&_.reduce((ne,D)=>ne+D.length,0)<E,J=Li();v.useEffect(()=>f.auth.add_sub(J),[J]);const oe=v.useCallback(async(ne=!1)=>{let D;L(!0);try{if(D=await y.current(),!Array.isArray(D))throw new Error("result is not an array");for(let $ of D)l($);ne?(M(0),C([[...D]])):(M($=>$+1),C($=>[...$,[...D]])),K(!0)}catch($){k($==null?void 0:$.code)}finally{L(!1)}return D},[]),Ne=v.useCallback(ne=>{if(!y.current)return Promise.resolve();const D=ne?1:-1;return S+D<0?Promise.resolve():S+D<_.length?(M(S+D),Promise.resolve(_[S+D])):F?oe():Promise.resolve()},[_,S,oe,F]),Ee=v.useCallback(()=>Ne(!0),[Ne]),be=v.useCallback(()=>Ne(!1),[Ne]),te=v.useCallback(async(ne=p.current,D=!0)=>{let $={...Oi,...ne};p.current=$,y.current=b5(f,$,n);let ie;D&&(ie=await s(n,$),!!ie&&Array.isArray(ie)?(M(0),C([[...ie]]),oe(!0).then(le=>{Array.isArray(le)&&r(n,$,le)})):ie=void 0),ie||(ie=await oe(!0),Array.isArray(ie)?r(n,$,ie):ie=void 0);{const{limit:ge,limitToLast:le,startAfter:se,startAt:Me,endAt:He,endBefore:Re,...pt}=$;hr(f,n,pt).then(R).catch(console.log)}return ie},[n,oe,s,r]),B=v.useCallback(async ne=>{try{return d(ne),await of(f,n,ne),await te(p.current,!1),ne}catch(D){throw k(D),L(!1),D}},[n,te]);v.useEffect(()=>{async function ne(){var ge;const D=_.flat(1).reduce((le,se)=>se.updated_at>le.updated_at?se:le,(ge=_==null?void 0:_.at(0))==null?void 0:ge.at(0)),$=`storecraft_max_updated_seen_${n}`;let ie=await a($);(D||ie)&&(D&&ie?(D.updated_at>ie.updated_at||D.updated_at==ie.updated_at&&D.id>ie.id)&&(ie=D):ie=ie??D),ie&&u($,ie)}ne()},[_,n]);const Z=v.useCallback(async()=>{const ne=`storecraft_max_updated_seen_${n}`,D=await a(ne);return D?await f.statistics.countOf(y5(n),{startAfter:[["updated_at",D.updated_at],["id",D.id]],order:"asc"})>0:!0},[]);v.useEffect(()=>{t&&S==-1&&!g.current&&te(p.current)},[]);const X=S>=0?_[S]:[];return{pages:_,page:X,loading:I,hasLoaded:O,resource_is_probably_empty:w5(p.current,O,I,X==null?void 0:X.length),resource_has_more_pages:F,error:w,sdk:f,queryCount:E,resource:n,actions:{prev:be,next:Ee,query:te,poll:Z,removeDocument:B}}};function cf(n,e,t=!0,s=!0){const{actions:{get:r,put:a,remove:l}}=Uv(),{sdk:u}=bt(),[d,f]=v.useState(!!(n&&e&&t)),[p,g]=v.useState(),[y,w]=v.useState(!1),[k,_]=v.useState(void 0),[C,S]=v.useState(void 0),M=Li();v.useEffect(()=>u.auth.add_sub(M),[M]);const I=v.useRef([n,e]);v.useEffect(()=>{I.current=[n,e]},[n,e]);const L=v.useRef(async(R=!0)=>{const F=I.current[0],J=I.current[1];if(!(F&&J))throw"no doc id";f(!0),_(void 0),S("load");try{let oe;return R&&(oe=await r(J),oe&&Mr(u,F,J).then(Ne=>{a(Ne),g(Ne)})),oe||(oe=await Mr(u,F,J),a(oe)),g(oe),w(!0),oe}catch(oe){throw console.log(oe),_(oe),oe}finally{f(!1)}}),O=v.useCallback(async(R=!0)=>{const F=I.current[0],J=I.current[1];if(!(F&&J))throw console.log("resource",F),console.log("document",J),"no doc id";f(!0),_(void 0),S("load");try{let oe;return R&&(oe=await r(J),oe&&Mr(u,F,J).then(Ne=>{a(Ne),g(Ne)})),oe||(oe=await Mr(u,F,J),a(oe)),g(oe),w(!0),oe}catch(oe){throw console.log(oe),_(oe),oe}finally{f(!1)}},[]),K=v.useCallback(async(R,...F)=>{f(!0),_(void 0),S("update");try{const J=await Fv(u,n,R),oe=await Mr(u,n,J);return g(oe),w(!0),oe}catch(J){throw _(J),console.log(JSON.stringify(J,null,2)),J}finally{f(!1)}},[n,e]),E=v.useCallback(async()=>{f(!0),_(void 0),S("delete");try{return await of(u,n,e),l(e),g(void 0),w(!0),e}catch(R){throw _(R),R}finally{f(!1)}},[n,e]);return v.useEffect(()=>{if(n==null)throw new Error("useDocument: no Collection Id");g(void 0)},[n,e]),v.useEffect(()=>{t&&O(s)},[t,O,n,e]),{doc:p,sdk:u,loading:d,hasLoaded:y,error:k,op:C,resource:n,document:e,actions:{reload:O,reload_hard:L,upsert:K,remove:E,setError:_}}}const uf=()=>{const n=Li(),{sdk:e}=bt();return v.useEffect(()=>{const t=e.auth.add_sub(n);return e.auth.reAuthenticateIfNeeded(),t},[]),{sdk:e,auth:e.auth.currentAuth,isAuthenticated:e.auth.isAuthenticated,actions:{signin:e.auth.signin,signup:e.auth.signup,signout:e.auth.signout,refresh:e.auth.reAuthenticateIfNeeded,changePassword:e.auth.changePassword,apikeys:{list:e.auth.list_api_keys_auth_users,create:e.auth.create_api_key},users:{get:e.auth.get_auth_user,remove:e.auth.remove_auth_user,list:e.auth.list_auth_users}}}},k5=(n,e)=>{const t=n;let s=Jl.get(t)??e;const r=new Set,a=u=>(r.add(u),()=>{r.delete(u)}),l=u=>{s=u,Jl.set(t,u),r.forEach(d=>d(s))};return()=>{const u=Li();v.useEffect(()=>a(u),[u]);const d=v.useCallback(f=>{typeof f=="function"&&f(s),l(f)},[]);return{state:s,setState:d}}},_5={sortBy:["updated_at","id"],order:"desc",limit:5},C5=()=>{const{sdk:n}=bt();v.useRef(!1);const[e,t]=v.useState(void 0),[s,r]=v.useState(),[a,l]=v.useState(!1),[u,d]=v.useState(!1);Li();const f=v.useCallback(async(p,g=!0)=>{p={..._5,...p};try{const y=await Fr(n,"search",p);r(y)}catch(y){t(y)}},[]);return{result:s,loading:a,hasLoaded:u,error:e,sdk:n,actions:{query:f}}},N5={darkMode:!0},j5="storecraft_dashboard_preferences",S5=k5(j5,N5);function hs(){const{state:n,setState:e}=S5(),t=v.useCallback(()=>{e({...n,darkMode:!n.darkMode})},[n]);return{darkMode:n.darkMode,toggle:t}}const E5=({...n})=>{const{darkMode:e}=hs(),t=({})=>c.jsxs("div",{className:`rounded-lg my-auto b
|
160
|
+
bg-pink-50 dark:bg-pink-50/10 w-fit text-sm
|
161
|
+
text-pink-500 -tracking-wideset
|
162
|
+
py-0 px-1 --border font-semibold`,children:[c.jsx("div",{children:"docs",className:"inline-block -translate-y-px --inline"}),c.jsx("span",{children:" 📖"})]});return c.jsxs("div",{className:`relative w-full h-16 flex flex-row
|
163
|
+
items-start
|
164
|
+
border-b
|
165
|
+
shelf-logo
|
166
|
+
text-xl font-bold
|
167
|
+
--pr-3 overflow-x-clip shadow-md`,...n,children:[e&&c.jsx("img",{src:Xa,className:"h-full p-1 opacity-80"}),!e&&c.jsx(M5,{className:`h-full object-contain rounded-xl bg-teal-400
|
168
|
+
scale-90 border-kf-600 --shadow-lg opacity-80`}),c.jsxs("div",{className:"flex flex-col justify-between h-full p-0.5",children:[c.jsx(Lv,{className:"h-[27px]"}),c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("span",{children:`v${w3.version}`,className:"tracking-wider text-sm font-light font-mono"}),c.jsx("a",{href:"https://storecraft.app/docs",target:"_blank",className:"mr-1",children:c.jsx(t,{})})]})]})]})},M5=({className:n="w-[512px] h-[512px] bg-slate-100 p-3",...e})=>c.jsx("div",{className:n,...e,children:c.jsx(Je,{className:"w-full h-full",stroke:"border-[2px]",from:"from-pink-600 dark:from-pink-500",to:"to-kf-600 dark:to-kf-500",children:c.jsx("div",{className:`w-full h-full bg-slate-100 rounded-3xl shadow-xl
|
169
|
+
flex flex-row items-center justify-center rotate-6 scale-[1.0]`,children:c.jsx("div",{className:`w-full h-full rounded-lg shadow-xl
|
170
|
+
flex flex-row items-center justify-center --opacity-80
|
171
|
+
--scale-[3.0] -rotate-`,children:c.jsx("div",{className:"w-full h-full overflow-clip rounded-xl",children:c.jsx("img",{src:b3,className:`w-full h-full object-cover scale-[1.05]
|
172
|
+
bg-teal-100 --bg-slate-300`})})})})})}),D5={xs:"480px",sm:"580px",md:"768px","md-lg":"914px",lg:"1024px",xl:"1280px","2xl":"1536px"},T5=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),G0=!T5;function I5(n){if(!n)throw new Error("Failed to create breakpoint hooks, given `screens` value is invalid.");function e(r,a=!1){const[l,u]=q.useState(a),d=q.useRef(a);return v.useEffect(()=>{if(!(G0&&"matchMedia"in window))return;function f(p){const g=n[r]??"999999px",y=window.matchMedia(`(min-width: ${g})`);d.current=y.matches,d.current!=l&&u(d.current)}return window.addEventListener("resize",f,!1),window.addEventListener("load",f,!1),window.dispatchEvent(new Event("load")),()=>{window.removeEventListener("resize",f),window.removeEventListener("load",f)}},[window,n,r,a,G0,l]),l}function t(r,a){const l=e(r);return q.useEffect(()=>a(l)),null}function s(r,a,l){const u=e(r);return q.useMemo(()=>u?a:l,[l,u,a])}return{useBreakpoint:e,useBreakpointEffect:t,useBreakpointValue:s}}const{useBreakpointValue:A5}=I5(D5),L5=({dash:{onCloseClick:n,menu:{items:e,info:t}},className:s,...r})=>{const a=A5("md",!0,!1);let l=Vr();const u=Ds(),d=v.useCallback((g,y)=>{const w=l.pathname.includes(g),k=(y==null?void 0:y.extra)??{active:"bg-pink-600"};return w?`${k==null?void 0:k.active} text-white`:"shelf-side-hover "},[l]),f=v.useCallback(g=>{g.preventDefault(),g.stopPropagation(),u("/settings")},[u]),p=v.useCallback(g=>{g.preventDefault(),!a&&n(),u("/home")},[u,a,n]);return c.jsxs("div",{className:`relative w-64 --scrollbar-none overflow-clip
|
173
|
+
flex flex-col
|
174
|
+
${s}`,children:[c.jsx(E5,{}),c.jsx(Ab,{className:`absolute bg-kf-500 text-3xl top-4 right-2
|
175
|
+
cursor-pointer transition-all duration-300 rounded-full
|
176
|
+
hover:bg-pink-400 text-white
|
177
|
+
p-1.5 hover:p-1 md:hidden`,onClick:n}),c.jsx("div",{className:"w-full flex-1 overflow-clip hover:overflow-y-auto max-h-full",children:c.jsxs("div",{className:"mt-3 pl-5 pr-1 w-full h-fit",children:[c.jsx(B0,{icon:c.jsx(f3,{className:"text-xl ml-0 --text-pink-600 "}),text:"Dashboard",className:`w-full my-2 py-2 pr-3 text-base
|
178
|
+
font-normal ${d("/home",void 0)}`,onClick:p,children:c.jsx(x3,{className:"text-lg",onClick:f})}),e.map((g,y)=>c.jsxs("div",{className:"w-full",children:[c.jsx("p",{children:g.name,className:`uppercase text-base font-light
|
179
|
+
tracking-normal text-gray-400`}),g.items.map((w,k)=>{const _=`/${W0(g.name)}/${W0(w.slug??w.name)}`;return c.jsx(Ht,{to:_,draggable:"false",children:c.jsx(B0,{icon:c.jsx("div",{className:`rounded-md border dark:border-none p-[3px]
|
180
|
+
shelf-border-color-soft `,children:w.icon}),text:w.name,className:`w-full my-px px-1.5 py-1.5 text-base
|
181
|
+
font-normal ${d(_,w)}`,onClick:C=>!a&&n()},k)},_)})]},g.name))]})})]})},Wv=1e3,pc=Wv*60,Yv=pc*60,hf=Yv*24,O5=hf*30,R5=hf*365,J0=[{millis:R5,adj:"year"},{millis:O5,adj:"month"},{millis:hf,adj:"day"},{millis:Yv,adj:"hour",singular:"about an hour ago"},{millis:pc,adj:"minute"},{millis:Wv,adj:"second"}],P5=n=>{const e=Math.max(Date.now()-new Date(n).getTime(),0);if(e<1e3)return"now";for(let t=0;t<J0.length;t++){const s=J0[t];let r=e/s.millis,a=Math.floor(r);if(a==1)return s.singular??`about a ${s.adj} ago`;if(a>1)return`${a} ${s.adj}s ago`}},Kv=(n,e=5e3,t=!0,s=Number.POSITIVE_INFINITY)=>{const r=v.useRef(void 0),a=v.useRef({count:0}),l=v.useCallback(()=>{r.current&&clearTimeout(r.current)},[]),u=v.useCallback(()=>{l(),a.current.count=1,n(1),r.current=setInterval(()=>{a.current.count+=1,n(a.current.count),a.current.count==s&&l()},e)},[l,e]);return v.useEffect(()=>(l(),t&&u(),l),[u,l]),{start:u,stop:l}},z5=({notification:n})=>{const e=Ds(),t=v.useCallback(()=>{var a;const s=(a=n==null?void 0:n.actions)==null?void 0:a.at(0),r=s==null?void 0:s.params;if(s)switch(s.type){case"route":let l=r;e(`/pages/${l.collection}/${l.document}`);break;case"url":let u=r;window.open(u.url,u.new_window?"_blank":"_self")}},[n,e,window]);return c.jsx("div",{className:`flex flex-row justify-between items-center w-full
|
182
|
+
cursor-pointer`,onClick:t,children:c.jsxs("div",{className:"w-full",children:[c.jsx(It,{className:"text-base",value:n.message}),c.jsxs("div",{className:`flex flex-row items-center w-full
|
183
|
+
justify-between mt-1`,children:[c.jsx("p",{children:P5(n.updated_at??Date.now()),className:`text-pink-500 --text-gray-400
|
184
|
+
font-semibold text-xs w-fit`}),c.jsxs("div",{className:`flex flex-row items-baseline
|
185
|
+
gap-0.5 text-xs`,children:[c.jsx("span",{children:"by",className:"inline --text-gray-500"}),c.jsx("p",{children:n.author??"unknown",className:`bg-lime-100 text-green-700
|
186
|
+
dark:bg-white/10 dark:text-green-300
|
187
|
+
dark:border-none inline
|
188
|
+
border italic rounded-md text-xs px-1`})]})]})]})})},B5=({notis:n=[],selected:e="All",onChange:t})=>{const s=v.useMemo(()=>{const a=n.reduce((l,u)=>{var d;return(d=u==null?void 0:u.search)==null||d.forEach(f=>{l.add(f)}),l},new Set);return["All",...Array.from(a)]},[n]),r=v.useCallback(a=>{t&&t(a)},[t]);return c.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:s.map(a=>c.jsx("div",{children:a,className:`text-base rounded-full px-2
|
189
|
+
cursor-pointer shelf-text-label-color py-1 box-border
|
190
|
+
${e===a?"bg-kf-50 dark:bg-white/10 shelf-border-color border ":"bg-transparent"}`,onClick:()=>r(a)},a))})},V5=({notis:n,onLoadMore:e})=>c.jsxs("div",{className:`flex flex-col gap-5 text-sm
|
191
|
+
font-normal --mt-5 max-h-max`,children:[n.map((t,s)=>c.jsx(z5,{notification:t},s)),(n==null?void 0:n.length)>0&&c.jsx(ls,{text:"Load more",onClick:e,keep_text_on_load:!0,className:`w-fit mx-auto h-12 p-3 border-b cursor-pointe
|
192
|
+
text-center text-pink-500 font-medium text-base`})]}),$5=({})=>c.jsxs("div",{className:`w-fit flex flex-row
|
193
|
+
items-center gap-1 `,children:[c.jsx(Mb,{className:"text-2xl"}),c.jsx("p",{children:"Notifications",className:"text-2xl font-bold"})]}),F5=v.forwardRef(({...n},e)=>{const[t,s]=v.useState("All"),{pages:r,actions:{next:a,query:l}}=fr("notifications",Oi,!1),u=v.useRef(l),d=v.useCallback(async()=>{u.current({limit:5},!1)},[]),{start:f}=Kv(d,pc*10,!1);v.useEffect(()=>{async function y(){await l({limit:5},!0),f()}y()},[f]);const p=v.useMemo(()=>r.flat(1),[r]);let g=v.useMemo(()=>t==="All"?p:p.filter(y=>{var w;return!!((w=y==null?void 0:y.search)!=null&&w.includes(t))}),[p,t]);return c.jsxs("div",{ref:e,className:`absolute w-[23rem] max-w-full top-full right-0
|
194
|
+
shelf-plain-card-fill h-[600px] rounded-b-xl --shadow-xl
|
195
|
+
border shadow-lg p-4
|
196
|
+
overflow-y-auto flex flex-col gap-5`,children:[c.jsx($5,{}),c.jsx(B5,{notis:p,selected:t,onChange:s}),c.jsx(V5,{notis:g,onLoadMore:a})]})});function q0(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M348.3 216.4c-5 5.1-13.3 5.1-18.4.1L269 155.8v231.3c0 7.1-5.8 12.9-13 12.9s-13-5.8-13-12.9V155.8l-60.9 60.8c-5.1 5-13.3 4.9-18.4-.1-5-5.1-5-13.2.1-18.3l83-82.4c1.2-1.1 2.5-2 4.1-2.7 1.6-.7 3.3-1 5-1 3.4 0 6.6 1.3 9.1 3.7l83 82.4c5.2 4.9 5.3 13.1.3 18.2z"}}]})(n)}function H5(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M112.4 92h77.7c7.7 0 13.9-6.2 13.9-13.9v-.2c0-7.7-6.2-13.9-13.9-13.9H77.9C70.2 64 64 70.2 64 77.9v112.2c0 7.7 6.2 13.9 13.9 13.9h.2c7.7 0 13.9-6.2 13.9-13.9v-77.7l117.1 116.3c2.6 2.6 6.1 4 9.8 4 3.7 0 7.2-1.4 9.8-4.1 5.4-5.4 5.4-14.2 0-19.6L112.4 92zM434.1 64H321.9c-7.7 0-13.9 6.2-13.9 13.9v.2c0 7.7 6.2 13.9 13.9 13.9h77.7L283.3 209.1c-5.4 5.4-5.4 14.2 0 19.6 2.6 2.6 6.1 4.1 9.8 4.1 3.7 0 7.2-1.4 9.8-4L420 112.4v77.7c0 7.7 6.2 13.9 13.9 13.9h.2c7.7 0 13.9-6.2 13.9-13.9V77.9c0-7.7-6.2-13.9-13.9-13.9zM218.9 279.2c-3.7 0-7.2 1.4-9.8 4L92 399.6v-77.7c0-7.7-6.2-13.9-13.9-13.9h-.2c-7.7 0-13.9 6.2-13.9 13.9v112.2c0 7.7 6.2 13.9 13.9 13.9h112.2c7.7 0 13.9-6.2 13.9-13.9v-.2c0-7.7-6.2-13.9-13.9-13.9h-77.7l116.3-117.1c5.4-5.4 5.4-14.2 0-19.6-2.6-2.6-6.1-4.1-9.8-4.1zM434.1 308h-.2c-7.7 0-13.9 6.2-13.9 13.9v77.7L302.9 283.3c-2.6-2.6-6.1-4-9.8-4-3.7 0-7.2 1.4-9.8 4.1-5.4 5.4-5.4 14.2 0 19.6l116.3 117h-77.7c-7.7 0-13.9 6.2-13.9 13.9v.2c0 7.7 6.2 13.9 13.9 13.9h112.2c7.7 0 13.9-6.2 13.9-13.9V321.9c0-7.7-6.2-13.9-13.9-13.9z"}}]})(n)}function U5(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M255.9 456c31.1 0 48.1-22 48.1-53h-96.3c0 31 17 53 48.2 53zM412 352.2c-15.4-20.3-45.7-32.2-45.7-123.1 0-93.3-41.2-130.8-79.6-139.8-3.6-.9-6.2-2.1-6.2-5.9v-2.9c0-13.4-11-24.7-24.4-24.6-13.4-.2-24.4 11.2-24.4 24.6v2.9c0 3.7-2.6 5-6.2 5.9-38.5 9.1-79.6 46.5-79.6 139.8 0 90.9-30.3 102.7-45.7 123.1-9.9 13.1-.5 31.8 15.9 31.8h280.1c16.3 0 25.7-18.8 15.8-31.8z"}}]})(n)}function W5(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 277.333H277.333V416h-42.666V277.333H96v-42.666h138.667V96h42.666v138.667H416v42.666z"}}]})(n)}function Y5(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"}}]})(n)}function K5(n){return ye({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 368v80h80l235.727-235.729-79.999-79.998L64 368zm377.602-217.602c8.531-8.531 8.531-21.334 0-29.865l-50.135-50.135c-8.531-8.531-21.334-8.531-29.865 0l-39.468 39.469 79.999 79.998 39.469-39.467z"}}]})(n)}const Q5=({outerClass:n="bg-white animate-bounce",innerClass:e="bg-red-500",...t})=>c.jsx("div",{...t,children:c.jsx("div",{className:`w-full h-full rounded-full p-0.5 ${n}`,children:c.jsx("div",{className:`w-full h-full rounded-full ${e}`})})}),Z5=({isOpen:n=!1,onClick:e,...t})=>{const[s,r]=v.useState(!1),{actions:{poll:a}}=fr("notifications",{limit:1}),l=v.useCallback(async()=>{const f=await a();r(f)},[a]),{stop:u,start:d}=Kv(l,pc*10,!1);return v.useEffect(()=>{n?(u(),r(!1)):d()},[n,d,u]),c.jsxs("div",{className:"relative",onClick:e,children:[c.jsx(qa,{Icon:U5,className:"h-6 w-6 cursor-pointer",...t}),c.jsx(_e,{show:s,children:c.jsx(Q5,{className:"absolute w-3 h-3 top-px right-0"})})]})},G5=({...n})=>{const{darkMode:e,toggle:t}=hs();return c.jsx("div",{className:"relative",children:c.jsx(qa,{Icon:e?Gb:Jb,className:"cursor-pointer "+(e?"h-6 w-6":"h-5 w-5"),onClick:t})})},J5=n=>{const e=v.useRef(null);return v.useEffect(()=>{const t=r=>{!e.current||e.current.contains(r.target)||n(r)},s=r=>{r.key==="Escape"&&n(r)};return document.addEventListener("click",t),document.addEventListener("keydown",s),()=>{document.removeEventListener("click",t),document.removeEventListener("keydown",s)}},[n]),e};function q5(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Bookmark_Remove"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M17.6,21.938a1.482,1.482,0,0,1-1.011-.4l-4.251-3.9a.5.5,0,0,0-.678,0L7.41,21.538a1.5,1.5,0,0,1-2.517-1.1V4.563a2.5,2.5,0,0,1,2.5-2.5h9.214a2.5,2.5,0,0,1,2.5,2.5V20.435a1.483,1.483,0,0,1-.9,1.375A1.526,1.526,0,0,1,17.6,21.938ZM12,16.5a1.5,1.5,0,0,1,1.018.395L17.269,20.8a.5.5,0,0,0,.838-.368V4.563a1.5,1.5,0,0,0-1.5-1.5H7.393a1.5,1.5,0,0,0-1.5,1.5V20.435a.5.5,0,0,0,.839.368L10.983,16.9A1.5,1.5,0,0,1,12,16.5Z"}},{tag:"path",attr:{d:"M10.23,10.84a.5.5,0,0,0,.71.71L12,10.491,13.06,11.55a.523.523,0,0,0,.71,0,.513.513,0,0,0,0-.71L12.709,9.779,13.77,8.72a.5.5,0,0,0-.71-.71c-.35.35-.7.71-1.06,1.06L10.94,8.01a.5.5,0,0,0-.71,0,.524.524,0,0,0,0,.71c.35.35.71.7,1.06,1.06Z"}}]}]}]})(n)}function X5(n){return ye({attr:{version:"1.1",id:"search",x:"0px",y:"0px",viewBox:"0 0 24 24",style:"enable-background:new 0 0 24 24;"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:`M20.031,20.79c0.46,0.46,1.17-0.25,0.71-0.7l-3.75-3.76c1.27-1.41,2.04-3.27,2.04-5.31
|
197
|
+
c0-4.39-3.57-7.96-7.96-7.96s-7.96,3.57-7.96,7.96c0,4.39,3.57,7.96,7.96,7.96c1.98,0,3.81-0.73,5.21-1.94L20.031,20.79z
|
198
|
+
M4.11,11.02c0-3.84,3.13-6.96,6.96-6.96c3.84,0,6.96,3.12,6.96,6.96c0,3.84-3.12,6.96-6.96,6.96C7.24,17.98,4.11,14.86,4.11,11.02
|
199
|
+
z`}}]}]})(n)}const Qv=(...n)=>e=>{v.useEffect(()=>{let t={};const s=()=>{const l=n.find(u=>u.every(d=>!!(t!=null&&t[d])));l&&(t={},e&&e(l))},r=l=>{t[l.key]=!0,s()},a=l=>{t[l.key]=!1};return document.addEventListener("keydown",r),document.addEventListener("keyup",a),()=>{t={},document.removeEventListener("keydown",r),document.removeEventListener("keyup",a)}},[n,e])},ek=({dash:{show:n,duration:e,unMountOnExit:t,enter:s,enterFrom:r,enterTo:a,leave:l,leaveFrom:u,leaveTo:d},children:f,className:p,...g})=>{const[y,w]=v.useState(!1),[k,_]=v.useState("hidden"),C=v.useRef({});v.useEffect(()=>(C.current.timer&&clearTimeout(C.current.timer),n?(_(`${s} block ${r}`),w(!0),setTimeout(()=>_(`${s} block ${a}`),0)):y?(_(`${l} ${u}`),setTimeout(()=>_(`${l} ${d}`),0),C.current.timer=setTimeout(()=>{w(!1),_(M=>`${M} hidden`)},e)):_("hidden"),()=>clearTimeout(C.current.timer)),[n,e]);const S=y||!t;return c.jsx(c.Fragment,{children:S&&c.jsx("div",{children:f,className:`${k} ${p}`,...g})})},Is=q.forwardRef(({children:n,...e},t)=>{const[s,r]=v.useState(!1);v.useImperativeHandle(t,()=>({show:()=>r(!0),hide:()=>r(!1),isShown:()=>s}),[s,t]);const a=v.useCallback(d=>{d.key==="Escape"&&r(!1)},[]),l=v.useRef(()=>{}),u=v.useCallback(d=>{d.preventDefault(),history.back(),r(!1)},[history]);return v.useEffect(()=>{l.current&&l.current();const d=f=>{f.stopPropagation(),f.preventDefault(),r(!1)};return l.current=()=>{window.removeEventListener("popstate",d)},s&&(history.pushState(null,document.title,location.href),window.addEventListener("popstate",d)),l.current},[s,window]),c.jsx(ek,{dash:{unMountOnExit:!0,show:s,duration:400,enter:"transition-all duration-300 ease-in-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-all duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0"},onKeyDown:a,className:`z-[100] w-full h-full
|
200
|
+
bg-teal-900/20 dark:bg-teal-900/10 backdrop-blur-sm fixed inset-0
|
201
|
+
flex flex-row justify-center items-center`,onClick:u,children:n})});function Zv(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14.5 1.5a.5.5 0 0 1 .5.5v4.8a2.5 2.5 0 0 1-2.5 2.5H2.707l3.347 3.346a.5.5 0 0 1-.708.708l-4.2-4.2a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 8.3H12.5A1.5 1.5 0 0 0 14 6.8V2a.5.5 0 0 1 .5-.5z"}}]})(n)}function tk(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 7a.5.5 0 0 1 .5.5V9H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V10H6a.5.5 0 0 1 0-1h1.5V7.5A.5.5 0 0 1 8 7z"}},{tag:"path",attr:{d:"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"}},{tag:"path",attr:{d:"M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"}}]})(n)}function nk(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M7.646 4.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V14.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3z"}}]})(n)}function sk(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.545 2.907a13.227 13.227 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 0 0-3.658 0 8.258 8.258 0 0 0-.412-.833.051.051 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019c.308-.42.582-.863.818-1.329a.05.05 0 0 0-.01-.059.051.051 0 0 0-.018-.011 8.875 8.875 0 0 1-1.248-.595.05.05 0 0 1-.02-.066.051.051 0 0 1 .015-.019c.084-.063.168-.129.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 0 1 .053.007c.08.066.164.132.248.195a.051.051 0 0 1-.004.085 8.254 8.254 0 0 1-1.249.594.05.05 0 0 0-.03.03.052.052 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.235 13.235 0 0 0 4.001-2.02.049.049 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 0 0-.02-.019Zm-8.198 7.307c-.789 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612Zm5.316 0c-.788 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612Z"}}]})(n)}function rk(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"}}]})(n)}function ik(n){return ye({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z"}}]})(n)}function ak(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m13.5 8.5-5 5"}},{tag:"path",attr:{d:"m8.5 8.5 5 5"}},{tag:"circle",attr:{cx:"11",cy:"11",r:"8"}},{tag:"path",attr:{d:"m21 21-4.3-4.3"}}]})(n)}const ok=Qv(["Meta","K"],["Meta","k"]),lk=Qv(["ArrowUp"],["ArrowDown"],["Enter"],["Escape"]),ck={collections:"/pages/collections",customers:"/pages/customers",discounts:"/pages/discounts",orders:"/pages/orders",products:"/pages/products",shipping_methods:"/pages/shipping-methods",storefronts:"/pages/storefronts",tags:"/pages/tags",posts:"/pages/posts",templates:"/apps/templates",images:"/apps/gallery/img"},uk=({onClick:n,...e})=>{const t=Ds();ok(a=>{s.current.show()});const s=v.useRef(void 0),r=v.useCallback((a,l)=>{const u=ck[a]+"/"+(l.handle??(l==null?void 0:l.id));s.current.hide(),t(u)},[t]);return c.jsxs("div",{onClick:()=>{s.current.show()},...e,children:[c.jsxs("div",{className:`rounded-md flex flex-row gap-2 p-1 items-center
|
202
|
+
border shelf-card shelf-text-minor text-sm
|
203
|
+
cursor-pointer hover:ring-pink-400 hover:ring-2`,children:[c.jsx(X5,{}),c.jsx("span",{children:"Search"}),c.jsxs("div",{className:`rounded-md border flex flex-row
|
204
|
+
items-center px-2 shelf-card`,children:[c.jsx(qb,{}),c.jsx("span",{children:"K"})]})]}),c.jsx(ff.PortalChild,{children:c.jsx(Is,{ref:s,children:c.jsx(mk,{onCancel:()=>s.current.hide(),onSelect:r})},"tomer")})]})},hk=()=>c.jsxs("div",{className:`text-lg font-normal text-gray-400 h-fit tracking-wider
|
205
|
+
flex flex-col gap-5 justify-center items-center`,children:[c.jsx(ak,{className:"text-5xl"}),"No search Results ",c.jsx("br",{}),"were found 😔"]}),dk=()=>c.jsxs("div",{className:`w-full flex flex-row items-center
|
206
|
+
gap-3 text-xs shelf-text-minor border-t
|
207
|
+
shadow-[0_-2px_5px_0px_rgba(0,0,0,0.16)]
|
208
|
+
shelf-border-color p-3`,children:[c.jsxs("div",{className:"flex flex-row items-center gap-2",children:[c.jsx("div",{className:"rounded-md border shelf-border-color px-1 py-px",children:c.jsx(Zv,{className:"text-sm "})}),c.jsx("span",{children:"to select"})]}),c.jsxs("div",{className:"flex flex-row items-center gap-2",children:[c.jsxs("div",{className:`flex flex-row items-center rounded-md
|
209
|
+
border shelf-border-color`,children:[c.jsx(q0,{className:"text-lg"}),c.jsx(q0,{className:"rotate-180 text-lg"})]}),c.jsx("span",{children:"to navigate"})]}),c.jsxs("div",{className:"flex flex-row items-center gap-1",children:[c.jsx("span",{children:"esc",className:`font-bold font-mono rounded-md
|
210
|
+
border shelf-border-color px-1`}),c.jsx("span",{children:"to close"})]})]}),fk={auth_users:"auth_users",collections:"🗂️ Collections",customers:"💁🏻♀️ Customers",discounts:"🎟️ Discounts",images:"🏞️ Images",notifications:"🔔 Notifications",orders:"🛒 Orders",products:"🛍️ Products",shipping_methods:"🚚 Shipping",storefronts:"🏪 Storefronts",tags:"⌗ tags",templates:"templates",posts:"📄 Posts"},pk=({name:n,group:e,index:t,selectedItemIndex:s,onHover:r,onClick:a,scrollIntoView:l=!0})=>{const u=v.useRef(void 0);return v.useEffect(()=>{l&&s>=0&&u.current.scrollIntoView({behavior:"instant",block:"nearest",inline:"start"})},[s,l]),c.jsxs("div",{className:"--p-3",ref:u,children:[c.jsx("span",{children:fk[n]??n,className:"font-bold text-kf-400 text-sm"}),c.jsx("div",{className:"w-full flex flex-col gap-2 mt-3 ",children:e.map((d,f)=>c.jsxs("div",{className:`h-14 w-full rounded-md p-3
|
211
|
+
shadow-sm scroll-auto
|
212
|
+
font-medium text-sm flex flex-row items-center
|
213
|
+
justify-between cursor-pointer
|
214
|
+
${s==f?"bg-kf-400 dark:bg-kf-400 text-white":"bg-slate-100 dark:bg-[rgb(41,52,69)]"}
|
215
|
+
`,onClick:p=>{a&&a(t,f)},onMouseMove:p=>{p.preventDefault(),r&&r(t,f)},children:[c.jsx("span",{children:(d==null?void 0:d.title)??(d==null?void 0:d.handle)??(d==null?void 0:d.id)??"nooop"}),c.jsx(Zv,{className:"text-xl "+(s==f?"inline":"hidden")})]},d.id))})]})},mk=({onCancel:n,onSelect:e})=>{const{result:t,loading:s,actions:{query:r}}=C5(),a=v.useMemo(()=>Object.entries(t??{}).map(_=>({group:_[1],name:_[0]})),[t]),[l,u]=v.useState({groupIndex:0,itemIndex:0}),[d,f]=v.useState(!1),p=v.useCallback(()=>{e&&e(a[l.groupIndex].name,a[l.groupIndex].group[l.itemIndex])},[e,a,l]);lk(_=>{if(a.length==0)return;const C={...l},S=_[0];S=="ArrowDown"&&(C.itemIndex+1>=a[C.groupIndex].group.length?(C.itemIndex=0,C.groupIndex+=1,C.groupIndex%=a.length):C.itemIndex+=1,u(C),f(!0)),S=="ArrowUp"&&(C.itemIndex-1<0?(C.groupIndex-=1-a.length,C.groupIndex%=a.length,C.itemIndex=a[C.groupIndex].group.length-1):C.itemIndex-=1,u(C),f(!0)),S==="Escape"&&n&&n(),S==="Enter"&&p()});const g=v.useCallback((_,C)=>{u({groupIndex:_,itemIndex:C}),f(!1)},[]),y=v.useCallback((_,C)=>{u({groupIndex:_,itemIndex:C}),e&&e(a[_].name,a[_].group[C])},[e,a]),w=v.useRef(void 0),k=v.useCallback(_=>{_==null||_.preventDefault();const C=w.current.value;r({limit:5,vql:C})},[r]);return c.jsx("div",{className:"w-full h-full relative",children:c.jsxs("div",{onClick:_=>_.stopPropagation(),className:`w-full --m-3 md:w-[35rem] --h-4/5 h-fit
|
216
|
+
shelf-plain-card-soft absolute top-20 left-1/2 -translate-x-1/2
|
217
|
+
rounded-xl --p-3 --sm:p-5 border shadow-lg --gap-5
|
218
|
+
text-base flex flex-col --overflow-hidden`,children:[c.jsxs("div",{className:"w-full h-fit flex flex-col gap-5 px-3 pt-3",children:[c.jsx("form",{autoFocus:!0,className:"w-full h-fit",tabIndex:4344,children:c.jsx(Je,{rounded:"rounded-xl",stroke:"border",children:c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("input",{onChange:k,autoFocus:!0,ref:w,type:"search",placeholder:"search",className:`w-full h-12 border shelf-input-color
|
219
|
+
shelf-border-color-soft px-3 text-xl font-medium
|
220
|
+
focus:outline-none rounded-xl`}),c.jsx(ud,{className:`text-white text-4xl mx-1 sm:mx-5
|
221
|
+
cursor-pointer`,onClick:k})]})})}),c.jsx("div",{className:"w-full h-fit ",children:c.jsx("div",{className:"flex flex-col gap-5 w-full h-fit",children:c.jsxs("div",{className:`w-full --h-full max-h-[50svh] overflow-y-auto
|
222
|
+
px-1 flex flex-col gap-5 pb-5`,children:[c.jsx(_e,{show:a.length==0&&!s,children:c.jsx(hk,{})}),a.map((_,C)=>c.jsx(pk,{name:_.name,group:_.group,index:C,scrollIntoView:d,selectedItemIndex:l.groupIndex==C?l.itemIndex:-1,onHover:g,onClick:y},_.name))]})})})]}),c.jsx(dk,{})]})})},gk=({menuOpen:n,className:e="w-full",onMenuClick:t,...s})=>{var p,g;const[r,a]=v.useState(!1),{auth:l,actions:{signout:u}}=uf(),d=J5(()=>{a(!1)}),f=v.useCallback(y=>{y.preventDefault(),y.stopPropagation(),a(w=>!w)},[]);return c.jsx("nav",{className:e,...s,children:c.jsxs("div",{className:"relative w-full flex flex-row h-full justify-between items-center ",children:[c.jsx(Rb,{className:`text-kf-500 dark:text-kf-400/70 text-4xl top-4 right-4
|
223
|
+
cursor-pointer --md:hidden hover-text-pink-600
|
224
|
+
rounded-full transition-all duration-300
|
225
|
+
hover:bg-pink-400
|
226
|
+
hover:text-white dark:hover:text-white
|
227
|
+
p-1.5 hover:p-1
|
228
|
+
${n?"rotate-0":"rotate-180"}`,onClick:t}),c.jsxs("div",{children:[c.jsx("span",{children:"Hi "}),c.jsx("span",{children:(g=(p=l==null?void 0:l.access_token)==null?void 0:p.claims)==null?void 0:g.firstname,className:"font-semibold "})]}),c.jsxs("div",{className:"flex flex-row gap-3 items-center",children:[c.jsx(uk,{}),c.jsx(qa,{Icon:Qb,onClick:u,className:"text-2xl cursor-pointer"}),c.jsx(Z5,{isOpen:r,onClick:f}),c.jsx(G5,{})]}),c.jsx(_e,{show:r,children:c.jsx(F5,{ref:d})})]})})},vk=(n=100,e=!0)=>{const t=v.useRef(null),s=v.useRef({}),[r,a]=v.useState(e);return v.useEffect(()=>{t.current.scrollTo({top:0,left:0,behavior:"smooth"})},[]),v.useEffect(()=>(s.current.state=0,s.current.latestPos=void 0,s.current.latestTurn=void 0,t.current.onscroll=function(f){var p=t.current.scrollTop;const g=s.current;if(g.latestPos===void 0&&(g.latestPos=p),g.latestTurn===void 0&&(g.latestTurn=p),p==0){a(!0);return}p-g.latestPos>0?(g.state!=0&&(g.latestTurn=p,g.state=0),p-g.latestTurn>=100&&a(!1)):(g.state!=1&&(g.latestTurn=p,g.state=1),p-g.latestTurn<=-100&&a(!0)),g.latestPos=p},()=>{t.current&&(t.current.onscroll=void 0)}),[]),{ref_scroll_element:t,open:r}};function xk(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7 3C8.86384 3 10.4299 4.27477 10.874 6H19V8H10.874C10.4299 9.72523 8.86384 11 7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3ZM7 9C8.10457 9 9 8.10457 9 7C9 5.89543 8.10457 5 7 5C5.89543 5 5 5.89543 5 7C5 8.10457 5.89543 9 7 9Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M17 20C15.1362 20 13.5701 18.7252 13.126 17H5V15H13.126C13.5701 13.2748 15.1362 12 17 12C19.2091 12 21 13.7909 21 16C21 18.2091 19.2091 20 17 20ZM17 18C18.1046 18 19 17.1046 19 16C19 14.8954 18.1046 14 17 14C15.8954 14 15 14.8954 15 16C15 17.1046 15.8954 18 17 18Z",fill:"currentColor"}}]})(n)}function yk(n){return ye({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3V9H21V3H3ZM19 5H5V7H19V5Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M3 11V21H11V11H3ZM9 13H5V19H9V13Z",fill:"currentColor"}},{tag:"path",attr:{d:"M21 11H13V13H21V11Z",fill:"currentColor"}},{tag:"path",attr:{d:"M13 15H21V17H13V15Z",fill:"currentColor"}},{tag:"path",attr:{d:"M21 19H13V21H21V19Z",fill:"currentColor"}}]})(n)}const df=()=>{const[n,e]=v.useState(0);return v.useCallback(()=>{e(s=>++s)},[])},wk=()=>{const n=new Map;let e;const t=()=>{v.useState(void 0);const a=df();return v.useEffect(()=>{e=a},[a]),v.Children.toArray(n.values())};function s(a=Number.MAX_SAFE_INTEGER){return Math.floor(Math.random()*a)}return{Portal:t,PortalChild:({children:a})=>{const l=v.useRef(s());return v.useEffect(()=>{n.set(l.current.toString(),a),e==null||e()}),a}}},bk={info:{name:"Storecraft",icon:c.jsx(Fb,{className:"inline"})},items:[{name:"pages",items:[{name:"Storefronts",icon:c.jsx(ev,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-cyan-400"}},{name:"Customers",icon:c.jsx(K1,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-cyan-400"}},{name:"Tags",icon:c.jsx(W1,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-pink-400"}},{name:"Products",icon:c.jsx(Yn,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-400"}},{name:"Collections",icon:c.jsx(tv,{}),extra:{active:"bg-pink-600",hover:"hover:bg-kf-400"}},{name:"Orders",icon:c.jsx(H1,{}),extra:{active:"bg-pink-600 dark:bg-pink-600/90",hover:"hover:bg-amber-200"}},{name:"Payment Gateways",icon:c.jsx(Zb,{}),extra:{active:"bg-pink-600",hover:"hover:bg-amber-200"}},{name:"Discounts",icon:c.jsx(Q1,{className:"--text-lg"}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-200"}},{name:"Shipping Methods",icon:c.jsx(nv,{className:"--text-lg"}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-200"}},{name:"Blog",slug:"posts",icon:c.jsx(Nb,{}),extra:{active:"bg-orange-400 dark:bg-orange-400/70",hover:"hover:bg-teal-200"}}]},{name:"apps",items:[{name:"Gallery",icon:c.jsx(Hb,{className:"--scale-125"}),extra:{active:"bg-yellow-400 dark:bg-yellow-400/80",hover:"hover:bg-teal-200"}},{name:"Templates",icon:c.jsx(yk,{className:"--scale-125"}),extra:{active:"bg-red-400 dark:bg-red-400/80",hover:"hover:bg-teal-200"}},{name:"Extensions",icon:c.jsx(Tb,{className:"--scale-125"}),extra:{active:"bg-teal-400 dark:bg-teal-400/80",hover:"hover:bg-teal-200"}}]}]},ff=wk(),yl=({children:n=void 0,className:e,...t})=>{const{open:s,ref_scroll_element:r}=vk(100,!0),[a,l]=v.useState(!0),{darkMode:u}=hs(),d=v.useCallback(()=>{l(g=>!g)},[]),f=v.useCallback(()=>{l(!1)},[]),p=s?"translate-y-0":"-translate-y-full";return c.jsx("div",{className:`w-full h-full ${u?"dark":""}`,"data-color-mode":u?"dark":"light",children:c.jsxs("div",{className:`relative flex flex-row font-inter
|
229
|
+
shelf-body-bg
|
230
|
+
w-full h-full sm:h-full ${e}
|
231
|
+
`,...t,ssstyle:{height:"100dvh"},children:[c.jsx(ff.Portal,{}),c.jsx("div",{className:`fixed left-0 top-0 w-full h-full bg-teal-900/10
|
232
|
+
z-50 transition-all md:hidden
|
233
|
+
${a?"block backdrop-blur-sm":"hidden backdrop-blur-0"}`,onClick:f}),c.jsx("div",{className:`absolute left-0 top-0 md:relative flex flex-shrink-0
|
234
|
+
w-fit h-full overflow-x-clip overflow-hidden
|
235
|
+
z-50
|
236
|
+
md:transition-max-width md:duration-500 ease-in-out
|
237
|
+
${a?"max-w-[72rem]":"max-w-0 "}`,children:c.jsx(Je,{className:"my-3 ml-3 shadow-sm",rounded:"rounded-tr-3xl rounded-tl-md rounded-br-3xl",stroke:"border-r pt-1 border-b-[16px]",from:"from-kf-400 dark:from-kf-500",to:"to-pink-400 dark:to-pink-500",children:c.jsx(L5,{dash:{menu:bk,onCloseClick:f},className:`bg-gradient-to-r
|
238
|
+
from-slate-100 to-white
|
239
|
+
dark:from-slate-800 dark:to-slate-800
|
240
|
+
shadow-md
|
241
|
+
shadow-gray-800 h-full rounded-tr-3xl
|
242
|
+
rounded-br-3xl`})})}),c.jsxs("div",{className:`relative flex-1 h-full flex flex-col
|
243
|
+
mx-0 sm:mx-3 md:mx-6 overflow-auto`,children:[c.jsx(gk,{className:`w-full
|
244
|
+
shelf-action-bar
|
245
|
+
h-12 backdrop-blur-sm
|
246
|
+
absolute left-0 top-0 z-40
|
247
|
+
border-b dark:border-b-slate-700
|
248
|
+
px-3
|
249
|
+
transition-transform
|
250
|
+
duration-500 ${p}`,onMenuClick:d,menuOpen:a}),c.jsx("div",{ref:r,className:`relative w-full
|
251
|
+
h-full pt-16 pb-5 overflow-y-auto scrollbar-none `,children:c.jsxs("div",{className:`bg-gradient-to-tl from-kf-50/50 to-slate-50/10
|
252
|
+
dark:from-transparent/0 dark:to-transparent/0
|
253
|
+
px-3 sm:px-5 lg:px-10 py-3 sm:py-5 lg:py-8
|
254
|
+
rounded-3xl text-sm font-medium
|
255
|
+
border dark:border-slate-700 w-full h-fit
|
256
|
+
min-h-full overflow-x-auto`,children:[c.jsx(ub,{}),n]})})]})]})})},Ta=({className:n="bg-gradient-to-r from-kf-600 to-pink-400",...e})=>c.jsx("span",{...e,className:n+" text-transparent bg-clip-text w-fit p-0.5"}),xh=({label:n="",Icon:e,className:t,iconClassName:s="inline-block text-kf-500",...r})=>c.jsxs("div",{className:`text-3xl mb-5 shelf-text-title-color
|
257
|
+
shelf-border-color w-full overflow-auto
|
258
|
+
border-b pb-2 flex flex-row gap-2 text-kf-500
|
259
|
+
${t}`,...r,children:[e&&c.jsx(e,{className:s}),c.jsxs("div",{className:"flex flex-row items-baseline text-3xl/none",children:[c.jsx(Ta,{children:n.slice(0,3),className:`bg-gradient-to-r from-kf-600 to-pink-500
|
260
|
+
dark:from-kf-600 dark:to-pink-500 --text-5xl
|
261
|
+
uppercase font-medium italic tracking-tighter
|
262
|
+
inline-flex --tracking-wide`}),c.jsx(Ta,{children:n.slice(3),className:`bg-gradient-to-r from-pink-600 to-pink-500
|
263
|
+
dark:from-pink-600 dark:to-pink-500 --text-5xl
|
264
|
+
uppercase font-extralight italic tracking-tighter --hidden --text-[34px]
|
265
|
+
-translate-x-[3px]
|
266
|
+
inline-flex --tracking-wide`})]})]});function at(n){var e=n.width,t=n.height;if(e<0)throw new Error("Negative width is not allowed for Size");if(t<0)throw new Error("Negative height is not allowed for Size");return{width:e,height:t}}function Ar(n,e){return n.width===e.width&&n.height===e.height}var kk=function(){function n(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return n.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(n.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),n.prototype.subscribe=function(e){var t=this,s={next:e};return this._observers.push(s),{unsubscribe:function(){t._observers=t._observers.filter(function(r){return r!==s})}}},n.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(e,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},n.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},n.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},n.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},n}();function _k(n){return new kk(n)}var Ck=function(){function n(e,t,s){var r;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=at({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=t??function(a){return a},this._allowResizeObserver=(r=s==null?void 0:s.allowResizeObserver)!==null&&r!==void 0?r:!0,this._chooseAndInitObserver()}return n.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw new Error("Object is disposed");(e=this._canvasElementResizeObserver)===null||e===void 0||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)===null||t===void 0||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(n.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bitmapSize",{get:function(){return at({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),n.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=at(e),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},n.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(n.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),n.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},n.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},n.prototype._resizeBitmap=function(e){var t=this.bitmapSize;Ar(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},n.prototype._emitBitmapSizeChanged=function(e,t){var s=this;this._bitmapSizeChangedListeners.forEach(function(r){return r.call(s,e,t)})},n.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,s=at(this._transformBitmapSize(e,this._canvasElementClientSize)),r=Ar(this.bitmapSize,s)?null:s;t===null&&r===null||t!==null&&r!==null&&Ar(t,r)||(this._suggestedBitmapSize=r,this._emitSuggestedBitmapSizeChanged(t,r))},n.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var s=this;this._suggestedBitmapSizeChangedListeners.forEach(function(r){return r.call(s,e,t)})},n.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}jk().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},n.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=X0(this._canvasElement);if(t===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=_k(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},n.prototype._invalidateBitmapSize=function(){var e,t;if(this._canvasElement!==null){var s=X0(this._canvasElement);if(s!==null){var r=(t=(e=this._devicePixelRatioObservable)===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:s.devicePixelRatio,a=this._canvasElement.getClientRects(),l=a[0]!==void 0?Sk(a[0],r):at({width:this._canvasElementClientSize.width*r,height:this._canvasElementClientSize.height*r});this._suggestNewBitmapSize(l)}}},n.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var s=t.find(function(l){return l.target===e._canvasElement});if(!(!s||!s.devicePixelContentBoxSize||!s.devicePixelContentBoxSize[0])){var r=s.devicePixelContentBoxSize[0],a=at({width:r.inlineSize,height:r.blockSize});e._suggestNewBitmapSize(a)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},n}();function Nk(n,e){return new Ck(n,e.transform,e.options)}function X0(n){return n.ownerDocument.defaultView}function jk(){return new Promise(function(n){var e=new ResizeObserver(function(t){n(t.every(function(s){return"devicePixelContentBoxSize"in s})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function Sk(n,e){return at({width:Math.round(n.left*e+n.width*e)-Math.round(n.left*e),height:Math.round(n.top*e+n.height*e)-Math.round(n.top*e)})}var Ek=function(){function n(e,t,s){if(t.width===0||t.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=t,s.width===0||s.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=s,this._context=e}return n.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},n.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(n.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),n}();function Or(n,e){var t=n.canvasElementClientSize;if(t.width===0||t.height===0)return null;var s=n.bitmapSize;if(s.width===0||s.height===0)return null;var r=n.canvasElement.getContext("2d",e);return r===null?null:new Ek(r,t,s)}/*!
|
267
|
+
* @license
|
268
|
+
* TradingView Lightweight Charts™ v5.0.5
|
269
|
+
* Copyright (c) 2025 TradingView, Inc.
|
270
|
+
* Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
|
271
|
+
*/const Mk={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var eg,tg;function Rr(n,e){const t={0:[],1:[n.lineWidth,n.lineWidth],2:[2*n.lineWidth,2*n.lineWidth],3:[6*n.lineWidth,6*n.lineWidth],4:[n.lineWidth,4*n.lineWidth]}[e];n.setLineDash(t)}function Gv(n,e,t,s){n.beginPath();const r=n.lineWidth%2?.5:0;n.moveTo(t,e+r),n.lineTo(s,e+r),n.stroke()}function Jt(n,e){if(!n)throw new Error("Assertion failed"+(e?": "+e:""))}function cn(n){if(n===void 0)throw new Error("Value is undefined");return n}function me(n){if(n===null)throw new Error("Value is null");return n}function Tr(n){return me(cn(n))}(function(n){n[n.Simple=0]="Simple",n[n.WithSteps=1]="WithSteps",n[n.Curved=2]="Curved"})(eg||(eg={})),function(n){n[n.Solid=0]="Solid",n[n.Dotted=1]="Dotted",n[n.Dashed=2]="Dashed",n[n.LargeDashed=3]="LargeDashed",n[n.SparseDotted=4]="SparseDotted"}(tg||(tg={}));class Et{constructor(){this.t=[]}i(e,t,s){const r={h:e,l:t,o:s===!0};this.t.push(r)}_(e){const t=this.t.findIndex(s=>e===s.h);t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter(t=>t.l!==e)}p(e,t,s){const r=[...this.t];this.t=this.t.filter(a=>!a.o),r.forEach(a=>a.h(e,t,s))}v(){return this.t.length>0}m(){this.t=[]}}function wn(n,...e){for(const t of e)for(const s in t)t[s]!==void 0&&Object.prototype.hasOwnProperty.call(t,s)&&!["__proto__","constructor","prototype"].includes(s)&&(typeof t[s]!="object"||n[s]===void 0||Array.isArray(t[s])?n[s]=t[s]:wn(n[s],t[s]));return n}function Mi(n){return typeof n=="number"&&isFinite(n)}function Va(n){return typeof n=="number"&&n%1==0}function eo(n){return typeof n=="string"}function wl(n){return typeof n=="boolean"}function Es(n){const e=n;if(!e||typeof e!="object")return e;let t,s,r;for(s in t=Array.isArray(e)?[]:{},e)e.hasOwnProperty(s)&&(r=e[s],t[s]=r&&typeof r=="object"?Es(r):r);return t}function Dk(n){return n!==null}function _d(n){return n===null?void 0:n}const Jv="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function ql(n,e,t){return e===void 0&&(e=Jv),`${t=t!==void 0?`${t} `:""}${n}px ${e}`}class Tk{constructor(e){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=e}N(){const e=this.M,t=this.W(),s=this.F();return e.P===t&&e.T===s||(e.P=t,e.T=s,e.k=ql(t,s),e.A=2.5/12*t,e.V=e.A,e.I=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}W(){return this.O.N().layout.fontSize}F(){return this.O.N().layout.fontFamily}}function yh(n){return n<0?0:n>255?255:Math.round(n)||0}function ng(n){return .199*n[0]+.687*n[1]+.114*n[2]}let Ik=class{constructor(e,t){this.q=new Map,this.Y=e,t&&(this.q=t)}j(e,t){if(e==="transparent")return e;const s=this.Z(e),r=s[3];return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${t*r})`}K(e){const t=this.Z(e);return{X:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,G:ng(t)>160?"black":"white"}}J(e){return ng(this.Z(e))}tt(e,t,s){const[r,a,l,u]=this.Z(e),[d,f,p,g]=this.Z(t),y=[yh(r+s*(d-r)),yh(a+s*(f-a)),yh(l+s*(p-l)),(w=u+s*(g-u),w<=0||w>1?Math.min(Math.max(w,0),1):Math.round(1e4*w)/1e4)];var w;return`rgba(${y[0]}, ${y[1]}, ${y[2]}, ${y[3]})`}Z(e){const t=this.q.get(e);if(t)return t;const s=function(l){const u=document.createElement("div");u.style.display="none",document.body.appendChild(u),u.style.color=l;const d=window.getComputedStyle(u).color;return document.body.removeChild(u),d}(e),r=s.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!r){if(this.Y.length)for(const l of this.Y){const u=l(e);if(u)return this.q.set(e,u),u}throw new Error(`Failed to parse color: ${e}`)}const a=[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),r[4]?parseFloat(r[4]):1];return this.q.set(e,a),a}};class qv{constructor(){this.it=[]}st(e){this.it=e}nt(e,t,s){this.it.forEach(r=>{r.nt(e,t,s)})}}class pr{nt(e,t,s){e.useBitmapCoordinateSpace(r=>this.et(r,t,s))}}let Ak=class extends pr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:s}){if(this.rt===null||this.rt.lt===null)return;const r=this.rt.lt,a=this.rt,l=Math.max(1,Math.floor(t))%2/2,u=d=>{e.beginPath();for(let f=r.to-1;f>=r.from;--f){const p=a.ot[f],g=Math.round(p._t*t)+l,y=p.ut*s,w=d*s+l;e.moveTo(g,y),e.arc(g,y,w,0,2*Math.PI)}e.fill()};a.ct>0&&(e.fillStyle=a.dt,u(a.ft+a.ct)),e.fillStyle=a.vt,u(a.ft)}};function Lk(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const Ok={from:0,to:1};class Rk{constructor(e,t,s){this.Mt=new qv,this.bt=[],this.xt=[],this.St=!0,this.O=e,this.Ct=t,this.yt=s,this.Mt.st(this.bt)}Pt(e){this.kt(),this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Mt}kt(){const e=this.yt.Dt();e.length!==this.bt.length&&(this.xt=e.map(Lk),this.bt=this.xt.map(t=>{const s=new Ak;return s.ht(t),s}),this.Mt.st(this.bt))}Rt(){const e=this.Ct.N().mode===2||!this.Ct.Vt(),t=this.yt.It(),s=this.Ct.Bt(),r=this.O.At();this.kt(),t.forEach((a,l)=>{const u=this.xt[l],d=a.Et(s),f=a.zt();!e&&d!==null&&a.Vt()&&f!==null?(u.vt=d.Lt,u.ft=d.ft,u.ct=d.Ot,u.ot[0].gt=d.gt,u.ot[0].ut=a.Wt().Nt(d.gt,f.Ft),u.dt=d.Ht??this.O.Ut(u.ot[0].ut/a.Wt().$t()),u.ot[0].wt=s,u.ot[0]._t=r.qt(s),u.lt=Ok):u.lt=null})}}class Pk extends pr{constructor(e){super(),this.Yt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:s,verticalPixelRatio:r}){if(this.Yt===null)return;const a=this.Yt.jt.Vt,l=this.Yt.Zt.Vt;if(!a&&!l)return;const u=Math.round(this.Yt._t*s),d=Math.round(this.Yt.ut*r);e.lineCap="butt",a&&u>=0&&(e.lineWidth=Math.floor(this.Yt.jt.ct*s),e.strokeStyle=this.Yt.jt.R,e.fillStyle=this.Yt.jt.R,Rr(e,this.Yt.jt.Kt),function(f,p,g,y){f.beginPath();const w=f.lineWidth%2?.5:0;f.moveTo(p+w,g),f.lineTo(p+w,y),f.stroke()}(e,u,0,t.height)),l&&d>=0&&(e.lineWidth=Math.floor(this.Yt.Zt.ct*r),e.strokeStyle=this.Yt.Zt.R,e.fillStyle=this.Yt.Zt.R,Rr(e,this.Yt.Zt.Kt),Gv(e,d,0,t.width))}}class zk{constructor(e,t){this.St=!0,this.Xt={jt:{ct:1,Kt:0,R:"",Vt:!1},Zt:{ct:1,Kt:0,R:"",Vt:!1},_t:0,ut:0},this.Gt=new Pk(this.Xt),this.Jt=e,this.yt=t}Pt(){this.St=!0}Tt(e){return this.St&&(this.Rt(),this.St=!1),this.Gt}Rt(){const e=this.Jt.Vt(),t=this.yt.Qt().N().crosshair,s=this.Xt;if(t.mode===2)return s.Zt.Vt=!1,void(s.jt.Vt=!1);s.Zt.Vt=e&&this.Jt.ti(this.yt),s.jt.Vt=e&&this.Jt.ii(),s.Zt.ct=t.horzLine.width,s.Zt.Kt=t.horzLine.style,s.Zt.R=t.horzLine.color,s.jt.ct=t.vertLine.width,s.jt.Kt=t.vertLine.style,s.jt.R=t.vertLine.color,s._t=this.Jt.si(),s.ut=this.Jt.ni()}}function mc(n,e,t,s,r,a){n.save(),n.globalCompositeOperation="copy",n.fillStyle=a,n.fillRect(e,t,s,r),n.restore()}function sg(n,e,t,s,r,a){n.beginPath(),n.roundRect?n.roundRect(e,t,s,r,a):(n.lineTo(e+s-a[1],t),a[1]!==0&&n.arcTo(e+s,t,e+s,t+a[1],a[1]),n.lineTo(e+s,t+r-a[2]),a[2]!==0&&n.arcTo(e+s,t+r,e+s-a[2],t+r,a[2]),n.lineTo(e+a[3],t+r),a[3]!==0&&n.arcTo(e,t+r,e,t+r-a[3],a[3]),n.lineTo(e,t+a[0]),a[0]!==0&&n.arcTo(e,t,e+a[0],t,a[0]))}function rg(n,e,t,s,r,a,l=0,u=[0,0,0,0],d=""){if(n.save(),!l||!d||d===a)return sg(n,e,t,s,r,u),n.fillStyle=a,n.fill(),void n.restore();const f=l/2;var p;sg(n,e+f,t+f,s-l,r-l,(p=-f,u.map(g=>g===0?g:g+p))),a!=="transparent"&&(n.fillStyle=a,n.fill()),d!=="transparent"&&(n.lineWidth=l,n.strokeStyle=d,n.closePath(),n.stroke()),n.restore()}function Xv(n,e,t,s,r,a,l){n.save(),n.globalCompositeOperation="copy";const u=n.createLinearGradient(0,0,0,r);u.addColorStop(0,a),u.addColorStop(1,l),n.fillStyle=u,n.fillRect(e,t,s,r),n.restore()}class ig{constructor(e,t){this.ht(e,t)}ht(e,t){this.Yt=e,this.ei=t}$t(e,t){return this.Yt.Vt?e.P+e.A+e.V:0}nt(e,t,s,r){if(!this.Yt.Vt||this.Yt.ri.length===0)return;const a=this.Yt.R,l=this.ei.X,u=e.useBitmapCoordinateSpace(d=>{const f=d.context;f.font=t.k;const p=this.hi(d,t,s,r),g=p.ai;return p.li?rg(f,g.oi,g._i,g.ui,g.ci,l,g.di,[g.ft,0,0,g.ft],l):rg(f,g.fi,g._i,g.ui,g.ci,l,g.di,[0,g.ft,g.ft,0],l),this.Yt.pi&&(f.fillStyle=a,f.fillRect(g.fi,g.mi,g.wi-g.fi,g.gi)),this.Yt.Mi&&(f.fillStyle=t.D,f.fillRect(p.li?g.bi-g.di:0,g._i,g.di,g.xi-g._i)),p});e.useMediaCoordinateSpace(({context:d})=>{const f=u.Si;d.font=t.k,d.textAlign=u.li?"right":"left",d.textBaseline="middle",d.fillStyle=a,d.fillText(this.Yt.ri,f.Ci,(f._i+f.xi)/2+f.yi)})}hi(e,t,s,r){const{context:a,bitmapSize:l,mediaSize:u,horizontalPixelRatio:d,verticalPixelRatio:f}=e,p=this.Yt.pi||!this.Yt.Pi?t.C:0,g=this.Yt.ki?t.S:0,y=t.A+this.ei.Ti,w=t.V+this.ei.Ri,k=t.I,_=t.B,C=this.Yt.ri,S=t.P,M=s.Di(a,C),I=Math.ceil(s.Vi(a,C)),L=S+y+w,O=t.S+k+_+I+p,K=Math.max(1,Math.floor(f));let E=Math.round(L*f);E%2!=K%2&&(E+=1);const R=g>0?Math.max(1,Math.floor(g*d)):0,F=Math.round(O*d),J=Math.round(p*d),oe=this.ei.Ii??this.ei.Bi,Ne=Math.round(oe*f)-Math.floor(.5*f),Ee=Math.floor(Ne+K/2-E/2),be=Ee+E,te=r==="right",B=te?u.width-g:g,Z=te?l.width-R:R;let X,ne,D;return te?(X=Z-F,ne=Z-J,D=B-p-k-g):(X=Z+F,ne=Z+J,D=B+p+k),{li:te,ai:{_i:Ee,mi:Ne,xi:be,ui:F,ci:E,ft:2*d,di:R,oi:X,fi:Z,wi:ne,gi:K,bi:l.width},Si:{_i:Ee/f,xi:be/f,Ci:D,yi:M}}}}let gc=class{constructor(e){this.Ai={Bi:0,X:"#000",Ri:0,Ti:0},this.Ei={ri:"",Vt:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",Mi:!1,ki:!1},this.zi={ri:"",Vt:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",Mi:!0,ki:!0},this.St=!0,this.Li=new(e||ig)(this.Ei,this.Ai),this.Oi=new(e||ig)(this.zi,this.Ai)}ri(){return this.Ni(),this.Ei.ri}Bi(){return this.Ni(),this.Ai.Bi}Pt(){this.St=!0}$t(e,t=!1){return Math.max(this.Li.$t(e,t),this.Oi.$t(e,t))}Wi(){return this.Ai.Ii||0}Fi(e){this.Ai.Ii=e}Hi(){return this.Ni(),this.Ei.Vt||this.zi.Vt}Ui(){return this.Ni(),this.Ei.Vt}Tt(e){return this.Ni(),this.Ei.pi=this.Ei.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Li}$i(){return this.Ni(),this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Oi}Ni(){this.St&&(this.Ei.pi=!0,this.zi.pi=!1,this.qi(this.Ei,this.zi,this.Ai))}};class Bk extends gc{constructor(e,t,s){super(),this.Jt=e,this.Yi=t,this.ji=s}qi(e,t,s){if(e.Vt=!1,this.Jt.N().mode===2)return;const r=this.Jt.N().horzLine;if(!r.labelVisible)return;const a=this.Yi.zt();if(!this.Jt.Vt()||this.Yi.Zi()||a===null)return;const l=this.Yi.Ki().K(r.labelBackgroundColor);s.X=l.X,e.R=l.G;const u=2/12*this.Yi.P();s.Ti=u,s.Ri=u;const d=this.ji(this.Yi);s.Bi=d.Bi,e.ri=this.Yi.Xi(d.gt,a),e.Vt=!0}}const Vk=/[1-9]/g;class ex{constructor(){this.Yt=null}ht(e){this.Yt=e}nt(e,t){if(this.Yt===null||this.Yt.Vt===!1||this.Yt.ri.length===0)return;const s=e.useMediaCoordinateSpace(({context:y})=>(y.font=t.k,Math.round(t.Gi.Vi(y,me(this.Yt).ri,Vk))));if(s<=0)return;const r=t.Ji,a=s+2*r,l=a/2,u=this.Yt.Qi;let d=this.Yt.Bi,f=Math.floor(d-l)+.5;f<0?(d+=Math.abs(0-f),f=Math.floor(d-l)+.5):f+a>u&&(d-=Math.abs(u-(f+a)),f=Math.floor(d-l)+.5);const p=f+a,g=Math.ceil(0+t.S+t.C+t.A+t.P+t.V);e.useBitmapCoordinateSpace(({context:y,horizontalPixelRatio:w,verticalPixelRatio:k})=>{const _=me(this.Yt);y.fillStyle=_.X;const C=Math.round(f*w),S=Math.round(0*k),M=Math.round(p*w),I=Math.round(g*k),L=Math.round(2*w);if(y.beginPath(),y.moveTo(C,S),y.lineTo(C,I-L),y.arcTo(C,I,C+L,I,L),y.lineTo(M-L,I),y.arcTo(M,I,M,I-L,L),y.lineTo(M,S),y.fill(),_.pi){const O=Math.round(_.Bi*w),K=S,E=Math.round((K+t.C)*k);y.fillStyle=_.R;const R=Math.max(1,Math.floor(w)),F=Math.floor(.5*w);y.fillRect(O-F,K,R,E-K)}}),e.useMediaCoordinateSpace(({context:y})=>{const w=me(this.Yt),k=0+t.S+t.C+t.A+t.P/2;y.font=t.k,y.textAlign="left",y.textBaseline="middle",y.fillStyle=w.R;const _=t.Gi.Di(y,"Apr0");y.translate(f+r,k+_),y.fillText(w.ri,0,0)})}}let $k=class{constructor(e,t,s){this.St=!0,this.Gt=new ex,this.Xt={Vt:!1,X:"#4c525e",R:"white",ri:"",Qi:0,Bi:NaN,pi:!0},this.Ct=e,this.ts=t,this.ji=s}Pt(){this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Gt.ht(this.Xt),this.Gt}Rt(){const e=this.Xt;if(e.Vt=!1,this.Ct.N().mode===2)return;const t=this.Ct.N().vertLine;if(!t.labelVisible)return;const s=this.ts.At();if(s.Zi())return;e.Qi=s.Qi();const r=this.ji();if(r===null)return;e.Bi=r.Bi;const a=s.ss(this.Ct.Bt());e.ri=s.ns(me(a)),e.Vt=!0;const l=this.ts.Ki().K(t.labelBackgroundColor);e.X=l.X,e.R=l.G,e.pi=s.N().ticksVisible}};class tx{constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(e){this.rs=e}Wt(){return this.es}_s(e){this.es=e}us(e){return[]}cs(){return[]}Vt(){return!0}}var Cd;(function(n){n[n.Normal=0]="Normal",n[n.Magnet=1]="Magnet",n[n.Hidden=2]="Hidden",n[n.MagnetOHLC=3]="MagnetOHLC"})(Cd||(Cd={}));class Fk extends tx{constructor(e,t){super(),this.yt=null,this.ds=NaN,this.fs=0,this.ps=!1,this.vs=new Map,this.ws=!1,this.gs=new WeakMap,this.Ms=new WeakMap,this.bs=NaN,this.xs=NaN,this.Ss=NaN,this.Cs=NaN,this.ts=e,this.ys=t,this.Ps=((r,a)=>l=>{const u=a(),d=r();if(l===me(this.yt).ks())return{gt:d,Bi:u};{const f=me(l.zt());return{gt:l.Ts(u,f),Bi:u}}})(()=>this.ds,()=>this.xs);const s=((r,a)=>()=>{const l=this.ts.At().Rs(r()),u=a();return l&&Number.isFinite(u)?{wt:l,Bi:u}:null})(()=>this.fs,()=>this.si());this.Ds=new $k(this,e,s)}N(){return this.ys}Vs(e,t){this.Ss=e,this.Cs=t}Is(){this.Ss=NaN,this.Cs=NaN}Bs(){return this.Ss}As(){return this.Cs}Es(e,t,s){this.ws||(this.ws=!0),this.ps=!0,this.zs(e,t,s)}Bt(){return this.fs}si(){return this.bs}ni(){return this.xs}Vt(){return this.ps}Ls(){this.ps=!1,this.Os(),this.ds=NaN,this.bs=NaN,this.xs=NaN,this.yt=null,this.Is(),this.Ns()}Ws(e){let t=this.gs.get(e);t||(t=new zk(this,e),this.gs.set(e,t));let s=this.Ms.get(e);return s||(s=new Rk(this.ts,this,e),this.Ms.set(e,s)),[t,s]}ti(e){return e===this.yt&&this.ys.horzLine.visible}ii(){return this.ys.vertLine.visible}Fs(e,t){this.ps&&this.yt===e||this.vs.clear();const s=[];return this.yt===e&&s.push(this.Hs(this.vs,t,this.Ps)),s}cs(){return this.ps?[this.Ds]:[]}Us(){return this.yt}Ns(){this.ts.$s().forEach(e=>{var t,s;(t=this.gs.get(e))==null||t.Pt(),(s=this.Ms.get(e))==null||s.Pt()}),this.vs.forEach(e=>e.Pt()),this.Ds.Pt()}qs(e){return e&&!e.ks().Zi()?e.ks():null}zs(e,t,s){this.Ys(e,t,s)&&this.Ns()}Ys(e,t,s){const r=this.bs,a=this.xs,l=this.ds,u=this.fs,d=this.yt,f=this.qs(s);this.fs=e,this.bs=isNaN(e)?NaN:this.ts.At().qt(e),this.yt=s;const p=f!==null?f.zt():null;return f!==null&&p!==null?(this.ds=t,this.xs=f.Nt(t,p)):(this.ds=NaN,this.xs=NaN),r!==this.bs||a!==this.xs||u!==this.fs||l!==this.ds||d!==this.yt}Os(){const e=this.ts.js().map(s=>s.Ks().Zs()).filter(Dk),t=e.length===0?null:Math.max(...e);this.fs=t!==null?t:NaN}Hs(e,t,s){let r=e.get(t);return r===void 0&&(r=new Bk(this,t,s),e.set(t,r)),r}}function vc(n){return n==="left"||n==="right"}class $t{constructor(e){this.Xs=new Map,this.Gs=[],this.Js=e}Qs(e,t){const s=function(r,a){return r===void 0?a:{tn:Math.max(r.tn,a.tn),sn:r.sn||a.sn}}(this.Xs.get(e),t);this.Xs.set(e,s)}nn(){return this.Js}en(e){const t=this.Xs.get(e);return t===void 0?{tn:this.Js}:{tn:Math.max(this.Js,t.tn),sn:t.sn}}rn(){this.hn(),this.Gs=[{an:0}]}ln(e){this.hn(),this.Gs=[{an:1,Ft:e}]}_n(e){this.un(),this.Gs.push({an:5,Ft:e})}hn(){this.un(),this.Gs.push({an:6})}cn(){this.hn(),this.Gs=[{an:4}]}dn(e){this.hn(),this.Gs.push({an:2,Ft:e})}fn(e){this.hn(),this.Gs.push({an:3,Ft:e})}pn(){return this.Gs}vn(e){for(const t of e.Gs)this.mn(t);this.Js=Math.max(this.Js,e.Js),e.Xs.forEach((t,s)=>{this.Qs(s,t)})}static wn(){return new $t(2)}static gn(){return new $t(3)}mn(e){switch(e.an){case 0:this.rn();break;case 1:this.ln(e.Ft);break;case 2:this.dn(e.Ft);break;case 3:this.fn(e.Ft);break;case 4:this.cn();break;case 5:this._n(e.Ft);break;case 6:this.un()}}un(){const e=this.Gs.findIndex(t=>t.an===5);e!==-1&&this.Gs.splice(e,1)}}const ag=".";function Ms(n,e){if(!Mi(n))return"n/a";if(!Va(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return e===0?n.toString():("0000000000000000"+n.toString()).slice(-e)}class xc{constructor(e,t){if(t||(t=1),Mi(e)&&Va(e)||(e=100),e<0)throw new TypeError("invalid base");this.Yi=e,this.Mn=t,this.bn()}format(e){const t=e<0?"−":"";return e=Math.abs(e),t+this.xn(e)}bn(){if(this.Sn=0,this.Yi>0&&this.Mn>0){let e=this.Yi;for(;e>1;)e/=10,this.Sn++}}xn(e){const t=this.Yi/this.Mn;let s=Math.floor(e),r="";const a=this.Sn!==void 0?this.Sn:NaN;if(t>1){let l=+(Math.round(e*t)-s*t).toFixed(this.Sn);l>=t&&(l-=t,s+=1),r=ag+Ms(+l.toFixed(this.Sn)*this.Mn,a)}else s=Math.round(s*t)/t,a>0&&(r=ag+Ms(0,a));return s.toFixed(0)+r}}class nx extends xc{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class Hk{constructor(e){this.Cn=e}format(e){let t="";return e<0&&(t="-",e=-e),e<995?t+this.yn(e):e<999995?t+this.yn(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this.yn(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this.yn(e/1e9)+"B")}yn(e){let t;const s=Math.pow(10,this.Cn);return t=(e=Math.round(e*s)/s)>=1e-15&&e<1?e.toFixed(this.Cn).replace(/\.?0+$/,""):String(e),t.replace(/(\.[1-9]*)0+$/,(r,a)=>a)}}const Uk=/[2-9]/g;class Xl{constructor(e=50){this.Pn=0,this.kn=1,this.Tn=1,this.Rn={},this.Dn=new Map,this.Vn=e}In(){this.Pn=0,this.Dn.clear(),this.kn=1,this.Tn=1,this.Rn={}}Vi(e,t,s){return this.Bn(e,t,s).width}Di(e,t,s){const r=this.Bn(e,t,s);return((r.actualBoundingBoxAscent||0)-(r.actualBoundingBoxDescent||0))/2}Bn(e,t,s){const r=s||Uk,a=String(t).replace(r,"0");if(this.Dn.has(a))return cn(this.Dn.get(a)).An;if(this.Pn===this.Vn){const u=this.Rn[this.Tn];delete this.Rn[this.Tn],this.Dn.delete(u),this.Tn++,this.Pn--}e.save(),e.textBaseline="middle";const l=e.measureText(a);return e.restore(),l.width===0&&t.length||(this.Dn.set(a,{An:l,En:this.kn}),this.Rn[this.kn]=a,this.Pn++,this.kn++),l}}class Wk{constructor(e){this.zn=null,this.M=null,this.Ln="right",this.On=e}Nn(e,t,s){this.zn=e,this.M=t,this.Ln=s}nt(e){this.M!==null&&this.zn!==null&&this.zn.nt(e,this.M,this.On,this.Ln)}}class sx{constructor(e,t,s){this.Wn=e,this.On=new Xl(50),this.Fn=t,this.O=s,this.W=-1,this.Gt=new Wk(this.On)}Tt(){const e=this.O.Hn(this.Fn);if(e===null)return null;const t=e.Un(this.Fn)?e.$n():this.Fn.Wt();if(t===null)return null;const s=e.qn(t);if(s==="overlay")return null;const r=this.O.Yn();return r.P!==this.W&&(this.W=r.P,this.On.In()),this.Gt.Nn(this.Wn.$i(),r,s),this.Gt}}class Yk extends pr{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}jn(e,t){var l;if(!((l=this.Yt)!=null&&l.Vt))return null;const{ut:s,ct:r,Zn:a}=this.Yt;return t>=s-r-7&&t<=s+r+7?{Kn:this.Yt,Zn:a}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:s,verticalPixelRatio:r}){if(this.Yt===null||this.Yt.Vt===!1)return;const a=Math.round(this.Yt.ut*r);a<0||a>t.height||(e.lineCap="butt",e.strokeStyle=this.Yt.R,e.lineWidth=Math.floor(this.Yt.ct*s),Rr(e,this.Yt.Kt),Gv(e,a,0,t.width))}}class pf{constructor(e){this.Xn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Kt:0,Vt:!1},this.Gn=new Yk,this.St=!0,this.Jn=e,this.Qn=e.Qt(),this.Gn.ht(this.Xn)}Pt(){this.St=!0}Tt(){return this.Jn.Vt()?(this.St&&(this.te(),this.St=!1),this.Gn):null}}class Kk extends pf{constructor(e){super(e)}te(){this.Xn.Vt=!1;const e=this.Jn.Wt(),t=e.ie().ie;if(t!==2&&t!==3)return;const s=this.Jn.N();if(!s.baseLineVisible||!this.Jn.Vt())return;const r=this.Jn.zt();r!==null&&(this.Xn.Vt=!0,this.Xn.ut=e.Nt(r.Ft,r.Ft),this.Xn.R=s.baseLineColor,this.Xn.ct=s.baseLineWidth,this.Xn.Kt=s.baseLineStyle)}}class Qk extends pr{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}se(){return this.Yt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:s}){const r=this.Yt;if(r===null)return;const a=Math.max(1,Math.floor(t)),l=a%2/2,u=Math.round(r.ne.x*t)+l,d=r.ne.y*s;e.fillStyle=r.ee,e.beginPath();const f=Math.max(2,1.5*r.re)*t;e.arc(u,d,f,0,2*Math.PI,!1),e.fill(),e.fillStyle=r.he,e.beginPath(),e.arc(u,d,r.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=a,e.strokeStyle=r.ae,e.beginPath(),e.arc(u,d,r.ft*t+a/2,0,2*Math.PI,!1),e.stroke()}}const Zk=[{le:0,oe:.25,_e:4,ue:10,ce:.25,de:0,fe:.4,pe:.8},{le:.25,oe:.525,_e:10,ue:14,ce:0,de:0,fe:.8,pe:0},{le:.525,oe:1,_e:14,ue:14,ce:0,de:0,fe:0,pe:0}];class Gk{constructor(e){this.Gt=new Qk,this.St=!0,this.ve=!0,this.me=performance.now(),this.we=this.me-1,this.ge=e}Me(){this.we=this.me-1,this.Pt()}be(){if(this.Pt(),this.ge.N().lastPriceAnimation===2){const e=performance.now(),t=this.we-e;if(t>0)return void(t<650&&(this.we+=2600));this.me=e,this.we=e+2600}}Pt(){this.St=!0}xe(){this.ve=!0}Vt(){return this.ge.N().lastPriceAnimation!==0}Se(){switch(this.ge.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.we}}Tt(){return this.St?(this.Rt(),this.St=!1,this.ve=!1):this.ve&&(this.Ce(),this.ve=!1),this.Gt}Rt(){this.Gt.ht(null);const e=this.ge.Qt().At(),t=e.ye(),s=this.ge.zt();if(t===null||s===null)return;const r=this.ge.Pe(!0);if(r.ke||!t.Te(r.Re))return;const a={x:e.qt(r.Re),y:this.ge.Wt().Nt(r.gt,s.Ft)},l=r.R,u=this.ge.N().lineWidth,d=this.De(this.Ve(),l);this.Gt.ht({ee:l,re:u,he:d.he,ae:d.ae,ft:d.ft,ne:a})}Ce(){const e=this.Gt.se();if(e!==null){const t=this.De(this.Ve(),e.ee);e.he=t.he,e.ae=t.ae,e.ft=t.ft}}Ve(){return this.Se()?performance.now()-this.me:2599}Ie(e,t,s,r){const a=s+(r-s)*t;return this.ge.Qt().Ki().j(e,a)}De(e,t){const s=e%2600/2600;let r;for(const f of Zk)if(s>=f.le&&s<=f.oe){r=f;break}Jt(r!==void 0,"Last price animation internal logic error");const a=(s-r.le)/(r.oe-r.le);return{he:this.Ie(t,a,r.ce,r.de),ae:this.Ie(t,a,r.fe,r.pe),ft:(l=a,u=r._e,d=r.ue,u+(d-u)*l)};var l,u,d}}class Jk extends pf{constructor(e){super(e)}te(){const e=this.Xn;e.Vt=!1;const t=this.Jn.N();if(!t.priceLineVisible||!this.Jn.Vt())return;const s=this.Jn.Pe(t.priceLineSource===0);s.ke||(e.Vt=!0,e.ut=s.Bi,e.R=this.Jn.Be(s.R),e.ct=t.priceLineWidth,e.Kt=t.priceLineStyle)}}class qk extends gc{constructor(e){super(),this.Jt=e}qi(e,t,s){e.Vt=!1,t.Vt=!1;const r=this.Jt;if(!r.Vt())return;const a=r.N(),l=a.lastValueVisible,u=r.Ae()!=="",d=a.seriesLastValueMode===0,f=r.Pe(!1);if(f.ke)return;l&&(e.ri=this.Ee(f,l,d),e.Vt=e.ri.length!==0),(u||d)&&(t.ri=this.ze(f,l,u,d),t.Vt=t.ri.length>0);const p=r.Be(f.R),g=this.Jt.Qt().Ki().K(p);s.X=g.X,s.Bi=f.Bi,t.Ht=r.Qt().Ut(f.Bi/r.Wt().$t()),e.Ht=p,e.R=g.G,t.R=g.G}ze(e,t,s,r){let a="";const l=this.Jt.Ae();return s&&l.length!==0&&(a+=`${l} `),t&&r&&(a+=this.Jt.Wt().Le()?e.Oe:e.Ne),a.trim()}Ee(e,t,s){return t?s?this.Jt.Wt().Le()?e.Ne:e.Oe:e.ri:""}}function og(n,e,t,s){const r=Number.isFinite(e),a=Number.isFinite(t);return r&&a?n(e,t):r||a?r?e:t:s}class ln{constructor(e,t){this.We=e,this.Fe=t}He(e){return e!==null&&this.We===e.We&&this.Fe===e.Fe}Ue(){return new ln(this.We,this.Fe)}$e(){return this.We}qe(){return this.Fe}Ye(){return this.Fe-this.We}Zi(){return this.Fe===this.We||Number.isNaN(this.Fe)||Number.isNaN(this.We)}vn(e){return e===null?this:new ln(og(Math.min,this.$e(),e.$e(),-1/0),og(Math.max,this.qe(),e.qe(),1/0))}je(e){if(!Mi(e)||this.Fe-this.We===0)return;const t=.5*(this.Fe+this.We);let s=this.Fe-t,r=this.We-t;s*=e,r*=e,this.Fe=t+s,this.We=t+r}Ze(e){Mi(e)&&(this.Fe+=e,this.We+=e)}Ke(){return{minValue:this.We,maxValue:this.Fe}}static Xe(e){return e===null?null:new ln(e.minValue,e.maxValue)}}class ec{constructor(e,t){this.Ge=e,this.Je=t||null}Qe(){return this.Ge}tr(){return this.Je}Ke(){return{priceRange:this.Ge===null?null:this.Ge.Ke(),margins:this.Je||void 0}}static Xe(e){return e===null?null:new ec(ln.Xe(e.priceRange),e.margins)}}class Xk extends pf{constructor(e,t){super(e),this.ir=t}te(){const e=this.Xn;e.Vt=!1;const t=this.ir.N();if(!this.Jn.Vt()||!t.lineVisible)return;const s=this.ir.sr();s!==null&&(e.Vt=!0,e.ut=s,e.R=t.color,e.ct=t.lineWidth,e.Kt=t.lineStyle,e.Zn=this.ir.N().id)}}class e_ extends gc{constructor(e,t){super(),this.ge=e,this.ir=t}qi(e,t,s){e.Vt=!1,t.Vt=!1;const r=this.ir.N(),a=r.axisLabelVisible,l=r.title!=="",u=this.ge;if(!a||!u.Vt())return;const d=this.ir.sr();if(d===null)return;l&&(t.ri=r.title,t.Vt=!0),t.Ht=u.Qt().Ut(d/u.Wt().$t()),e.ri=this.nr(r.price),e.Vt=!0;const f=this.ge.Qt().Ki().K(r.axisLabelColor||r.color);s.X=f.X;const p=r.axisLabelTextColor||f.G;e.R=p,t.R=p,s.Bi=d}nr(e){const t=this.ge.zt();return t===null?"":this.ge.Wt().Xi(e,t.Ft)}}class t_{constructor(e,t){this.ge=e,this.ys=t,this.er=new Xk(e,this),this.Wn=new e_(e,this),this.rr=new sx(this.Wn,e,e.Qt())}hr(e){wn(this.ys,e),this.Pt(),this.ge.Qt().ar()}N(){return this.ys}lr(){return this.er}_r(){return this.rr}ur(){return this.Wn}Pt(){this.er.Pt(),this.Wn.Pt()}sr(){const e=this.ge,t=e.Wt();if(e.Qt().At().Zi()||t.Zi())return null;const s=e.zt();return s===null?null:t.Nt(this.ys.price,s.Ft)}}class n_ extends tx{constructor(e){super(),this.ts=e}Qt(){return this.ts}}const s_={Bar:(n,e,t,s)=>{const r=e.upColor,a=e.downColor,l=me(n(t,s)),u=Tr(l.Ft[0])<=Tr(l.Ft[3]);return{cr:l.R??(u?r:a)}},Candlestick:(n,e,t,s)=>{const r=e.upColor,a=e.downColor,l=e.borderUpColor,u=e.borderDownColor,d=e.wickUpColor,f=e.wickDownColor,p=me(n(t,s)),g=Tr(p.Ft[0])<=Tr(p.Ft[3]);return{cr:p.R??(g?r:a),dr:p.Ht??(g?l:u),pr:p.vr??(g?d:f)}},Custom:(n,e,t,s)=>({cr:me(n(t,s)).R??e.color}),Area:(n,e,t,s)=>{const r=me(n(t,s));return{cr:r.vt??e.lineColor,vt:r.vt??e.lineColor,mr:r.mr??e.topColor,wr:r.wr??e.bottomColor}},Baseline:(n,e,t,s)=>{const r=me(n(t,s));return{cr:r.Ft[3]>=e.baseValue.price?e.topLineColor:e.bottomLineColor,gr:r.gr??e.topLineColor,Mr:r.Mr??e.bottomLineColor,br:r.br??e.topFillColor1,Sr:r.Sr??e.topFillColor2,Cr:r.Cr??e.bottomFillColor1,yr:r.yr??e.bottomFillColor2}},Line:(n,e,t,s)=>{const r=me(n(t,s));return{cr:r.R??e.color,vt:r.R??e.color}},Histogram:(n,e,t,s)=>({cr:me(n(t,s)).R??e.color})};class r_{constructor(e){this.Pr=(t,s)=>s!==void 0?s.Ft:this.ge.Ks().kr(t),this.ge=e,this.Tr=s_[e.Rr()]}Dr(e,t){return this.Tr(this.Pr,this.ge.N(),e,t)}}function rx(n,e,t,s,r=0,a=e.length){let l=a-r;for(;0<l;){const u=l>>1,d=r+u;s(e[d],t)===n?(r=d+1,l-=u+1):l=u}return r}const Di=rx.bind(null,!0),ix=rx.bind(null,!1);var lg;(function(n){n[n.NearestLeft=-1]="NearestLeft",n[n.None=0]="None",n[n.NearestRight=1]="NearestRight"})(lg||(lg={}));const tr=30;class i_{constructor(){this.Vr=[],this.Ir=new Map,this.Br=new Map,this.Ar=[]}Er(){return this.zr()>0?this.Vr[this.Vr.length-1]:null}Lr(){return this.zr()>0?this.Or(0):null}Zs(){return this.zr()>0?this.Or(this.Vr.length-1):null}zr(){return this.Vr.length}Zi(){return this.zr()===0}Te(e){return this.Nr(e,0)!==null}kr(e){return this.Wr(e)}Wr(e,t=0){const s=this.Nr(e,t);return s===null?null:{...this.Fr(s),Re:this.Or(s)}}Hr(){return this.Vr}Ur(e,t,s){if(this.Zi())return null;let r=null;for(const a of s)r=bl(r,this.$r(e,t,a));return r}ht(e){this.Br.clear(),this.Ir.clear(),this.Vr=e,this.Ar=e.map(t=>t.Re)}qr(){return this.Ar}Or(e){return this.Vr[e].Re}Fr(e){return this.Vr[e]}Nr(e,t){const s=this.Yr(e);if(s===null&&t!==0)switch(t){case-1:return this.jr(e);case 1:return this.Zr(e);default:throw new TypeError("Unknown search mode")}return s}jr(e){let t=this.Kr(e);return t>0&&(t-=1),t!==this.Vr.length&&this.Or(t)<e?t:null}Zr(e){const t=this.Xr(e);return t!==this.Vr.length&&e<this.Or(t)?t:null}Yr(e){const t=this.Kr(e);return t===this.Vr.length||e<this.Vr[t].Re?null:t}Kr(e){return Di(this.Vr,e,(t,s)=>t.Re<s)}Xr(e){return ix(this.Vr,e,(t,s)=>t.Re>s)}Gr(e,t,s){let r=null;for(let a=e;a<t;a++){const l=this.Vr[a].Ft[s];Number.isNaN(l)||(r===null?r={Jr:l,Qr:l}:(l<r.Jr&&(r.Jr=l),l>r.Qr&&(r.Qr=l)))}return r}$r(e,t,s){if(this.Zi())return null;let r=null;const a=me(this.Lr()),l=me(this.Zs()),u=Math.max(e,a),d=Math.min(t,l),f=Math.ceil(u/tr)*tr,p=Math.max(f,Math.floor(d/tr)*tr);{const y=this.Kr(u),w=this.Xr(Math.min(d,f,t));r=bl(r,this.Gr(y,w,s))}let g=this.Ir.get(s);g===void 0&&(g=new Map,this.Ir.set(s,g));for(let y=Math.max(f+1,u);y<p;y+=tr){const w=Math.floor(y/tr);let k=g.get(w);if(k===void 0){const _=this.Kr(w*tr),C=this.Xr((w+1)*tr-1);k=this.Gr(_,C,s),g.set(w,k)}r=bl(r,k)}{const y=this.Kr(p),w=this.Xr(d);r=bl(r,this.Gr(y,w,s))}return r}}function bl(n,e){return n===null?e:e===null?n:{Jr:Math.min(n.Jr,e.Jr),Qr:Math.max(n.Qr,e.Qr)}}class a_{constructor(e){this.th=e}nt(e,t,s){this.th.draw(e)}ih(e,t,s){var r,a;(a=(r=this.th).drawBackground)==null||a.call(r,e)}}class o_{constructor(e){this.Dn=null,this.sh=e}Tt(){var s;const e=this.sh.renderer();if(e===null)return null;if(((s=this.Dn)==null?void 0:s.nh)===e)return this.Dn.eh;const t=new a_(e);return this.Dn={nh:e,eh:t},t}rh(){var e,t;return((t=(e=this.sh).zOrder)==null?void 0:t.call(e))??"normal"}}class ax{constructor(e){this.hh=null,this.ah=e}oh(){return this.ah}Ns(){var e,t;(t=(e=this.ah).updateAllViews)==null||t.call(e)}Ws(){var s,r,a;const e=((r=(s=this.ah).paneViews)==null?void 0:r.call(s))??[];if(((a=this.hh)==null?void 0:a.nh)===e)return this.hh.eh;const t=e.map(l=>new o_(l));return this.hh={nh:e,eh:t},t}jn(e,t){var s,r;return((r=(s=this.ah).hitTest)==null?void 0:r.call(s,e,t))??null}}let l_=class extends ax{us(){return[]}};class c_{constructor(e){this.th=e}nt(e,t,s){this.th.draw(e)}ih(e,t,s){var r,a;(a=(r=this.th).drawBackground)==null||a.call(r,e)}}class cg{constructor(e){this.Dn=null,this.sh=e}Tt(){var s;const e=this.sh.renderer();if(e===null)return null;if(((s=this.Dn)==null?void 0:s.nh)===e)return this.Dn.eh;const t=new c_(e);return this.Dn={nh:e,eh:t},t}rh(){var e,t;return((t=(e=this.sh).zOrder)==null?void 0:t.call(e))??"normal"}}function ox(n){var e,t,s;return{ri:n.text(),Bi:n.coordinate(),Ii:(e=n.fixedCoordinate)==null?void 0:e.call(n),R:n.textColor(),X:n.backColor(),Vt:((t=n.visible)==null?void 0:t.call(n))??!0,pi:((s=n.tickVisible)==null?void 0:s.call(n))??!0}}class u_{constructor(e,t){this.Gt=new ex,this._h=e,this.uh=t}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...ox(this._h)}),this.Gt}}class h_ extends gc{constructor(e,t){super(),this._h=e,this.Yi=t}qi(e,t,s){const r=ox(this._h);s.X=r.X,e.R=r.R;const a=2/12*this.Yi.P();s.Ti=a,s.Ri=a,s.Bi=r.Bi,s.Ii=r.Ii,e.ri=r.ri,e.Vt=r.Vt,e.pi=r.pi}}class d_ extends ax{constructor(e,t){super(e),this.dh=null,this.fh=null,this.ph=null,this.mh=null,this.ge=t}cs(){var r,a,l;const e=((a=(r=this.ah).timeAxisViews)==null?void 0:a.call(r))??[];if(((l=this.dh)==null?void 0:l.nh)===e)return this.dh.eh;const t=this.ge.Qt().At(),s=e.map(u=>new u_(u,t));return this.dh={nh:e,eh:s},s}Fs(){var r,a,l;const e=((a=(r=this.ah).priceAxisViews)==null?void 0:a.call(r))??[];if(((l=this.fh)==null?void 0:l.nh)===e)return this.fh.eh;const t=this.ge.Wt(),s=e.map(u=>new h_(u,t));return this.fh={nh:e,eh:s},s}wh(){var s,r,a;const e=((r=(s=this.ah).priceAxisPaneViews)==null?void 0:r.call(s))??[];if(((a=this.ph)==null?void 0:a.nh)===e)return this.ph.eh;const t=e.map(l=>new cg(l));return this.ph={nh:e,eh:t},t}gh(){var s,r,a;const e=((r=(s=this.ah).timeAxisPaneViews)==null?void 0:r.call(s))??[];if(((a=this.mh)==null?void 0:a.nh)===e)return this.mh.eh;const t=e.map(l=>new cg(l));return this.mh={nh:e,eh:t},t}Mh(e,t){var s,r;return((r=(s=this.ah).autoscaleInfo)==null?void 0:r.call(s,e,t))??null}}function wh(n,e,t,s){n.forEach(r=>{e(r).forEach(a=>{a.rh()===t&&s.push(a)})})}function bh(n){return n.Ws()}function f_(n){return n.wh()}function p_(n){return n.gh()}const m_=["Area","Line","Baseline"];class yc extends n_{constructor(e,t,s,r,a){super(e),this.Yt=new i_,this.er=new Jk(this),this.bh=[],this.xh=new Kk(this),this.Sh=null,this.Ch=null,this.yh=null,this.Ph=[],this.ys=s,this.kh=t;const l=new qk(this);this.vs=[l],this.rr=new sx(l,this,e),m_.includes(this.kh)&&(this.Sh=new Gk(this)),this.Th(),this.sh=r(this,this.Qt(),a)}m(){this.yh!==null&&clearTimeout(this.yh)}Be(e){return this.ys.priceLineColor||e}Pe(e){const t={ke:!0},s=this.Wt();if(this.Qt().At().Zi()||s.Zi()||this.Yt.Zi())return t;const r=this.Qt().At().ye(),a=this.zt();if(r===null||a===null)return t;let l,u;if(e){const g=this.Yt.Er();if(g===null)return t;l=g,u=g.Re}else{const g=this.Yt.Wr(r.bi(),-1);if(g===null||(l=this.Yt.kr(g.Re),l===null))return t;u=g.Re}const d=l.Ft[3],f=this.Rh().Dr(u,{Ft:l}),p=s.Nt(d,a.Ft);return{ke:!1,gt:d,ri:s.Xi(d,a.Ft),Oe:s.Dh(d),Ne:s.Vh(d,a.Ft),R:f.cr,Bi:p,Re:u}}Rh(){return this.Ch!==null||(this.Ch=new r_(this)),this.Ch}N(){return this.ys}hr(e){const t=e.priceScaleId;t!==void 0&&t!==this.ys.priceScaleId&&this.Qt().Ih(this,t),wn(this.ys,e),e.priceFormat!==void 0&&(this.Th(),this.Qt().Bh()),this.Qt().Ah(this),this.Qt().Eh(),this.sh.Pt("options")}ht(e,t){this.Yt.ht(e),this.sh.Pt("data"),this.Sh!==null&&(t&&t.zh?this.Sh.be():e.length===0&&this.Sh.Me());const s=this.Qt().Hn(this);this.Qt().Lh(s),this.Qt().Ah(this),this.Qt().Eh(),this.Qt().ar()}Oh(e){const t=new t_(this,e);return this.bh.push(t),this.Qt().Ah(this),t}Nh(e){const t=this.bh.indexOf(e);t!==-1&&this.bh.splice(t,1),this.Qt().Ah(this)}Wh(){return this.bh}Rr(){return this.kh}zt(){const e=this.Fh();return e===null?null:{Ft:e.Ft[3],Hh:e.wt}}Fh(){const e=this.Qt().At().ye();if(e===null)return null;const t=e.Uh();return this.Yt.Wr(t,1)}Ks(){return this.Yt}$h(e){const t=this.Yt.kr(e);return t===null?null:this.kh==="Bar"||this.kh==="Candlestick"||this.kh==="Custom"?{qh:t.Ft[0],Yh:t.Ft[1],jh:t.Ft[2],Zh:t.Ft[3]}:t.Ft[3]}Kh(e){const t=[];wh(this.Ph,bh,"top",t);const s=this.Sh;return s!==null&&s.Vt()&&(this.yh===null&&s.Se()&&(this.yh=setTimeout(()=>{this.yh=null,this.Qt().Xh()},0)),s.xe(),t.unshift(s)),t}Ws(){const e=[];this.Gh()||e.push(this.xh),e.push(this.sh,this.er);const t=this.bh.map(s=>s.lr());return e.push(...t),wh(this.Ph,bh,"normal",e),e}Jh(){return this.Qh(bh,"bottom")}ta(e){return this.Qh(f_,e)}ia(e){return this.Qh(p_,e)}sa(e,t){return this.Ph.map(s=>s.jn(e,t)).filter(s=>s!==null)}us(){return[this.rr,...this.bh.map(e=>e._r())]}Fs(e,t){if(t!==this.es&&!this.Gh())return[];const s=[...this.vs];for(const r of this.bh)s.push(r.ur());return this.Ph.forEach(r=>{s.push(...r.Fs())}),s}cs(){const e=[];return this.Ph.forEach(t=>{e.push(...t.cs())}),e}Mh(e,t){if(this.ys.autoscaleInfoProvider!==void 0){const s=this.ys.autoscaleInfoProvider(()=>{const r=this.na(e,t);return r===null?null:r.Ke()});return ec.Xe(s)}return this.na(e,t)}ea(){return this.ys.priceFormat.minMove}ra(){return this.ha}Ns(){var e;this.sh.Pt();for(const t of this.vs)t.Pt();for(const t of this.bh)t.Pt();this.er.Pt(),this.xh.Pt(),(e=this.Sh)==null||e.Pt(),this.Ph.forEach(t=>t.Ns())}Wt(){return me(super.Wt())}Et(e){if(!((this.kh==="Line"||this.kh==="Area"||this.kh==="Baseline")&&this.ys.crosshairMarkerVisible))return null;const t=this.Yt.kr(e);return t===null?null:{gt:t.Ft[3],ft:this.aa(),Ht:this.la(),Ot:this.oa(),Lt:this._a(e)}}Ae(){return this.ys.title}Vt(){return this.ys.visible}ua(e){this.Ph.push(new d_(e,this))}ca(e){this.Ph=this.Ph.filter(t=>t.oh()!==e)}da(){if(this.kh==="Custom")return e=>this.sh.fa(e)}pa(){if(this.kh==="Custom")return e=>this.sh.va(e)}ma(){return this.Yt.qr()}Gh(){return!vc(this.Wt().wa())}na(e,t){if(!Va(e)||!Va(t)||this.Yt.Zi())return null;const s=this.kh==="Line"||this.kh==="Area"||this.kh==="Baseline"||this.kh==="Histogram"?[3]:[2,1],r=this.Yt.Ur(e,t,s);let a=r!==null?new ln(r.Jr,r.Qr):null,l=null;if(this.Rr()==="Histogram"){const u=this.ys.base,d=new ln(u,u);a=a!==null?a.vn(d):d}return this.Ph.forEach(u=>{const d=u.Mh(e,t);if(d!=null&&d.priceRange){const f=new ln(d.priceRange.minValue,d.priceRange.maxValue);a=a!==null?a.vn(f):f}d!=null&&d.margins&&(l=d.margins)}),new ec(a,l)}aa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerRadius}return 0}la(){switch(this.kh){case"Line":case"Area":case"Baseline":{const e=this.ys.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}oa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerBorderWidth}return 0}_a(e){switch(this.kh){case"Line":case"Area":case"Baseline":{const t=this.ys.crosshairMarkerBackgroundColor;if(t.length!==0)return t}}return this.Rh().Dr(e).cr}Th(){switch(this.ys.priceFormat.type){case"custom":this.ha={format:this.ys.priceFormat.formatter};break;case"volume":this.ha=new Hk(this.ys.priceFormat.precision);break;case"percent":this.ha=new nx(this.ys.priceFormat.precision);break;default:{const e=Math.pow(10,this.ys.priceFormat.precision);this.ha=new xc(e,this.ys.priceFormat.minMove*e)}}this.es!==null&&this.es.ga()}Qh(e,t){const s=[];return wh(this.Ph,e,t,s),s}}const g_=[3],v_=[0,1,2,3];class x_{constructor(e){this.ys=e}Ma(e,t,s){let r=e;if(this.ys.mode===0)return r;const a=s.ks(),l=a.zt();if(l===null)return r;const u=a.Nt(e,l),d=s.ba().filter(p=>p instanceof yc).reduce((p,g)=>{if(s.Un(g)||!g.Vt())return p;const y=g.Wt(),w=g.Ks();if(y.Zi()||!w.Te(t))return p;const k=w.kr(t);if(k===null)return p;const _=Tr(g.zt()),C=this.ys.mode===3?v_:g_;return p.concat(C.map(S=>y.Nt(k.Ft[S],_.Ft)))},[]);if(d.length===0)return r;d.sort((p,g)=>Math.abs(p-u)-Math.abs(g-u));const f=d[0];return r=a.Ts(f,l),r}}class y_ extends pr{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:s,verticalPixelRatio:r}){if(this.Yt===null)return;const a=Math.max(1,Math.floor(s));e.lineWidth=a,function(l,u){l.save(),l.lineWidth%2&&l.translate(.5,.5),u(),l.restore()}(e,()=>{const l=me(this.Yt);if(l.xa){e.strokeStyle=l.Sa,Rr(e,l.Ca),e.beginPath();for(const u of l.ya){const d=Math.round(u.Pa*s);e.moveTo(d,-a),e.lineTo(d,t.height+a)}e.stroke()}if(l.ka){e.strokeStyle=l.Ta,Rr(e,l.Ra),e.beginPath();for(const u of l.Da){const d=Math.round(u.Pa*r);e.moveTo(-a,d),e.lineTo(t.width+a,d)}e.stroke()}})}}class w_{constructor(e){this.Gt=new y_,this.St=!0,this.yt=e}Pt(){this.St=!0}Tt(){if(this.St){const e=this.yt.Qt().N().grid,t={ka:e.horzLines.visible,xa:e.vertLines.visible,Ta:e.horzLines.color,Sa:e.vertLines.color,Ra:e.horzLines.style,Ca:e.vertLines.style,Da:this.yt.ks().Va(),ya:(this.yt.Qt().At().Va()||[]).map(s=>({Pa:s.coord}))};this.Gt.ht(t),this.St=!1}return this.Gt}}class b_{constructor(e){this.sh=new w_(e)}lr(){return this.sh}}const kh={Ia:4,Ba:1e-4};function yi(n,e){const t=100*(n-e)/e;return e<0?-t:t}function k_(n,e){const t=yi(n.$e(),e),s=yi(n.qe(),e);return new ln(t,s)}function Ia(n,e){const t=100*(n-e)/e+100;return e<0?-t:t}function __(n,e){const t=Ia(n.$e(),e),s=Ia(n.qe(),e);return new ln(t,s)}function tc(n,e){const t=Math.abs(n);if(t<1e-15)return 0;const s=Math.log10(t+e.Ba)+e.Ia;return n<0?-s:s}function Aa(n,e){const t=Math.abs(n);if(t<1e-15)return 0;const s=Math.pow(10,t-e.Ia)-e.Ba;return n<0?-s:s}function _a(n,e){if(n===null)return null;const t=tc(n.$e(),e),s=tc(n.qe(),e);return new ln(t,s)}function kl(n,e){if(n===null)return null;const t=Aa(n.$e(),e),s=Aa(n.qe(),e);return new ln(t,s)}function _h(n){if(n===null)return kh;const e=Math.abs(n.qe()-n.$e());if(e>=1||e<1e-15)return kh;const t=Math.ceil(Math.abs(Math.log10(e))),s=kh.Ia+t;return{Ia:s,Ba:1/Math.pow(10,s)}}function La(n,e,t){return Math.min(Math.max(n,e),t)}function _l(n,e,t){return e-n<=t}class Ch{constructor(e,t){if(this.Aa=e,this.Ea=t,function(s){if(s<0)return!1;for(let r=s;r>1;r/=10)if(r%10!=0)return!1;return!0}(this.Aa))this.za=[2,2.5,2];else{this.za=[];for(let s=this.Aa;s!==1;){if(s%2==0)this.za.push(2),s/=2;else{if(s%5!=0)throw new Error("unexpected base");this.za.push(2,2.5),s/=5}if(this.za.length>100)throw new Error("something wrong with base")}}}La(e,t,s){const r=this.Aa===0?0:1/this.Aa;let a=Math.pow(10,Math.max(0,Math.ceil(Math.log10(e-t)))),l=0,u=this.Ea[0];for(;;){const g=_l(a,r,1e-14)&&a>r+1e-14,y=_l(a,s*u,1e-14),w=_l(a,1,1e-14);if(!(g&&y&&w))break;a/=u,u=this.Ea[++l%this.Ea.length]}if(a<=r+1e-14&&(a=r),a=Math.max(1,a),this.za.length>0&&(d=a,f=1,p=1e-14,Math.abs(d-f)<p))for(l=0,u=this.za[0];_l(a,s*u,1e-14)&&a>r+1e-14;)a/=u,u=this.za[++l%this.za.length];var d,f,p;return a}}class ug{constructor(e,t,s,r){this.Oa=[],this.Yi=e,this.Aa=t,this.Na=s,this.Wa=r}La(e,t){if(e<t)throw new Error("high < low");const s=this.Yi.$t(),r=(e-t)*this.Fa()/s,a=new Ch(this.Aa,[2,2.5,2]),l=new Ch(this.Aa,[2,2,2.5]),u=new Ch(this.Aa,[2.5,2,2]),d=[];return d.push(a.La(e,t,r),l.La(e,t,r),u.La(e,t,r)),function(f){if(f.length<1)throw Error("array is empty");let p=f[0];for(let g=1;g<f.length;++g)f[g]<p&&(p=f[g]);return p}(d)}Ha(){const e=this.Yi,t=e.zt();if(t===null)return void(this.Oa=[]);const s=e.$t(),r=this.Na(s-1,t),a=this.Na(0,t),l=this.Yi.N().entireTextOnly?this.Ua()/2:0,u=l,d=s-1-l,f=Math.max(r,a),p=Math.min(r,a);if(f===p)return void(this.Oa=[]);let g=this.La(f,p),y=f%g;y+=y<0?g:0;const w=f>=p?1:-1;let k=null,_=0;for(let C=f-y;C>p;C-=g){const S=this.Wa(C,t,!0);k!==null&&Math.abs(S-k)<this.Fa()||S<u||S>d||(_<this.Oa.length?(this.Oa[_].Pa=S,this.Oa[_].$a=e.qa(C)):this.Oa.push({Pa:S,$a:e.qa(C)}),_++,k=S,e.Ya()&&(g=this.La(C*w,p)))}this.Oa.length=_}Va(){return this.Oa}Ua(){return this.Yi.P()}Fa(){return Math.ceil(2.5*this.Ua())}}function lx(n){return n.slice().sort((e,t)=>me(e.hs())-me(t.hs()))}var hg;(function(n){n[n.Normal=0]="Normal",n[n.Logarithmic=1]="Logarithmic",n[n.Percentage=2]="Percentage",n[n.IndexedTo100=3]="IndexedTo100"})(hg||(hg={}));const dg=new nx,fg=new xc(100,1);class C_{constructor(e,t,s,r,a){this.ja=0,this.Za=null,this.Ge=null,this.Ka=null,this.Xa={Ga:!1,Ja:null},this.Qa=0,this.tl=0,this.il=new Et,this.sl=new Et,this.nl=[],this.el=null,this.rl=null,this.hl=null,this.al=null,this.ha=fg,this.ll=_h(null),this.ol=e,this.ys=t,this._l=s,this.ul=r,this.cl=a,this.dl=new ug(this,100,this.fl.bind(this),this.pl.bind(this))}wa(){return this.ol}N(){return this.ys}hr(e){if(wn(this.ys,e),this.ga(),e.mode!==void 0&&this.vl({ie:e.mode}),e.scaleMargins!==void 0){const t=cn(e.scaleMargins.top),s=cn(e.scaleMargins.bottom);if(t<0||t>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(s<0||s>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${s}`);if(t+s>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${t+s}`);this.ml(),this.rl=null}}wl(){return this.ys.autoScale}Ya(){return this.ys.mode===1}Le(){return this.ys.mode===2}gl(){return this.ys.mode===3}ie(){return{sn:this.ys.autoScale,Ml:this.ys.invertScale,ie:this.ys.mode}}vl(e){const t=this.ie();let s=null;e.sn!==void 0&&(this.ys.autoScale=e.sn),e.ie!==void 0&&(this.ys.mode=e.ie,e.ie!==2&&e.ie!==3||(this.ys.autoScale=!0),this.Xa.Ga=!1),t.ie===1&&e.ie!==t.ie&&(function(a,l){if(a===null)return!1;const u=Aa(a.$e(),l),d=Aa(a.qe(),l);return isFinite(u)&&isFinite(d)}(this.Ge,this.ll)?(s=kl(this.Ge,this.ll),s!==null&&this.bl(s)):this.ys.autoScale=!0),e.ie===1&&e.ie!==t.ie&&(s=_a(this.Ge,this.ll),s!==null&&this.bl(s));const r=t.ie!==this.ys.mode;r&&(t.ie===2||this.Le())&&this.ga(),r&&(t.ie===3||this.gl())&&this.ga(),e.Ml!==void 0&&t.Ml!==e.Ml&&(this.ys.invertScale=e.Ml,this.xl()),this.sl.p(t,this.ie())}Sl(){return this.sl}P(){return this._l.fontSize}$t(){return this.ja}Cl(e){this.ja!==e&&(this.ja=e,this.ml(),this.rl=null)}yl(){if(this.Za)return this.Za;const e=this.$t()-this.Pl()-this.kl();return this.Za=e,e}Qe(){return this.Tl(),this.Ge}bl(e,t){const s=this.Ge;(t||s===null&&e!==null||s!==null&&!s.He(e))&&(this.rl=null,this.Ge=e)}Zi(){return this.Tl(),this.ja===0||!this.Ge||this.Ge.Zi()}Rl(e){return this.Ml()?e:this.$t()-1-e}Nt(e,t){return this.Le()?e=yi(e,t):this.gl()&&(e=Ia(e,t)),this.pl(e,t)}Dl(e,t,s){this.Tl();const r=this.kl(),a=me(this.Qe()),l=a.$e(),u=a.qe(),d=this.yl()-1,f=this.Ml(),p=d/(u-l),g=s===void 0?0:s.from,y=s===void 0?e.length:s.to,w=this.Vl();for(let k=g;k<y;k++){const _=e[k],C=_.gt;if(isNaN(C))continue;let S=C;w!==null&&(S=w(_.gt,t));const M=r+p*(S-l),I=f?M:this.ja-1-M;_.ut=I}}Il(e,t,s){this.Tl();const r=this.kl(),a=me(this.Qe()),l=a.$e(),u=a.qe(),d=this.yl()-1,f=this.Ml(),p=d/(u-l),g=s===void 0?0:s.from,y=s===void 0?e.length:s.to,w=this.Vl();for(let k=g;k<y;k++){const _=e[k];let C=_.qh,S=_.Yh,M=_.jh,I=_.Zh;w!==null&&(C=w(_.qh,t),S=w(_.Yh,t),M=w(_.jh,t),I=w(_.Zh,t));let L=r+p*(C-l),O=f?L:this.ja-1-L;_.Bl=O,L=r+p*(S-l),O=f?L:this.ja-1-L,_.Al=O,L=r+p*(M-l),O=f?L:this.ja-1-L,_.El=O,L=r+p*(I-l),O=f?L:this.ja-1-L,_.zl=O}}Ts(e,t){const s=this.fl(e,t);return this.Ll(s,t)}Ll(e,t){let s=e;return this.Le()?s=function(r,a){return a<0&&(r=-r),r/100*a+a}(s,t):this.gl()&&(s=function(r,a){return r-=100,a<0&&(r=-r),r/100*a+a}(s,t)),s}ba(){return this.nl}Dt(){if(this.el)return this.el;let e=[];for(let t=0;t<this.nl.length;t++){const s=this.nl[t];s.hs()===null&&s.ls(t+1),e.push(s)}return e=lx(e),this.el=e,this.el}Ol(e){this.nl.indexOf(e)===-1&&(this.nl.push(e),this.ga(),this.Nl())}Wl(e){const t=this.nl.indexOf(e);if(t===-1)throw new Error("source is not attached to scale");this.nl.splice(t,1),this.nl.length===0&&(this.vl({sn:!0}),this.bl(null)),this.ga(),this.Nl()}zt(){let e=null;for(const t of this.nl){const s=t.zt();s!==null&&(e===null||s.Hh<e.Hh)&&(e=s)}return e===null?null:e.Ft}Ml(){return this.ys.invertScale}Va(){const e=this.zt()===null;if(this.rl!==null&&(e||this.rl.Fl===e))return this.rl.Va;this.dl.Ha();const t=this.dl.Va();return this.rl={Va:t,Fl:e},this.il.p(),t}Hl(){return this.il}Ul(e){this.Le()||this.gl()||this.hl===null&&this.Ka===null&&(this.Zi()||(this.hl=this.ja-e,this.Ka=me(this.Qe()).Ue()))}$l(e){if(this.Le()||this.gl()||this.hl===null)return;this.vl({sn:!1}),(e=this.ja-e)<0&&(e=0);let t=(this.hl+.2*(this.ja-1))/(e+.2*(this.ja-1));const s=me(this.Ka).Ue();t=Math.max(t,.1),s.je(t),this.bl(s)}ql(){this.Le()||this.gl()||(this.hl=null,this.Ka=null)}Yl(e){this.wl()||this.al===null&&this.Ka===null&&(this.Zi()||(this.al=e,this.Ka=me(this.Qe()).Ue()))}jl(e){if(this.wl()||this.al===null)return;const t=me(this.Qe()).Ye()/(this.yl()-1);let s=e-this.al;this.Ml()&&(s*=-1);const r=s*t,a=me(this.Ka).Ue();a.Ze(r),this.bl(a,!0),this.rl=null}Zl(){this.wl()||this.al!==null&&(this.al=null,this.Ka=null)}ra(){return this.ha||this.ga(),this.ha}Xi(e,t){switch(this.ys.mode){case 2:return this.Kl(yi(e,t));case 3:return this.ra().format(Ia(e,t));default:return this.nr(e)}}qa(e){switch(this.ys.mode){case 2:return this.Kl(e);case 3:return this.ra().format(e);default:return this.nr(e)}}Dh(e){return this.nr(e,me(this.Xl()).ra())}Vh(e,t){return e=yi(e,t),this.Kl(e,dg)}Gl(){return this.nl}Jl(e){this.Xa={Ja:e,Ga:!1}}Ns(){this.nl.forEach(e=>e.Ns())}ga(){this.rl=null;const e=this.Xl();let t=100;e!==null&&(t=Math.round(1/e.ea())),this.ha=fg,this.Le()?(this.ha=dg,t=100):this.gl()?(this.ha=new xc(100,1),t=100):e!==null&&(this.ha=e.ra()),this.dl=new ug(this,t,this.fl.bind(this),this.pl.bind(this)),this.dl.Ha()}Nl(){this.el=null}Ki(){return this.cl}Xl(){return this.nl[0]||null}Pl(){return this.Ml()?this.ys.scaleMargins.bottom*this.$t()+this.tl:this.ys.scaleMargins.top*this.$t()+this.Qa}kl(){return this.Ml()?this.ys.scaleMargins.top*this.$t()+this.Qa:this.ys.scaleMargins.bottom*this.$t()+this.tl}Tl(){this.Xa.Ga||(this.Xa.Ga=!0,this.Ql())}ml(){this.Za=null}pl(e,t){if(this.Tl(),this.Zi())return 0;e=this.Ya()&&e?tc(e,this.ll):e;const s=me(this.Qe()),r=this.kl()+(this.yl()-1)*(e-s.$e())/s.Ye();return this.Rl(r)}fl(e,t){if(this.Tl(),this.Zi())return 0;const s=this.Rl(e),r=me(this.Qe()),a=r.$e()+r.Ye()*((s-this.kl())/(this.yl()-1));return this.Ya()?Aa(a,this.ll):a}xl(){this.rl=null,this.dl.Ha()}Ql(){const e=this.Xa.Ja;if(e===null)return;let t=null;const s=this.Gl();let r=0,a=0;for(const d of s){if(!d.Vt())continue;const f=d.zt();if(f===null)continue;const p=d.Mh(e.Uh(),e.bi());let g=p&&p.Qe();if(g!==null){switch(this.ys.mode){case 1:g=_a(g,this.ll);break;case 2:g=k_(g,f.Ft);break;case 3:g=__(g,f.Ft)}if(t=t===null?g:t.vn(me(g)),p!==null){const y=p.tr();y!==null&&(r=Math.max(r,y.above),a=Math.max(a,y.below))}}}if(r===this.Qa&&a===this.tl||(this.Qa=r,this.tl=a,this.rl=null,this.ml()),t!==null){if(t.$e()===t.qe()){const d=this.Xl(),f=5*(d===null||this.Le()||this.gl()?1:d.ea());this.Ya()&&(t=kl(t,this.ll)),t=new ln(t.$e()-f,t.qe()+f),this.Ya()&&(t=_a(t,this.ll))}if(this.Ya()){const d=kl(t,this.ll),f=_h(d);if(l=f,u=this.ll,l.Ia!==u.Ia||l.Ba!==u.Ba){const p=this.Ka!==null?kl(this.Ka,this.ll):null;this.ll=f,t=_a(d,f),p!==null&&(this.Ka=_a(p,f))}}this.bl(t)}else this.Ge===null&&(this.bl(new ln(-.5,.5)),this.ll=_h(null));var l,u;this.Xa.Ga=!0}Vl(){return this.Le()?yi:this.gl()?Ia:this.Ya()?e=>tc(e,this.ll):null}io(e,t,s){return t===void 0?(s===void 0&&(s=this.ra()),s.format(e)):t(e)}nr(e,t){return this.io(e,this.ul.priceFormatter,t)}Kl(e,t){return this.io(e,this.ul.percentageFormatter,t)}}function pg(n){return n instanceof yc}class mg{constructor(e,t){this.nl=[],this.so=new Map,this.ja=0,this.no=0,this.eo=1e3,this.el=null,this.ro=new Et,this.Ph=[],this.uh=e,this.ts=t,this.ho=new b_(this);const s=t.N();this.ao=this.lo("left",s.leftPriceScale),this.oo=this.lo("right",s.rightPriceScale),this.ao.Sl().i(this._o.bind(this,this.ao),this),this.oo.Sl().i(this._o.bind(this,this.oo),this),this.uo(s)}uo(e){if(e.leftPriceScale&&this.ao.hr(e.leftPriceScale),e.rightPriceScale&&this.oo.hr(e.rightPriceScale),e.localization&&(this.ao.ga(),this.oo.ga()),e.overlayPriceScales){const t=Array.from(this.so.values());for(const s of t){const r=me(s[0].Wt());r.hr(e.overlayPriceScales),e.localization&&r.ga()}}}co(e){switch(e){case"left":return this.ao;case"right":return this.oo}return this.so.has(e)?cn(this.so.get(e))[0].Wt():null}m(){this.Qt().do().u(this),this.ao.Sl().u(this),this.oo.Sl().u(this),this.nl.forEach(e=>{e.m&&e.m()}),this.Ph=this.Ph.filter(e=>{const t=e.oh();return t.detached&&t.detached(),!1}),this.ro.p()}fo(){return this.eo}po(e){this.eo=e}Qt(){return this.ts}Qi(){return this.no}$t(){return this.ja}vo(e){this.no=e,this.mo()}Cl(e){this.ja=e,this.ao.Cl(e),this.oo.Cl(e),this.nl.forEach(t=>{if(this.Un(t)){const s=t.Wt();s!==null&&s.Cl(e)}}),this.mo()}wo(){return this.nl.filter(pg)}ba(){return this.nl}Un(e){const t=e.Wt();return t===null||this.ao!==t&&this.oo!==t}Ol(e,t,s){const r=s!==void 0?s:this.bo().Mo+1;this.xo(e,t,r)}Wl(e){const t=this.nl.indexOf(e);Jt(t!==-1,"removeDataSource: invalid data source"),this.nl.splice(t,1);const s=me(e.Wt()).wa();if(this.so.has(s)){const a=cn(this.so.get(s)),l=a.indexOf(e);l!==-1&&(a.splice(l,1),a.length===0&&this.so.delete(s))}const r=e.Wt();r&&r.ba().indexOf(e)>=0&&r.Wl(e),r!==null&&(r.Nl(),this.So(r)),this.el=null}qn(e){return e===this.ao?"left":e===this.oo?"right":"overlay"}Co(){return this.ao}yo(){return this.oo}Po(e,t){e.Ul(t)}ko(e,t){e.$l(t),this.mo()}To(e){e.ql()}Ro(e,t){e.Yl(t)}Do(e,t){e.jl(t),this.mo()}Vo(e){e.Zl()}mo(){this.nl.forEach(e=>{e.Ns()})}ks(){let e=null;return this.ts.N().rightPriceScale.visible&&this.oo.ba().length!==0?e=this.oo:this.ts.N().leftPriceScale.visible&&this.ao.ba().length!==0?e=this.ao:this.nl.length!==0&&(e=this.nl[0].Wt()),e===null&&(e=this.oo),e}$n(){let e=null;return this.ts.N().rightPriceScale.visible?e=this.oo:this.ts.N().leftPriceScale.visible&&(e=this.ao),e}So(e){e!==null&&e.wl()&&this.Io(e)}Bo(e){const t=this.uh.ye();e.vl({sn:!0}),t!==null&&e.Jl(t),this.mo()}Ao(){this.Io(this.ao),this.Io(this.oo)}Eo(){this.So(this.ao),this.So(this.oo),this.nl.forEach(e=>{this.Un(e)&&this.So(e.Wt())}),this.mo(),this.ts.ar()}Dt(){return this.el===null&&(this.el=lx(this.nl)),this.el}It(){return this.Dt().filter(pg)}zo(){return this.ro}Lo(){return this.ho}ua(e){this.Ph.push(new l_(e))}ca(e){this.Ph=this.Ph.filter(t=>t.oh()!==e),e.detached&&e.detached(),this.ts.ar()}Oo(){return this.Ph}sa(e,t){return this.Ph.map(s=>s.jn(e,t)).filter(s=>s!==null)}Io(e){const t=e.Gl();if(t&&t.length>0&&!this.uh.Zi()){const s=this.uh.ye();s!==null&&e.Jl(s)}e.Ns()}bo(){const e=this.Dt();if(e.length===0)return{No:0,Mo:0};let t=0,s=0;for(let r=0;r<e.length;r++){const a=e[r].hs();a!==null&&(a<t&&(t=a),a>s&&(s=a))}return{No:t,Mo:s}}xo(e,t,s){let r=this.co(t);if(r===null&&(r=this.lo(t,this.ts.N().overlayPriceScales)),this.nl.push(e),!vc(t)){const a=this.so.get(t)||[];a.push(e),this.so.set(t,a)}r.Ol(e),e._s(r),e.ls(s),this.So(r),this.el=null}_o(e,t,s){t.ie!==s.ie&&this.Io(e)}lo(e,t){const s={visible:!0,autoScale:!0,...Es(t)},r=new C_(e,s,this.ts.N().layout,this.ts.N().localization,this.ts.Ki());return r.Cl(this.$t()),r}}function Cl(n){return{Wo:n.Wo,Fo:{Zn:n.Ho.externalId},Uo:n.Ho.cursorStyle}}function N_(n,e,t,s){for(const r of n){const a=r.Tt(s);if(a!==null&&a.jn){const l=a.jn(e,t);if(l!==null)return{$o:r,Fo:l}}}return null}function j_(n){return n.Ws!==void 0}function cx(n,e,t){const s=[n,...n.Dt()],r=function(a,l,u){var y;let d,f;for(const w of a){const k=((y=w.sa)==null?void 0:y.call(w,l,u))??[];for(const _ of k)p=_.zOrder,g=d==null?void 0:d.zOrder,(!g||p==="top"&&g!=="top"||p==="normal"&&g==="bottom")&&(d=_,f=w)}var p,g;return d&&f?{Ho:d,Wo:f}:null}(s,e,t);if((r==null?void 0:r.Ho.zOrder)==="top")return Cl(r);for(const a of s){if(r&&r.Wo===a&&r.Ho.zOrder!=="bottom"&&!r.Ho.isBackground)return Cl(r);if(j_(a)){const l=N_(a.Ws(n),e,t,n);if(l!==null)return{Wo:a,$o:l.$o,Fo:l.Fo}}if(r&&r.Wo===a&&r.Ho.zOrder!=="bottom"&&r.Ho.isBackground)return Cl(r)}return r!=null&&r.Ho?Cl(r):null}class S_{constructor(e,t,s=50){this.Pn=0,this.kn=1,this.Tn=1,this.Dn=new Map,this.Rn=new Map,this.qo=e,this.Yo=t,this.Vn=s}jo(e){const t=e.time,s=this.Yo.cacheKey(t),r=this.Dn.get(s);if(r!==void 0)return r.Zo;if(this.Pn===this.Vn){const l=this.Rn.get(this.Tn);this.Rn.delete(this.Tn),this.Dn.delete(cn(l)),this.Tn++,this.Pn--}const a=this.qo(e);return this.Dn.set(s,{Zo:a,En:this.kn}),this.Rn.set(this.kn,s),this.Pn++,this.kn++,a}}class Oa{constructor(e,t){Jt(e<=t,"right should be >= left"),this.Ko=e,this.Xo=t}Uh(){return this.Ko}bi(){return this.Xo}Go(){return this.Xo-this.Ko+1}Te(e){return this.Ko<=e&&e<=this.Xo}He(e){return this.Ko===e.Uh()&&this.Xo===e.bi()}}function gg(n,e){return n===null||e===null?n===e:n.He(e)}class E_{constructor(){this.Jo=new Map,this.Dn=null,this.Qo=!1}t_(e){this.Qo=e,this.Dn=null}i_(e,t){this.s_(t),this.Dn=null;for(let s=t;s<e.length;++s){const r=e[s];let a=this.Jo.get(r.timeWeight);a===void 0&&(a=[],this.Jo.set(r.timeWeight,a)),a.push({index:s,time:r.time,weight:r.timeWeight,originalTime:r.originalTime})}}n_(e,t,s,r,a){const l=Math.ceil(t/e);return this.Dn!==null&&this.Dn.e_===l&&a===this.Dn.r_&&s===this.Dn.h_||(this.Dn={r_:a,h_:s,Va:this.a_(l,s,r),e_:l}),this.Dn.Va}s_(e){if(e===0)return void this.Jo.clear();const t=[];this.Jo.forEach((s,r)=>{e<=s[0].index?t.push(r):s.splice(Di(s,e,a=>a.index<e),1/0)});for(const s of t)this.Jo.delete(s)}a_(e,t,s){let r=[];const a=l=>!t||s.has(l.index);for(const l of Array.from(this.Jo.keys()).sort((u,d)=>d-u)){if(!this.Jo.get(l))continue;const u=r;r=[];const d=u.length;let f=0;const p=cn(this.Jo.get(l)),g=p.length;let y=1/0,w=-1/0;for(let k=0;k<g;k++){const _=p[k],C=_.index;for(;f<d;){const S=u[f],M=S.index;if(!(M<C&&a(S))){y=M;break}f++,r.push(S),w=M,y=1/0}if(y-C>=e&&C-w>=e&&a(_))r.push(_),w=C;else if(this.Qo)return u}for(;f<d;f++)a(u[f])&&r.push(u[f])}return r}}class _i{constructor(e){this.l_=e}o_(){return this.l_===null?null:new Oa(Math.floor(this.l_.Uh()),Math.ceil(this.l_.bi()))}__(){return this.l_}static u_(){return new _i(null)}}function M_(n,e){return n.weight>e.weight?n:e}class D_{constructor(e,t,s,r){this.no=0,this.c_=null,this.d_=[],this.al=null,this.hl=null,this.f_=new E_,this.p_=new Map,this.v_=_i.u_(),this.m_=!0,this.w_=new Et,this.g_=new Et,this.M_=new Et,this.b_=null,this.x_=null,this.S_=new Map,this.C_=-1,this.y_=[],this.ys=t,this.ul=s,this.P_=t.rightOffset,this.k_=t.barSpacing,this.ts=e,this.Yo=r,this.T_(),this.f_.t_(t.uniformDistribution),this.R_()}N(){return this.ys}D_(e){wn(this.ul,e),this.V_(),this.T_()}hr(e,t){wn(this.ys,e),this.ys.fixLeftEdge&&this.I_(),this.ys.fixRightEdge&&this.B_(),e.barSpacing!==void 0&&this.ts.dn(e.barSpacing),e.rightOffset!==void 0&&this.ts.fn(e.rightOffset),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.ts.dn(e.barSpacing??this.k_),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.ys.ignoreWhitespaceIndices&&this.R_(),this.V_(),this.T_(),this.M_.p()}Rs(e){var t;return((t=this.d_[e])==null?void 0:t.time)??null}ss(e){return this.d_[e]??null}A_(e,t){if(this.d_.length<1)return null;if(this.Yo.key(e)>this.Yo.key(this.d_[this.d_.length-1].time))return t?this.d_.length-1:null;const s=Di(this.d_,this.Yo.key(e),(r,a)=>this.Yo.key(r.time)<a);return this.Yo.key(e)<this.Yo.key(this.d_[s].time)?t?s:null:s}Zi(){return this.no===0||this.d_.length===0||this.c_===null}E_(){return this.d_.length>0}ye(){return this.z_(),this.v_.o_()}L_(){return this.z_(),this.v_.__()}O_(){const e=this.ye();if(e===null)return null;const t={from:e.Uh(),to:e.bi()};return this.N_(t)}N_(e){const t=Math.round(e.from),s=Math.round(e.to),r=me(this.W_()),a=me(this.F_());return{from:me(this.ss(Math.max(r,t))),to:me(this.ss(Math.min(a,s)))}}H_(e){return{from:me(this.A_(e.from,!0)),to:me(this.A_(e.to,!0))}}Qi(){return this.no}vo(e){if(!isFinite(e)||e<=0||this.no===e)return;const t=this.L_(),s=this.no;if(this.no=e,this.m_=!0,this.ys.lockVisibleTimeRangeOnResize&&s!==0){const r=this.k_*e/s;this.k_=r}if(this.ys.fixLeftEdge&&t!==null&&t.Uh()<=0){const r=s-e;this.P_-=Math.round(r/this.k_)+1,this.m_=!0}this.U_(),this.q_()}qt(e){if(this.Zi()||!Va(e))return 0;const t=this.Y_()+this.P_-e;return this.no-(t+.5)*this.k_-1}j_(e,t){const s=this.Y_(),r=t===void 0?0:t.from,a=t===void 0?e.length:t.to;for(let l=r;l<a;l++){const u=e[l].wt,d=s+this.P_-u,f=this.no-(d+.5)*this.k_-1;e[l]._t=f}}Z_(e,t){const s=Math.ceil(this.K_(e));return t&&this.ys.ignoreWhitespaceIndices&&!this.X_(s)?this.G_(s):s}fn(e){this.m_=!0,this.P_=e,this.q_(),this.ts.J_(),this.ts.ar()}Q_(){return this.k_}dn(e){this.tu(e),this.q_(),this.ts.J_(),this.ts.ar()}iu(){return this.P_}Va(){if(this.Zi())return null;if(this.x_!==null)return this.x_;const e=this.k_,t=5*(this.ts.N().layout.fontSize+4)/8*(this.ys.tickMarkMaxCharacterLength||8),s=Math.round(t/e),r=me(this.ye()),a=Math.max(r.Uh(),r.Uh()-s),l=Math.max(r.bi(),r.bi()-s),u=this.f_.n_(e,t,this.ys.ignoreWhitespaceIndices,this.S_,this.C_),d=this.W_()+s,f=this.F_()-s,p=this.su(),g=this.ys.fixLeftEdge||p,y=this.ys.fixRightEdge||p;let w=0;for(const k of u){if(!(a<=k.index&&k.index<=l))continue;let _;w<this.y_.length?(_=this.y_[w],_.coord=this.qt(k.index),_.label=this.nu(k),_.weight=k.weight):(_={needAlignCoordinate:!1,coord:this.qt(k.index),label:this.nu(k),weight:k.weight},this.y_.push(_)),this.k_>t/2&&!p?_.needAlignCoordinate=!1:_.needAlignCoordinate=g&&k.index<=d||y&&k.index>=f,w++}return this.y_.length=w,this.x_=this.y_,this.y_}eu(){this.m_=!0,this.dn(this.ys.barSpacing),this.fn(this.ys.rightOffset)}ru(e){this.m_=!0,this.c_=e,this.q_(),this.I_()}hu(e,t){const s=this.K_(e),r=this.Q_(),a=r+t*(r/10);this.dn(a),this.ys.rightBarStaysOnScroll||this.fn(this.iu()+(s-this.K_(e)))}Ul(e){this.al&&this.Zl(),this.hl===null&&this.b_===null&&(this.Zi()||(this.hl=e,this.au()))}$l(e){if(this.b_===null)return;const t=La(this.no-e,0,this.no),s=La(this.no-me(this.hl),0,this.no);t!==0&&s!==0&&this.dn(this.b_.Q_*t/s)}ql(){this.hl!==null&&(this.hl=null,this.lu())}Yl(e){this.al===null&&this.b_===null&&(this.Zi()||(this.al=e,this.au()))}jl(e){if(this.al===null)return;const t=(this.al-e)/this.Q_();this.P_=me(this.b_).iu+t,this.m_=!0,this.q_()}Zl(){this.al!==null&&(this.al=null,this.lu())}ou(){this._u(this.ys.rightOffset)}_u(e,t=400){if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const s=this.P_,r=performance.now();this.ts._n({uu:a=>(a-r)/t>=1,cu:a=>{const l=(a-r)/t;return l>=1?e:s+(e-s)*l}})}Pt(e,t){this.m_=!0,this.d_=e,this.f_.i_(e,t),this.q_()}du(){return this.w_}fu(){return this.g_}pu(){return this.M_}Y_(){return this.c_||0}vu(e){const t=e.Go();this.tu(this.no/t),this.P_=e.bi()-this.Y_(),this.q_(),this.m_=!0,this.ts.J_(),this.ts.ar()}mu(){const e=this.W_(),t=this.F_();e!==null&&t!==null&&this.vu(new Oa(e,t+this.ys.rightOffset))}wu(e){const t=new Oa(e.from,e.to);this.vu(t)}ns(e){return this.ul.timeFormatter!==void 0?this.ul.timeFormatter(e.originalTime):this.Yo.formatHorzItem(e.time)}R_(){if(!this.ys.ignoreWhitespaceIndices)return;this.S_.clear();const e=this.ts.js();for(const t of e)for(const s of t.ma())this.S_.set(s,!0);this.C_++}su(){const e=this.ts.N().handleScroll,t=this.ts.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}W_(){return this.d_.length===0?null:0}F_(){return this.d_.length===0?null:this.d_.length-1}gu(e){return(this.no-1-e)/this.k_}K_(e){const t=this.gu(e),s=this.Y_()+this.P_-t;return Math.round(1e6*s)/1e6}tu(e){const t=this.k_;this.k_=e,this.U_(),t!==this.k_&&(this.m_=!0,this.Mu())}z_(){if(!this.m_)return;if(this.m_=!1,this.Zi())return void this.bu(_i.u_());const e=this.Y_(),t=this.no/this.k_,s=this.P_+e,r=new Oa(s-t+1,s);this.bu(new _i(r))}U_(){const e=La(this.k_,this.xu(),this.Su());this.k_!==e&&(this.k_=e,this.m_=!0)}Su(){return this.ys.maxBarSpacing>0?this.ys.maxBarSpacing:.5*this.no}xu(){return this.ys.fixLeftEdge&&this.ys.fixRightEdge&&this.d_.length!==0?this.no/this.d_.length:this.ys.minBarSpacing}q_(){const e=this.Cu();e!==null&&this.P_<e&&(this.P_=e,this.m_=!0);const t=this.yu();this.P_>t&&(this.P_=t,this.m_=!0)}Cu(){const e=this.W_(),t=this.c_;return e===null||t===null?null:e-t-1+(this.ys.fixLeftEdge?this.no/this.k_:Math.min(2,this.d_.length))}yu(){return this.ys.fixRightEdge?0:this.no/this.k_-Math.min(2,this.d_.length)}au(){this.b_={Q_:this.Q_(),iu:this.iu()}}lu(){this.b_=null}nu(e){let t=this.p_.get(e.weight);return t===void 0&&(t=new S_(s=>this.Pu(s),this.Yo),this.p_.set(e.weight,t)),t.jo(e)}Pu(e){return this.Yo.formatTickmark(e,this.ul)}bu(e){const t=this.v_;this.v_=e,gg(t.o_(),this.v_.o_())||this.w_.p(),gg(t.__(),this.v_.__())||this.g_.p(),this.Mu()}Mu(){this.x_=null}V_(){this.Mu(),this.p_.clear()}T_(){this.Yo.updateFormatter(this.ul)}I_(){if(!this.ys.fixLeftEdge)return;const e=this.W_();if(e===null)return;const t=this.ye();if(t===null)return;const s=t.Uh()-e;if(s<0){const r=this.P_-s-1;this.fn(r)}this.U_()}B_(){this.q_(),this.U_()}X_(e){return!this.ys.ignoreWhitespaceIndices||this.S_.get(e)||!1}G_(e){const t=function*(r){const a=Math.round(r),l=a<r;let u=1;for(;;)l?(yield a+u,yield a-u):(yield a-u,yield a+u),u++}(e),s=this.F_();for(;s;){const r=t.next().value;if(this.S_.get(r))return r;if(r<0||r>s)break}return e}}var vg,xg,yg,Nd,wg;(function(n){n[n.OnTouchEnd=0]="OnTouchEnd",n[n.OnNextTap=1]="OnNextTap"})(vg||(vg={}));class T_{constructor(e,t,s){this.ku=[],this.Tu=[],this.no=0,this.Ru=null,this.Du=new Et,this.Vu=new Et,this.Iu=null,this.Bu=e,this.ys=t,this.Yo=s,this.cl=new Ik(this.ys.layout.colorParsers),this.Au=new Tk(this),this.uh=new D_(this,t.timeScale,this.ys.localization,s),this.Ct=new Fk(this,t.crosshair),this.Eu=new x_(t.crosshair),this.zu(0),this.ku[0].po(2e3),this.Lu=this.Ou(0),this.Nu=this.Ou(1)}Bh(){this.Wu($t.gn())}ar(){this.Wu($t.wn())}Xh(){this.Wu(new $t(1))}Ah(e){const t=this.Fu(e);this.Wu(t)}Hu(){return this.Ru}Uu(e){var s,r,a,l;if(((s=this.Ru)==null?void 0:s.Wo)===(e==null?void 0:e.Wo)&&((a=(r=this.Ru)==null?void 0:r.Fo)==null?void 0:a.Zn)===((l=e==null?void 0:e.Fo)==null?void 0:l.Zn))return;const t=this.Ru;this.Ru=e,t!==null&&this.Ah(t.Wo),e!==null&&e.Wo!==(t==null?void 0:t.Wo)&&this.Ah(e.Wo)}N(){return this.ys}hr(e){wn(this.ys,e),this.ku.forEach(t=>t.uo(e)),e.timeScale!==void 0&&this.uh.hr(e.timeScale),e.localization!==void 0&&this.uh.D_(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.Du.p(),this.Lu=this.Ou(0),this.Nu=this.Ou(1),this.Bh()}$u(e,t,s=0){const r=this.ku[s];if(r===void 0)return;if(e==="left")return wn(this.ys,{leftPriceScale:t}),r.uo({leftPriceScale:t}),this.Du.p(),void this.Bh();if(e==="right")return wn(this.ys,{rightPriceScale:t}),r.uo({rightPriceScale:t}),this.Du.p(),void this.Bh();const a=this.qu(e,s);a!==null&&(a.Wt.hr(t),this.Du.p())}qu(e,t){const s=this.ku[t];if(s===void 0)return null;const r=s.co(e);return r!==null?{Us:s,Wt:r}:null}At(){return this.uh}$s(){return this.ku}Yu(){return this.Ct}ju(){return this.Vu}Zu(e,t){e.Cl(t),this.J_()}vo(e){this.no=e,this.uh.vo(this.no),this.ku.forEach(t=>t.vo(e)),this.J_()}Ku(e){this.ku.length!==1&&(Jt(e>=0&&e<this.ku.length,"Invalid pane index"),this.ku.splice(e,1),this.Bh())}Xu(e,t){if(this.ku.length<2)return;Jt(e>=0&&e<this.ku.length,"Invalid pane index");const s=this.ku[e],r=this.ku.reduce((g,y)=>g+y.fo(),0),a=this.ku.reduce((g,y)=>g+y.$t(),0),l=a-30*(this.ku.length-1);t=Math.min(l,Math.max(30,t));const u=r/a,d=s.$t();s.po(t*u);let f=t-d,p=this.ku.length-1;for(const g of this.ku)if(g!==s){const y=Math.min(l,Math.max(30,g.$t()-f/p));f-=g.$t()-y,p-=1;const w=y*u;g.po(w)}this.Bh()}Gu(e,t){Jt(e>=0&&e<this.ku.length&&t>=0&&t<this.ku.length,"Invalid pane index");const s=this.ku[e],r=this.ku[t];this.ku[e]=r,this.ku[t]=s,this.Bh()}Po(e,t,s){e.Po(t,s)}ko(e,t,s){e.ko(t,s),this.Eh(),this.Wu(this.Ju(e,2))}To(e,t){e.To(t),this.Wu(this.Ju(e,2))}Ro(e,t,s){t.wl()||e.Ro(t,s)}Do(e,t,s){t.wl()||(e.Do(t,s),this.Eh(),this.Wu(this.Ju(e,2)))}Vo(e,t){t.wl()||(e.Vo(t),this.Wu(this.Ju(e,2)))}Bo(e,t){e.Bo(t),this.Wu(this.Ju(e,2))}Qu(e){this.uh.Ul(e)}tc(e,t){const s=this.At();if(s.Zi()||t===0)return;const r=s.Qi();e=Math.max(1,Math.min(e,r)),s.hu(e,t),this.J_()}sc(e){this.nc(0),this.ec(e),this.rc()}hc(e){this.uh.$l(e),this.J_()}ac(){this.uh.ql(),this.ar()}nc(e){this.uh.Yl(e)}ec(e){this.uh.jl(e),this.J_()}rc(){this.uh.Zl(),this.ar()}js(){return this.Tu}lc(e,t,s,r,a){this.Ct.Vs(e,t);let l=NaN,u=this.uh.Z_(e,!0);const d=this.uh.ye();d!==null&&(u=Math.min(Math.max(d.Uh(),u),d.bi()));const f=r.ks(),p=f.zt();if(p!==null&&(l=f.Ts(t,p)),l=this.Eu.Ma(l,u,r),this.Ct.Es(u,l,r),this.Xh(),!a){const g=cx(r,e,t);this.Uu(g&&{Wo:g.Wo,Fo:g.Fo,Uo:g.Uo||null}),this.Vu.p(this.Ct.Bt(),{x:e,y:t},s)}}oc(e,t,s){const r=s.ks(),a=r.zt(),l=r.Nt(e,me(a)),u=this.uh.A_(t,!0),d=this.uh.qt(me(u));this.lc(d,l,null,s,!0)}_c(e){this.Yu().Ls(),this.Xh(),e||this.Vu.p(null,null,null)}Eh(){const e=this.Ct.Us();if(e!==null){const t=this.Ct.Bs(),s=this.Ct.As();this.lc(t,s,null,e)}this.Ct.Ns()}uc(e,t,s){const r=this.uh.Rs(0);t!==void 0&&s!==void 0&&this.uh.Pt(t,s);const a=this.uh.Rs(0),l=this.uh.Y_(),u=this.uh.ye();if(u!==null&&r!==null&&a!==null){const d=u.Te(l),f=this.Yo.key(r)>this.Yo.key(a),p=e!==null&&e>l&&!f,g=this.uh.N().allowShiftVisibleRangeOnWhitespaceReplacement,y=d&&(s!==void 0||g)&&this.uh.N().shiftVisibleRangeOnNewBar;if(p&&!y){const w=e-l;this.uh.fn(this.uh.iu()-w)}}this.uh.ru(e)}Lh(e){e!==null&&e.Eo()}Hn(e){if(function(s){return s instanceof mg}(e))return e;const t=this.ku.find(s=>s.Dt().includes(e));return t===void 0?null:t}J_(){this.ku.forEach(e=>e.Eo()),this.Eh()}m(){this.ku.forEach(e=>e.m()),this.ku.length=0,this.ys.localization.priceFormatter=void 0,this.ys.localization.percentageFormatter=void 0,this.ys.localization.timeFormatter=void 0}cc(){return this.Au}Yn(){return this.Au.N()}do(){return this.Du}dc(e,t){const s=this.zu(t);this.fc(e,s),this.Tu.push(e),this.Tu.length===1?this.Bh():this.ar()}vc(e){const t=this.Hn(e),s=this.Tu.indexOf(e);Jt(s!==-1,"Series not found");const r=me(t);this.Tu.splice(s,1),r.Wl(e),e.m&&e.m(),this.uh.R_(),this.mc(r)}Ih(e,t){const s=me(this.Hn(e));s.Wl(e),s.Ol(e,t,me(e.hs()))}mu(){const e=$t.wn();e.rn(),this.Wu(e)}wc(e){const t=$t.wn();t.ln(e),this.Wu(t)}cn(){const e=$t.wn();e.cn(),this.Wu(e)}dn(e){const t=$t.wn();t.dn(e),this.Wu(t)}fn(e){const t=$t.wn();t.fn(e),this.Wu(t)}_n(e){const t=$t.wn();t._n(e),this.Wu(t)}hn(){const e=$t.wn();e.hn(),this.Wu(e)}gc(){return this.ys.rightPriceScale.visible?"right":"left"}Mc(e,t){if(Jt(t>=0,"Index should be greater or equal to 0"),t===this.bc(e))return;const s=me(this.Hn(e));s.Wl(e);const r=this.zu(t);this.fc(e,r),s.ba().length===0&&this.mc(s)}xc(){return this.Nu}$(){return this.Lu}Ut(e){const t=this.Nu,s=this.Lu;if(t===s)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.Iu===null||this.Iu.mr!==s||this.Iu.wr!==t)this.Iu={mr:s,wr:t,Sc:new Map};else{const a=this.Iu.Sc.get(e);if(a!==void 0)return a}const r=this.cl.tt(s,t,e/100);return this.Iu.Sc.set(e,r),r}Cc(e){return this.ku.indexOf(e)}Ki(){return this.cl}zu(e){if(Jt(e>=0,"Index should be greater or equal to 0"),(e=Math.min(this.ku.length,e))<this.ku.length)return this.ku[e];const t=new mg(this.uh,this);this.ku.push(t);const s=$t.gn();return s.Qs(e,{tn:0,sn:!0}),this.Wu(s),t}bc(e){return this.ku.findIndex(t=>t.wo().includes(e))}Ju(e,t){const s=new $t(t);if(e!==null){const r=this.ku.indexOf(e);s.Qs(r,{tn:t})}return s}Fu(e,t){return t===void 0&&(t=2),this.Ju(this.Hn(e),t)}Wu(e){this.Bu&&this.Bu(e),this.ku.forEach(t=>t.Lo().lr().Pt())}fc(e,t){const s=e.N().priceScaleId,r=s!==void 0?s:this.gc();t.Ol(e,r),vc(r)||e.hr(e.N())}Ou(e){const t=this.ys.layout;return t.background.type==="gradient"?e===0?t.background.topColor:t.background.bottomColor:t.background.color}mc(e){e.ba().length===0&&this.ku.length>1&&(this.ku.splice(this.Cc(e),1),this.Bh())}}function jd(n){return!Mi(n)&&!eo(n)}function ux(n){return Mi(n)}(function(n){n[n.Disabled=0]="Disabled",n[n.Continuous=1]="Continuous",n[n.OnDataUpdate=2]="OnDataUpdate"})(xg||(xg={})),function(n){n[n.LastBar=0]="LastBar",n[n.LastVisible=1]="LastVisible"}(yg||(yg={})),function(n){n.Solid="solid",n.VerticalGradient="gradient"}(Nd||(Nd={})),function(n){n[n.Year=0]="Year",n[n.Month=1]="Month",n[n.DayOfMonth=2]="DayOfMonth",n[n.Time=3]="Time",n[n.TimeWithSeconds=4]="TimeWithSeconds"}(wg||(wg={}));const bg=n=>n.getUTCFullYear();function I_(n,e,t){return e.replace(/yyyy/g,(s=>Ms(bg(s),4))(n)).replace(/yy/g,(s=>Ms(bg(s)%100,2))(n)).replace(/MMMM/g,((s,r)=>new Date(s.getUTCFullYear(),s.getUTCMonth(),1).toLocaleString(r,{month:"long"}))(n,t)).replace(/MMM/g,((s,r)=>new Date(s.getUTCFullYear(),s.getUTCMonth(),1).toLocaleString(r,{month:"short"}))(n,t)).replace(/MM/g,(s=>Ms((r=>r.getUTCMonth()+1)(s),2))(n)).replace(/dd/g,(s=>Ms((r=>r.getUTCDate())(s),2))(n))}class hx{constructor(e="yyyy-MM-dd",t="default"){this.yc=e,this.Pc=t}jo(e){return I_(e,this.yc,this.Pc)}}class A_{constructor(e){this.kc=e||"%h:%m:%s"}jo(e){return this.kc.replace("%h",Ms(e.getUTCHours(),2)).replace("%m",Ms(e.getUTCMinutes(),2)).replace("%s",Ms(e.getUTCSeconds(),2))}}const L_={Tc:"yyyy-MM-dd",Rc:"%h:%m:%s",Dc:" ",Vc:"default"};class O_{constructor(e={}){const t={...L_,...e};this.Ic=new hx(t.Tc,t.Vc),this.Bc=new A_(t.Rc),this.Ac=t.Dc}jo(e){return`${this.Ic.jo(e)}${this.Ac}${this.Bc.jo(e)}`}}function Nl(n){return 60*n*60*1e3}function Nh(n){return 60*n*1e3}const jl=[{Ec:(kg=1,1e3*kg),zc:10},{Ec:Nh(1),zc:20},{Ec:Nh(5),zc:21},{Ec:Nh(30),zc:22},{Ec:Nl(1),zc:30},{Ec:Nl(3),zc:31},{Ec:Nl(6),zc:32},{Ec:Nl(12),zc:33}];var kg;function _g(n,e){if(n.getUTCFullYear()!==e.getUTCFullYear())return 70;if(n.getUTCMonth()!==e.getUTCMonth())return 60;if(n.getUTCDate()!==e.getUTCDate())return 50;for(let t=jl.length-1;t>=0;--t)if(Math.floor(e.getTime()/jl[t].Ec)!==Math.floor(n.getTime()/jl[t].Ec))return jl[t].zc;return 0}function jh(n){let e=n;if(eo(n)&&(e=mf(n)),!jd(e))throw new Error("time must be of type BusinessDay");const t=new Date(Date.UTC(e.year,e.month-1,e.day,0,0,0,0));return{Lc:Math.round(t.getTime()/1e3),Oc:e}}function Cg(n){if(!ux(n))throw new Error("time must be of type isUTCTimestamp");return{Lc:n}}function mf(n){const e=new Date(n);if(isNaN(e.getTime()))throw new Error(`Invalid date string=${n}, expected format=yyyy-mm-dd`);return{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}}function Ng(n){eo(n.time)&&(n.time=mf(n.time))}class jg{options(){return this.ys}setOptions(e){this.ys=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(t){t.forEach(Ng)}(e):Ng(e)}createConverterToInternalObj(e){return me(function(t){return t.length===0?null:jd(t[0].time)||eo(t[0].time)?jh:Cg}(e))}key(e){return typeof e=="object"&&"Lc"in e?e.Lc:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){const t=e;return t.Oc===void 0?new Date(1e3*t.Lc).getTime():new Date(Date.UTC(t.Oc.year,t.Oc.month-1,t.Oc.day)).getTime()}convertHorzItemToInternal(e){return ux(t=e)?Cg(t):jd(t)?jh(t):jh(mf(t));var t}updateFormatter(e){if(!this.ys)return;const t=e.dateFormat;this.ys.timeScale.timeVisible?this.Nc=new O_({Tc:t,Rc:this.ys.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Dc:" ",Vc:e.locale}):this.Nc=new hx(t,e.locale)}formatHorzItem(e){const t=e;return this.Nc.jo(new Date(1e3*t.Lc))}formatTickmark(e,t){const s=function(a,l,u){switch(a){case 0:case 10:return l?u?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return l?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.ys.timeScale.timeVisible,this.ys.timeScale.secondsVisible),r=this.ys.timeScale;if(r.tickMarkFormatter!==void 0){const a=r.tickMarkFormatter(e.originalTime,s,t.locale);if(a!==null)return a}return function(a,l,u){const d={};switch(l){case 0:d.year="numeric";break;case 1:d.month="short";break;case 2:d.day="numeric";break;case 3:d.hour12=!1,d.hour="2-digit",d.minute="2-digit";break;case 4:d.hour12=!1,d.hour="2-digit",d.minute="2-digit",d.second="2-digit"}const f=a.Oc===void 0?new Date(1e3*a.Lc):new Date(Date.UTC(a.Oc.year,a.Oc.month-1,a.Oc.day));return new Date(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()).toLocaleString(u,d)}(e.time,s,t.locale)}maxTickMarkWeight(e){let t=e.reduce(M_,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(s,r=0){if(s.length===0)return;let a=r===0?null:s[r-1].time.Lc,l=a!==null?new Date(1e3*a):null,u=0;for(let d=r;d<s.length;++d){const f=s[d],p=new Date(1e3*f.time.Lc);l!==null&&(f.timeWeight=_g(p,l)),u+=f.time.Lc-(a||f.time.Lc),a=f.time.Lc,l=p}if(r===0&&s.length>1){const d=Math.ceil(u/(s.length-1)),f=new Date(1e3*(s[0].time.Lc-d));s[0].timeWeight=_g(new Date(1e3*s[0].time.Lc),f)}})(e,t)}static Wc(e){return wn({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}const Ti=typeof window<"u";function Sg(){return!!Ti&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function Sh(){return!!Ti&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function Sd(n){return n+n%2}function R_(n){Ti&&window.chrome!==void 0&&n.addEventListener("mousedown",e=>{if(e.button===1)return e.preventDefault(),!1})}class wc{constructor(e,t,s){this.Fc=0,this.Hc=null,this.Uc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.$c=0,this.qc=null,this.Yc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.jc=null,this.Zc=!1,this.Kc=null,this.Xc=null,this.Gc=!1,this.Jc=!1,this.Qc=!1,this.td=null,this.sd=null,this.nd=null,this.ed=null,this.rd=null,this.hd=null,this.ad=null,this.ld=0,this.od=!1,this._d=!1,this.ud=!1,this.dd=0,this.fd=null,this.pd=!Sh(),this.vd=r=>{this.md(r)},this.wd=r=>{if(this.gd(r)){const a=this.Md(r);if(++this.$c,this.qc&&this.$c>1){const{bd:l}=this.xd(ss(r),this.Yc);l<30&&!this.Qc&&this.Sd(a,this.yd.Cd),this.Pd()}}else{const a=this.Md(r);if(++this.Fc,this.Hc&&this.Fc>1){const{bd:l}=this.xd(ss(r),this.Uc);l<5&&!this.Jc&&this.kd(a,this.yd.Td),this.Rd()}}},this.Dd=e,this.yd=t,this.ys=s,this.Vd()}m(){this.td!==null&&(this.td(),this.td=null),this.sd!==null&&(this.sd(),this.sd=null),this.ed!==null&&(this.ed(),this.ed=null),this.rd!==null&&(this.rd(),this.rd=null),this.hd!==null&&(this.hd(),this.hd=null),this.nd!==null&&(this.nd(),this.nd=null),this.Id(),this.Rd()}Bd(e){this.ed&&this.ed();const t=this.Ad.bind(this);if(this.ed=()=>{this.Dd.removeEventListener("mousemove",t)},this.Dd.addEventListener("mousemove",t),this.gd(e))return;const s=this.Md(e);this.kd(s,this.yd.Ed),this.pd=!0}Rd(){this.Hc!==null&&clearTimeout(this.Hc),this.Fc=0,this.Hc=null,this.Uc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Pd(){this.qc!==null&&clearTimeout(this.qc),this.$c=0,this.qc=null,this.Yc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Ad(e){if(this.ud||this.Xc!==null||this.gd(e))return;const t=this.Md(e);this.kd(t,this.yd.zd),this.pd=!0}Ld(e){const t=Eh(e.changedTouches,me(this.fd));if(t===null||(this.dd=Sl(e),this.ad!==null)||this._d)return;this.od=!0;const s=this.xd(ss(t),me(this.Xc)),{Od:r,Nd:a,bd:l}=s;if(this.Gc||!(l<5)){if(!this.Gc){const u=.5*r,d=a>=u&&!this.ys.Wd(),f=u>a&&!this.ys.Fd();d||f||(this._d=!0),this.Gc=!0,this.Qc=!0,this.Id(),this.Pd()}if(!this._d){const u=this.Md(e,t);this.Sd(u,this.yd.Hd),pi(e)}}}Ud(e){if(e.button!==0)return;const t=this.xd(ss(e),me(this.Kc)),{bd:s}=t;if(s>=5&&(this.Jc=!0,this.Rd()),this.Jc){const r=this.Md(e);this.kd(r,this.yd.$d)}}xd(e,t){const s=Math.abs(t._t-e._t),r=Math.abs(t.ut-e.ut);return{Od:s,Nd:r,bd:s+r}}qd(e){let t=Eh(e.changedTouches,me(this.fd));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.fd=null,this.dd=Sl(e),this.Id(),this.Xc=null,this.hd&&(this.hd(),this.hd=null);const s=this.Md(e,t);if(this.Sd(s,this.yd.Yd),++this.$c,this.qc&&this.$c>1){const{bd:r}=this.xd(ss(t),this.Yc);r<30&&!this.Qc&&this.Sd(s,this.yd.Cd),this.Pd()}else this.Qc||(this.Sd(s,this.yd.jd),this.yd.jd&&pi(e));this.$c===0&&pi(e),e.touches.length===0&&this.Zc&&(this.Zc=!1,pi(e))}md(e){if(e.button!==0)return;const t=this.Md(e);if(this.Kc=null,this.ud=!1,this.rd&&(this.rd(),this.rd=null),Sg()&&this.Dd.ownerDocument.documentElement.removeEventListener("mouseleave",this.vd),!this.gd(e))if(this.kd(t,this.yd.Zd),++this.Fc,this.Hc&&this.Fc>1){const{bd:s}=this.xd(ss(e),this.Uc);s<5&&!this.Jc&&this.kd(t,this.yd.Td),this.Rd()}else this.Jc||this.kd(t,this.yd.Kd)}Id(){this.jc!==null&&(clearTimeout(this.jc),this.jc=null)}Xd(e){if(this.fd!==null)return;const t=e.changedTouches[0];this.fd=t.identifier,this.dd=Sl(e);const s=this.Dd.ownerDocument.documentElement;this.Qc=!1,this.Gc=!1,this._d=!1,this.Xc=ss(t),this.hd&&(this.hd(),this.hd=null);{const a=this.Ld.bind(this),l=this.qd.bind(this);this.hd=()=>{s.removeEventListener("touchmove",a),s.removeEventListener("touchend",l)},s.addEventListener("touchmove",a,{passive:!1}),s.addEventListener("touchend",l,{passive:!1}),this.Id(),this.jc=setTimeout(this.Gd.bind(this,e),240)}const r=this.Md(e,t);this.Sd(r,this.yd.Jd),this.qc||(this.$c=0,this.qc=setTimeout(this.Pd.bind(this),500),this.Yc=ss(t))}Qd(e){if(e.button!==0)return;const t=this.Dd.ownerDocument.documentElement;Sg()&&t.addEventListener("mouseleave",this.vd),this.Jc=!1,this.Kc=ss(e),this.rd&&(this.rd(),this.rd=null);{const r=this.Ud.bind(this),a=this.md.bind(this);this.rd=()=>{t.removeEventListener("mousemove",r),t.removeEventListener("mouseup",a)},t.addEventListener("mousemove",r),t.addEventListener("mouseup",a)}if(this.ud=!0,this.gd(e))return;const s=this.Md(e);this.kd(s,this.yd.tf),this.Hc||(this.Fc=0,this.Hc=setTimeout(this.Rd.bind(this),500),this.Uc=ss(e))}Vd(){this.Dd.addEventListener("mouseenter",this.Bd.bind(this)),this.Dd.addEventListener("touchcancel",this.Id.bind(this));{const e=this.Dd.ownerDocument,t=s=>{this.yd.if&&(s.composed&&this.Dd.contains(s.composedPath()[0])||s.target&&this.Dd.contains(s.target)||this.yd.if())};this.sd=()=>{e.removeEventListener("touchstart",t)},this.td=()=>{e.removeEventListener("mousedown",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0})}Sh()&&(this.nd=()=>{this.Dd.removeEventListener("dblclick",this.wd)},this.Dd.addEventListener("dblclick",this.wd)),this.Dd.addEventListener("mouseleave",this.sf.bind(this)),this.Dd.addEventListener("touchstart",this.Xd.bind(this),{passive:!0}),R_(this.Dd),this.Dd.addEventListener("mousedown",this.Qd.bind(this)),this.nf(),this.Dd.addEventListener("touchmove",()=>{},{passive:!1})}nf(){this.yd.ef===void 0&&this.yd.rf===void 0&&this.yd.hf===void 0||(this.Dd.addEventListener("touchstart",e=>this.af(e.touches),{passive:!0}),this.Dd.addEventListener("touchmove",e=>{if(e.touches.length===2&&this.ad!==null&&this.yd.rf!==void 0){const t=Eg(e.touches[0],e.touches[1])/this.ld;this.yd.rf(this.ad,t),pi(e)}},{passive:!1}),this.Dd.addEventListener("touchend",e=>{this.af(e.touches)}))}af(e){e.length===1&&(this.od=!1),e.length!==2||this.od||this.Zc?this.lf():this._f(e)}_f(e){const t=this.Dd.getBoundingClientRect()||{left:0,top:0};this.ad={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.ld=Eg(e[0],e[1]),this.yd.ef!==void 0&&this.yd.ef(),this.Id()}lf(){this.ad!==null&&(this.ad=null,this.yd.hf!==void 0&&this.yd.hf())}sf(e){if(this.ed&&this.ed(),this.gd(e)||!this.pd)return;const t=this.Md(e);this.kd(t,this.yd.uf),this.pd=!Sh()}Gd(e){const t=Eh(e.touches,me(this.fd));if(t===null)return;const s=this.Md(e,t);this.Sd(s,this.yd.cf),this.Qc=!0,this.Zc=!0}gd(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:Sl(e)<this.dd+500}Sd(e,t){t&&t.call(this.yd,e)}kd(e,t){t&&t.call(this.yd,e)}Md(e,t){const s=t||e,r=this.Dd.getBoundingClientRect()||{left:0,top:0};return{clientX:s.clientX,clientY:s.clientY,pageX:s.pageX,pageY:s.pageY,screenX:s.screenX,screenY:s.screenY,localX:s.clientX-r.left,localY:s.clientY-r.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,df:!e.type.startsWith("mouse")&&e.type!=="contextmenu"&&e.type!=="click",ff:e.type,pf:s.target,$o:e.view,vf:()=>{e.type!=="touchstart"&&pi(e)}}}}function Eg(n,e){const t=n.clientX-e.clientX,s=n.clientY-e.clientY;return Math.sqrt(t*t+s*s)}function pi(n){n.cancelable&&n.preventDefault()}function ss(n){return{_t:n.pageX,ut:n.pageY}}function Sl(n){return n.timeStamp||performance.now()}function Eh(n,e){for(let t=0;t<n.length;++t)if(n[t].identifier===e)return n[t];return null}class P_{constructor(e,t,s){this.mf=null,this.wf=null,this.gf=!0,this.Mf=null,this.bf=e,this.xf=e.Sf()[t],this.Cf=e.Sf()[s],this.yf=document.createElement("tr"),this.yf.style.height="1px",this.Pf=document.createElement("td"),this.Pf.style.position="relative",this.Pf.style.padding="0",this.Pf.style.margin="0",this.Pf.setAttribute("colspan","3"),this.kf(),this.yf.appendChild(this.Pf),this.gf=this.bf.N().layout.panes.enableResize,this.gf?this.Tf():(this.mf=null,this.wf=null)}m(){this.wf!==null&&this.wf.m()}Rf(){return this.yf}Df(){return at({width:this.xf.Df().width,height:1})}Vf(){return at({width:this.xf.Vf().width,height:1*window.devicePixelRatio})}If(e,t,s){const r=this.Vf();e.fillStyle=this.bf.N().layout.panes.separatorColor,e.fillRect(t,s,r.width,r.height)}Pt(){this.kf(),this.bf.N().layout.panes.enableResize!==this.gf&&(this.gf=this.bf.N().layout.panes.enableResize,this.gf?this.Tf():(this.mf!==null&&(this.Pf.removeChild(this.mf.Bf),this.Pf.removeChild(this.mf.Af),this.mf=null),this.wf!==null&&(this.wf.m(),this.wf=null)))}Tf(){const e=document.createElement("div"),t=e.style;t.position="fixed",t.display="none",t.zIndex="49",t.top="0",t.left="0",t.width="100%",t.height="100%",t.cursor="row-resize",this.Pf.appendChild(e);const s=document.createElement("div"),r=s.style;r.position="absolute",r.zIndex="50",r.top="-4px",r.height="9px",r.width="100%",r.backgroundColor="",r.cursor="row-resize",this.Pf.appendChild(s);const a={Ed:this.Ef.bind(this),uf:this.zf.bind(this),tf:this.Lf.bind(this),Jd:this.Lf.bind(this),$d:this.Of.bind(this),Hd:this.Of.bind(this),Zd:this.Nf.bind(this),Yd:this.Nf.bind(this)};this.wf=new wc(s,a,{Wd:()=>!1,Fd:()=>!0}),this.mf={Af:s,Bf:e}}kf(){this.Pf.style.background=this.bf.N().layout.panes.separatorColor}Ef(e){this.mf!==null&&(this.mf.Af.style.backgroundColor=this.bf.N().layout.panes.separatorHoverColor)}zf(e){this.mf!==null&&this.Mf===null&&(this.mf.Af.style.backgroundColor="")}Lf(e){if(this.mf===null)return;const t=this.xf.Wf().fo()+this.Cf.Wf().fo(),s=t/(this.xf.Df().height+this.Cf.Df().height),r=30*s;t<=2*r||(this.Mf={Ff:e.pageY,Hf:this.xf.Wf().fo(),Uf:t-r,$f:t,qf:s,Yf:r},this.mf.Bf.style.display="block")}Of(e){const t=this.Mf;if(t===null)return;const s=(e.pageY-t.Ff)*t.qf,r=La(t.Hf+s,t.Yf,t.Uf);this.xf.Wf().po(r),this.Cf.Wf().po(t.$f-r),this.bf.Qt().Bh()}Nf(e){this.Mf!==null&&this.mf!==null&&(this.Mf=null,this.mf.Bf.style.display="none")}}function Mh(n,e){return n.jf-e.jf}function Dh(n,e,t){const s=(n.jf-e.jf)/(n.wt-e.wt);return Math.sign(s)*Math.min(Math.abs(s),t)}class z_{constructor(e,t,s,r){this.Zf=null,this.Kf=null,this.Xf=null,this.Gf=null,this.Jf=null,this.Qf=0,this.tp=0,this.ip=e,this.sp=t,this.np=s,this.Mn=r}ep(e,t){if(this.Zf!==null){if(this.Zf.wt===t)return void(this.Zf.jf=e);if(Math.abs(this.Zf.jf-e)<this.Mn)return}this.Gf=this.Xf,this.Xf=this.Kf,this.Kf=this.Zf,this.Zf={wt:t,jf:e}}le(e,t){if(this.Zf===null||this.Kf===null||t-this.Zf.wt>50)return;let s=0;const r=Dh(this.Zf,this.Kf,this.sp),a=Mh(this.Zf,this.Kf),l=[r],u=[a];if(s+=a,this.Xf!==null){const f=Dh(this.Kf,this.Xf,this.sp);if(Math.sign(f)===Math.sign(r)){const p=Mh(this.Kf,this.Xf);if(l.push(f),u.push(p),s+=p,this.Gf!==null){const g=Dh(this.Xf,this.Gf,this.sp);if(Math.sign(g)===Math.sign(r)){const y=Mh(this.Xf,this.Gf);l.push(g),u.push(y),s+=y}}}}let d=0;for(let f=0;f<l.length;++f)d+=u[f]/s*l[f];Math.abs(d)<this.ip||(this.Jf={jf:e,wt:t},this.tp=d,this.Qf=function(f,p){const g=Math.log(p);return Math.log(1*g/-f)/g}(Math.abs(d),this.np))}cu(e){const t=me(this.Jf),s=e-t.wt;return t.jf+this.tp*(Math.pow(this.np,s)-1)/Math.log(this.np)}uu(e){return this.Jf===null||this.rp(e)===this.Qf}rp(e){const t=e-me(this.Jf).wt;return Math.min(t,this.Qf)}}class B_{constructor(e,t){this.hp=void 0,this.ap=void 0,this.lp=void 0,this.ps=!1,this.op=e,this._p=t,this.up()}Pt(){this.up()}cp(){this.hp&&this.op.removeChild(this.hp),this.ap&&this.op.removeChild(this.ap),this.hp=void 0,this.ap=void 0}dp(){return this.ps!==this.fp()||this.lp!==this.pp()}pp(){return this._p.Qt().Ki().J(this._p.N().layout.textColor)>160?"dark":"light"}fp(){return this._p.N().layout.attributionLogo}vp(){const e=new URL(location.href);return e.hostname?"&utm_source="+e.hostname+e.pathname:""}up(){this.dp()&&(this.cp(),this.ps=this.fp(),this.ps&&(this.lp=this.pp(),this.ap=document.createElement("style"),this.ap.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.hp=document.createElement("a"),this.hp.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.vp()}`,this.hp.title="Charting by TradingView",this.hp.id="tv-attr-logo",this.hp.target="_blank",this.hp.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.hp.toggleAttribute("data-dark",this.lp==="dark"),this.op.appendChild(this.ap),this.op.appendChild(this.hp)))}}function Pr(n,e){const t=me(n.ownerDocument).createElement("canvas");n.appendChild(t);const s=Nk(t,{options:{allowResizeObserver:!0},transform:(r,a)=>({width:Math.max(r.width,a.width),height:Math.max(r.height,a.height)})});return s.resizeCanvasElement(e),s}function zr(n){var e;n.width=1,n.height=1,(e=n.getContext("2d"))==null||e.clearRect(0,0,1,1)}function Ed(n,e,t,s){n.ih&&n.ih(e,t,s)}function Pl(n,e,t,s){n.nt(e,t,s)}function Md(n,e,t,s){const r=n(t,s);for(const a of r){const l=a.Tt(s);l!==null&&e(l)}}function Th(n,e){return t=>{var s,r;return function(a){return a.Wt!==void 0}(t)?(((s=t.Wt())==null?void 0:s.wa())??"")!==e?[]:((r=t.ta)==null?void 0:r.call(t,n))??[]:[]}}function Mg(n,e,t,s){if(!n.length)return;let r=0;const a=n[0].$t(s,!0);let l=e===1?t/2-(n[0].Wi()-a/2):n[0].Wi()-a/2-t/2;l=Math.max(0,l);for(let u=1;u<n.length;u++){const d=n[u],f=n[u-1],p=f.$t(s,!1),g=d.Wi(),y=f.Wi();if(e===1?g>y-p:g<y+p){const w=y-p*e;d.Fi(w);const k=w-e*p/2;if((e===1?k<0:k>t)&&l>0){const _=e===1?-1-k:k-t,C=Math.min(_,l);for(let S=r;S<n.length;S++)n[S].Fi(n[S].Wi()+e*C);l-=C}}else r=u,l=e===1?y-p-g:g-(y+p)}}class Dg{constructor(e,t,s,r){this.Yi=null,this.mp=null,this.wp=!1,this.gp=new Xl(200),this.Mp=null,this.bp=0,this.xp=!1,this.Sp=()=>{this.xp||this.yt.Cp().Qt().ar()},this.yp=()=>{this.xp||this.yt.Cp().Qt().ar()},this.yt=e,this.ys=t,this._l=t.layout,this.Au=s,this.Pp=r==="left",this.kp=Th("normal",r),this.Tp=Th("top",r),this.Rp=Th("bottom",r),this.Pf=document.createElement("div"),this.Pf.style.height="100%",this.Pf.style.overflow="hidden",this.Pf.style.width="25px",this.Pf.style.left="0",this.Pf.style.position="relative",this.Dp=Pr(this.Pf,at({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);const a=this.Dp.canvasElement;a.style.position="absolute",a.style.zIndex="1",a.style.left="0",a.style.top="0",this.Vp=Pr(this.Pf,at({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);const l=this.Vp.canvasElement;l.style.position="absolute",l.style.zIndex="2",l.style.left="0",l.style.top="0";const u={tf:this.Lf.bind(this),Jd:this.Lf.bind(this),$d:this.Of.bind(this),Hd:this.Of.bind(this),if:this.Ip.bind(this),Zd:this.Nf.bind(this),Yd:this.Nf.bind(this),Td:this.Bp.bind(this),Cd:this.Bp.bind(this),Ed:this.Ap.bind(this),uf:this.zf.bind(this)};this.wf=new wc(this.Vp.canvasElement,u,{Wd:()=>!this.ys.handleScroll.vertTouchDrag,Fd:()=>!0})}m(){this.wf.m(),this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),zr(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),zr(this.Dp.canvasElement),this.Dp.dispose(),this.Yi!==null&&this.Yi.Hl().u(this),this.Yi=null}Rf(){return this.Pf}P(){return this._l.fontSize}Ep(){const e=this.Au.N();return this.Mp!==e.k&&(this.gp.In(),this.Mp=e.k),e}zp(){if(this.Yi===null)return 0;let e=0;const t=this.Ep(),s=me(this.Dp.canvasElement.getContext("2d",{colorSpace:this.yt.Cp().N().layout.colorSpace}));s.save();const r=this.Yi.Va();s.font=this.Lp(),r.length>0&&(e=Math.max(this.gp.Vi(s,r[0].$a),this.gp.Vi(s,r[r.length-1].$a)));const a=this.Op();for(let f=a.length;f--;){const p=this.gp.Vi(s,a[f].ri());p>e&&(e=p)}const l=this.Yi.zt();if(l!==null&&this.mp!==null&&(u=this.ys.crosshair).mode!==2&&u.horzLine.visible&&u.horzLine.labelVisible){const f=this.Yi.Ts(1,l),p=this.Yi.Ts(this.mp.height-2,l);e=Math.max(e,this.gp.Vi(s,this.Yi.Xi(Math.floor(Math.min(f,p))+.11111111111111,l)),this.gp.Vi(s,this.Yi.Xi(Math.ceil(Math.max(f,p))-.11111111111111,l)))}var u;s.restore();const d=e||34;return Sd(Math.ceil(t.S+t.C+t.I+t.B+5+d))}Np(e){this.mp!==null&&Ar(this.mp,e)||(this.mp=e,this.xp=!0,this.Dp.resizeCanvasElement(e),this.Vp.resizeCanvasElement(e),this.xp=!1,this.Pf.style.width=`${e.width}px`,this.Pf.style.height=`${e.height}px`)}Wp(){return me(this.mp).width}_s(e){this.Yi!==e&&(this.Yi!==null&&this.Yi.Hl().u(this),this.Yi=e,e.Hl().i(this.il.bind(this),this))}Wt(){return this.Yi}In(){const e=this.yt.Wf();this.yt.Cp().Qt().Bo(e,me(this.Wt()))}Fp(e){if(this.mp===null)return;const t={colorSpace:this.yt.Cp().N().layout.colorSpace};if(e!==1){this.Hp(),this.Dp.applySuggestedBitmapSize();const r=Or(this.Dp,t);r!==null&&(r.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a)}),this.yt.qp(r,this.Rp),this.Yp(r),this.yt.qp(r,this.kp),this.jp(r))}this.Vp.applySuggestedBitmapSize();const s=Or(this.Vp,t);s!==null&&(s.useBitmapCoordinateSpace(({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)}),this.Zp(s),this.yt.qp(s,this.Tp))}Vf(){return this.Dp.bitmapSize}If(e,t,s){const r=this.Vf();r.width>0&&r.height>0&&e.drawImage(this.Dp.canvasElement,t,s)}Pt(){var e;(e=this.Yi)==null||e.Va()}Lf(e){if(this.Yi===null||this.Yi.Zi()||!this.ys.handleScale.axisPressedMouseMove.price)return;const t=this.yt.Cp().Qt(),s=this.yt.Wf();this.wp=!0,t.Po(s,this.Yi,e.localY)}Of(e){if(this.Yi===null||!this.ys.handleScale.axisPressedMouseMove.price)return;const t=this.yt.Cp().Qt(),s=this.yt.Wf(),r=this.Yi;t.ko(s,r,e.localY)}Ip(){if(this.Yi===null||!this.ys.handleScale.axisPressedMouseMove.price)return;const e=this.yt.Cp().Qt(),t=this.yt.Wf(),s=this.Yi;this.wp&&(this.wp=!1,e.To(t,s))}Nf(e){if(this.Yi===null||!this.ys.handleScale.axisPressedMouseMove.price)return;const t=this.yt.Cp().Qt(),s=this.yt.Wf();this.wp=!1,t.To(s,this.Yi)}Bp(e){this.ys.handleScale.axisDoubleClickReset.price&&this.In()}Ap(e){this.Yi!==null&&(!this.yt.Cp().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Le()||this.Yi.gl()||this.Kp(1))}zf(e){this.Kp(0)}Op(){const e=[],t=this.Yi===null?void 0:this.Yi;return(s=>{for(let r=0;r<s.length;++r){const a=s[r].Fs(this.yt.Wf(),t);for(let l=0;l<a.length;l++)e.push(a[l])}})(this.yt.Wf().Dt()),e}Up({context:e,bitmapSize:t}){const{width:s,height:r}=t,a=this.yt.Wf().Qt(),l=a.$(),u=a.xc();l===u?mc(e,0,0,s,r,l):Xv(e,0,0,s,r,l,u)}$p({context:e,bitmapSize:t,horizontalPixelRatio:s}){if(this.mp===null||this.Yi===null||!this.Yi.N().borderVisible)return;e.fillStyle=this.Yi.N().borderColor;const r=Math.max(1,Math.floor(this.Ep().S*s));let a;a=this.Pp?t.width-r:0,e.fillRect(a,0,r,t.height)}Yp(e){if(this.mp===null||this.Yi===null)return;const t=this.Yi.Va(),s=this.Yi.N(),r=this.Ep(),a=this.Pp?this.mp.width-r.C:0;s.borderVisible&&s.ticksVisible&&e.useBitmapCoordinateSpace(({context:l,horizontalPixelRatio:u,verticalPixelRatio:d})=>{l.fillStyle=s.borderColor;const f=Math.max(1,Math.floor(d)),p=Math.floor(.5*d),g=Math.round(r.C*u);l.beginPath();for(const y of t)l.rect(Math.floor(a*u),Math.round(y.Pa*d)-p,g,f);l.fill()}),e.useMediaCoordinateSpace(({context:l})=>{l.font=this.Lp(),l.fillStyle=s.textColor??this._l.textColor,l.textAlign=this.Pp?"right":"left",l.textBaseline="middle";const u=this.Pp?Math.round(a-r.I):Math.round(a+r.C+r.I),d=t.map(f=>this.gp.Di(l,f.$a));for(let f=t.length;f--;){const p=t[f];l.fillText(p.$a,u,p.Pa+d[f])}})}Hp(){if(this.mp===null||this.Yi===null)return;let e=this.mp.height/2;const t=[],s=this.Yi.Dt().slice(),r=this.yt.Wf(),a=this.Ep();this.Yi===r.$n()&&this.yt.Wf().Dt().forEach(d=>{r.Un(d)&&s.push(d)});const l=this.Yi.ba()[0],u=this.Yi;s.forEach(d=>{const f=d.Fs(r,u);f.forEach(p=>{p.Fi(null),p.Hi()&&t.push(p)}),l===d&&f.length>0&&(e=f[0].Bi())}),t.forEach(d=>d.Fi(d.Bi())),this.Yi.N().alignLabels&&this.Xp(t,a,e)}Xp(e,t,s){if(this.mp===null)return;const r=e.filter(l=>l.Bi()<=s),a=e.filter(l=>l.Bi()>s);r.sort((l,u)=>u.Bi()-l.Bi()),r.length&&a.length&&a.push(r[0]),a.sort((l,u)=>l.Bi()-u.Bi());for(const l of e){const u=Math.floor(l.$t(t)/2),d=l.Bi();d>-u&&d<u&&l.Fi(u),d>this.mp.height-u&&d<this.mp.height+u&&l.Fi(this.mp.height-u)}Mg(r,1,this.mp.height,t),Mg(a,-1,this.mp.height,t)}jp(e){if(this.mp===null)return;const t=this.Op(),s=this.Ep(),r=this.Pp?"right":"left";t.forEach(a=>{a.Ui()&&a.Tt(me(this.Yi)).nt(e,s,this.gp,r)})}Zp(e){if(this.mp===null||this.Yi===null)return;const t=this.yt.Cp().Qt(),s=[],r=this.yt.Wf(),a=t.Yu().Fs(r,this.Yi);a.length&&s.push(a);const l=this.Ep(),u=this.Pp?"right":"left";s.forEach(d=>{d.forEach(f=>{f.Tt(me(this.Yi)).nt(e,l,this.gp,u)})})}Kp(e){this.Pf.style.cursor=e===1?"ns-resize":"default"}il(){const e=this.zp();this.bp<e&&this.yt.Cp().Qt().Bh(),this.bp=e}Lp(){return ql(this._l.fontSize,this._l.fontFamily)}}function V_(n,e){var t;return((t=n.Jh)==null?void 0:t.call(n,e))??[]}function Tg(n,e){var t;return((t=n.Ws)==null?void 0:t.call(n,e))??[]}function Ig(n,e){var t;return((t=n.us)==null?void 0:t.call(n,e))??[]}function $_(n,e){var t;return((t=n.Kh)==null?void 0:t.call(n,e))??[]}class gf{constructor(e,t){this.mp=at({width:0,height:0}),this.Gp=null,this.Jp=null,this.Qp=null,this.tv=null,this.iv=!1,this.sv=new Et,this.nv=new Et,this.ev=0,this.rv=!1,this.hv=null,this.av=!1,this.lv=null,this.ov=null,this.xp=!1,this.Sp=()=>{this.xp||this._v===null||this.ts().ar()},this.yp=()=>{this.xp||this._v===null||this.ts().ar()},this._p=e,this._v=t,this._v.zo().i(this.uv.bind(this),this,!0),this.cv=document.createElement("td"),this.cv.style.padding="0",this.cv.style.position="relative";const s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",s.style.overflow="hidden",this.dv=document.createElement("td"),this.dv.style.padding="0",this.fv=document.createElement("td"),this.fv.style.padding="0",this.cv.appendChild(s),this.Dp=Pr(s,at({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);const r=this.Dp.canvasElement;r.style.position="absolute",r.style.zIndex="1",r.style.left="0",r.style.top="0",this.Vp=Pr(s,at({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);const a=this.Vp.canvasElement;a.style.position="absolute",a.style.zIndex="2",a.style.left="0",a.style.top="0",this.yf=document.createElement("tr"),this.yf.appendChild(this.dv),this.yf.appendChild(this.cv),this.yf.appendChild(this.fv),this.pv(),this.wf=new wc(this.Vp.canvasElement,this,{Wd:()=>this.hv===null&&!this._p.N().handleScroll.vertTouchDrag,Fd:()=>this.hv===null&&!this._p.N().handleScroll.horzTouchDrag})}m(){this.Gp!==null&&this.Gp.m(),this.Jp!==null&&this.Jp.m(),this.Qp=null,this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),zr(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),zr(this.Dp.canvasElement),this.Dp.dispose(),this._v!==null&&(this._v.zo().u(this),this._v.m()),this.wf.m()}Wf(){return me(this._v)}vv(e){var t;this._v!==null&&this._v.zo().u(this),this._v=e,this._v!==null&&this._v.zo().i(gf.prototype.uv.bind(this),this,!0),this.pv(),this._p.Sf().indexOf(this)===this._p.Sf().length-1?(this.Qp=this.Qp??new B_(this.cv,this._p),this.Qp.Pt()):((t=this.Qp)==null||t.cp(),this.Qp=null)}Cp(){return this._p}Rf(){return this.yf}pv(){if(this._v!==null&&(this.mv(),this.ts().js().length!==0)){if(this.Gp!==null){const e=this._v.Co();this.Gp._s(me(e))}if(this.Jp!==null){const e=this._v.yo();this.Jp._s(me(e))}}}wv(){this.Gp!==null&&this.Gp.Pt(),this.Jp!==null&&this.Jp.Pt()}fo(){return this._v!==null?this._v.fo():0}po(e){this._v&&this._v.po(e)}Ed(e){if(!this._v)return;this.gv();const t=e.localX,s=e.localY;this.Mv(t,s,e)}tf(e){this.gv(),this.bv(),this.Mv(e.localX,e.localY,e)}zd(e){if(!this._v)return;this.gv();const t=e.localX,s=e.localY;this.Mv(t,s,e)}Kd(e){this._v!==null&&(this.gv(),this.xv(e))}Td(e){this._v!==null&&this.Sv(this.nv,e)}Cd(e){this.Td(e)}$d(e){this.gv(),this.Cv(e),this.Mv(e.localX,e.localY,e)}Zd(e){this._v!==null&&(this.gv(),this.rv=!1,this.yv(e))}jd(e){this._v!==null&&this.xv(e)}cf(e){if(this.rv=!0,this.hv===null){const t={x:e.localX,y:e.localY};this.Pv(t,t,e)}}uf(e){this._v!==null&&(this.gv(),this._v.Qt().Uu(null),this.kv())}Tv(){return this.sv}Rv(){return this.nv}ef(){this.ev=1,this.ts().hn()}rf(e,t){if(!this._p.N().handleScale.pinch)return;const s=5*(t-this.ev);this.ev=t,this.ts().tc(e._t,s)}Jd(e){this.rv=!1,this.av=this.hv!==null,this.bv();const t=this.ts().Yu();this.hv!==null&&t.Vt()&&(this.lv={x:t.si(),y:t.ni()},this.hv={x:e.localX,y:e.localY})}Hd(e){if(this._v===null)return;const t=e.localX,s=e.localY;if(this.hv===null)this.Cv(e);else{this.av=!1;const r=me(this.lv),a=r.x+(t-this.hv.x),l=r.y+(s-this.hv.y);this.Mv(a,l,e)}}Yd(e){this.Cp().N().trackingMode.exitMode===0&&(this.av=!0),this.Dv(),this.yv(e)}jn(e,t){const s=this._v;return s===null?null:cx(s,e,t)}Vv(e,t){me(t==="left"?this.Gp:this.Jp).Np(at({width:e,height:this.mp.height}))}Df(){return this.mp}Np(e){Ar(this.mp,e)||(this.mp=e,this.xp=!0,this.Dp.resizeCanvasElement(e),this.Vp.resizeCanvasElement(e),this.xp=!1,this.cv.style.width=e.width+"px",this.cv.style.height=e.height+"px")}Iv(){const e=me(this._v);e.So(e.Co()),e.So(e.yo());for(const t of e.ba())if(e.Un(t)){const s=t.Wt();s!==null&&e.So(s),t.Ns()}for(const t of e.Oo())t.Ns()}Vf(){return this.Dp.bitmapSize}If(e,t,s){const r=this.Vf();r.width>0&&r.height>0&&e.drawImage(this.Dp.canvasElement,t,s)}Fp(e){if(e===0||this._v===null)return;e>1&&this.Iv(),this.Gp!==null&&this.Gp.Fp(e),this.Jp!==null&&this.Jp.Fp(e);const t={colorSpace:this._p.N().layout.colorSpace};if(e!==1){this.Dp.applySuggestedBitmapSize();const r=Or(this.Dp,t);r!==null&&(r.useBitmapCoordinateSpace(a=>{this.Up(a)}),this._v&&(this.Bv(r,V_),this.Av(r),this.Bv(r,Tg),this.Bv(r,Ig)))}this.Vp.applySuggestedBitmapSize();const s=Or(this.Vp,t);s!==null&&(s.useBitmapCoordinateSpace(({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)}),this.Ev(s),this.Bv(s,$_),this.Bv(s,Ig))}zv(){return this.Gp}Lv(){return this.Jp}qp(e,t){this.Bv(e,t)}uv(){this._v!==null&&this._v.zo().u(this),this._v=null}xv(e){this.Sv(this.sv,e)}Sv(e,t){const s=t.localX,r=t.localY;e.v()&&e.p(this.ts().At().Z_(s),{x:s,y:r},t)}Up({context:e,bitmapSize:t}){const{width:s,height:r}=t,a=this.ts(),l=a.$(),u=a.xc();l===u?mc(e,0,0,s,r,u):Xv(e,0,0,s,r,l,u)}Av(e){const t=me(this._v),s=t.Lo().lr().Tt(t);s!==null&&s.nt(e,!1)}Ev(e){this.Ov(e,Tg,Pl,this.ts().Yu())}Bv(e,t){const s=me(this._v),r=s.Dt(),a=s.Oo();for(const l of a)this.Ov(e,t,Ed,l);for(const l of r)this.Ov(e,t,Ed,l);for(const l of a)this.Ov(e,t,Pl,l);for(const l of r)this.Ov(e,t,Pl,l)}Ov(e,t,s,r){const a=me(this._v),l=a.Qt().Hu(),u=l!==null&&l.Wo===r,d=l!==null&&u&&l.Fo!==void 0?l.Fo.Kn:void 0;Md(t,f=>s(f,e,u,d),r,a)}mv(){if(this._v===null)return;const e=this._p,t=this._v.Co().N().visible,s=this._v.yo().N().visible;t||this.Gp===null||(this.dv.removeChild(this.Gp.Rf()),this.Gp.m(),this.Gp=null),s||this.Jp===null||(this.fv.removeChild(this.Jp.Rf()),this.Jp.m(),this.Jp=null);const r=e.Qt().cc();t&&this.Gp===null&&(this.Gp=new Dg(this,e.N(),r,"left"),this.dv.appendChild(this.Gp.Rf())),s&&this.Jp===null&&(this.Jp=new Dg(this,e.N(),r,"right"),this.fv.appendChild(this.Jp.Rf()))}Nv(e){return e.df&&this.rv||this.hv!==null}Wv(e){return Math.max(0,Math.min(e,this.mp.width-1))}Fv(e){return Math.max(0,Math.min(e,this.mp.height-1))}Mv(e,t,s){this.ts().lc(this.Wv(e),this.Fv(t),s,me(this._v))}kv(){this.ts()._c()}Dv(){this.av&&(this.hv=null,this.kv())}Pv(e,t,s){this.hv=e,this.av=!1,this.Mv(t.x,t.y,s);const r=this.ts().Yu();this.lv={x:r.si(),y:r.ni()}}ts(){return this._p.Qt()}yv(e){if(!this.iv)return;const t=this.ts(),s=this.Wf();if(t.Vo(s,s.ks()),this.tv=null,this.iv=!1,t.rc(),this.ov!==null){const r=performance.now(),a=t.At();this.ov.le(a.iu(),r),this.ov.uu(r)||t._n(this.ov)}}gv(){this.hv=null}bv(){if(this._v){if(this.ts().hn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)me(document.activeElement).blur();else{const e=document.getSelection();e!==null&&e.removeAllRanges()}!this._v.ks().Zi()&&this.ts().At().Zi()}}Cv(e){if(this._v===null)return;const t=this.ts(),s=t.At();if(s.Zi())return;const r=this._p.N(),a=r.handleScroll,l=r.kineticScroll;if((!a.pressedMouseMove||e.df)&&(!a.horzTouchDrag&&!a.vertTouchDrag||!e.df))return;const u=this._v.ks(),d=performance.now();if(this.tv!==null||this.Nv(e)||(this.tv={x:e.clientX,y:e.clientY,Lc:d,Hv:e.localX,Uv:e.localY}),this.tv!==null&&!this.iv&&(this.tv.x!==e.clientX||this.tv.y!==e.clientY)){if(e.df&&l.touch||!e.df&&l.mouse){const f=s.Q_();this.ov=new z_(.2/f,7/f,.997,15/f),this.ov.ep(s.iu(),this.tv.Lc)}else this.ov=null;u.Zi()||t.Ro(this._v,u,e.localY),t.nc(e.localX),this.iv=!0}this.iv&&(u.Zi()||t.Do(this._v,u,e.localY),t.ec(e.localX),this.ov!==null&&this.ov.ep(s.iu(),d))}}class Ag{constructor(e,t,s,r,a){this.St=!0,this.mp=at({width:0,height:0}),this.Sp=()=>this.Fp(3),this.Pp=e==="left",this.Au=s.cc,this.ys=t,this.$v=r,this.qv=a,this.Pf=document.createElement("div"),this.Pf.style.width="25px",this.Pf.style.height="100%",this.Pf.style.overflow="hidden",this.Dp=Pr(this.Pf,at({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp)}m(){this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),zr(this.Dp.canvasElement),this.Dp.dispose()}Rf(){return this.Pf}Df(){return this.mp}Np(e){Ar(this.mp,e)||(this.mp=e,this.Dp.resizeCanvasElement(e),this.Pf.style.width=`${e.width}px`,this.Pf.style.height=`${e.height}px`,this.St=!0)}Fp(e){if(e<3&&!this.St||this.mp.width===0||this.mp.height===0)return;this.St=!1,this.Dp.applySuggestedBitmapSize();const t=Or(this.Dp,{colorSpace:this.ys.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace(s=>{this.Up(s),this.$p(s)})}Vf(){return this.Dp.bitmapSize}If(e,t,s){const r=this.Vf();r.width>0&&r.height>0&&e.drawImage(this.Dp.canvasElement,t,s)}$p({context:e,bitmapSize:t,horizontalPixelRatio:s,verticalPixelRatio:r}){if(!this.$v())return;e.fillStyle=this.ys.timeScale.borderColor;const a=Math.floor(this.Au.N().S*s),l=Math.floor(this.Au.N().S*r),u=this.Pp?t.width-a:0;e.fillRect(u,0,a,l)}Up({context:e,bitmapSize:t}){mc(e,0,0,t.width,t.height,this.qv())}}function vf(n){return e=>{var t;return((t=e.ia)==null?void 0:t.call(e,n))??[]}}const F_=vf("normal"),H_=vf("top"),U_=vf("bottom");class W_{constructor(e,t){this.Yv=null,this.jv=null,this.M=null,this.Zv=!1,this.mp=at({width:0,height:0}),this.Kv=new Et,this.gp=new Xl(5),this.xp=!1,this.Sp=()=>{this.xp||this._p.Qt().ar()},this.yp=()=>{this.xp||this._p.Qt().ar()},this._p=e,this.Yo=t,this.ys=e.N().layout,this.hp=document.createElement("tr"),this.Xv=document.createElement("td"),this.Xv.style.padding="0",this.Gv=document.createElement("td"),this.Gv.style.padding="0",this.Pf=document.createElement("td"),this.Pf.style.height="25px",this.Pf.style.padding="0",this.Jv=document.createElement("div"),this.Jv.style.width="100%",this.Jv.style.height="100%",this.Jv.style.position="relative",this.Jv.style.overflow="hidden",this.Pf.appendChild(this.Jv),this.Dp=Pr(this.Jv,at({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);const s=this.Dp.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Vp=Pr(this.Jv,at({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);const r=this.Vp.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0",this.hp.appendChild(this.Xv),this.hp.appendChild(this.Pf),this.hp.appendChild(this.Gv),this.Qv(),this._p.Qt().do().i(this.Qv.bind(this),this),this.wf=new wc(this.Vp.canvasElement,this,{Wd:()=>!0,Fd:()=>!this._p.N().handleScroll.horzTouchDrag})}m(){this.wf.m(),this.Yv!==null&&this.Yv.m(),this.jv!==null&&this.jv.m(),this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),zr(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),zr(this.Dp.canvasElement),this.Dp.dispose()}Rf(){return this.hp}tm(){return this.Yv}im(){return this.jv}tf(e){if(this.Zv)return;this.Zv=!0;const t=this._p.Qt();!t.At().Zi()&&this._p.N().handleScale.axisPressedMouseMove.time&&t.Qu(e.localX)}Jd(e){this.tf(e)}if(){const e=this._p.Qt();!e.At().Zi()&&this.Zv&&(this.Zv=!1,this._p.N().handleScale.axisPressedMouseMove.time&&e.ac())}$d(e){const t=this._p.Qt();!t.At().Zi()&&this._p.N().handleScale.axisPressedMouseMove.time&&t.hc(e.localX)}Hd(e){this.$d(e)}Zd(){this.Zv=!1;const e=this._p.Qt();e.At().Zi()&&!this._p.N().handleScale.axisPressedMouseMove.time||e.ac()}Yd(){this.Zd()}Td(){this._p.N().handleScale.axisDoubleClickReset.time&&this._p.Qt().cn()}Cd(){this.Td()}Ed(){this._p.Qt().N().handleScale.axisPressedMouseMove.time&&this.Kp(1)}uf(){this.Kp(0)}Df(){return this.mp}sm(){return this.Kv}nm(e,t,s){Ar(this.mp,e)||(this.mp=e,this.xp=!0,this.Dp.resizeCanvasElement(e),this.Vp.resizeCanvasElement(e),this.xp=!1,this.Pf.style.width=`${e.width}px`,this.Pf.style.height=`${e.height}px`,this.Kv.p(e)),this.Yv!==null&&this.Yv.Np(at({width:t,height:e.height})),this.jv!==null&&this.jv.Np(at({width:s,height:e.height}))}rm(){const e=this.hm();return Math.ceil(e.S+e.C+e.P+e.A+e.V+e.am)}Pt(){this._p.Qt().At().Va()}Vf(){return this.Dp.bitmapSize}If(e,t,s){const r=this.Vf();r.width>0&&r.height>0&&e.drawImage(this.Dp.canvasElement,t,s)}Fp(e){if(e===0)return;const t={colorSpace:this.ys.colorSpace};if(e!==1){this.Dp.applySuggestedBitmapSize();const r=Or(this.Dp,t);r!==null&&(r.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a),this.lm(r,U_)}),this.Yp(r),this.lm(r,F_)),this.Yv!==null&&this.Yv.Fp(e),this.jv!==null&&this.jv.Fp(e)}this.Vp.applySuggestedBitmapSize();const s=Or(this.Vp,t);s!==null&&(s.useBitmapCoordinateSpace(({context:r,bitmapSize:a})=>{r.clearRect(0,0,a.width,a.height)}),this.om([...this._p.Qt().js(),this._p.Qt().Yu()],s),this.lm(s,H_))}lm(e,t){const s=this._p.Qt().js();for(const r of s)Md(t,a=>Ed(a,e,!1,void 0),r,void 0);for(const r of s)Md(t,a=>Pl(a,e,!1,void 0),r,void 0)}Up({context:e,bitmapSize:t}){mc(e,0,0,t.width,t.height,this._p.Qt().xc())}$p({context:e,bitmapSize:t,verticalPixelRatio:s}){if(this._p.N().timeScale.borderVisible){e.fillStyle=this._m();const r=Math.max(1,Math.floor(this.hm().S*s));e.fillRect(0,0,t.width,r)}}Yp(e){const t=this._p.Qt().At(),s=t.Va();if(!s||s.length===0)return;const r=this.Yo.maxTickMarkWeight(s),a=this.hm(),l=t.N();l.borderVisible&&l.ticksVisible&&e.useBitmapCoordinateSpace(({context:u,horizontalPixelRatio:d,verticalPixelRatio:f})=>{u.strokeStyle=this._m(),u.fillStyle=this._m();const p=Math.max(1,Math.floor(d)),g=Math.floor(.5*d);u.beginPath();const y=Math.round(a.C*f);for(let w=s.length;w--;){const k=Math.round(s[w].coord*d);u.rect(k-g,0,p,y)}u.fill()}),e.useMediaCoordinateSpace(({context:u})=>{const d=a.S+a.C+a.A+a.P/2;u.textAlign="center",u.textBaseline="middle",u.fillStyle=this.H(),u.font=this.Lp();for(const f of s)if(f.weight<r){const p=f.needAlignCoordinate?this.um(u,f.coord,f.label):f.coord;u.fillText(f.label,p,d)}this._p.N().timeScale.allowBoldLabels&&(u.font=this.dm());for(const f of s)if(f.weight>=r){const p=f.needAlignCoordinate?this.um(u,f.coord,f.label):f.coord;u.fillText(f.label,p,d)}})}um(e,t,s){const r=this.gp.Vi(e,s),a=r/2,l=Math.floor(t-a)+.5;return l<0?t+=Math.abs(0-l):l+r>this.mp.width&&(t-=Math.abs(this.mp.width-(l+r))),t}om(e,t){const s=this.hm();for(const r of e)for(const a of r.cs())a.Tt().nt(t,s)}_m(){return this._p.N().timeScale.borderColor}H(){return this.ys.textColor}W(){return this.ys.fontSize}Lp(){return ql(this.W(),this.ys.fontFamily)}dm(){return ql(this.W(),this.ys.fontFamily,"bold")}hm(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Gi:new Xl,am:0});const e=this.M,t=this.Lp();if(e.k!==t){const s=this.W();e.P=s,e.k=t,e.A=3*s/12,e.V=3*s/12,e.Ji=9*s/12,e.L=0,e.am=4*s/12,e.Gi.In()}return this.M}Kp(e){this.Pf.style.cursor=e===1?"ew-resize":"default"}Qv(){const e=this._p.Qt(),t=e.N();t.leftPriceScale.visible||this.Yv===null||(this.Xv.removeChild(this.Yv.Rf()),this.Yv.m(),this.Yv=null),t.rightPriceScale.visible||this.jv===null||(this.Gv.removeChild(this.jv.Rf()),this.jv.m(),this.jv=null);const s={cc:this._p.Qt().cc()},r=()=>t.leftPriceScale.borderVisible&&e.At().N().borderVisible,a=()=>e.xc();t.leftPriceScale.visible&&this.Yv===null&&(this.Yv=new Ag("left",t,s,r,a),this.Xv.appendChild(this.Yv.Rf())),t.rightPriceScale.visible&&this.jv===null&&(this.jv=new Ag("right",t,s,r,a),this.Gv.appendChild(this.jv.Rf()))}}var A1;const Y_=!!Ti&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(n=>n.brand.includes("Chromium"))&&!!Ti&&((A1=navigator==null?void 0:navigator.userAgentData)!=null&&A1.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class K_{constructor(e,t,s){var r;this.fm=[],this.pm=[],this.vm=0,this.ja=0,this.no=0,this.wm=0,this.gm=0,this.Mm=null,this.bm=!1,this.sv=new Et,this.nv=new Et,this.Vu=new Et,this.xm=null,this.Sm=null,this.op=e,this.ys=t,this.Yo=s,this.hp=document.createElement("div"),this.hp.classList.add("tv-lightweight-charts"),this.hp.style.overflow="hidden",this.hp.style.direction="ltr",this.hp.style.width="100%",this.hp.style.height="100%",(r=this.hp).style.userSelect="none",r.style.webkitUserSelect="none",r.style.msUserSelect="none",r.style.MozUserSelect="none",r.style.webkitTapHighlightColor="transparent",this.Cm=document.createElement("table"),this.Cm.setAttribute("cellspacing","0"),this.hp.appendChild(this.Cm),this.ym=this.Pm.bind(this),Ih(this.ys)&&this.km(!0),this.ts=new T_(this.Bu.bind(this),this.ys,s),this.Qt().ju().i(this.Tm.bind(this),this),this.Rm=new W_(this,this.Yo),this.Cm.appendChild(this.Rm.Rf());const a=t.autoSize&&this.Dm();let l=this.ys.width,u=this.ys.height;if(a||l===0||u===0){const d=e.getBoundingClientRect();l=l||d.width,u=u||d.height}this.Vm(l,u),this.Im(),e.appendChild(this.hp),this.Bm(),this.ts.At().pu().i(this.ts.Bh.bind(this.ts),this),this.ts.do().i(this.ts.Bh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.ys}Sf(){return this.fm}Am(){return this.Rm}m(){this.km(!1),this.vm!==0&&window.cancelAnimationFrame(this.vm),this.ts.ju().u(this),this.ts.At().pu().u(this),this.ts.do().u(this),this.ts.m();for(const e of this.fm)this.Cm.removeChild(e.Rf()),e.Tv().u(this),e.Rv().u(this),e.m();this.fm=[];for(const e of this.pm)this.Em(e);this.pm=[],me(this.Rm).m(),this.hp.parentElement!==null&&this.hp.parentElement.removeChild(this.hp),this.Vu.m(),this.sv.m(),this.nv.m(),this.zm()}Vm(e,t,s=!1){if(this.ja===t&&this.no===e)return;const r=function(u){const d=Math.floor(u.width),f=Math.floor(u.height);return at({width:d-d%2,height:f-f%2})}(at({width:e,height:t}));this.ja=r.height,this.no=r.width;const a=this.ja+"px",l=this.no+"px";me(this.hp).style.height=a,me(this.hp).style.width=l,this.Cm.style.height=a,this.Cm.style.width=l,s?this.Lm($t.gn(),performance.now()):this.ts.Bh()}Fp(e){e===void 0&&(e=$t.gn());for(let t=0;t<this.fm.length;t++)this.fm[t].Fp(e.en(t).tn);this.ys.timeScale.visible&&this.Rm.Fp(e.nn())}hr(e){var r;const t=Ih(this.ys);this.ts.hr(e);const s=Ih(this.ys);s!==t&&this.km(s),(r=e.layout)!=null&&r.panes&&this.Om(),this.Bm(),this.Nm(e)}Tv(){return this.sv}Rv(){return this.nv}ju(){return this.Vu}Wm(){this.Mm!==null&&(this.Lm(this.Mm,performance.now()),this.Mm=null);const e=this.Fm(null),t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=me(t.getContext("2d"));return this.Fm(s),t}Hm(e){return e==="left"&&!this.Um()||e==="right"&&!this.$m()||this.fm.length===0?0:me(e==="left"?this.fm[0].zv():this.fm[0].Lv()).Wp()}qm(){return this.ys.autoSize&&this.xm!==null}Af(){return this.hp}Ym(e){this.Sm=e,this.Sm?this.Af().style.setProperty("cursor",e):this.Af().style.removeProperty("cursor")}jm(){return this.Sm}Zm(e){return cn(this.fm[e]).Df()}Om(){this.pm.forEach(e=>{e.Pt()})}Nm(e){(e.autoSize!==void 0||!this.xm||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.xm&&this.Dm(),e.autoSize===!1&&this.xm!==null&&this.zm(),e.autoSize||e.width===void 0&&e.height===void 0||this.Vm(e.width||this.no,e.height||this.ja))}Fm(e){let t=0,s=0;const r=this.fm[0],a=(u,d)=>{let f=0;for(let p=0;p<this.fm.length;p++){const g=this.fm[p],y=me(u==="left"?g.zv():g.Lv()),w=y.Vf();if(e!==null&&y.If(e,d,f),f+=w.height,p<this.fm.length-1){const k=this.pm[p],_=k.Vf();e!==null&&k.If(e,d,f),f+=_.height}}};this.Um()&&(a("left",0),t+=me(r.zv()).Vf().width);for(let u=0;u<this.fm.length;u++){const d=this.fm[u],f=d.Vf();if(e!==null&&d.If(e,t,s),s+=f.height,u<this.fm.length-1){const p=this.pm[u],g=p.Vf();e!==null&&p.If(e,t,s),s+=g.height}}t+=r.Vf().width,this.$m()&&(a("right",t),t+=me(r.Lv()).Vf().width);const l=(u,d,f)=>{me(u==="left"?this.Rm.tm():this.Rm.im()).If(me(e),d,f)};if(this.ys.timeScale.visible){const u=this.Rm.Vf();if(e!==null){let d=0;this.Um()&&(l("left",d,s),d=me(r.zv()).Vf().width),this.Rm.If(e,d,s),d+=u.width,this.$m()&&l("right",d,s)}s+=u.height}return at({width:t,height:s})}Km(){let e=0,t=0,s=0;for(const C of this.fm)this.Um()&&(t=Math.max(t,me(C.zv()).zp(),this.ys.leftPriceScale.minimumWidth)),this.$m()&&(s=Math.max(s,me(C.Lv()).zp(),this.ys.rightPriceScale.minimumWidth)),e+=C.fo();t=Sd(t),s=Sd(s);const r=this.no,a=this.ja,l=Math.max(r-t-s,0),u=1*this.pm.length,d=this.ys.timeScale.visible;let f=d?Math.max(this.Rm.rm(),this.ys.timeScale.minimumHeight):0;var p;f=(p=f)+p%2;const g=u+f,y=a<g?0:a-g,w=y/e;let k=0;const _=window.devicePixelRatio||1;for(let C=0;C<this.fm.length;++C){const S=this.fm[C];S.vv(this.ts.$s()[C]);let M=0,I=0;I=C===this.fm.length-1?Math.ceil((y-k)*_)/_:Math.round(S.fo()*w*_)/_,M=Math.max(I,2),k+=M,S.Np(at({width:l,height:M})),this.Um()&&S.Vv(t,"left"),this.$m()&&S.Vv(s,"right"),S.Wf()&&this.ts.Zu(S.Wf(),M)}this.Rm.nm(at({width:d?l:0,height:f}),d?t:0,d?s:0),this.ts.vo(l),this.wm!==t&&(this.wm=t),this.gm!==s&&(this.gm=s)}km(e){e?this.hp.addEventListener("wheel",this.ym,{passive:!1}):this.hp.removeEventListener("wheel",this.ym)}Xm(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return Y_?1/window.devicePixelRatio:1}Pm(e){if(!(e.deltaX!==0&&this.ys.handleScroll.mouseWheel||e.deltaY!==0&&this.ys.handleScale.mouseWheel))return;const t=this.Xm(e),s=t*e.deltaX/100,r=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),r!==0&&this.ys.handleScale.mouseWheel){const a=Math.sign(r)*Math.min(1,Math.abs(r)),l=e.clientX-this.hp.getBoundingClientRect().left;this.Qt().tc(l,a)}s!==0&&this.ys.handleScroll.mouseWheel&&this.Qt().sc(-80*s)}Lm(e,t){var r;const s=e.nn();s===3&&this.Gm(),s!==3&&s!==2||(this.Jm(e),this.Qm(e,t),this.Rm.Pt(),this.fm.forEach(a=>{a.wv()}),((r=this.Mm)==null?void 0:r.nn())===3&&(this.Mm.vn(e),this.Gm(),this.Jm(this.Mm),this.Qm(this.Mm,t),e=this.Mm,this.Mm=null)),this.Fp(e)}Qm(e,t){for(const s of e.pn())this.mn(s,t)}Jm(e){const t=this.ts.$s();for(let s=0;s<t.length;s++)e.en(s).sn&&t[s].Ao()}mn(e,t){const s=this.ts.At();switch(e.an){case 0:s.mu();break;case 1:s.wu(e.Ft);break;case 2:s.dn(e.Ft);break;case 3:s.fn(e.Ft);break;case 4:s.eu();break;case 5:e.Ft.uu(t)||s.fn(e.Ft.cu(t))}}Bu(e){this.Mm!==null?this.Mm.vn(e):this.Mm=e,this.bm||(this.bm=!0,this.vm=window.requestAnimationFrame(t=>{if(this.bm=!1,this.vm=0,this.Mm!==null){const s=this.Mm;this.Mm=null,this.Lm(s,t);for(const r of s.pn())if(r.an===5&&!r.Ft.uu(t)){this.Qt()._n(r.Ft);break}}}))}Gm(){this.Im()}Em(e){this.Cm.removeChild(e.Rf()),e.m()}Im(){const e=this.ts.$s(),t=e.length,s=this.fm.length;for(let r=t;r<s;r++){const a=cn(this.fm.pop());this.Cm.removeChild(a.Rf()),a.Tv().u(this),a.Rv().u(this),a.m();const l=this.pm.pop();l!==void 0&&this.Em(l)}for(let r=s;r<t;r++){const a=new gf(this,e[r]);if(a.Tv().i(this.tw.bind(this,a),this),a.Rv().i(this.iw.bind(this,a),this),this.fm.push(a),r>0){const l=new P_(this,r-1,r);this.pm.push(l),this.Cm.insertBefore(l.Rf(),this.Rm.Rf())}this.Cm.insertBefore(a.Rf(),this.Rm.Rf())}for(let r=0;r<t;r++){const a=e[r],l=this.fm[r];l.Wf()!==a?l.vv(a):l.pv()}this.Bm(),this.Km()}sw(e,t,s,r){var g;const a=new Map;e!==null&&this.ts.js().forEach(y=>{const w=y.Ks().Wr(e);w!==null&&a.set(y,w)});let l;if(e!==null){const y=(g=this.ts.At().ss(e))==null?void 0:g.originalTime;y!==void 0&&(l=y)}const u=this.Qt().Hu(),d=u!==null&&u.Wo instanceof yc?u.Wo:void 0,f=u!==null&&u.Fo!==void 0?u.Fo.Zn:void 0,p=this.nw(r);return{ew:l,Re:e??void 0,rw:t??void 0,hw:p!==-1?p:void 0,aw:d,lw:a,ow:f,_w:s??void 0}}nw(e){let t=-1;if(e)t=this.fm.indexOf(e);else{const s=this.Qt().Yu().Us();s!==null&&(t=this.Qt().$s().indexOf(s))}return t}tw(e,t,s,r){this.sv.p(()=>this.sw(t,s,r,e))}iw(e,t,s,r){this.nv.p(()=>this.sw(t,s,r,e))}Tm(e,t,s){var r;this.Ym(((r=this.Qt().Hu())==null?void 0:r.Uo)??null),this.Vu.p(()=>this.sw(e,t,s))}Bm(){const e=this.ys.timeScale.visible?"":"none";this.Rm.Rf().style.display=e}Um(){return this.fm[0].Wf().Co().N().visible}$m(){return this.fm[0].Wf().yo().N().visible}Dm(){return"ResizeObserver"in window&&(this.xm=new ResizeObserver(e=>{const t=e[e.length-1];t&&this.Vm(t.contentRect.width,t.contentRect.height)}),this.xm.observe(this.op,{box:"border-box"}),!0)}zm(){this.xm!==null&&this.xm.disconnect(),this.xm=null}}function Ih(n){return!!(n.handleScroll.mouseWheel||n.handleScale.mouseWheel)}function Q_(n){return n.open===void 0&&n.value===void 0}function Z_(n){return function(e){return e.open!==void 0}(n)||function(e){return e.value!==void 0}(n)}function Lg(n,e,t,s){const r=t.value,a={Re:e,wt:n,Ft:[r,r,r,r],ew:s};return t.color!==void 0&&(a.R=t.color),a}function G_(n,e,t,s){const r=t.value,a={Re:e,wt:n,Ft:[r,r,r,r],ew:s};return t.lineColor!==void 0&&(a.vt=t.lineColor),t.topColor!==void 0&&(a.mr=t.topColor),t.bottomColor!==void 0&&(a.wr=t.bottomColor),a}function J_(n,e,t,s){const r=t.value,a={Re:e,wt:n,Ft:[r,r,r,r],ew:s};return t.topLineColor!==void 0&&(a.gr=t.topLineColor),t.bottomLineColor!==void 0&&(a.Mr=t.bottomLineColor),t.topFillColor1!==void 0&&(a.br=t.topFillColor1),t.topFillColor2!==void 0&&(a.Sr=t.topFillColor2),t.bottomFillColor1!==void 0&&(a.Cr=t.bottomFillColor1),t.bottomFillColor2!==void 0&&(a.yr=t.bottomFillColor2),a}function q_(n,e,t,s){const r={Re:e,wt:n,Ft:[t.open,t.high,t.low,t.close],ew:s};return t.color!==void 0&&(r.R=t.color),r}function X_(n,e,t,s){const r={Re:e,wt:n,Ft:[t.open,t.high,t.low,t.close],ew:s};return t.color!==void 0&&(r.R=t.color),t.borderColor!==void 0&&(r.Ht=t.borderColor),t.wickColor!==void 0&&(r.vr=t.wickColor),r}function eC(n,e,t,s,r){const a=cn(r)(t),l=Math.max(...a),u=Math.min(...a),d=a[a.length-1],f=[d,l,u,d],{time:p,color:g,...y}=t;return{Re:e,wt:n,Ft:f,ew:s,se:y,R:g}}function Ca(n){return n.Ft!==void 0}function Og(n,e){return e.customValues!==void 0&&(n.uw=e.customValues),n}function Er(n){return(e,t,s,r,a,l)=>function(u,d){return d?d(u):Q_(u)}(s,l)?Og({wt:e,Re:t,ew:r},s):Og(n(e,t,s,r,a),s)}function Rg(n){return{Candlestick:Er(X_),Bar:Er(q_),Area:Er(G_),Baseline:Er(J_),Histogram:Er(Lg),Line:Er(Lg),Custom:Er(eC)}[n]}function Pg(n){return{Re:0,cw:new Map,Hh:n}}function zg(n,e){if(n!==void 0&&n.length!==0)return{dw:e.key(n[0].wt),fw:e.key(n[n.length-1].wt)}}function Bg(n){let e;return n.forEach(t=>{e===void 0&&(e=t.ew)}),cn(e)}class tC{constructor(e){this.pw=new Map,this.mw=new Map,this.ww=new Map,this.gw=[],this.Yo=e}m(){this.pw.clear(),this.mw.clear(),this.ww.clear(),this.gw=[]}Mw(e,t){let s=this.pw.size!==0,r=!1;const a=this.mw.get(e);if(a!==void 0)if(this.mw.size===1)s=!1,r=!0,this.pw.clear();else for(const d of this.gw)d.pointData.cw.delete(e)&&(r=!0);let l=[];if(t.length!==0){const d=t.map(w=>w.time),f=this.Yo.createConverterToInternalObj(t),p=Rg(e.Rr()),g=e.da(),y=e.pa();l=t.map((w,k)=>{const _=f(w.time),C=this.Yo.key(_);let S=this.pw.get(C);S===void 0&&(S=Pg(_),this.pw.set(C,S),r=!0);const M=p(_,S.Re,w,d[k],g,y);return S.cw.set(e,M),M})}s&&this.bw(),this.xw(e,l);let u=-1;if(r){const d=[];this.pw.forEach(f=>{d.push({timeWeight:0,time:f.Hh,pointData:f,originalTime:Bg(f.cw)})}),d.sort((f,p)=>this.Yo.key(f.time)-this.Yo.key(p.time)),u=this.Sw(d)}return this.Cw(e,u,function(d,f,p){const g=zg(d,p),y=zg(f,p);if(g!==void 0&&y!==void 0)return{yw:!1,zh:g.fw>=y.fw&&g.dw>=y.dw}}(this.mw.get(e),a,this.Yo))}vc(e){return this.Mw(e,[])}Pw(e,t,s){const r=t;(function(C){C.ew===void 0&&(C.ew=C.time)})(r),this.Yo.preprocessData(t);const a=this.Yo.createConverterToInternalObj([t])(t.time),l=this.ww.get(e);if(!s&&l!==void 0&&this.Yo.key(a)<this.Yo.key(l))throw new Error(`Cannot update oldest data, last time=${l}, new time=${a}`);let u=this.pw.get(this.Yo.key(a));if(s&&u===void 0)throw new Error("Cannot update non-existing data point when historicalUpdate is true");const d=u===void 0;u===void 0&&(u=Pg(a),this.pw.set(this.Yo.key(a),u));const f=Rg(e.Rr()),p=e.da(),g=e.pa(),y=f(a,u.Re,t,r.ew,p,g);u.cw.set(e,y),s?this.kw(e,y,u.Re):this.Tw(e,y);const w={zh:Ca(y),yw:s};if(!d)return this.Cw(e,-1,w);const k={timeWeight:0,time:u.Hh,pointData:u,originalTime:Bg(u.cw)},_=Di(this.gw,this.Yo.key(k.time),(C,S)=>this.Yo.key(C.time)<S);this.gw.splice(_,0,k);for(let C=_;C<this.gw.length;++C)Ah(this.gw[C].pointData,C);return this.Yo.fillWeightsForPoints(this.gw,_),this.Cw(e,_,w)}Tw(e,t){let s=this.mw.get(e);s===void 0&&(s=[],this.mw.set(e,s));const r=s.length!==0?s[s.length-1]:null;r===null||this.Yo.key(t.wt)>this.Yo.key(r.wt)?Ca(t)&&s.push(t):Ca(t)?s[s.length-1]=t:s.splice(-1,1),this.ww.set(e,t.wt)}kw(e,t,s){const r=this.mw.get(e);if(r===void 0)return;const a=Di(r,s,(l,u)=>l.Re<u);Ca(t)?r[a]=t:r.splice(a,1)}xw(e,t){t.length!==0?(this.mw.set(e,t.filter(Ca)),this.ww.set(e,t[t.length-1].wt)):(this.mw.delete(e),this.ww.delete(e))}bw(){for(const e of this.gw)e.pointData.cw.size===0&&this.pw.delete(this.Yo.key(e.time))}Sw(e){let t=-1;for(let s=0;s<this.gw.length&&s<e.length;++s){const r=this.gw[s],a=e[s];if(this.Yo.key(r.time)!==this.Yo.key(a.time)){t=s;break}a.timeWeight=r.timeWeight,Ah(a.pointData,s)}if(t===-1&&this.gw.length!==e.length&&(t=Math.min(this.gw.length,e.length)),t===-1)return-1;for(let s=t;s<e.length;++s)Ah(e[s].pointData,s);return this.Yo.fillWeightsForPoints(e,t),this.gw=e,t}Rw(){if(this.mw.size===0)return null;let e=0;return this.mw.forEach(t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].Re))}),e}Cw(e,t,s){const r={wo:new Map,At:{Y_:this.Rw()}};if(t!==-1)this.mw.forEach((a,l)=>{r.wo.set(l,{se:a,Dw:l===e?s:void 0})}),this.mw.has(e)||r.wo.set(e,{se:[],Dw:s}),r.At.Vw=this.gw,r.At.Iw=t;else{const a=this.mw.get(e);r.wo.set(e,{se:a||[],Dw:s})}return r}}function Ah(n,e){n.Re=e,n.cw.forEach(t=>{t.Re=e})}function nC(n,e){return n.wt<e}function sC(n,e){return e<n.wt}function rC(n,e,t){const s=e.Uh(),r=e.bi(),a=Di(n,s,nC),l=ix(n,r,sC);if(!t)return{from:a,to:l};let u=a,d=l;return a>0&&a<n.length&&n[a].wt>=s&&(u=a-1),l>0&&l<n.length&&n[l-1].wt<=r&&(d=l+1),{from:u,to:d}}class dx{constructor(e,t,s){this.Bw=!0,this.Aw=!0,this.Ew=!0,this.zw=[],this.Lw=null,this.Jn=e,this.Qn=t,this.Ow=s}Pt(e){this.Bw=!0,e==="data"&&(this.Aw=!0),e==="options"&&(this.Ew=!0)}Tt(){return this.Jn.Vt()?(this.Nw(),this.Lw===null?null:this.Ww):null}Fw(){this.zw=this.zw.map(e=>({...e,...this.Jn.Rh().Dr(e.wt)}))}Hw(){this.Lw=null}Nw(){this.Aw&&(this.Uw(),this.Aw=!1),this.Ew&&(this.Fw(),this.Ew=!1),this.Bw&&(this.$w(),this.Bw=!1)}$w(){const e=this.Jn.Wt(),t=this.Qn.At();if(this.Hw(),t.Zi()||e.Zi())return;const s=t.ye();if(s===null||this.Jn.Ks().zr()===0)return;const r=this.Jn.zt();r!==null&&(this.Lw=rC(this.zw,s,this.Ow),this.qw(e,t,r.Ft),this.Yw())}}class iC{constructor(e,t){this.jw=e,this.Yi=t}nt(e,t,s){this.jw.draw(e,this.Yi,t,s)}}class aC extends dx{constructor(e,t,s){super(e,t,!1),this.sh=s,this.Ww=new iC(this.sh.renderer(),r=>{const a=e.zt();return a===null?null:e.Wt().Nt(r,a.Ft)})}fa(e){return this.sh.priceValueBuilder(e)}va(e){return this.sh.isWhitespace(e)}Uw(){const e=this.Jn.Rh();this.zw=this.Jn.Ks().Hr().map(t=>({wt:t.Re,_t:NaN,...e.Dr(t.Re),Zw:t.se}))}qw(e,t){t.j_(this.zw,_d(this.Lw))}Yw(){this.sh.update({bars:this.zw.map(oC),barSpacing:this.Qn.At().Q_(),visibleRange:this.Lw},this.Jn.N())}}function oC(n){return{x:n._t,time:n.wt,originalData:n.Zw,barColor:n.cr}}const lC={color:"#2196f3"},cC=(n,e,t)=>{const s=Tr(t);return new aC(n,e,s)};function xf(n){const e={value:n.Ft[3],time:n.ew};return n.uw!==void 0&&(e.customValues=n.uw),e}function Vg(n){const e=xf(n);return n.R!==void 0&&(e.color=n.R),e}function uC(n){const e=xf(n);return n.vt!==void 0&&(e.lineColor=n.vt),n.mr!==void 0&&(e.topColor=n.mr),n.wr!==void 0&&(e.bottomColor=n.wr),e}function hC(n){const e=xf(n);return n.gr!==void 0&&(e.topLineColor=n.gr),n.Mr!==void 0&&(e.bottomLineColor=n.Mr),n.br!==void 0&&(e.topFillColor1=n.br),n.Sr!==void 0&&(e.topFillColor2=n.Sr),n.Cr!==void 0&&(e.bottomFillColor1=n.Cr),n.yr!==void 0&&(e.bottomFillColor2=n.yr),e}function fx(n){const e={open:n.Ft[0],high:n.Ft[1],low:n.Ft[2],close:n.Ft[3],time:n.ew};return n.uw!==void 0&&(e.customValues=n.uw),e}function dC(n){const e=fx(n);return n.R!==void 0&&(e.color=n.R),e}function fC(n){const e=fx(n),{R:t,Ht:s,vr:r}=n;return t!==void 0&&(e.color=t),s!==void 0&&(e.borderColor=s),r!==void 0&&(e.wickColor=r),e}function Dd(n){return{Area:uC,Line:Vg,Baseline:hC,Histogram:Vg,Bar:dC,Candlestick:fC,Custom:pC}[n]}function pC(n){const e=n.ew;return{...n.se,time:e}}const mC={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},gC={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},vC={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Jv,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},Lh={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},xC={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function $g(){return{width:0,height:0,autoSize:!1,layout:vC,crosshair:mC,grid:gC,overlayPriceScales:{...Lh},leftPriceScale:{...Lh,visible:!1},rightPriceScale:{...Lh,visible:!0},timeScale:xC,localization:{locale:Ti?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class px{constructor(e,t,s){this.bf=e,this.Kw=t,this.Xw=s??0}applyOptions(e){this.bf.Qt().$u(this.Kw,e,this.Xw)}options(){return this.Yi().N()}width(){return vc(this.Kw)?this.bf.Hm(this.Kw):0}Yi(){return me(this.bf.Qt().qu(this.Kw,this.Xw)).Wt}}class yC{constructor(e,t,s,r){this.bf=e,this.yt=s,this.Gw=t,this.Jw=r}getHeight(){return this.yt.$t()}setHeight(e){const t=this.bf.Qt(),s=t.Cc(this.yt);t.Xu(s,e)}paneIndex(){return this.bf.Qt().Cc(this.yt)}moveTo(e){const t=this.paneIndex();t!==e&&(Jt(e>=0&&e<this.bf.Sf().length,"Invalid pane index"),this.bf.Qt().Gu(t,e))}getSeries(){return this.yt.wo().map(e=>this.Gw(e))??[]}getHTMLElement(){return this.bf.Sf()[this.paneIndex()].Rf()}attachPrimitive(e){this.yt.ua(e),e.attached&&e.attached({chart:this.Jw,requestUpdate:()=>this.yt.Qt().Bh()})}detachPrimitive(e){this.yt.ca(e)}priceScale(e){if(this.yt.co(e)===null)throw new Error(`Cannot find price scale with id: ${e}`);return new px(this.bf,e,this.paneIndex())}}const wC={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class Fg{constructor(e){this.ir=e}applyOptions(e){this.ir.hr(e)}options(){return this.ir.N()}Qw(){return this.ir}}class bC{constructor(e,t,s,r,a,l){this.tg=new Et,this.Jn=e,this.ig=t,this.sg=s,this.Yo=a,this.Jw=r,this.ng=l}m(){this.tg.m()}priceFormatter(){return this.Jn.ra()}priceToCoordinate(e){const t=this.Jn.zt();return t===null?null:this.Jn.Wt().Nt(e,t.Ft)}coordinateToPrice(e){const t=this.Jn.zt();return t===null?null:this.Jn.Wt().Ts(e,t.Ft)}barsInLogicalRange(e){if(e===null)return null;const t=new _i(new Oa(e.from,e.to)).o_(),s=this.Jn.Ks();if(s.Zi())return null;const r=s.Wr(t.Uh(),1),a=s.Wr(t.bi(),-1),l=me(s.Lr()),u=me(s.Zs());if(r!==null&&a!==null&&r.Re>a.Re)return{barsBefore:e.from-l,barsAfter:u-e.to};const d={barsBefore:r===null||r.Re===l?e.from-l:r.Re-l,barsAfter:a===null||a.Re===u?u-e.to:u-a.Re};return r!==null&&a!==null&&(d.from=r.ew,d.to=a.ew),d}setData(e){this.Jn.Rr(),this.ig.eg(this.Jn,e),this.rg("full")}update(e,t=!1){this.Jn.Rr(),this.ig.hg(this.Jn,e,t),this.rg("update")}dataByIndex(e,t){const s=this.Jn.Ks().Wr(e,t);return s===null?null:Dd(this.seriesType())(s)}data(){const e=Dd(this.seriesType());return this.Jn.Ks().Hr().map(t=>e(t))}subscribeDataChanged(e){this.tg.i(e)}unsubscribeDataChanged(e){this.tg._(e)}applyOptions(e){this.Jn.hr(e)}options(){return Es(this.Jn.N())}priceScale(){return this.sg.priceScale(this.Jn.Wt().wa(),this.getPane().paneIndex())}createPriceLine(e){const t=wn(Es(wC),e),s=this.Jn.Oh(t);return new Fg(s)}removePriceLine(e){this.Jn.Nh(e.Qw())}priceLines(){return this.Jn.Wh().map(e=>new Fg(e))}seriesType(){return this.Jn.Rr()}attachPrimitive(e){this.Jn.ua(e),e.attached&&e.attached({chart:this.Jw,series:this,requestUpdate:()=>this.Jn.Qt().Bh(),horzScaleBehavior:this.Yo})}detachPrimitive(e){this.Jn.ca(e),e.detached&&e.detached(),this.Jn.Qt().Bh()}getPane(){const e=this.Jn,t=me(this.Jn.Qt().Hn(e));return this.ng(t)}moveToPane(e){this.Jn.Qt().Mc(this.Jn,e)}rg(e){this.tg.v()&&this.tg.p(e)}}class kC{constructor(e,t,s){this.ag=new Et,this.g_=new Et,this.Kv=new Et,this.ts=e,this.uh=e.At(),this.Rm=t,this.uh.du().i(this.lg.bind(this)),this.uh.fu().i(this.og.bind(this)),this.Rm.sm().i(this._g.bind(this)),this.Yo=s}m(){this.uh.du().u(this),this.uh.fu().u(this),this.Rm.sm().u(this),this.ag.m(),this.g_.m(),this.Kv.m()}scrollPosition(){return this.uh.iu()}scrollToPosition(e,t){t?this.uh._u(e,1e3):this.ts.fn(e)}scrollToRealTime(){this.uh.ou()}getVisibleRange(){const e=this.uh.O_();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){const t={from:this.Yo.convertHorzItemToInternal(e.from),to:this.Yo.convertHorzItemToInternal(e.to)},s=this.uh.H_(t);this.ts.wc(s)}getVisibleLogicalRange(){const e=this.uh.L_();return e===null?null:{from:e.Uh(),to:e.bi()}}setVisibleLogicalRange(e){Jt(e.from<=e.to,"The from index cannot be after the to index."),this.ts.wc(e)}resetTimeScale(){this.ts.cn()}fitContent(){this.ts.mu()}logicalToCoordinate(e){const t=this.ts.At();return t.Zi()?null:t.qt(e)}coordinateToLogical(e){return this.uh.Zi()?null:this.uh.Z_(e)}timeToIndex(e,t){const s=this.Yo.convertHorzItemToInternal(e);return this.uh.A_(s,t)}timeToCoordinate(e){const t=this.timeToIndex(e,!1);return t===null?null:this.uh.qt(t)}coordinateToTime(e){const t=this.ts.At(),s=t.Z_(e),r=t.ss(s);return r===null?null:r.originalTime}width(){return this.Rm.Df().width}height(){return this.Rm.Df().height}subscribeVisibleTimeRangeChange(e){this.ag.i(e)}unsubscribeVisibleTimeRangeChange(e){this.ag._(e)}subscribeVisibleLogicalRangeChange(e){this.g_.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.g_._(e)}subscribeSizeChange(e){this.Kv.i(e)}unsubscribeSizeChange(e){this.Kv._(e)}applyOptions(e){this.uh.hr(e)}options(){return{...Es(this.uh.N()),barSpacing:this.uh.Q_()}}lg(){this.ag.v()&&this.ag.p(this.getVisibleRange())}og(){this.g_.v()&&this.g_.p(this.getVisibleLogicalRange())}_g(e){this.Kv.p(e.width,e.height)}}function _C(n){if(n===void 0||n.type==="custom")return;const e=n;e.minMove!==void 0&&e.precision===void 0&&(e.precision=function(t){if(t>=1)return 0;let s=0;for(;s<8;s++){const r=Math.round(t);if(Math.abs(r-t)<1e-8)return s;t*=10}return s}(e.minMove))}function Hg(n){return function(e){if(wl(e.handleScale)){const s=e.handleScale;e.handleScale={axisDoubleClickReset:{time:s,price:s},axisPressedMouseMove:{time:s,price:s},mouseWheel:s,pinch:s}}else if(e.handleScale!==void 0){const{axisPressedMouseMove:s,axisDoubleClickReset:r}=e.handleScale;wl(s)&&(e.handleScale.axisPressedMouseMove={time:s,price:s}),wl(r)&&(e.handleScale.axisDoubleClickReset={time:r,price:r})}const t=e.handleScroll;wl(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(n),n}class CC{constructor(e,t,s){this.ug=new Map,this.cg=new Map,this.dg=new Et,this.fg=new Et,this.pg=new Et,this.ku=new WeakMap,this.vg=new tC(t);const r=s===void 0?Es($g()):wn(Es($g()),Hg(s));this.mg=t,this.bf=new K_(e,r,t),this.bf.Tv().i(l=>{this.dg.v()&&this.dg.p(this.wg(l()))},this),this.bf.Rv().i(l=>{this.fg.v()&&this.fg.p(this.wg(l()))},this),this.bf.ju().i(l=>{this.pg.v()&&this.pg.p(this.wg(l()))},this);const a=this.bf.Qt();this.gg=new kC(a,this.bf.Am(),this.mg)}remove(){this.bf.Tv().u(this),this.bf.Rv().u(this),this.bf.ju().u(this),this.gg.m(),this.bf.m(),this.ug.clear(),this.cg.clear(),this.dg.m(),this.fg.m(),this.pg.m(),this.vg.m()}resize(e,t,s){this.autoSizeActive()||this.bf.Vm(e,t,s)}addCustomSeries(e,t={},s=0){const r=(a=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...lC,...a.defaultOptions()},Mg:cC,bg:a}))(Tr(e));return this.xg(r,t,s)}addSeries(e,t={},s=0){return this.xg(e,t,s)}removeSeries(e){const t=cn(this.ug.get(e)),s=this.vg.vc(t);this.bf.Qt().vc(t),this.Sg(s),this.ug.delete(e),this.cg.delete(t)}eg(e,t){this.Sg(this.vg.Mw(e,t))}hg(e,t,s){this.Sg(this.vg.Pw(e,t,s))}subscribeClick(e){this.dg.i(e)}unsubscribeClick(e){this.dg._(e)}subscribeCrosshairMove(e){this.pg.i(e)}unsubscribeCrosshairMove(e){this.pg._(e)}subscribeDblClick(e){this.fg.i(e)}unsubscribeDblClick(e){this.fg._(e)}priceScale(e,t=0){return new px(this.bf,e,t)}timeScale(){return this.gg}applyOptions(e){this.bf.hr(Hg(e))}options(){return this.bf.N()}takeScreenshot(){return this.bf.Wm()}removePane(e){this.bf.Qt().Ku(e)}swapPanes(e,t){this.bf.Qt().Gu(e,t)}autoSizeActive(){return this.bf.qm()}chartElement(){return this.bf.Af()}panes(){return this.bf.Qt().$s().map(e=>this.Cg(e))}paneSize(e=0){const t=this.bf.Zm(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,s){const r=this.ug.get(s);if(r===void 0)return;const a=this.bf.Qt().Hn(r);a!==null&&this.bf.Qt().oc(e,t,a)}clearCrosshairPosition(){this.bf.Qt()._c(!0)}horzBehaviour(){return this.mg}xg(e,t={},s=0){Jt(e.Mg!==void 0),_C(t.priceFormat),e.type==="Candlestick"&&function(d){d.borderColor!==void 0&&(d.borderUpColor=d.borderColor,d.borderDownColor=d.borderColor),d.wickColor!==void 0&&(d.wickUpColor=d.wickColor,d.wickDownColor=d.wickColor)}(t);const r=wn(Es(Mk),Es(e.defaultOptions),t),a=e.Mg,l=new yc(this.bf.Qt(),e.type,r,a,e.bg);this.bf.Qt().dc(l,s);const u=new bC(l,this,this,this,this.mg,d=>this.Cg(d));return this.ug.set(u,l),this.cg.set(l,u),u}Sg(e){const t=this.bf.Qt();t.uc(e.At.Y_,e.At.Vw,e.At.Iw),e.wo.forEach((s,r)=>r.ht(s.se,s.Dw)),t.At().R_(),t.J_()}yg(e){return cn(this.cg.get(e))}wg(e){const t=new Map;e.lw.forEach((r,a)=>{const l=a.Rr(),u=Dd(l)(r);if(l!=="Custom")Jt(Z_(u));else{const d=a.pa();Jt(!d||d(u)===!1)}t.set(this.yg(a),u)});const s=e.aw!==void 0&&this.cg.has(e.aw)?this.yg(e.aw):void 0;return{time:e.ew,logical:e.Re,point:e.rw,paneIndex:e.hw,hoveredSeries:s,hoveredObjectId:e.ow,seriesData:t,sourceEvent:e._w}}Cg(e){let t=this.ku.get(e);return t||(t=new yC(this.bf,s=>this.yg(s),e,this),this.ku.set(e,t)),t}}function NC(n){if(eo(n)){const e=document.getElementById(n);return Jt(e!==null,`Cannot find element in DOM with id=${n}`),e}return n}function jC(n,e,t){const s=NC(n),r=new CC(s,e,t);return e.setOptions(r.options()),r}function SC(n,e){return jC(n,new jg,jg.Wc(e))}class mx extends dx{constructor(e,t){super(e,t,!0)}qw(e,t,s){t.j_(this.zw,_d(this.Lw)),e.Dl(this.zw,s,_d(this.Lw))}Pg(e,t){return{wt:e,gt:t,_t:NaN,ut:NaN}}Uw(){const e=this.Jn.Rh();this.zw=this.Jn.Ks().Hr().map(t=>{const s=t.Ft[3];return this.kg(t.Re,s,e)})}}function gx(n,e,t,s,r,a,l){if(e.length===0||s.from>=e.length||s.to<=0)return;const{context:u,horizontalPixelRatio:d,verticalPixelRatio:f}=n,p=e[s.from];let g=a(n,p),y=p;if(s.to-s.from<2){const w=r/2;u.beginPath();const k={_t:p._t-w,ut:p.ut},_={_t:p._t+w,ut:p.ut};u.moveTo(k._t*d,k.ut*f),u.lineTo(_._t*d,_.ut*f),l(n,g,k,_)}else{const w=(_,C)=>{l(n,g,y,C),u.beginPath(),g=_,y=C};let k=y;u.beginPath(),u.moveTo(p._t*d,p.ut*f);for(let _=s.from+1;_<s.to;++_){k=e[_];const C=a(n,k);switch(t){case 0:u.lineTo(k._t*d,k.ut*f);break;case 1:u.lineTo(k._t*d,e[_-1].ut*f),C!==g&&(w(C,k),u.lineTo(k._t*d,e[_-1].ut*f)),u.lineTo(k._t*d,k.ut*f);break;case 2:{const[S,M]=EC(e,_-1,_);u.bezierCurveTo(S._t*d,S.ut*f,M._t*d,M.ut*f,k._t*d,k.ut*f);break}}t!==1&&C!==g&&(w(C,k),u.moveTo(k._t*d,k.ut*f))}(y!==k||y===k&&t===1)&&l(n,g,y,k)}}const Ug=6;function Oh(n,e){return{_t:n._t-e._t,ut:n.ut-e.ut}}function Wg(n,e){return{_t:n._t/e,ut:n.ut/e}}function EC(n,e,t){const s=Math.max(0,e-1),r=Math.min(n.length-1,t+1);var a,l;return[(a=n[e],l=Wg(Oh(n[t],n[s]),Ug),{_t:a._t+l._t,ut:a.ut+l.ut}),Oh(n[t],Wg(Oh(n[r],n[e]),Ug))]}function MC(n,e){const t=n.context;t.strokeStyle=e,t.stroke()}class DC extends pr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:t,lt:s,Tg:r,Rg:a,ct:l,Kt:u,Dg:d}=this.rt;if(s===null)return;const f=e.context;f.lineCap="butt",f.lineWidth=l*e.verticalPixelRatio,Rr(f,u),f.lineJoin="round";const p=this.Vg.bind(this);a!==void 0&&gx(e,t,a,s,r,p,MC),d&&function(g,y,w,k,_){if(k.to-k.from<=0)return;const{horizontalPixelRatio:C,verticalPixelRatio:S,context:M}=g;let I=null;const L=Math.max(1,Math.floor(C))%2/2,O=w*S+L;for(let K=k.to-1;K>=k.from;--K){const E=y[K];if(E){const R=_(g,E);R!==I&&(M.beginPath(),I!==null&&M.fill(),M.fillStyle=R,I=R);const F=Math.round(E._t*C)+L,J=E.ut*S;M.moveTo(F,J),M.arc(F,J,O,0,2*Math.PI)}}M.fill()}(e,t,d,s,p)}}class TC extends DC{Vg(e,t){return t.vt}}function IC(n,e,t,s,r){const{context:a,horizontalPixelRatio:l,verticalPixelRatio:u}=e;a.lineTo(r._t*l,n*u),a.lineTo(s._t*l,n*u),a.closePath(),a.fillStyle=t,a.fill()}let AC=class extends pr{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:t,lt:s,Tg:r,ct:a,Kt:l,Rg:u}=this.rt,d=this.rt.Og??(this.rt.Ng?0:e.mediaSize.height);if(s===null)return;const f=e.context;f.lineCap="butt",f.lineJoin="round",f.lineWidth=a,Rr(f,l),f.lineWidth=1,gx(e,t,u,s,r,this.Wg.bind(this),IC.bind(null,d))}};class LC{Fg(e,t){const s=this.Hg,{Ug:r,$g:a,qg:l,Yg:u,Og:d,jg:f,Zg:p}=t;if(this.Kg===void 0||s===void 0||s.Ug!==r||s.$g!==a||s.qg!==l||s.Yg!==u||s.Og!==d||s.jg!==f||s.Zg!==p){const{verticalPixelRatio:g}=e,y=d||f>0?g:1,w=f*y,k=p===e.bitmapSize.height?p:p*y,_=(d??0)*y,C=e.context.createLinearGradient(0,w,0,k);if(C.addColorStop(0,r),d!=null){const S=La((_-w)/(k-w),0,1);C.addColorStop(S,a),C.addColorStop(S,l)}C.addColorStop(1,u),this.Kg=C,this.Hg=t}return this.Kg}}let OC=class extends AC{constructor(){super(...arguments),this.Xg=new LC}Wg(e,t){var s;return this.Xg.Fg(e,{Ug:t.mr,$g:"",qg:"",Yg:t.wr,jg:((s=this.rt)==null?void 0:s.jg)??0,Zg:e.bitmapSize.height})}};class RC extends mx{constructor(e,t){super(e,t),this.Ww=new qv,this.tM=new OC,this.iM=new TC,this.Ww.st([this.tM,this.iM])}kg(e,t,s){return{...this.Pg(e,t),...s.Dr(e)}}Yw(){const e=this.Jn.N();if(this.Lw===null||this.zw.length===0)return;let t;if(e.relativeGradient){t=this.zw[this.Lw.from].ut;for(let s=this.Lw.from;s<this.Lw.to;s++){const r=this.zw[s];r.ut<t&&(t=r.ut)}}this.tM.ht({Rg:e.lineType,ot:this.zw,Kt:e.lineStyle,ct:e.lineWidth,Og:null,jg:t,Ng:e.invertFilledArea,lt:this.Lw,Tg:this.Qn.At().Q_()}),this.iM.ht({Rg:e.lineVisible?e.lineType:void 0,ot:this.zw,Kt:e.lineStyle,ct:e.lineWidth,lt:this.Lw,Tg:this.Qn.At().Q_(),Dg:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0})}}const PC={type:"Area",isBuiltIn:!0,defaultOptions:{topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,relativeGradient:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Mg:(n,e)=>new RC(n,e)};let zC=class extends pr{constructor(){super(...arguments),this.Yt=null,this.cM=[]}ht(e){this.Yt=e,this.cM=[]}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:s}){if(this.Yt===null||this.Yt.ot.length===0||this.Yt.lt===null)return;this.cM.length||this.dM(t);const r=Math.max(1,Math.floor(s)),a=Math.round(this.Yt.fM*s)-Math.floor(r/2),l=a+r;for(let u=this.Yt.lt.from;u<this.Yt.lt.to;u++){const d=this.Yt.ot[u],f=this.cM[u-this.Yt.lt.from],p=Math.round(d.ut*s);let g,y;e.fillStyle=d.cr,p<=a?(g=p,y=l):(g=a,y=p-Math.floor(r/2)+r),e.fillRect(f.Uh,g,f.bi-f.Uh+1,y-g)}}dM(e){if(this.Yt===null||this.Yt.ot.length===0||this.Yt.lt===null)return void(this.cM=[]);const t=Math.ceil(this.Yt.Q_*e)<=1?0:Math.max(1,Math.floor(e)),s=Math.round(this.Yt.Q_*e)-t;this.cM=new Array(this.Yt.lt.to-this.Yt.lt.from);for(let a=this.Yt.lt.from;a<this.Yt.lt.to;a++){const l=this.Yt.ot[a],u=Math.round(l._t*e);let d,f;if(s%2){const p=(s-1)/2;d=u-p,f=u+p}else{const p=s/2;d=u-p,f=u+p-1}this.cM[a-this.Yt.lt.from]={Uh:d,bi:f,pM:u,ne:l._t*e,wt:l.wt}}for(let a=this.Yt.lt.from+1;a<this.Yt.lt.to;a++){const l=this.cM[a-this.Yt.lt.from],u=this.cM[a-this.Yt.lt.from-1];l.wt===u.wt+1&&l.Uh-u.bi!==t+1&&(u.pM>u.ne?u.bi=l.Uh-t-1:l.Uh=u.bi+t+1)}let r=Math.ceil(this.Yt.Q_*e);for(let a=this.Yt.lt.from;a<this.Yt.lt.to;a++){const l=this.cM[a-this.Yt.lt.from];l.bi<l.Uh&&(l.bi=l.Uh);const u=l.bi-l.Uh+1;r=Math.min(u,r)}if(t>0&&r<4)for(let a=this.Yt.lt.from;a<this.Yt.lt.to;a++){const l=this.cM[a-this.Yt.lt.from];l.bi-l.Uh+1>r&&(l.pM>l.ne?l.bi-=1:l.Uh+=1)}}};class BC extends mx{constructor(){super(...arguments),this.Ww=new zC}kg(e,t,s){return{...this.Pg(e,t),...s.Dr(e)}}Yw(){const e={ot:this.zw,Q_:this.Qn.At().Q_(),lt:this.Lw,fM:this.Jn.Wt().Nt(this.Jn.N().base,me(this.Jn.zt()).Ft)};this.Ww.ht(e)}}const VC={type:"Histogram",isBuiltIn:!0,defaultOptions:{color:"#26a69a",base:0},Mg:(n,e)=>new BC(n,e)},$C=({config:n,...e})=>{const{series:t,chart:s={},tooltip:r}=n,a=v.useRef(void 0),l=v.useRef(void 0),u=v.useRef([]),d=v.useRef(void 0),[f,p]=v.useState({});return v.useEffect(()=>{const g=()=>{y.applyOptions({width:a.current.clientWidth})},y=SC(a.current,{autoSize:!0,grid:{horzLines:{color:"rgba(0, 0, 0, 0.1)"}},width:a.current.clientWidth,height:450,...s.options});y.timeScale().applyOptions(s.timeScaleOptions??{}),y.priceScale("right").applyOptions(s.priceScaleOptions??{}),s.fitContent&&y.timeScale().fitContent(),l.current=y,u.current=[];for(const w of t){const{data:k,options:_,definition:C,priceScaleOptions:S}=w,M=y.addSeries(C,_,0);M.setData(k),S&&M.priceScale().applyOptions(S),u.current.push(M)}return window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g),y.remove()}},[t,s]),v.useEffect(()=>{var _;const g=l.current,y=a.current,w=(_=u.current)==null?void 0:_.at(0),k=C=>{if(C.point===void 0||!C.time||C.point.x<0||C.point.x>y.clientWidth||C.point.y<0||C.point.y>y.clientHeight)p({show:!1});else{const S=C.seriesData.get(w);if(!(S&&"value"in S))throw new Error("value not in data");const M=w.priceToCoordinate(S.value);let I=C.point.x-0;if(M===null)return;I=Math.max(0,Math.min(y.clientWidth-d.current.clientWidth,I));const L=5,O=M-d.current.clientHeight-L>0?M-d.current.clientHeight-L:Math.max(0,Math.min(y.clientHeight-d.current.clientHeight-L,M+L));p({show:!0,left:I+"px",top:O+"px",tooltip_params:{point:C.point,event_params:C}})}};return g.subscribeCrosshairMove(k),()=>{g.unsubscribeCrosshairMove(k)}},[l.current]),c.jsx("div",{...e,children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{...e,ref:a,style:{zIndex:1,zoom:1.1111}}),(r==null?void 0:r.component)&&c.jsx("div",{className:"absolute block w-fit h-fit",ref:d,style:{left:f.left,top:f.top,display:f.show?"block":"none",zIndex:10,pointerEvents:"none"},children:c.jsx(r.component,{chart:f.tooltip_params})})]})})},Yg=864e5,Kg=n=>new Date(n).getTime(),FC=({chart:n})=>{const{event_params:e}=n||{};if(!e)return null;const{seriesData:t}=e||{},s=Array.from(t.values()),r=s==null?void 0:s.at(0),a=s==null?void 0:s.at(1);return c.jsxs("div",{className:`flex flex-col gap-2 border
|
272
|
+
shelf-plain-card-fill p-2 rounded-md w-fit h-fit`,children:[r&&c.jsxs("div",{className:"flex flex-row gap-2 ",children:[c.jsx("div",{className:"text-sm font-extrabold",children:"Income"}),c.jsx("div",{className:"text-sm dark:text-white text-black",children:(r==null?void 0:r.value)??0})]}),a&&c.jsxs("div",{className:"flex flex-row gap-2 ",children:[c.jsx("div",{className:"text-sm font-extrabold",children:"Orders"}),c.jsx("div",{className:"text-sm dark:text-white text-black",children:(a==null?void 0:a.value)??0})]})]})},HC=({data:n,...e})=>{const[t,s]=v.useState(0),{darkMode:r}=hs(),a=v.useMemo(()=>{const l=Kg(n.from_day);let u=Array.from({length:n.count_days}).map((d,f)=>({day:new Date(l+f*Yg).toISOString()}));return Object.entries(n.days).forEach(([d,f])=>{u[(Kg(d)-l)/Yg]=f}),console.log({arr:u}),{chart:{fitContent:!0,options:{crosshair:{mode:Cd.Normal},autoSize:!0,grid:{horzLines:{color:r?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)"},vertLines:{color:r?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)"}},layout:{attributionLogo:!1,background:{color:"transparent",type:Nd.Solid},textColor:r?"#d1d5db":"#374151"}}},tooltip:{component:FC},series:[{definition:PC,data:u.map((d,f)=>{var p,g;return{time:Math.floor(new Date(d==null?void 0:d.day).getTime()/1e3),value:((g=(p=d==null?void 0:d.metrics)==null?void 0:p.checkouts_completed)==null?void 0:g.total_income)??0}}),priceScaleOptions:{scaleMargins:{top:.15,bottom:.4}},options:{topColor:r?"rgba(246, 51, 154, 0.8)":"rgba(151, 60, 255, 0.8)",bottomColor:r?"rgba(246, 51, 154, 0.13)":"rgba(151, 60, 255, 0.128)",lineColor:r?"rgba(246, 51, 154, 1.0)":"rgba(151, 60, 255, 1.0)",lineWidth:4,crossHairMarkerVisible:!0,crossHairMarkerRadius:4,crossHairMarkerBorderWidth:2,crossHairMarkerBorderColor:r?"#ffffff":"#000000",crossHairMarkerBackgroundColor:r?"#1e293b":"#ffffff",crossHairMarkerTextColor:r?"#ffffff":"#000000",crossHairMarkerFontSize:12,crossHairMarkerFontFamily:"Arial, Helvetica, sans-serif",crossHairMarkerFontWeight:"bold",crossHairMarkerFontStyle:"normal",crossHairMarkerTextAlign:"center",crossHairMarkerTextBaseline:"middle",crossHairMarkerPadding:4,crossHairMarkerBorderRadius:4,title:"Income"}},{definition:VC,priceScaleOptions:{scaleMargins:{top:.7,bottom:0}},options:{color:r?"rgba(246, 51, 154, 0.5)":"rgba(151, 60, 255, 0.5)",priceFormat:{type:"volume"},priceScaleId:"",title:"Orders"},data:u.map((d,f)=>{var p,g;return{time:Math.floor(new Date(d==null?void 0:d.day).getTime()/1e3),value:((g=(p=d==null?void 0:d.metrics)==null?void 0:p.checkouts_completed)==null?void 0:g.count)??0}})}].slice(0)}},[n,t,r]);return c.jsx($C,{className:" bg-pink-700",config:a,...e},String(r))},UC=({label:n,selected:e,...t})=>{const s=e?"bg-pink-500":"bg-gray-300 dark:bg-gray-300/10",r=e?"text-white":"text-gray-500 dark:text-gray-400";return c.jsx("div",{className:`py-1 px-2 rounded-xl --shelf-border-color border dark:border-white/10 border-black/10
|
273
|
+
cursor-pointer ${s} ${r} `,children:n,...t})},WC=({span:n,onChange:e})=>{const t=v.useCallback(s=>{e&&e(s)},[e]);return c.jsx("div",{className:"flex flex-row gap-2",children:[90,30,7,1].map(s=>c.jsx(UC,{label:`Last ${s} days`,selected:n==s,onClick:()=>t(s)},s))})},YC=864e5,KC=n=>{if(!n||!n.days)return;const e={tags:{},products:{},collections:{},discounts:{}},t=Object.entries(n.days).reduce((a,l)=>{const[u,{products:d,tags:f,collections:p,discounts:g}]=l;return Object.entries(f).forEach(([y,w])=>{a.tags[y]=a.tags[y]??{...w,count:0},a.tags[y].count+=w.count?w.count:0}),Object.entries(p).forEach(([y,w])=>{a.collections[y]=a.collections[y]??{...w,count:0},a.collections[y].count+=w.count?w.count:0}),Object.entries(g).forEach(([y,w])=>{a.discounts[y]=a.discounts[y]??{...w,count:0},a.discounts[y].count+=w.count?w.count:0}),Object.entries(d).forEach(([y,w])=>{a.products[y]=a.products[y]??{...w,count:0},a.products[y].count+=w.count?w.count:0}),a},e),s=([a,l],[u,d])=>-l.count+d.count,r=(a,l)=>Object.entries(a).sort(l);return{collections:r(t.collections,s),tags:r(t.tags,s),discounts:r(t.discounts,s),products:r(t.products,s)}},QC=({label:n,value:e,...t})=>c.jsxs("div",{className:`p-1 pl-2 px-1 rounded-full border shelf-border-color
|
274
|
+
cursor-pointer
|
275
|
+
bg-kf-400 text-white
|
276
|
+
dark:bg-kf-800/20
|
277
|
+
w-fit max-w-full h-fit
|
278
|
+
flex flex-row justify-between gap-3 text-sm shadow-lg
|
279
|
+
hover:scale-[1.04] duration-75 transition-transform`,...t,children:[c.jsx("span",{children:n,className:`whitespace-nowrap --flex-0 max-w-[80%]
|
280
|
+
overflow-x-hidden hover:overflow-x-auto`}),c.jsx("span",{children:e,className:`rounded-full bg-white --flex-shrink-0
|
281
|
+
text-pink-500 px-2 font-semibold`})]}),El=({data:n,label_prefix:e="",label:t="Top Sold",linkFn:s,valFn:r=(u,d)=>d.count??0,labelFn:a=(u,d)=>d.title??u,...l})=>c.jsx(Je,{rounded:"rounded-xl",stroke:"border-2",className:"shadow-md dark:shadow-xl",children:c.jsxs("div",{className:`w-56 h-52
|
282
|
+
shelf-plain-card-fill
|
283
|
+
rounded-xl px-3 pt-2
|
284
|
+
flex flex-col`,children:[c.jsxs("div",{className:"text-gray-500 text-base border-b shelf-border-color pb-2",children:[c.jsx(Kb,{className:`inline text-2xl rounded-md
|
285
|
+
text-kf-400 bg-white/50
|
286
|
+
dark:text-kf-400 dark:bg-white/10
|
287
|
+
border border-kf-500/25 p-px`}),c.jsx("div",{children:t,className:`p-1 tracking-wider font-mono
|
288
|
+
bg-pink-50 text-pink-500
|
289
|
+
dark:bg-pink-50/10 dark:text-pink-500
|
290
|
+
font-semibold h-20 mx-1
|
291
|
+
rounded-md --border text-sm inline`})]}),c.jsx(_e,{show:n.length,children:c.jsx("div",{className:`w-full rounded-lg flex flex-row flex-wrap
|
292
|
+
gap-1 py-3 flex-1 overflow-clip hover:overflow-y-auto
|
293
|
+
overflow-x-hidden content-start`,children:n.map(([u,d],f)=>c.jsx(Ht,{to:s(u,d),draggable:"false",className:"w-full",children:c.jsx(QC,{label:a(u,d),value:String(r(u,d))})},u))})}),c.jsx(_e,{show:!n.length,children:c.jsx("p",{className:`w-full h-full flex flex-row items-center justify-center
|
294
|
+
--text-gray-300 text-3xl text-center font-semibold
|
295
|
+
whitespace-pre-wrap text-transparent bg-clip-text
|
296
|
+
bg-gradient-to-b from-gray-200 to-gray-500`,children:`Not enough
|
297
|
+
data
|
298
|
+
:-)`})})]})}),ZC=({...n})=>{const{sdk:e}=bt(),t=v.useRef(!1),[s,r]=v.useState(),[a,l]=v.useState(7),[u,d]=v.useState(!0),[f,p]=v.useState(),{actions:{get:g,put:y}}=v5(),w=v.useCallback(async S=>{if(p(void 0),!(S===a&&s))try{const M=`statistics_orders_latest_span_${S}`,I=await g(M);I&&(r(I),d(!1));const L=await e.statistics.orders(Date.now()-S*YC,Date.now());y(M,L),r(L)}catch(M){p(M)}finally{d(!1)}},[s,e,g,y,a]),k=v.useCallback(S=>{l(S),w(S)},[w]);v.useEffect(()=>{t.current||(t.current=!0,k(a))},[k,a]);const _=v.useMemo(()=>{if(s!==void 0)return KC(s)},[s]),C=u?"Loading ...":f?String(f):s===void 0?"Not enough data...":void 0;return c.jsxs("div",{...n,children:[c.jsx(_e,{show:C,children:c.jsx("div",{className:`w-full h-fit p-10 border-4 border-dashed
|
299
|
+
shelf-border-color rounded-lg flex
|
300
|
+
flex-row justify-center items-center
|
301
|
+
text-2xl text-gray-400 animate-pulse`,children:C})}),c.jsx(_e,{show:_&&s&&!C,children:c.jsxs("div",{className:"w-full h-fit",children:[c.jsx(WC,{onChange:k,span:a}),c.jsx(HC,{data:s,className:"w-full max-w-screen-md h-[200px] mt-5"}),c.jsx(lt,{className:"my-5"}),c.jsxs("div",{className:`w-full h-fit flex flex-row justify-center
|
302
|
+
lg:justify-start flex-wrap mt-5 gap-5`,children:[c.jsx(El,{data:_==null?void 0:_.products,label:"products",labelFn:(S,M)=>M.title??S,valFn:(S,M)=>M.count??0,linkFn:(S,M)=>`/pages/products/${S}`}),c.jsx(El,{data:_==null?void 0:_.collections,label:"collections",valFn:(S,M)=>M.count??0,linkFn:(S,M)=>`/pages/collections/${S}`}),c.jsx(El,{data:_==null?void 0:_.discounts,label:"discounts",valFn:(S,M)=>M.count??0,linkFn:(S,M)=>`/pages/discounts/${S}`}),c.jsx(El,{data:_==null?void 0:_.tags,label:"tags",valFn:(S,M)=>M.count??0,linkFn:(S,M)=>`/pages/tags/${S.split("_")[0]}`})]})]})})]})},GC=({msg:n="",link:e="/admin",Icon:t})=>c.jsx(Ht,{to:e,className:"cursor-pointer",draggable:"false",children:c.jsx(Je,{className:"w-fit shadow-md hover:scale-105 transition-transform",rounded:"rounded-lg",children:c.jsxs("div",{className:`shelf-plain-card-fill shelf-border-color
|
303
|
+
border
|
304
|
+
rounded-lg max-h-[5rem]
|
305
|
+
w-fit px-5 py-5 flex flex-row items-center gap-2`,children:[t,c.jsx("p",{children:n,className:"text-lg "}),c.jsx(Wl,{className:"text-3xl text-kf-400"})]})})}),JC=({which_table:n,msg:e,link:t,search:s="",Icon:r})=>{const{sdk:a}=bt(),[l,u]=v.useState("-");return v.useEffect(()=>{async function d(){let f="-";try{f=await a.statistics.countOf(n,{vql:s})}catch{}u(f)}d()},[n,s]),c.jsx(Ht,{to:t,className:"cursor-pointer",draggable:"false",children:c.jsx(Je,{stroke:"border-2",rounded:"rounded-lg",className:`w-fit shadow-md hover:scale-105
|
306
|
+
transition-transform`,children:c.jsxs("div",{className:`shelf-plain-card-fill shelf-border-color
|
307
|
+
border rounded-lg max-h-[5rem]
|
308
|
+
w-fit px-2 py-2 flex flex-col items-left gap-2`,children:[c.jsx("p",{children:e,className:"text-sm "}),c.jsxs("div",{className:`flex flex-row justify-between w-full
|
309
|
+
items-center shelf-text-label-color`,children:[l&&c.jsx("p",{children:l,className:"text-xl "}),c.jsx(Wl,{className:"text-2xl translate-x-2"})]})]})})})},qC=[{msg:"Add new Product",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/products/create"},{msg:"Create a new Collection",Icon:c.jsx(tv,{className:"text-pink-400 text-2xl"}),link:"/pages/collections/create"},{msg:"Create a new Store Front",Icon:c.jsx(ev,{className:"text-pink-400 text-2xl"}),link:"/pages/storefronts/create"},{msg:"Create an Order",Icon:c.jsx(H1,{className:"text-pink-400 text-2xl"}),link:"/pages/orders/create"},{msg:"Make a new Discount or Coupon",Icon:c.jsx(Q1,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/create"},{msg:"Add a new Shipping method",Icon:c.jsx(nv,{className:"text-pink-400 text-3xl"}),link:"/pages/shipping-methods/create"},{msg:"See latest customers",Icon:c.jsx(K1,{className:"text-pink-400 text-3xl"}),link:"/pages/customers"},{msg:"Create reusable Tags",Icon:c.jsx(W1,{className:"text-pink-400 text-3xl"}),link:"/pages/tags/create"},{msg:"Write a Blog post",Icon:c.jsx(jb,{className:"text-pink-400 text-3xl"}),link:"/pages/posts/create"}],XC=[{msg:"customers",which_table:"customers",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/customers"},{msg:"products",which_table:"products",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/products"},{msg:"collections",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),which_table:"collections",link:"/pages/collections"},{msg:"unfulfilled orders",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/orders/q/vql=fulfill:1",which_table:"orders",search:"fulfill:1"},{msg:"all time orders",which_table:"orders",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/orders"},{msg:"automatic discounts",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/q/vql=app:automatic",which_table:"discounts",search:"app:automatic"},{msg:"coupons",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/q/vql=app:manual",which_table:"discounts",search:"app:manual"},{msg:"storefronts",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),which_table:"storefronts",link:"/pages/storefronts"},{msg:"tags",which_table:"tags",Icon:c.jsx(Yn,{className:"text-pink-400 text-3xl"}),link:"/pages/tags"}],e6=({})=>c.jsx("div",{className:"w-full lg:min-w-fit mx-auto",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(xh,{label:"Performance",Icon:r4,iconClassName:"text-2xl text-kf-500",className:"--mt-10 items-baseline"}),c.jsx(ZC,{className:"relative w-full h-fit"}),c.jsx(xh,{label:"Statistics",Icon:Db,className:"mt-20 items-center"}),c.jsx("div",{className:"flex flex-row flex-wrap gap-5 justify-left mt-8",children:XC.map((n,e)=>c.jsx(JC,{...n},e))}),c.jsx(xh,{label:"Quick Actions",Icon:K5,className:"mt-20 items-center"}),c.jsx("div",{className:"flex flex-row flex-wrap gap-5 justify-left mt-8",children:qC.map((n,e)=>c.jsx(GC,{...n},e))})]})}),ds=v.forwardRef(({reload:n,searchTitle:e,isLoading:t,createLink:s="",className:r="",isCollectionEmpty:a=!1},l)=>{const[u,d]=v.useState("");v.useImperativeHandle(l,()=>({getSearch:()=>u,setSearch:d}),[u]);const f=v.useCallback(p=>{var g=p.keyCode?p.keyCode:p.which;g==13&&(p.preventDefault(),n())},[n]);return c.jsx("div",{className:r,children:c.jsxs("div",{className:`--border-x --bg-kf-50 w-full text-grey-800
|
310
|
+
flex flex-row justify-between items-center px-0 --border-t`,children:[c.jsx(Ht,{to:s,draggable:"false",className:"m-2",children:c.jsx("div",{className:a?"animate-[wave_1.5s_ease-in-out_infinite]":"",children:c.jsx(q4,{className:"h-9 w-16 text-base rounded-lg",stroke:"border-2",children:"add",icon:c.jsx(s4,{className:`inline shelf-text-label-color
|
311
|
+
text-xl text-grey-800`})})})}),c.jsx(Qe,{className:"m-1 flex-1 h-fit max-w-[20rem]",rounded:"rounded-md",type:"search",placeholder:e,value:u??"",onChange:p=>d(p.currentTarget.value),onKeyPress:f,inputClsName:"h-9 hover:ring-pink-400 hover:ring-2"}),c.jsx(sv,{className:" bg-kf-500 text-3xl mx-3 cursor-pointer transition-all duration-300 rounded-full md:hover:bg-pink-500 text-white hover:p-1 "+(t?"animate-spin p-1 bg-pink-500":"p-1.5"),onClick:n})]})})}),_n=({next:n,prev:e,limit:t=5,onLimitChange:s,className:r=""})=>{const a=v.useCallback(l=>{const u=parseInt(l.target.value);s&&s(u)},[s]);return c.jsxs("div",{className:`h-fit --bg-slate-50 py-3 w-full flex
|
312
|
+
flex-row justify-between items-center px-3
|
313
|
+
${r}`,children:[c.jsx(ls,{Icon:c.jsx(Wl,{className:"rotate-180 scale-150 cursor-pointer"}),text:"",className:"text-lg",onClick:e}),c.jsxs("select",{name:"limit",onChange:a,value:t,className:`m-1 h-8 px-4 rounded-md text-sm
|
314
|
+
bg-slate-50 dark:bg-slate-800
|
315
|
+
--border focus:outline-none`,children:[c.jsx("option",{value:"5",children:"5"}),c.jsx("option",{value:"10",children:"10"}),c.jsx("option",{value:"15",children:"15"}),c.jsx("option",{value:"20",children:"20"})]}),c.jsx(ls,{Icon:c.jsx(Wl,{className:"scale-150"}),text:"",className:"text-lg cursor-pointer",onClick:n})]})},yf=v.forwardRef(({title:n=c.jsx("p",{children:"NA",className:"text-gray-500"}),onApprove:e,...t},s)=>{const[r,a]=v.useState({data:void 0,message:"NA"}),l=v.useRef(void 0);v.useImperativeHandle(s,()=>({hide:()=>l.current.hide(),show:()=>l.current.show(),setDataAndMessage:(d,f,p)=>{a({data:d,message:f}),p&&l.current.show()}}),[]);const u=v.useCallback((d,f=void 0)=>{e!==void 0&&(d.preventDefault(),d.stopPropagation(),l.current.hide(),e(r.data,f))},[r,e]);return c.jsx(Is,{ref:l,children:c.jsxs(Ts,{name:n,cardClass:"shelf-card-light",className:"max-w-96 w-full",onClick:d=>d.stopPropagation(),children:[c.jsx("p",{children:r.message,className:"text-red-500 text-lg break-words w-full whitespace-pre-wrap"}),c.jsxs("div",{className:"flex flex-row justify-between mt-10 text-base",children:[c.jsx(Xt,{stroke:"border-b-2",btnClassName:"rounded-none",rounded:"rounded-none",children:"No",onClick:()=>l.current.hide()}),c.jsx(Xt,{stroke:"border-b-2",btnClassName:"rounded-none",rounded:"rounded-none",children:"Yes",onClick:d=>u(d)})]})]})})});function vx(n){return ye({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:"currentColor"}}]})(n)}const to=({to:n,current_state:e,next_state:t,onClick:s,...r})=>{const{navWithState:a}=Gn(),l=v.useCallback(u=>{e=typeof e=="function"?e():e,t=typeof t=="function"?t():t,a(n,e,t),s&&s(),u.preventDefault()},[n,s,a,e,t]);return c.jsx(Ht,{to:n,onClick:l,...r})},Gn=()=>{const n=Vr(),e=Ds(),t=v.useCallback((s,r,a)=>{r=typeof r=="function"?r():r,a=typeof a=="function"?a():a,r!==void 0&&e(n,{replace:!0,state:r}),e(s,{state:a})},[e,n]);return{nav:e,navWithState:t,location:n,state:n.state}},zl=(n,e=0)=>({field:s,value:r,onChange:a})=>{const{comp_params:l}=s,[u,d]=v.useState(r??n[e]),f=v.useCallback(w=>{const k=n.find(_=>_.id==parseInt(w.target.value).toString());d(k),a&&a(k)},[n]),{className:p,...g}=l,y="h-10 px-1 w-full shelf-input-color rounded-md text-sm focus:outline-none "+p;return c.jsx("select",{name:"limit",onChange:f,value:u.id,className:y,...g,children:n.map((w,k)=>c.jsx("option",{value:w.id,children:w.name},k))})},t6="pr-3 py-2 max-w-[18rem] overflow-clip hover:overflow-x-auto inline-block whitespace-nowrap",wt=({value:n,children:e,className:t,extra:s="max-w-[8rem] md:max-w-[18rem]",...r})=>{const l=`overflow-clip hover:overflow-x-auto inline-block whitespace-nowrap ${t} ${s}`;return c.jsx("div",{className:l,...r,children:c.jsx("div",{children:n??e})})},xx=({field:n,value:e,className:t,name_fn:s=u=>u,classNameDelimiter:r="text-pink-600 font-bold text-lg",delimiter:a=" / ",...l})=>{const u=e==null?void 0:e.map((d,f)=>c.jsxs("span",{children:[c.jsx("span",{children:s(d)}),f<(e==null?void 0:e.length)-1&&c.jsx("span",{children:a,className:r})]},f));return c.jsx("p",{className:`${t6} ${t}`,children:u,...l})},fs=({field:n,value:e,...t})=>{const{comp_params:s}=n;return c.jsx("p",{children:new Date(e).toLocaleDateString(),...s,...t})},Fe=({field:n,value:e,onChange:t,type:s="text",...r})=>{const{comp_params:a}=n,l={...a,...r},{className:u,setError:d,error:f,...p}=l,g=v.useCallback(y=>{let w=y.currentTarget.value;s==="number"&&(w=parseFloat(w)),t(w)},[t,s]);return c.jsx(yv,{type:n.type,onWheel:y=>y.target.blur(),className:u,value:e??"",onChange:g,...p})},Qg=({value:n,field:e,onChange:t,setError:s,...r})=>{const a=v.useCallback(async()=>{const l=await pd();console.log(l),l&&t(l)},[t,pd]);return c.jsxs("div",{...r,children:[c.jsx("div",{className:"w-full flex flex-row justify-end",children:c.jsx("p",{children:"From Clipboard",className:`w-fit underline cursor-pointer
|
316
|
+
shelf-text-label-color
|
317
|
+
dark:bg-kf-50/10 p-1 rounded-md
|
318
|
+
text-sm font-medium tracking-wider`,onClick:a})}),c.jsx(Je,{className:"w-full h-fit mt-2",children:c.jsx(Fe,{field:e,value:n,onChange:t,className:"w-full h-10"})})]})},bc=({value:n,field:e,onChange:t,context:s,setError:r,...a})=>{const l=v.useCallback(async()=>{const u=s.query.title.get(),d=Q0(n)??Q0(u);t&&t(d)},[t,s,n]);return c.jsxs("div",{...a,children:[c.jsx("div",{className:"w-full flex flex-row justify-end",children:c.jsx("p",{children:"Auto Suggest",className:`w-fit underline cursor-pointer
|
319
|
+
shelf-text-label-color
|
320
|
+
dark:bg-kf-50/10 p-1 rounded-md
|
321
|
+
text-sm font-medium tracking-wider`,onClick:l})}),c.jsx(Je,{className:"w-full h-fit mt-2",children:c.jsx(Fe,{field:e,value:n,onChange:t,className:"w-full h-10"})})]})},no=({field:n,value:e=!0,onChange:t,...s})=>{const[r,a]=v.useState(e),l=v.useCallback(()=>{const y=!r;a(y),t(y)},[r,t]);let u=`relative transition-all duration-300 --border
|
322
|
+
rounded-3xl cursor-pointer w-16 h-8 flex flex-row`;u+=r?" bg-teal-500 ":" bg-red-400 ";const d="absolute rounded-full w-1/2 h-full bg-white border shadow-md",f="transition-all duration-300",p=r?"top-0 left-1/2":"top-0 left-0",g=d+" "+p+" "+f;return c.jsx("div",{className:u,onClick:l,children:c.jsx("div",{className:g})})},wf=({value:n,config:e=1,process_before_copy:t=s=>s})=>{const[s,r]=v.useState(!1),a=v.useCallback(()=>{r(!0),md(t(n)),setTimeout(()=>r(!1),2e3)},[n,t]);return c.jsxs("div",{className:`flex ${e==0?"flex-row":"flex-row-reverse"} gap-1`,children:[c.jsx(vx,{className:`text-lg cursor-pointer text-gray-500
|
323
|
+
hover:text-gray-800 dark:hover:text-gray-400 inline`,onClick:a}),s&&c.jsx("span",{children:"(copied)",className:"text-xs"})]})},ce=(n,e={},t=!0,s=!1)=>({field:r,value:a,disabled:l,onChange:u,children:d=void 0,error:f=void 0,setError:p,context:g,...y})=>{const{desc:w,name:k,comp_params:_}=r,C={...r,comp_params:e},S=v.useMemo(()=>s?c.jsx(wf,{value:JSON.stringify(a)}):null,[s,a]);return c.jsx(Ts,{id:"card",name:k,error:f,..._,border:t,desc:w,rightView:S,setError:p,children:c.jsx(n,{field:C,value:a,onChange:u,disabled:l,children:d,error:f,setError:p,context:g,...e})})},Cn=({context:n,field:e,value:t,...s})=>{const r=v.useRef(void 0),[a,l]=v.useState(!1),u=n.item.handle??n.item.id,d=v.useCallback(()=>{r.current.setDataAndMessage(u,`Are you sure you want to remove ${u} ?`),r.current.show()},[n]),f=v.useCallback(p=>{console.log("data_id",p),l(!0),n.deleteDocument(p).finally(()=>l(!1))},[n]);return c.jsxs("div",{className:`flex flex-row items-center text-center flex-shrink-0
|
324
|
+
justify-end text-base overflow-clip w-fit mx-auto `,children:[!(n!=null&&n.editDocumentUrl)&&(n==null?void 0:n.viewDocumentUrl)&&c.jsx(Ht,{to:n.viewDocumentUrl(u),children:c.jsx(Yb,{className:" text-xl text-teal-600 stroke-[0.5px] hover:stroke-[1px]"})}),(n==null?void 0:n.editDocumentUrl)&&c.jsx(to,{to:n.editDocumentUrl(u),draggable:"false",current_state:()=>(n==null?void 0:n.getState)&&(n==null?void 0:n.getState()),children:c.jsx($b,{title:"edit",className:`ml-3 text-2xl text-pink-500 cursor-pointer
|
325
|
+
stroke-0 hover:stroke-1`})}),(n==null?void 0:n.deleteDocument)&&c.jsx(Ja,{title:"delete",Icon:c.jsx(Yd,{className:"text-xl scale-125 text-kf-500 --outline-8"}),loading:a,className:"ml-3 px-0 py-0 border-0 cursor-pointer",onClick:d}),c.jsx(ff.PortalChild,{children:c.jsx(yf,{ref:r,onApprove:f,title:c.jsxs("p",{className:"text-xl flex flex-row items-center gap-3 cursor-pointer",children:[c.jsx(Kd,{className:"text-2xl"})," Warning"]})})})]})},ar=({value:n,className:e="",label:t=n,bgColor:s="bg-pink-400",...r})=>{const a=typeof s=="function"?s(n):s,l=typeof t=="function"?t(n):typeof t=="string"?t:typeof n=="string"?n:"missing";return c.jsx("div",{className:`font-medium cursor-pointer text-white w-fit
|
326
|
+
py-0 border shelf-border-color-blend px-2 rounded-full whitespace-nowrap
|
327
|
+
hover:scale-105 transition-transform inline-block
|
328
|
+
${e} ${a}`,children:l,...r})},yx=n=>{switch(n){case 0:return"bg-gray-400 dark:bg-gray-400/40";case 1:return"bg-red-500 dark:bg-red-500/40";case 2:return"bg-green-600 dark:bg-green-600/40";case 3:return"bg-black dark:bg-black/40";default:return"bg-pink-400 dark:bg-pink-400/40"}},n6=n=>{switch(n){case 0:return"bg-gray-400 dark:bg-gray-400/40";case 1:return"bg-green-500 dark:bg-green-500/40";case 2:return"bg-green-600 dark:bg-green-600/40";case 3:return"bg-kf-400 dark:bg-kf-400/40";case 4:return"bg-malibu-500 dark:bg-malibu-500/40";case 5:return"bg-red-400 dark:bg-red-400/40";case 6:return"bg-cyan-400 dark:bg-cyan-400/40";case 7:return"bg-teal-500 dark:bg-teal-500/40";case 8:return"bg-teal-400 dark:bg-teal-400/40";default:return"bg-pink-400 dark:bg-pink-400/40"}},s6=({...n})=>c.jsx("div",{...n,children:c.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[c.jsx(Ht,{to:"/pages/orders",draggable:"false",children:c.jsx(ar,{value:"all",className:"border shelf-border-color",bgColor:"bg-pink-400 dark:bg-pink-400/40"})}),Object.values(bd).map(e=>c.jsx(Ht,{draggable:"false",to:`/pages/orders/q/vql=fulfill:${e.id}`,children:c.jsx(ar,{value:e.name2,className:"border shelf-border-color",bgColor:yx(e.id)})},e.id)),Object.values(kd).map(e=>c.jsx(Ht,{draggable:"false",to:`/pages/orders/q/vql=payment:${e.id}`,children:c.jsx(ar,{value:e.name,className:"border shelf-border-color",bgColor:n6(e.id)})},e.id))]})}),Nn=(n,e=n,t=!1,s=Oi)=>{const{query_params:r}=un(),a=v.useMemo(()=>A3(r),[r]),l=Ds(),u=v.useRef(void 0),d=v.useRef(!0),{pages:f,page:p,loading:g,hasLoaded:y,error:w,sdk:k,queryCount:_,resource_is_probably_empty:C,actions:{removeDocument:S,query:M}}=fr(n,s,t);v.useEffect(()=>{var R;(R=u.current)==null||R.setSearch(a.vql),M(a,d.current)},[a,M]);const I=v.useCallback(async(R=!0)=>{const{endBefore:F,endAt:J,startAfter:oe,startAt:Ne,limitToLast:Ee,...be}=a,te=u.current.getSearch();d.current=!1;const B={...be,limit:5,vql:te};return R?l(`${e}/q/${yn(B).toString()}`,{replace:!0}):await M(B),B},[l,M,e,a]),L=v.useCallback((R,F=!0)=>{const{limit:J,limitToLast:oe}=a,Ne={...a,limit:J?R:void 0,limitToLast:oe?R:void 0};return F?l(`${e}/q/${yn(Ne).toString()}`):M(Ne),Ne},[l,M,e,a,p]),O=v.useCallback(async(R=!0)=>{const F=p==null?void 0:p.at(-1),{endBefore:J,endAt:oe,startAfter:Ne,startAt:Ee,limit:be,limitToLast:te,...B}=a,Z={...B,startAfter:[["updated_at",F.updated_at],["id",F.id]],limit:be||te};if(R){if(await hr(k,n,Z)==0)return;l(`${e}/q/${yn(Z).toString()}`)}else await M(Z);return Z},[l,M,p,a,e,n]),K=v.useCallback(async(R=!0)=>{const F=p==null?void 0:p.at(0),{endBefore:J,endAt:oe,startAfter:Ne,startAt:Ee,limit:be,limitToLast:te,...B}=a,Z={...B,endBefore:[["updated_at",F.updated_at],["id",F.id]],limitToLast:te||be};if(R){if(await hr(k,n,Z)==0)return;l(`${e}/q/${yn(Z).toString()}`)}else await M(Z);return Z},[l,M,p,a,e]),E=v.useMemo(()=>({viewDocumentUrl:R=>`${e}/${R}/view`,editDocumentUrl:R=>`${e}/${R}`,deleteDocument:S}),[S,e]);return{resource:n,query_api:a,ref_actions:u,context:E,pages:f,page:p,loading:g,hasLoaded:y,resource_is_probably_empty:C,error:w,queryCount:_,actions:{onLimitChange:L,onReload:I,prev:K,next:O}}},r6=(n,e={},t=s=>s)=>{if(n===void 0)return t(e);const s=n?n.split("."):[];return t(s.reduce((r,a)=>r==null?void 0:r[a],e))},i6=({context:n,fields:e,data:t,recordClassName:s,className:r,...a})=>{const l=({item:u,className:d,...f})=>c.jsx("tr",{className:s,...f,children:e.map((p,g)=>c.jsx("td",{className:g==0?"text-start pl-3 overflow-x-scroll":g<e.length-1?"text-center px-3 overflow-x-clip ":"text-end pr-3 right-0 bg-white/60 dark:bg-transparent sticky z-10 w-0 --border-l-2 overflow-clip shelf-body-bg opacity-80",children:c.jsx(c.Fragment,{children:c.jsx(p.comp,{context:{item:u,...n},field:p,value:r6(p.key,u,p.transform),...p.comp_params})})},g))});return c.jsxs("table",{className:r,children:[c.jsx("thead",{children:c.jsx("tr",{className:`border-b border-b-gray-300 dark:border-gray-300/25
|
329
|
+
h-10 text-xs font-medium text-gray-400`,children:e.map((u,d)=>c.jsx("th",{className:d==0?"text-left pl-3":d<e.length-1?"text-center":"text-end pr-3 sticky right-0 bg-white/60 dark:bg-transparent --border-l-2 --shelf-body-bg ",children:u.name},d))})}),c.jsx("tbody",{children:t.map((u,d)=>c.jsx(l,{item:u},d))})]})},hn=({context:n,fields:e,data:t,recordClassName:s=`bg-white dark:bg-white/5
|
330
|
+
dark:border-gray-300/25 border-b h-14`,className:r=" "})=>c.jsx("div",{className:`w-full ${r}`,children:c.jsx("div",{className:"w-full overflow-auto",children:c.jsx(i6,{context:n,fields:e,data:t,recordClassName:s,className:"w-full table-fixed2 whitespace-nowrap"})})}),a6=n=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",id:"Layer_1",x:0,y:0,className:"illustrations_image w-[100px]","data-imageid":"astronaut-52",style:{},viewBox:"0 0 500 500",...n,children:[c.jsx("style",{children:".st0_astronaut-52{fill:#68e1fd}.st1_astronaut-52{fill:#093f68}.st2_astronaut-52{fill:#fff}.st4_astronaut-52{fill:none}.st5_astronaut-52{fill:#dfeaef}"}),c.jsxs("g",{id:"character_astronaut-52",children:[c.jsx("path",{d:"M196.1 120.1h1.5c6.6 0 12 5.4 12 12v10.7c0 6.6-5.4 12-12 12h-1.5c-6.6 0-12-5.4-12-12v-10.7c0-6.6 5.3-12 12-12z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M196.8 156.6c-8.1 0-14.6-6.5-14.6-14.6v-9.2c.2-8 6.9-14.4 15-14.2 7.8.2 14 6.4 14.2 14.2v9.2c0 8.1-6.5 14.6-14.6 14.6zm0-34.7c-6 0-10.9 4.9-10.9 10.9v9.2c.2 6 5.2 10.7 11.2 10.6 5.8-.2 10.4-4.8 10.6-10.6v-9.2c0-6-4.9-10.9-10.9-10.9z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M314.7 120.1h1.4c6.6 0 12 5.4 12 12v10.7c0 6.6-5.4 12-12 12h-1.4c-6.6 0-12-5.4-12-12v-10.7c0-6.6 5.3-12 12-12z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M315.4 156.6c-8.1 0-14.6-6.5-14.6-14.6v-9.2c.2-8 6.9-14.4 15-14.2 7.8.2 14 6.4 14.2 14.2v9.2c0 8.1-6.5 14.6-14.6 14.6zm0-34.7c-6 0-10.9 4.9-10.9 10.9v9.2c.2 6 5.2 10.7 11.2 10.6 5.8-.2 10.4-4.8 10.6-10.6v-9.2c0-6-4.9-10.9-10.9-10.9z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M207.2 176.4h97c11.8 0 21.5 9.6 21.5 21.4v97c0 11.8-9.6 21.5-21.5 21.5h-97c-11.8 0-21.4-9.6-21.4-21.5v-97c0-11.8 9.6-21.4 21.4-21.4z",className:"st2_astronaut-52"}),c.jsx("path",{d:"M304.6 318.1h-97.8c-12.6 0-22.9-10.3-22.9-22.9v-97.8c0-12.6 10.3-22.9 22.9-22.9h97.8c12.6 0 22.9 10.3 22.9 22.9v97.8c0 12.7-10.3 22.9-22.9 22.9zm-97.8-139.9c-10.6 0-19.2 8.6-19.2 19.2v97.8c0 10.6 8.6 19.2 19.2 19.2h97.8c10.6 0 19.2-8.6 19.2-19.2v-97.8c0-10.6-8.6-19.2-19.2-19.2h-97.8z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M339.1 228.9c-17.3-23.8-30.2-31.4-43.6-33.5-2.6-.4-10-1.2-11.2-1.2h-52c-14.9 0-23.8 3.6-33.9 13.4-15.3 14.8-25.7 45.5-31.8 48.3-1.2 0-2.3-.5-3.1-1.5-6.1-6.6-7.8-26.5-7-37.9.7-8.9-6-16.7-14.9-17.4s-16.7 6-17.4 14.9c-.5 7-2.3 43.1 15.5 62.3 7 7.7 17 12 27.4 11.9 15.3 0 28.3-10.9 39.7-33.1v146h-5c-5.5-.1-10.1 4.2-10.5 9.7-.2 5.5 4.1 10.1 9.7 10.3h45.9V309.9c.2-4.8 4.2-8.5 9-8.4 4.6.2 8.2 3.8 8.4 8.4v111.3h45.6c5.5 0 10-4.5 10-10v-.3c-.3-5.5-4.9-9.8-10.5-9.7h-5V238.6c3.2 2.8 6 6 8.5 9.4 4.6 6.3 11.7 31.8 14.1 69.7-2.8 5.3-6 12.8-4.1 16.5 1.5 3 4.7 1.5 7.6-.8 3 4.1 7.9 6.6 13 6.6h.8c8.9-.4 15.9-8 15.5-16.9-.6-11.8-4.1-71.3-20.7-94.2z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M309.8 423h-45.6c-1 0-1.8-.8-1.8-1.8V309.9c0-3.8-3.1-6.8-6.8-6.8s-6.8 3.1-6.8 6.8v111.3c0 1-.8 1.8-1.8 1.8h-45.6c-6.5 0-11.9-5.3-11.9-11.8v-.4c.4-6.5 5.8-11.6 12.3-11.5h3.2V262.4c-11 18.6-23.4 27.7-38 27.7-10.9.1-21.3-4.4-28.7-12.5-18.3-19.8-16.5-56.6-16-63.7.8-9.9 9.4-17.4 19.4-16.6 9.9.8 17.4 9.4 16.6 19.4-.8 11.5 1 30.5 6.5 36.5.3.4.8.7 1.4.8 2.2-1.6 5.8-8.5 9.4-15.1 5.7-10.7 12.8-24.1 21.6-32.6 10.5-10.1 20-13.9 35.2-13.9h52c1.4 0 9 .8 11.5 1.2 16 2.6 29 12.5 44.8 34.3 16.9 23.3 20.5 83.3 21 95.1.5 9.9-7.1 18.4-17 18.9-5.5.3-10.7-1.9-14.4-6-2.3 1.5-4.2 2-5.8 1.6-1.4-.3-2.5-1.3-3.1-2.6-1.7-3.4-.4-9.4 3.9-17.7-2.4-37.3-9.5-62.3-13.7-68.2-1.6-2.2-3.3-4.2-5.2-6.2v156.4h3.2c6.5-.1 11.9 5 12.3 11.5.2 6.6-5 12-11.5 12.2-.3.1-.4.2-.6.1zm-43.8-3.6h43.8c4.5 0 8.2-3.7 8.2-8.2v-.3c-.3-4.5-4.1-8-8.6-7.9h-5c-1 0-1.8-.8-1.8-1.8V238.6c0-1 .8-1.8 1.8-1.8.5 0 .9.2 1.3.5 3.3 2.9 6.2 6.2 8.8 9.7 5.3 7.3 12.2 34.5 14.5 70.6 0 .3 0 .7-.2 1-3.7 7-5.2 12.5-4.1 14.8.3.5.5.6.6.6.6.1 2-.3 4.2-2 .4-.3.9-.4 1.4-.4.5.1.9.3 1.2.7 4.7 6.4 13.7 7.8 20.1 3.1 3.9-2.8 6.1-7.5 5.9-12.3-.5-11.6-4-70.7-20.3-93.1-18.8-25.9-31.5-31-42.4-32.8-2.7-.4-9.9-1.1-10.9-1.1h-52c-14.3 0-22.8 3.4-32.6 12.8-8.4 8.1-15.3 21.2-20.9 31.7-5.4 10.2-8.4 15.6-11.5 17-.3.1-.6.2-.9.2-1.7 0-3.3-.8-4.4-2.1-6.6-7.1-8.3-27.2-7.5-39.2.6-7.9-5.3-14.8-13.2-15.5-7.9-.6-14.8 5.3-15.4 13.2-.5 6.9-2.3 42.3 15 60.9 6.7 7.3 16.1 11.4 26 11.3 14.6 0 27-10.5 38.1-32.1.4-.8 1.2-1.2 2.1-.9.8.2 1.4.9 1.4 1.8v146c0 1-.8 1.8-1.8 1.8h-5c-4.5-.1-8.3 3.4-8.6 7.9-.1 4.5 3.4 8.3 7.9 8.5H245V309.9c.3-5.8 5.2-10.3 11-10 5.4.2 9.8 4.6 10 10v109.5z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M313.8 136.5c-.4 31.9-26.6 57.4-58.5 57-31.3-.4-56.5-25.7-57-57 0-2.8.2-5.6.6-8.4 4.6-31.5 33.9-53.4 65.5-48.8a57.7 57.7 0 0 1 48.8 48.8c.4 2.8.6 5.6.6 8.4z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M256.1 196.1c-32.9 0-59.5-26.7-59.5-59.6 0-2.9.2-5.8.6-8.6 4.8-32.5 35-55.1 67.5-50.3 26.1 3.8 46.5 24.3 50.3 50.3.4 2.9.6 5.7.6 8.6 0 32.9-26.6 59.5-59.5 59.6zm0-115.5c-27.7.1-51.2 20.4-55.3 47.8-.4 2.7-.6 5.4-.6 8.1.4 30.9 25.8 55.5 56.6 55.1 30.3-.4 54.7-24.9 55.1-55.1 0-2.7-.2-5.4-.6-8.1-4-27.4-27.5-47.7-55.2-47.8z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M313.8 136.5c-.4 31.9-26.6 57.4-58.5 57-31.3-.4-56.5-25.7-57-57 0-2.8.2-5.6.6-8.4 13.9-12 34.3-19.6 57.1-19.6s43.2 7.6 57.1 19.6c.5 2.8.7 5.6.7 8.4z",className:"st2_astronaut-52"}),c.jsx("path",{d:"M256.1 196.1c-32.9 0-59.5-26.7-59.5-59.6 0-2.9.2-5.8.6-8.6.1-.4.3-.8.6-1.1 14.8-12.7 36-20 58.3-20s43.6 7.3 58.3 20c.3.3.6.7.6 1.1.4 2.8.6 5.7.6 8.6 0 32.9-26.6 59.5-59.5 59.6zm-55.4-67c-.3 2.5-.5 4.9-.5 7.4 0 30.9 25 55.9 55.8 55.9s55.9-25 55.9-55.8c0-2.5-.2-5-.5-7.5-14.1-11.9-34.2-18.7-55.4-18.7s-41.2 6.8-55.3 18.7zM304.4 291.5h-97.6c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h97.6c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8zM246.9 388.8h-40.1c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h40.1c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8zM304.4 388.8h-40.1c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h40.1c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8zM304.4 356.7h-40.1c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h40.1c1 0 1.8.8 1.8 1.8 0 .9-.8 1.8-1.8 1.8zM246.9 356.7h-38.3c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h38.3c1 0 1.8.8 1.8 1.8 0 .9-.8 1.8-1.8 1.8z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M225.7 216.2h56.8c3.3 0 5.9 2.7 5.9 5.9v44c0 3.3-2.7 5.9-5.9 5.9h-56.8c-3.3 0-5.9-2.7-5.9-5.9v-44c0-3.3 2.7-5.9 5.9-5.9z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M277.6 273.9h-46.9c-7 0-12.7-5.7-12.7-12.8V227c0-7 5.7-12.7 12.8-12.8h46.9c7 0 12.7 5.7 12.8 12.8v34.1c-.1 7.1-5.8 12.8-12.9 12.8zM230.7 218c-5 0-9.1 4.1-9.1 9.1v34.1c0 5 4.1 9.1 9.1 9.1h46.9c5 0 9.1-4.1 9.1-9.1v-34c0-5-4.1-9.1-9.1-9.1l-46.9-.1z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M276.1 227.8h-20.5c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h20.5c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8z",className:"st1_astronaut-52"}),c.jsx("circle",{cx:235,cy:228.3,r:4.6,style:{fill:"#ffbc0e"}}),c.jsx("path",{d:"M235 234.7c-3.5 0-6.4-2.9-6.4-6.4s2.9-6.4 6.4-6.4 6.4 2.9 6.4 6.4c0 3.5-2.9 6.4-6.4 6.4zm0-9.2c-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.7-1.2 2.7-2.7c0-1.4-1.2-2.7-2.7-2.7zM304.4 240.4c-1 0-1.8-.8-1.8-1.8v-19.4c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8v19.4c0 1-.8 1.8-1.8 1.8z",className:"st1_astronaut-52"}),c.jsx("path",{d:"m325.7 301.8 31.8-6.1",className:"st4_astronaut-52"}),c.jsx("path",{d:"M325.7 303.7c-1 0-1.8-.8-1.9-1.8 0-.9.6-1.7 1.5-1.8l31.9-6.1c1-.2 2 .4 2.2 1.4s-.4 2-1.4 2.2h-.2l-31.9 6.1c0-.1-.1 0-.2 0z",className:"st1_astronaut-52"}),c.jsx("path",{d:"m126.5 248.9 29.9-12.1",className:"st4_astronaut-52"}),c.jsx("path",{d:"M126.5 250.7c-1 0-1.8-.8-1.9-1.8 0-.8.5-1.4 1.2-1.7l29.8-12.1c.9-.4 2 .1 2.4 1 .4.9-.1 2-1 2.4l-29.8 12.1c-.2.1-.4.1-.7.1zM230.4 156.6c-1 0-1.8-.8-1.8-1.8 0-.6.3-1.1.7-1.4l35.4-28.2c.8-.6 2-.5 2.6.3.6.8.5 2-.3 2.6l-35.4 28.2c-.3.2-.7.3-1.2.3zM246.9 177.6c-1 0-1.8-.8-1.8-1.8 0-.6.3-1.1.7-1.4l37.4-29.6c.8-.6 1.9-.5 2.6.3.6.8.5 1.9-.3 2.6L248 177.2c-.3.2-.7.4-1.1.4z",className:"st1_astronaut-52"})]}),c.jsx("g",{id:"lines_astronaut-52",children:c.jsx("path",{d:"M386.4 232.9c-1 0-1.8-.8-1.8-1.8 0-.2 0-.4.1-.6 3.5-10.2-7.1-25.8-7.2-25.9-.6-.8-.4-2 .5-2.6.4-.3 1-.4 1.5-.3 13.5 3.7 26.7-6.5 26.8-6.6.8-.6 1.9-.5 2.6.3.4.5.5 1.1.3 1.7-3.4 13.5 5.5 24.4 5.6 24.5.5.6.6 1.4.2 2.1-.4.7-1.1 1-1.9.9-11.9-1.7-25.4 8-25.6 8.1-.4.1-.8.2-1.1.2zm-3.8-26.9c2.7 4.8 6.8 13.4 6.3 21.2 4.5-2.6 12.5-6.5 20.7-6.6-3.7-6-5.4-13.1-4.9-20.1-4.5 2.6-12.8 6.5-22.1 5.5zM400.7 356.6c-1 0-1.8-.8-1.8-1.8 0-.2 0-.4.1-.6 1.7-4.9-2.6-12.8-4.4-15.4-.6-.8-.3-2 .5-2.6.4-.3 1-.4 1.5-.3 8 2.2 15.9-3.9 16-4 .6-.5 1.5-.5 2.1-.1.7.4 1 1.2.8 2-2 8 3.3 14.5 3.3 14.5.7.8.5 1.9-.2 2.6-.4.3-.9.5-1.4.4-7.1-1-15.2 4.8-15.3 4.9-.4.3-.8.4-1.2.4zm-1.1-16.5c1.5 2.8 3.3 7 3.4 11.1 3.4-1.9 7.1-3.1 10.9-3.5-1.8-3.2-2.7-6.9-2.6-10.6-3.6 2-7.6 3-11.7 3zM94.4 325c-1 0-1.8-.8-1.8-1.8 0-.2 0-.4.1-.6 1.7-5-2.6-12.8-4.4-15.4-.6-.8-.4-2 .5-2.6.4-.3 1-.4 1.5-.3 8 2.2 15.9-3.9 16-4 .8-.6 2-.5 2.6.3.3.4.5 1 .3 1.6-2 8 3.3 14.5 3.3 14.5.7.8.5 1.9-.2 2.6-.4.3-.9.5-1.4.4-7-1-15.2 4.8-15.3 4.9-.4.3-.8.4-1.2.4zm-1.1-16.5c1.5 2.8 3.3 7 3.4 11.1 3.4-1.9 7.1-3.1 10.9-3.5-1.8-3.2-2.6-6.9-2.6-10.5-3.6 1.9-7.6 2.9-11.7 2.9z",className:"st5_astronaut-52"})}),c.jsxs("g",{id:"flag_astronaut-52",children:[c.jsx("path",{d:"m134.5 108.6-51.8 52.3 56.7-1.4z",style:{fill:"#f56132"}}),c.jsx("path",{d:"M82.7 162.7c-1 0-1.8-.8-1.8-1.8 0-.5.2-1 .5-1.3l51.8-52.3c.7-.7 1.9-.7 2.6 0 .3.3.5.7.5 1.1l4.9 51c.1.5-.1 1-.4 1.4-.3.4-.8.6-1.3.6l-56.8 1.3zm50.4-50L87.2 159l50.2-1.2-4.3-45.1z",className:"st1_astronaut-52"}),c.jsx("path",{d:"m163.9 417.5-30.2-317",className:"st4_astronaut-52"}),c.jsx("path",{d:"M163.9 421.1c-1.9 0-3.5-1.4-3.7-3.3L130 100.9c-.2-2 1.3-3.8 3.3-4 2-.2 3.8 1.3 4 3.3l30.2 316.9c.2 2-1.3 3.8-3.3 4h-.3z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M127.9 196.8h22.8c3.1 0 5.6 2.5 5.6 5.6v22.8c0 3.1-2.5 5.6-5.6 5.6h-22.8c-3.1 0-5.6-2.5-5.6-5.6v-22.8c.1-3.1 2.6-5.6 5.6-5.6z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M146.1 232.6h-13.5c-6.7 0-12.1-5.4-12.1-12.1V207c.1-6.6 5.5-12 12.1-12h13.5c6.6 0 12 5.4 12.1 12v13.5c0 6.7-5.4 12.1-12.1 12.1zm-13.5-34c-4.6 0-8.4 3.8-8.4 8.4v13.5c0 4.6 3.8 8.4 8.4 8.4h13.5c4.6 0 8.4-3.8 8.4-8.4V207c0-4.6-3.8-8.4-8.4-8.4h-13.5z",className:"st1_astronaut-52"}),c.jsx("path",{d:"M156.8 198.4h5c1.6 0 3 1.3 3 3v11.8c0 1.6-1.3 3-3 3h-5c-1.6 0-3-1.3-3-3v-11.8c0-1.7 1.3-3 3-3z",className:"st0_astronaut-52 targetColor",style:{fill:"#68e1fd"}}),c.jsx("path",{d:"M159.3 218c-4 0-7.3-3.3-7.3-7.3v-6.8c0-4 3.3-7.3 7.3-7.3s7.3 3.3 7.3 7.3v6.8c0 4-3.3 7.3-7.3 7.3zm0-17.8c-2 0-3.6 1.6-3.6 3.6v6.8c.1 2 1.8 3.5 3.8 3.4 1.9-.1 3.3-1.6 3.4-3.4v-6.8c0-1.9-1.6-3.6-3.6-3.6z",className:"st1_astronaut-52"})]})]}),dn=({resource:n,should_onboard:e=!1,hasLoaded:t=!0,overallCollectionCount:s})=>c.jsxs("div",{className:"",children:[c.jsx(_e,{show:e,children:c.jsxs("div",{className:"flex flex-row items-center justify-between relative",children:[c.jsxs("div",{className:"flex flex-col flex-wrap items-baseline gap-3 --w-3/4",children:[c.jsxs("div",{className:"flex flex-row gap-3 flex-wrap items-baseline",children:[c.jsx(ka,{children:"Welcome"}),c.jsx(ka,{children:"👋",className:"animate-waving-hand"}),c.jsx(ka,{children:"to your empty"})]}),c.jsx(Ta,{children:n,className:`bg-gradient-to-r from-kf-500 to-pink-500
|
331
|
+
dark:from-kf-600 dark:to-pink-500
|
332
|
+
uppercase font-extrabold italic tracking-tighter
|
333
|
+
-translate-x-2
|
334
|
+
text-5xl font-inter inline-flex`}),c.jsx(ka,{children:"let's create something ",className:"animate-fadein"})]}),c.jsx(a6,{className:`w-[150px] scale-[3.0] duration-300 transition-transform
|
335
|
+
translate-x-[75px] translate-y-[55px] -rotate-[30deg] overflow-clip
|
336
|
+
opacity-30 right-0 top-0 flex-shrink-0 absolute`})]})}),c.jsx(_e,{show:!e,children:c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex flex-row items-baseline text-3xl/none",children:[c.jsx(Ta,{children:n.slice(0,3),className:`bg-gradient-to-r from-kf-600 to-pink-500
|
337
|
+
dark:from-kf-600 dark:to-pink-500 --text-5xl
|
338
|
+
uppercase font-medium italic tracking-tighter
|
339
|
+
inline-flex --tracking-wide`}),c.jsx(Ta,{children:n.slice(3),className:`bg-gradient-to-r from-pink-600 to-pink-500
|
340
|
+
dark:from-pink-600 dark:to-pink-500 --text-5xl
|
341
|
+
uppercase font-extralight italic tracking-tighter --hidden --text-[34px]
|
342
|
+
-translate-x-[3px]
|
343
|
+
inline-flex --tracking-wide`})]}),s!==void 0&&c.jsx(ka,{children:`${Math.max(s??0,0)} items`,className:t?"animate-fadein":"opacity-0"})]})})]}),o6=n=>{const e=n==null?void 0:n.contact;return e!=null&&e.firstname?(e==null?void 0:e.firstname)+(e!=null&&e.lastname?" "+(e==null?void 0:e.lastname):""):(e==null?void 0:e.email)??"anonymous"},l6=[{comp:({})=>c.jsx("div",{}),key:"active",name:""},{key:"contact",name:"Customer",comp:({context:n,value:e})=>c.jsx(It,{value:o6(n==null?void 0:n.item),className:"overflow-x-auto max-w-20 flex-shrink"})},{key:"pricing.total",name:"Price",comp:wt,comp_params:{className:"shelf-text-label-color font-semibold"}},{key:"id",name:"Order ID",comp:wt,comp_params:{className:"text-gray-500 font-semibold",extra:"max-w-[4rem]"}},{key:"status.fulfillment",name:"Status",comp:ar,comp_params:{bgColor:n=>yx(n==null?void 0:n.id),label:n=>n==null?void 0:n.name.split(" ")[0]}},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn}],Zg=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("orders","/pages/orders");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsx(s6,{className:"mt-5"}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
344
|
+
shelf-border-color shadow-md
|
345
|
+
dark:shadow-slate-900 mt-5`,children:[c.jsx(ds,{isCollectionEmpty:f,reload:g,ref:t,createLink:"/pages/orders/create",searchTitle:"Search by ID, status, date, customer info...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:l6}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},c6=n=>n,ps=({tags:n=[],name_fn:e=c6,className:t,clsCapsule:s="bg-kf-500",onRemove:r=void 0,onClick:a=void 0})=>n!=null&&n.length?c.jsx("div",{className:`flex flex-row flex-wrap w-full text-sm
|
346
|
+
text-white gap-1 ${t}`,children:n.map((l,u)=>c.jsxs("div",{className:`flex flex-row items-center border shelf-border-color-blend
|
347
|
+
rounded-2xl w-fit max-w-full px-0.5 py-0 --m-1 font-medium
|
348
|
+
${s}`,children:[c.jsx("button",{children:e(l),onClick:()=>a(l),className:`mx-1 max-w-full overflow-x-auto py-0
|
349
|
+
hover:scrollbar-thin scrollbar-none cursor-pointer
|
350
|
+
whitespace-nowrap --underline --decoration-double
|
351
|
+
decoration-white/60
|
352
|
+
--underline-offset-[1px] --border-b --border-dashed `}),r&&c.jsx(Wd,{className:"text-lg cursor-pointer flex-shrink-0",onClick:d=>{d.stopPropagation(),r&&r(l)}})]},u))}):null,wx=n=>(n==null?void 0:n.title)??(n==null?void 0:n.handle)??(n==null?void 0:n.id)??"unknown",bx=n=>n??[],so=({onSelect:n,header:e,resource:t,limit:s=100,layout:r=0,add_all:a=!1,transform_fn:l=bx,name_fn:u=wx,className:d,clsHeader:f,clsReload:p,...g})=>{const y="---",w="ALL",[k,_]=v.useState(y),{page:C,loading:S,actions:{query:M}}=fr(t,Oi,!1),I=v.useMemo(()=>l(C).sort((E,R)=>{var F;return((F=u(E))==null?void 0:F.localeCompare(u(R)))??0}),[C,l,u]);v.useEffect(()=>{M({limit:s},!0).catch(E=>{console.log(E),M({limit:s},!1)})},[s,M]);const L=v.useCallback(()=>{M({limit:s},!1)},[M,s]),O=v.useCallback(E=>{const R=E.target.value;if(R===y)return;if(R===w){_(w),n(w);return}const F=parseInt(R);_(F),n(I[F])},[I,y,n]),K=({className:E=""})=>c.jsxs("select",{name:"limit",onChange:O,value:k,className:`h-10 px-1 w-full
|
353
|
+
shelf-input-color
|
354
|
+
rounded-md text-sm
|
355
|
+
focus:outline-none
|
356
|
+
${E}`,children:[c.jsx("option",{value:y,children:y}),a&&c.jsx("option",{value:w,children:w}),I.map((R,F)=>c.jsx("option",{value:F,children:u(R)},F))]});return c.jsxs("div",{className:d,children:[c.jsx(_e,{show:r==0,children:c.jsxs("div",{className:`flex flex-row justify-between
|
357
|
+
items-center gap-3`,children:[c.jsx("p",{children:e,className:f}),c.jsx(Je,{children:c.jsx(K,{})}),c.jsx(A0,{className:`cursor-pointer ${p}
|
358
|
+
${S?"animate-spin":""}`,onClick:L})]})}),c.jsxs(_e,{show:r==1,children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("p",{children:e,className:f}),c.jsx(A0,{className:`cursor-pointer --h-6 --w-6 flex-shrink-0
|
359
|
+
${p} ${S?"animate-spin":""}`,onClick:L})]}),c.jsx("div",{className:"flex flex-row items-center gap-3 mt-2",children:c.jsx(Je,{className:"w-full",children:c.jsx(K,{})})})]})]})},Sa=({field:n,context:e,value:t,onChange:s,resource:r,add_all:a=!1,transform_fn:l=bx,name_fn:u=wx,slug:d,label:f="Select",className:p,...g})=>{const{navWithState:y}=Gn(),[w,k]=v.useState(Array.isArray(t)?t:[]),_=v.useCallback(M=>{const I=M==="ALL";if(w.indexOf(M)!=-1)return;const L=I?[M]:[...w.filter(O=>O!=="ALL"),M];console.log("new_tags",L),s(L),k(L)},[w,s]),C=v.useCallback(M=>{const I=w.filter(L=>L.id!==M.id);s(I),k(I)},[w,s]),S=v.useCallback(M=>{if(M==="ALL")return;const I=M.handle??M.id;y(`${d}/${I}`,e==null?void 0:e.getState())},[y,e,r,d]);return c.jsxs("div",{className:p,children:[c.jsx(so,{transform_fn:l,name_fn:u,add_all:a,resource:r,onSelect:_,layout:1,className:"mt-3",clsReload:"text-kf-500 text-3xl",header:f}),(w==null?void 0:w.length)>0&&c.jsx(lt,{className:"my-5"}),c.jsx(ps,{tags:w,onClick:S,onRemove:C,name_fn:u,clsCapsule:"bg-kf-500 dark:bg-kf-500/60",className:"--mt-3"})]})},u6=({field:n,value:e,onChange:t,...s})=>{const[r,a]=v.useState(e),{comp_params:l}=n,u=v.useCallback(d=>{a(d),t(d)},[t]);return c.jsxs("div",{...l,children:[c.jsx(so,{resource:"shipping",layout:1,className:"mt-3",onSelect:u,header:"Pick Methods you defined",clsHeader:"shelf-text-minor",clsReload:"text-kf-500 text-3xl",name_fn:d=>d.title}),c.jsx(lt,{className:"w-full mt-5"}),c.jsx("p",{children:"Method",className:"mt-2 shelf-text-minor"}),c.jsx(Qe,{stroke:"",readOnly:!0,className:"mt-1 pointer-events-none",value:r==null?void 0:r.title,placeholder:"Shipping Method",type:"text"}),c.jsx("p",{children:"Price",className:"mt-3 shelf-text-minor"}),c.jsx("div",{className:"flex flex-row items-center h-fit w-full mt-1",children:c.jsx(Qe,{stroke:"",readOnly:!0,className:"mt-1 w-full pointer-events-none",onWheel:d=>d.target.blur(),value:r==null?void 0:r.price,placeholder:"Price",type:"number",min:"0"})})]})},h6=({field:n,value:e,onChange:t,...s})=>{v.useRef(void 0);const{comp_params:r}=n,[a,l]=v.useState(e??[]),u=Ds(),d=v.useCallback(g=>{const y=[g,...a.filter(w=>w.handle!==g.handle)];t(y),l(y)},[a,t]),f=v.useCallback(g=>{const y=g.handle;u(`/pages/discounts/${y}`)},[u]),p=v.useCallback(g=>{const y=[...a.filter(w=>w.handle!==g.handle)];t(y),l(y)},[a,t]);return c.jsxs("div",{...r,children:[c.jsx(so,{resource:"discounts",layout:1,className:"mt-3",transform_fn:g=>g.filter(y=>y.application.id==Ei.Manual.id&&y.active),onSelect:d,name_fn:g=>g.handle,header:"Add Coupons you defined",clsHeader:"text-gray-500",clsReload:"text-pink-500 text-3xl"}),c.jsx(ps,{onClick:f,onRemove:p,name_fn:g=>g.handle,tags:a,className:"mt-3",clsCapsule:"bg-pink-500"})]})},kx=({resource:n,title:e="Browse products",Comp:t,onSave:s,onCancel:r})=>{const[a,l]=v.useState(!1),[u,d]=v.useState([]),[f,p]=v.useState(5),{pages:g,loading:y,queryCount:w,actions:{next:k,query:_}}=fr(n),C=v.useCallback(O=>{d(K=>[O,...K.filter(E=>E.id!==O.id)]),l(!1)},[]),S=v.useCallback(O=>{d(K=>K.filter(E=>E.id!==O.id))},[]),M=v.useMemo(()=>g.reduce((O,K)=>[...O,...K],[]),[g]),I=v.useRef(void 0),L=v.useCallback(O=>{O==null||O.preventDefault();const K=I.current.value;_({limit:f,vql:K})},[f,_]);return v.useCallback(O=>{r()},[]),c.jsxs("div",{onClick:O=>O.stopPropagation(),className:`w-full m-3 md:w-[35rem] h-3/4
|
360
|
+
shelf-plain-card-soft
|
361
|
+
rounded-xl p-3 sm:p-5 border shadow-lg gap-5
|
362
|
+
text-base flex flex-col overflow-hidden`,children:[c.jsx("p",{children:e,className:"pb-3 border-b shelf-border-color-soft"}),c.jsx("form",{onSubmit:L,className:"w-full",onFocus:()=>l(!0),tabIndex:4344,children:c.jsx(Je,{rounded:"rounded-xl",stroke:"border-2",children:c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("input",{ref:I,type:"search",placeholder:"search",className:`w-full h-12 border shelf-input-color
|
363
|
+
shelf-border-color-soft px-3 text-base
|
364
|
+
focus:outline-none rounded-xl`}),c.jsx(ud,{className:`text-white text-4xl mx-1 sm:mx-5
|
365
|
+
cursor-pointer`,onClick:L})]})})}),c.jsxs("div",{className:"relative w-full flex-1 --bg-gray-50 ",children:[c.jsxs("div",{className:`absolute inset-0 flex flex-col w-full gap-5 h-full
|
366
|
+
${a?"hidden":""}`,children:[c.jsx("p",{children:"Selected items",className:" font-semibold text-base --text-gray-500"}),c.jsxs("div",{className:`w-full flex-1 rounded-md border shelf-border-color-soft
|
367
|
+
overflow-y-auto`,children:[c.jsx(_e,{show:u.length==0,children:c.jsxs("div",{className:`text-xl sm:text-3xl font-medium text-gray-400
|
368
|
+
h-full flex flex-col justify-center
|
369
|
+
items-center gap-5`,children:["No Selected items, ",c.jsx("br",{}),"Tap the Search box",c.jsx(ud,{className:`text-inherit text-5xl opacity-50
|
370
|
+
mx-5 cursor-pointer`,onClick:L})]})}),u.map((O,K)=>c.jsxs("div",{className:`w-full h-14 sm:h-14 p-3 border-b shelf-border-color-soft
|
371
|
+
flex flex-row justify-between items-center
|
372
|
+
gap-3`,children:[c.jsx(t,{data:O}),c.jsx(Yl,{onClick:()=>S(O),className:`h-6 w-9 pl-3 border-l shelf-border-color-soft
|
373
|
+
cursor-pointer`})]},O.id))]}),c.jsxs("div",{className:"self-end flex flex-row gap-5",children:[c.jsx(Xt,{stroke:"border-2",className:"opacity-60",children:"cancel",onClick:r}),c.jsx(Xt,{stroke:"border-2",children:"save",onClick:()=>s(u)})]})]}),c.jsxs("div",{className:`flex flex-col gap-5 absolute inset-0 w-full h-full
|
374
|
+
--bg-white ${a?"":"hidden"}`,children:[c.jsxs("div",{className:"flex flex-row justify-between",children:[c.jsx("p",{children:"Select from search results "+(w>=0?`(${w})`:""),className:"font-semibold text-base "}),c.jsx(Yl,{className:`h-6 w-9 pl-3 border-l
|
375
|
+
shelf-border-color-soft cursor-pointer`,onClick:()=>l(!1)})]}),c.jsx(Je,{rounded:"rounded-md",className:"flex-1 overflow-y-auto",children:c.jsxs("div",{className:`w-full h-full rounded-md border shelf-plain-card-soft
|
376
|
+
overflow-y-auto `,children:[c.jsx(_e,{show:M.length==0&&!y,children:c.jsxs("div",{className:`text-3xl font-medium text-gray-400 h-full
|
377
|
+
flex justify-center items-center`,children:["No search Results ",c.jsx("br",{}),"were found ",c.jsx("br",{})," :()"]})}),M.map((O,K)=>c.jsx("div",{className:`w-full h-14 sm:h-14 p-3 border-b shelf-border-color-soft
|
378
|
+
cursor-pointer`,onClick:()=>C(O),children:c.jsx(t,{data:O})},`sr_${O.id}`)),c.jsx(ls,{text:"Load more",onClick:()=>k().catch(O=>{}),keep_text_on_load:!0,className:`w-fit mx-auto h-12 p-3 border-b cursor-pointer
|
379
|
+
shelf-border-color-soft
|
380
|
+
text-center text-pink-500 font-medium text-base`})]})})]})]})]})},d6=({data:n})=>c.jsxs("div",{className:`w-full h-full flex flex-row justify-between
|
381
|
+
items-center text-sm gap-3`,children:[c.jsx("span",{className:`text-base overflow-hidden hover:overflow-auto
|
382
|
+
whitespace-nowrap h-full
|
383
|
+
flex flex-row items-center pr-3 flex-1`,children:`${n.firstname} ${n.lastname}`}),c.jsx("span",{className:`text-gray-500 max-w-[8rem] sm:max-w-none
|
384
|
+
overflow-x-auto whitespace-normal h-full
|
385
|
+
flex flex-row items-center`,children:`(${n.auth_id})`})]}),f6=({data:n})=>c.jsxs("div",{className:`w-full h-full flex flex-row justify-between
|
386
|
+
items-center gap-3 text-sm `,children:[c.jsx("span",{className:`overflow-hidden hover:overflow-auto
|
387
|
+
text-sm whitespace-nowrap h-full
|
388
|
+
flex flex-row items-center
|
389
|
+
pr-1`,children:n.title}),c.jsx("span",{className:"text-gray-500 whitespace-nowrap flex-shrink-0",children:`(${n.qty} In stock)`})]}),p6=({onSave:n,onCancel:e})=>c.jsx(kx,{resource:"customers",Comp:d6,onSave:n,onCancel:e,title:"Browse Customers"}),ro=({onSave:n,onCancel:e})=>c.jsx(kx,{resource:"products",Comp:f6,onSave:n,onCancel:e,title:"Browse Products"}),m6=({items:n,context:e,onChangeItem:t,onRemoveItem:s})=>{const r=a=>a.stock_reserved?`(${a.stock_reserved} stock reserved, return stock)`:`(reduce ${a.qty} stock units)`;return c.jsx("div",{className:"w-full flex flex-row mt-3",children:c.jsxs("table",{className:"w-full border-collapse text-left",children:[c.jsx("thead",{className:"w-full",children:c.jsxs("tr",{className:"w-full",children:[c.jsx("th",{children:"Product"}),c.jsx("th",{children:"Price"}),c.jsx("th",{children:"Quantity"}),c.jsx("th",{children:"",className:"text-right"})]})}),c.jsx("tbody",{className:"w-full text-sm",children:n.map((a,l)=>{var u,d;return c.jsxs("tr",{className:"--text-gray-500 border w-full border-pink-500",children:[c.jsx("td",{className:"pl-1 max-w-[100px] sm:max-w-[200px] pr-5",children:c.jsxs("div",{className:`overflow-x-auto --text-black whitespace-nowrap
|
390
|
+
scrollbar-thin`,children:[c.jsx(to,{to:`/pages/products/${a.id}`,current_state:()=>(e==null?void 0:e.getState)&&(e==null?void 0:e.getState()),draggable:"false",children:c.jsx("span",{children:(u=a.data)==null?void 0:u.title,className:"underline"})}),c.jsx("br",{}),c.jsx("span",{children:r(a),className:`underline shelf-text-label-color text-sm
|
391
|
+
font-medium cursor-pointer text-left`,onClick:f=>t(l,"stock-change")})]})}),c.jsx("td",{children:a.price,className:"py-2 w-14 pr-3"}),c.jsx("td",{className:"py-2 w-14 pr-3",children:c.jsx(Je,{stroke:"border-b-2",className:"w-full ",children:c.jsx("input",{placeholder:"",value:a.qty,type:"number",onWheel:f=>f.target.blur(),min:(a==null?void 0:a.stock_reserved)>0?a.stock_reserved:1,max:((d=a==null?void 0:a.data)==null?void 0:d.qty)??a.qty??0,step:"1",onChange:f=>t(l,"change-qty",f.currentTarget.value),className:"h-9 w-full px-1 shelf-input-color"})})}),c.jsx("td",{className:"py-2 w-12 text-right items-center",children:c.jsx(Yl,{onClick:f=>s(l,a),className:`h-6 w-9 pl-3 border-l shelf-border-color
|
392
|
+
cursor-pointer`})})]},l)})})]})})},g6=({field:n,value:e,onChange:t,context:s,error:r,setError:a,...l})=>{const{sdk:u}=bt(),d=v.useRef(void 0),f=v.useRef(void 0),p=v.useRef(void 0),[g,y]=v.useState(e),w=v.useRef(void 0),k=v.useCallback(()=>{const I=d.current.value,L=parseFloat(f.current.value),O=parseInt(p.current.value);I&&L&&O&&y(K=>[...K,{id:I,title:I,price:L,qty:O,source:"manual",data:void 0}])},[]),_=v.useCallback(I=>{const L=I.map(O=>({id:O.handle,price:O.price,qty:1,title:O.title,data:O,stock_reserved:0}));y(O=>[...L.filter(K=>O.find(E=>E.id===K.id)===void 0),...O]),w.current.hide()},[]),C=v.useCallback((I,L)=>{if(L.stock_reserved&&L.qty>0){a(`${L.id} has reserved ${L.stock_reserved} items,
|
393
|
+
please return the stock before removing :)`);return}y(O=>O.filter((K,E)=>I!==E))},[]),S=v.useCallback(async(I,L,O)=>{if(L==="change-qty")g[I].qty=parseInt(O),y([...g]);else if(L==="stock-change"){const K=g[I],E=K.stock_reserved&&g[I].stock_reserved>0,R=E?K.stock_reserved:-K.qty;try{await u.products.changeStockOfBy(K.id,R),g[I].stock_reserved=E?0:K.qty,y([...g])}catch(F){switch(F.code){case"doc-not-exists":a("Product does not exist in inventory");break;case"out-of-bounds":a(`Not enough items of ${K.id} in stock to reduce`);break;default:a("Unknown error, try again later");break}console.error(F)}}},[g]);v.useEffect(()=>{e!==g&&t&&t(g)},[g,t,e]);const M=v.useMemo(()=>g.reduce((I,L)=>I+L.price*L.qty,0),[g]);return c.jsxs("div",{...l,children:[c.jsx(Xt,{children:"Browse products",className:"text-sm h-10 w-40 mx-auto",onClick:()=>w.current.show()}),c.jsx("p",{children:"or",className:"text-center text-gray-300 mt-5 text-3xl font-semibold"}),c.jsx("p",{children:"Manual Add",className:"mt-3 text-center text-gray-400 text-lg font-semibold"}),c.jsxs("div",{className:`h-fit flex flex-row items-center
|
394
|
+
mt-3 w-full text-sm font-normal gap-3`,children:[c.jsx(Qe,{className:"flex-1 h-fit",rounded:"rounded-md",ref:d,placeholder:"Product",type:"text"}),c.jsx(Qe,{className:"flex-1 h-fit",rounded:"rounded-md",ref:f,placeholder:"Price",min:"0",type:"number",onWheel:I=>I.target.blur()}),c.jsx(Qe,{className:"flex-1 h-fit",rounded:"rounded-md",ref:p,placeholder:"Quantity",min:"0",type:"number",onWheel:I=>I.target.blur()}),c.jsx(Xt,{children:"Add",className:"flex-1 h-[42px] hidden sm:inline shadow-md",onClick:k})]}),c.jsx(Xt,{children:"Add",className:`flex-1 h-10 text-sm font-semibold mt-3 \\
|
395
|
+
block sm:hidden shadow-md`,onClick:k}),c.jsx(Is,{ref:w,children:c.jsx(ro,{onSave:_,onCancel:()=>w.current.hide()})}),c.jsx(lt,{className:"mt-5"}),c.jsx("p",{children:"Items",className:"mt-3 text-gray-400 text-lg font-semibold"}),c.jsx(m6,{items:g,context:s,onRemoveItem:C,onChangeItem:S}),c.jsxs("p",{className:"mt-5 --text-gray-400 text-lg font-semibold ",children:["Sub-Total: ",c.jsx("span",{className:"font-semibold",children:M})]})]})},Ml=({title:n,value:e,description:t="",link:s,context:r})=>c.jsxs("div",{className:"flex flex-row justify-between items-center w-full",title:t??n,children:[s&&c.jsx(to,{to:s,current_state:()=>(r==null?void 0:r.getState)&&(r==null?void 0:r.getState()),draggable:"false",children:c.jsx("span",{children:n,className:"text-sm font-medium underline"})}),!s&&c.jsx("span",{children:n,className:"text-sm font-medium "}),c.jsx("span",{children:e,className:"text-xs"})]}),v6=({field:n,context:e,setError:t,value:s,onChange:r,...a})=>{var y,w;const{sdk:l}=bt(),[u,d]=v.useState(s),{comp_params:f}=n,p=v.useCallback(k=>{const _=parseFloat(k.currentTarget.value);console.log("total ",_);const C={...u,total:_};d(C),r(C)},[u,r]),g=v.useCallback(async k=>{try{t(void 0);const _=await l.checkout.pricing(e.getState().data);d(_),r(_),console.log("pricing ",_)}catch{t("An error occured while calculating pricing")}},[e]);return c.jsxs("div",{...f,children:[c.jsxs("div",{className:"flex flex-col gap-3 w-full --shelf-text-minor",children:[c.jsx(Ml,{title:"SubTotal",value:(u==null?void 0:u.subtotal_undiscounted)??0}),c.jsx(Ml,{title:"Shipping",value:((y=u==null?void 0:u.shipping_method)==null?void 0:y.price)??0}),(w=u==null?void 0:u.evo)==null?void 0:w.slice(1).filter(k=>k.total_discount>0).map(k=>c.jsx(Ml,{title:`${k.discount_code} (discount)`,value:-k.total_discount,link:`/pages/discounts/${k.discount_code}`,context:e},k.discount_code)),u==null?void 0:u.taxes.map(k=>c.jsx(Ml,{title:`${k.name} (tax)`,value:k.value,description:k.description,context:e},k.name))]}),c.jsx(lt,{className:"my-5"}),c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("span",{children:"Total",className:"text-sm font-medium "}),c.jsx("span",{children:"Calculate Price",className:`text-sm font-medium underline
|
396
|
+
shelf-text-label-color cursor-pointer`,onClick:g})]}),c.jsx(Qe,{className:"mt-2 w-full",onChange:p,onWheel:k=>k.target.blur(),value:(u==null?void 0:u.total)??0,placeholder:"Price",type:"number",min:"0"})]})},x6=n=>{if(n==0)return"text-4xl text-black dark:text-gray-300";if(n%2==0)return"text-3xl text-black dark:text-gray-300";if(n%2==1)return"text-3xl text-gray-500 tracking-wide"},Jn=({major:n=[],delimiter:e=" / ",className:t,...s})=>c.jsx("div",{className:`scrollbar-none break-words ${t}`,...s,children:n.map((r,a)=>c.jsxs("span",{children:[c.jsx("span",{children:r,className:x6(a)}),a<n.length-1&&c.jsx("span",{children:e,className:`text-4xl text-pink-400 text-pink-400/50
|
397
|
+
break-inside-avoid`})]},a))});function y6(n){return ye({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"}}]})(n)}const ms=({onClickSave:n=void 0,onClickCreate:e=void 0,onClickDelete:t=void 0,onClickDuplicate:s=void 0,onClickReload:r=void 0,id:a,children:l,...u})=>{const d=v.useRef(void 0),[f,p]=v.useState(!1),g=v.useCallback(()=>{d.current.setDataAndMessage(a,`Are you sure you want to remove ${a} ?`),d.current.show()},[a]),y=v.useCallback(w=>{p(!0),t(w).finally(()=>p(!1))},[t]);return c.jsxs("div",{...u,children:[c.jsxs("div",{className:"flex flex-row justify-between w-full",children:[c.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-2",children:[c.jsx(Zn,{Icon:c.jsx(v3,{}),text:"save",keep_text_on_load:!0,show:!!n,onClick:n}),c.jsx(Zn,{Icon:c.jsx(Z1,{}),text:"create",keep_text_on_load:!0,show:!!e,onClick:e}),c.jsx(Zn,{Icon:c.jsx(y6,{}),text:"duplicate",show:!!s,onClick:s}),c.jsx(Zn,{Icon:c.jsx(Bb,{}),text:"reload",show:!!r,keep_text_on_load:!0,onClick:r}),l]}),c.jsx(_e,{show:!!t,children:c.jsx(Je,{stroke:"border-2",className:"h-fit",rounded:"rounded-full",children:c.jsx(Ja,{className:`h-6 px-2
|
398
|
+
bg-slate-50 dark:bg-slate-800
|
399
|
+
text-gray-600 dark:text-gray-400
|
400
|
+
rounded-full text-base font-semibold tracking-tight`,Icon:c.jsx(Yd,{className:"--text-red-500 text-base"}),loading:f,text:"delete",keep_text_on_load:!0,show:!!t,onClick:g})})})]}),c.jsx(yf,{ref:d,onApprove:y,title:c.jsxs("p",{className:`text-xl flex
|
401
|
+
flex-row items-center gap-3`,children:[c.jsx(Kd,{className:"text-2xl"}),"Warning"]})})]})},Td=n=>{var e;return((e=n==null?void 0:n.messages)==null?void 0:e.map(t=>{let s="";return t.path&&(s+=t.path.join(".")+" - "),s+=t.message??"Unknown Error",s}))??["ouch, unexpected error"]},jn=({error:n,positive:e=!1,className:t,...s})=>{console.log("error ",n);const[r,a]=v.useState(!1),l=v.useMemo(()=>Td(n),[n]);v.useEffect(()=>{var p;const f=!!(n&&((p=n.messages)!=null&&p.length));a(f)},[n]);let u=e?"text-green-500":"text-red-700 dark:text-red-500",d=r?"max-h-[1000px] mt-0 ":"max-h-0 mt-0 ";return d+=" my-8 w-full h-fit transition-max-height duration-500 rounded-lg overflow-hidden "+t,c.jsx("div",{className:d,children:c.jsx(Je,{stroke:"border-2 dark:border mt-5",rounded:"rounded-lg",children:c.jsxs("div",{className:` relative rounded-md dark:rounded-lg bg-gradient-to-br
|
402
|
+
to-slate-50 dark:to-slate-800
|
403
|
+
from-slate-50 dark:from-slate-800
|
404
|
+
w-full`,children:[c.jsx(Lb,{className:`text-xl absolute right-2 top-2
|
405
|
+
text-kf-500 cursor-pointer hover:text-pink-500`,onClick:()=>a(!1)}),c.jsx("ul",{className:"list-disc w-full list-inside p-5",children:l==null?void 0:l.map((f,p)=>c.jsx("li",{children:f??String(f),className:"px-2 py-1 text-base font-semibold "+u},p))})]})})})},w6=({value:n})=>{const[e,t]=v.useState(!1),s=v.useCallback(r=>{t(!0),md(n),setTimeout(()=>t(!1),2e3)},[n,md]);return c.jsxs(c.Fragment,{children:[c.jsx(vx,{className:`text-base cursor-pointer text-gray-500
|
406
|
+
hover:text-gray-800 dark:hover:text-gray-400
|
407
|
+
inline -translate-y-0.5`,onClick:s}),e&&c.jsx("span",{children:"(copied)",className:"text-xs -translate-x-2"})]})},gs=({doc:n,collectionId:e,className:t,...s})=>{const{sdk:r}=bt(),a=v.useCallback(async()=>{var p,g;if(n&&"published"in n){const y=await r.storage.getBlob((g=(p=n==null?void 0:n.published)==null?void 0:p.split("storage://"))==null?void 0:g.at(-1)),w=URL.createObjectURL(new Blob([y],{type:"application/json"}));window.open(w,"_blank")}},[n,r]);if(!(n!=null&&n.updated_at)||!e)return null;const l=new Date(n.updated_at);let u="";n&&"published"in n&&(u=n==null?void 0:n.published);let d=l.toLocaleDateString()+`
|
408
|
+
(last updated)`,f="exported @ ";return e==="discounts"&&(f="collection @ "),u||(f=""),c.jsx(_e,{show:n,children:c.jsxs("div",{className:`w-full flex flex-row justify-between text-sm
|
409
|
+
text-gray-500 dark:text-gray-400 ${t}`,...s,children:[c.jsxs("div",{className:"items-center w-3/5 font-mono",children:[c.jsx("div",{children:f,className:`bg-kf-50 text-kf-600
|
410
|
+
dark:bg-kf-50/20 dark:text-kf-300
|
411
|
+
w-fit
|
412
|
+
rounded-lg px-1 font-light`}),c.jsx(_e,{show:e==="discounts",children:c.jsx(Ht,{to:`/pages/collections/discount-${n==null?void 0:n.handle}`,draggable:"false",children:c.jsx(wt,{className:"w-full max-w-[30rem] underline",children:u})})}),c.jsx(_e,{show:e!=="discounts"&&u,children:c.jsxs("div",{className:"flex flex-row items-center gap-2 cursor-pointer",children:[c.jsx("div",{onClick:a,draggable:"false",rel:"noopener noreferrer",children:c.jsx(wt,{className:"w-full max-w-[30rem] underline",children:u})}),c.jsx(w6,{value:u})]})})]}),c.jsx("div",{className:"whitespace-pre-line text-right font-semibold",children:d})]})})};var b6=Object.create,bf=Object.defineProperty,k6=Object.getOwnPropertyDescriptor,_x=Object.getOwnPropertyNames,_6=Object.getPrototypeOf,C6=Object.prototype.hasOwnProperty,kf=(n,e)=>function(){return e||(0,n[_x(n)[0]])((e={exports:{}}).exports,e),e.exports},N6=(n,e)=>{for(var t in e)bf(n,t,{get:e[t],enumerable:!0})},j6=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _x(e))!C6.call(n,r)&&r!==t&&bf(n,r,{get:()=>e[r],enumerable:!(s=k6(e,r))||s.enumerable});return n},S6=(n,e,t)=>(t=n!=null?b6(_6(n)):{},j6(!n||!n.__esModule?bf(t,"default",{value:n,enumerable:!0}):t,n)),E6=kf({"node_modules/is-object/index.js"(n,e){e.exports=function(s){return typeof s=="object"&&s!==null}}}),M6=kf({"node_modules/is-window/index.js"(n,e){e.exports=function(t){if(t==null)return!1;var s=Object(t);return s===s.window}}}),D6=kf({"node_modules/is-dom/index.js"(n,e){var t=E6(),s=M6();function r(a){return!t(a)||!s(window)||typeof window.Node!="function"?!1:typeof a.nodeType=="number"&&typeof a.nodeName=="string"}e.exports=r}}),nc={};N6(nc,{chromeDark:()=>Cx,chromeLight:()=>Nx});var Cx={BASE_FONT_FAMILY:"Menlo, monospace",BASE_FONT_SIZE:"11px",BASE_LINE_HEIGHT:1.2,BASE_BACKGROUND_COLOR:"rgb(36, 36, 36)",BASE_COLOR:"rgb(213, 213, 213)",OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES:10,OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES:5,OBJECT_NAME_COLOR:"rgb(227, 110, 236)",OBJECT_VALUE_NULL_COLOR:"rgb(127, 127, 127)",OBJECT_VALUE_UNDEFINED_COLOR:"rgb(127, 127, 127)",OBJECT_VALUE_REGEXP_COLOR:"rgb(233, 63, 59)",OBJECT_VALUE_STRING_COLOR:"rgb(233, 63, 59)",OBJECT_VALUE_SYMBOL_COLOR:"rgb(233, 63, 59)",OBJECT_VALUE_NUMBER_COLOR:"hsl(252, 100%, 75%)",OBJECT_VALUE_BOOLEAN_COLOR:"hsl(252, 100%, 75%)",OBJECT_VALUE_FUNCTION_PREFIX_COLOR:"rgb(85, 106, 242)",HTML_TAG_COLOR:"rgb(93, 176, 215)",HTML_TAGNAME_COLOR:"rgb(93, 176, 215)",HTML_TAGNAME_TEXT_TRANSFORM:"lowercase",HTML_ATTRIBUTE_NAME_COLOR:"rgb(155, 187, 220)",HTML_ATTRIBUTE_VALUE_COLOR:"rgb(242, 151, 102)",HTML_COMMENT_COLOR:"rgb(137, 137, 137)",HTML_DOCTYPE_COLOR:"rgb(192, 192, 192)",ARROW_COLOR:"rgb(145, 145, 145)",ARROW_MARGIN_RIGHT:3,ARROW_FONT_SIZE:12,ARROW_ANIMATION_DURATION:"0",TREENODE_FONT_FAMILY:"Menlo, monospace",TREENODE_FONT_SIZE:"11px",TREENODE_LINE_HEIGHT:1.2,TREENODE_PADDING_LEFT:12,TABLE_BORDER_COLOR:"rgb(85, 85, 85)",TABLE_TH_BACKGROUND_COLOR:"rgb(44, 44, 44)",TABLE_TH_HOVER_COLOR:"rgb(48, 48, 48)",TABLE_SORT_ICON_COLOR:"black",TABLE_DATA_BACKGROUND_IMAGE:"linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",TABLE_DATA_BACKGROUND_SIZE:"128px 32px"},Nx={BASE_FONT_FAMILY:"Menlo, monospace",BASE_FONT_SIZE:"11px",BASE_LINE_HEIGHT:1.2,BASE_BACKGROUND_COLOR:"white",BASE_COLOR:"black",OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES:10,OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES:5,OBJECT_NAME_COLOR:"rgb(136, 19, 145)",OBJECT_VALUE_NULL_COLOR:"rgb(128, 128, 128)",OBJECT_VALUE_UNDEFINED_COLOR:"rgb(128, 128, 128)",OBJECT_VALUE_REGEXP_COLOR:"rgb(196, 26, 22)",OBJECT_VALUE_STRING_COLOR:"rgb(196, 26, 22)",OBJECT_VALUE_SYMBOL_COLOR:"rgb(196, 26, 22)",OBJECT_VALUE_NUMBER_COLOR:"rgb(28, 0, 207)",OBJECT_VALUE_BOOLEAN_COLOR:"rgb(28, 0, 207)",OBJECT_VALUE_FUNCTION_PREFIX_COLOR:"rgb(13, 34, 170)",HTML_TAG_COLOR:"rgb(168, 148, 166)",HTML_TAGNAME_COLOR:"rgb(136, 18, 128)",HTML_TAGNAME_TEXT_TRANSFORM:"lowercase",HTML_ATTRIBUTE_NAME_COLOR:"rgb(153, 69, 0)",HTML_ATTRIBUTE_VALUE_COLOR:"rgb(26, 26, 166)",HTML_COMMENT_COLOR:"rgb(35, 110, 37)",HTML_DOCTYPE_COLOR:"rgb(192, 192, 192)",ARROW_COLOR:"#6e6e6e",ARROW_MARGIN_RIGHT:3,ARROW_FONT_SIZE:12,ARROW_ANIMATION_DURATION:"0",TREENODE_FONT_FAMILY:"Menlo, monospace",TREENODE_FONT_SIZE:"11px",TREENODE_LINE_HEIGHT:1.2,TREENODE_PADDING_LEFT:12,TABLE_BORDER_COLOR:"#aaa",TABLE_TH_BACKGROUND_COLOR:"#eee",TABLE_TH_HOVER_COLOR:"hsla(0, 0%, 90%, 1)",TABLE_SORT_ICON_COLOR:"#6e6e6e",TABLE_DATA_BACKGROUND_IMAGE:"linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",TABLE_DATA_BACKGROUND_SIZE:"128px 32px"},jx=v.createContext([{},()=>{}]),Rh={WebkitTouchCallout:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",OUserSelect:"none",userSelect:"none"},Bl=n=>({DOMNodePreview:{htmlOpenTag:{base:{color:n.HTML_TAG_COLOR},tagName:{color:n.HTML_TAGNAME_COLOR,textTransform:n.HTML_TAGNAME_TEXT_TRANSFORM},htmlAttributeName:{color:n.HTML_ATTRIBUTE_NAME_COLOR},htmlAttributeValue:{color:n.HTML_ATTRIBUTE_VALUE_COLOR}},htmlCloseTag:{base:{color:n.HTML_TAG_COLOR},offsetLeft:{marginLeft:-n.TREENODE_PADDING_LEFT},tagName:{color:n.HTML_TAGNAME_COLOR,textTransform:n.HTML_TAGNAME_TEXT_TRANSFORM}},htmlComment:{color:n.HTML_COMMENT_COLOR},htmlDoctype:{color:n.HTML_DOCTYPE_COLOR}},ObjectPreview:{objectDescription:{fontStyle:"italic"},preview:{fontStyle:"italic"},arrayMaxProperties:n.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,objectMaxProperties:n.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES},ObjectName:{base:{color:n.OBJECT_NAME_COLOR},dimmed:{opacity:.6}},ObjectValue:{objectValueNull:{color:n.OBJECT_VALUE_NULL_COLOR},objectValueUndefined:{color:n.OBJECT_VALUE_UNDEFINED_COLOR},objectValueRegExp:{color:n.OBJECT_VALUE_REGEXP_COLOR},objectValueString:{color:n.OBJECT_VALUE_STRING_COLOR},objectValueSymbol:{color:n.OBJECT_VALUE_SYMBOL_COLOR},objectValueNumber:{color:n.OBJECT_VALUE_NUMBER_COLOR},objectValueBoolean:{color:n.OBJECT_VALUE_BOOLEAN_COLOR},objectValueFunctionPrefix:{color:n.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,fontStyle:"italic"},objectValueFunctionName:{fontStyle:"italic"}},TreeView:{treeViewOutline:{padding:0,margin:0,listStyleType:"none"}},TreeNode:{treeNodeBase:{color:n.BASE_COLOR,backgroundColor:n.BASE_BACKGROUND_COLOR,lineHeight:n.TREENODE_LINE_HEIGHT,cursor:"default",boxSizing:"border-box",listStyle:"none",fontFamily:n.TREENODE_FONT_FAMILY,fontSize:n.TREENODE_FONT_SIZE},treeNodePreviewContainer:{},treeNodePlaceholder:{whiteSpace:"pre",fontSize:n.ARROW_FONT_SIZE,marginRight:n.ARROW_MARGIN_RIGHT,...Rh},treeNodeArrow:{base:{color:n.ARROW_COLOR,display:"inline-block",fontSize:n.ARROW_FONT_SIZE,marginRight:n.ARROW_MARGIN_RIGHT,...parseFloat(n.ARROW_ANIMATION_DURATION)>0?{transition:`transform ${n.ARROW_ANIMATION_DURATION} ease 0s`}:{},...Rh},expanded:{WebkitTransform:"rotateZ(90deg)",MozTransform:"rotateZ(90deg)",transform:"rotateZ(90deg)"},collapsed:{WebkitTransform:"rotateZ(0deg)",MozTransform:"rotateZ(0deg)",transform:"rotateZ(0deg)"}},treeNodeChildNodesContainer:{margin:0,paddingLeft:n.TREENODE_PADDING_LEFT}},TableInspector:{base:{color:n.BASE_COLOR,position:"relative",border:`1px solid ${n.TABLE_BORDER_COLOR}`,fontFamily:n.BASE_FONT_FAMILY,fontSize:n.BASE_FONT_SIZE,lineHeight:"120%",boxSizing:"border-box",cursor:"default"}},TableInspectorHeaderContainer:{base:{top:0,height:"17px",left:0,right:0,overflowX:"hidden"},table:{tableLayout:"fixed",borderSpacing:0,borderCollapse:"separate",height:"100%",width:"100%",margin:0}},TableInspectorDataContainer:{tr:{display:"table-row"},td:{boxSizing:"border-box",border:"none",height:"16px",verticalAlign:"top",padding:"1px 4px",WebkitUserSelect:"text",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"14px"},div:{position:"static",top:"17px",bottom:0,overflowY:"overlay",transform:"translateZ(0)",left:0,right:0,overflowX:"hidden"},table:{positon:"static",left:0,top:0,right:0,bottom:0,borderTop:"0 none transparent",margin:0,backgroundImage:n.TABLE_DATA_BACKGROUND_IMAGE,backgroundSize:n.TABLE_DATA_BACKGROUND_SIZE,tableLayout:"fixed",borderSpacing:0,borderCollapse:"separate",width:"100%",fontSize:n.BASE_FONT_SIZE,lineHeight:"120%"}},TableInspectorTH:{base:{position:"relative",height:"auto",textAlign:"left",backgroundColor:n.TABLE_TH_BACKGROUND_COLOR,borderBottom:`1px solid ${n.TABLE_BORDER_COLOR}`,fontWeight:"normal",verticalAlign:"middle",padding:"0 4px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"14px",":hover":{backgroundColor:n.TABLE_TH_HOVER_COLOR}},div:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",fontSize:n.BASE_FONT_SIZE,lineHeight:"120%"}},TableInspectorLeftBorder:{none:{borderLeft:"none"},solid:{borderLeft:`1px solid ${n.TABLE_BORDER_COLOR}`}},TableInspectorSortIcon:{display:"block",marginRight:3,width:8,height:7,marginTop:-7,color:n.TABLE_SORT_ICON_COLOR,fontSize:12,...Rh}}),Id="chromeLight",Sx=v.createContext(Bl(nc[Id])),bn=n=>v.useContext(Sx)[n],_f=n=>({theme:t=Id,...s})=>{const r=v.useMemo(()=>{switch(Object.prototype.toString.call(t)){case"[object String]":return Bl(nc[t]);case"[object Object]":return Bl(t);default:return Bl(nc[Id])}},[t]);return q.createElement(Sx.Provider,{value:r},q.createElement(n,{...s}))},T6=({expanded:n,styles:e})=>q.createElement("span",{style:{...e.base,...n?e.expanded:e.collapsed}},"▶"),I6=v.memo(n=>{n={expanded:!0,nodeRenderer:({name:p})=>q.createElement("span",null,p),onClick:()=>{},shouldShowArrow:!1,shouldShowPlaceholder:!0,...n};const{expanded:e,onClick:t,children:s,nodeRenderer:r,title:a,shouldShowArrow:l,shouldShowPlaceholder:u}=n,d=bn("TreeNode"),f=r;return q.createElement("li",{"aria-expanded":e,role:"treeitem",style:d.treeNodeBase,title:a},q.createElement("div",{style:d.treeNodePreviewContainer,onClick:t},l||v.Children.count(s)>0?q.createElement(T6,{expanded:e,styles:d.treeNodeArrow}):u&&q.createElement("span",{style:d.treeNodePlaceholder}," "),q.createElement(f,{...n})),q.createElement("ol",{role:"group",style:d.treeNodeChildNodesContainer},e?s:void 0))}),sc="$",Gg="*";function Vl(n,e){return!e(n).next().done}var A6=n=>Array.from({length:n},(e,t)=>[sc].concat(Array.from({length:t},()=>"*")).join(".")),L6=(n,e,t,s,r)=>{const a=[].concat(A6(s)).concat(t).filter(u=>typeof u=="string"),l=[];return a.forEach(u=>{const d=u.split("."),f=(p,g,y)=>{if(y===d.length){l.push(g);return}const w=d[y];if(y===0)Vl(p,e)&&(w===sc||w===Gg)&&f(p,sc,y+1);else if(w===Gg)for(const{name:k,data:_}of e(p))Vl(_,e)&&f(_,`${g}.${k}`,y+1);else{const k=p[w];Vl(k,e)&&f(k,`${g}.${w}`,y+1)}};f(n,"",0)}),l.reduce((u,d)=>(u[d]=!0,u),{...r})},Ex=v.memo(n=>{const{data:e,dataIterator:t,path:s,depth:r,nodeRenderer:a}=n,[l,u]=v.useContext(jx),d=Vl(e,t),f=!!l[s],p=v.useCallback(()=>d&&u(g=>({...g,[s]:!f})),[d,u,s,f]);return q.createElement(I6,{expanded:f,onClick:p,shouldShowArrow:d,shouldShowPlaceholder:r>0,nodeRenderer:a,...n},f?[...t(e)].map(({name:g,data:y,...w})=>q.createElement(Ex,{name:g,data:y,depth:r+1,path:`${s}.${g}`,key:g,dataIterator:t,nodeRenderer:a,...w})):null)}),Mx=v.memo(({name:n,data:e,dataIterator:t,nodeRenderer:s,expandPaths:r,expandLevel:a})=>{const l=bn("TreeView"),u=v.useState({}),[,d]=u;return v.useLayoutEffect(()=>d(f=>L6(e,t,r,a,f)),[e,t,r,a]),q.createElement(jx.Provider,{value:u},q.createElement("ol",{role:"tree",style:l.treeViewOutline},q.createElement(Ex,{name:n,data:e,dataIterator:t,depth:0,path:sc,nodeRenderer:s})))}),Cf=({name:n,dimmed:e=!1,styles:t={}})=>{const s=bn("ObjectName"),r={...s.base,...e?s.dimmed:{},...t};return q.createElement("span",{style:r},n)},Ra=({object:n,styles:e})=>{const t=bn("ObjectValue"),s=r=>({...t[r],...e});switch(typeof n){case"bigint":return q.createElement("span",{style:s("objectValueNumber")},String(n),"n");case"number":return q.createElement("span",{style:s("objectValueNumber")},String(n));case"string":return q.createElement("span",{style:s("objectValueString")},'"',n,'"');case"boolean":return q.createElement("span",{style:s("objectValueBoolean")},String(n));case"undefined":return q.createElement("span",{style:s("objectValueUndefined")},"undefined");case"object":return n===null?q.createElement("span",{style:s("objectValueNull")},"null"):n instanceof Date?q.createElement("span",null,n.toString()):n instanceof RegExp?q.createElement("span",{style:s("objectValueRegExp")},n.toString()):Array.isArray(n)?q.createElement("span",null,`Array(${n.length})`):n.constructor?typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)?q.createElement("span",null,`Buffer[${n.length}]`):q.createElement("span",null,n.constructor.name):q.createElement("span",null,"Object");case"function":return q.createElement("span",null,q.createElement("span",{style:s("objectValueFunctionPrefix")},"ƒ "),q.createElement("span",{style:s("objectValueFunctionName")},n.name,"()"));case"symbol":return q.createElement("span",{style:s("objectValueSymbol")},n.toString());default:return q.createElement("span",null)}},Dx=Object.prototype.hasOwnProperty,O6=Object.prototype.propertyIsEnumerable;function Ad(n,e){const t=Object.getOwnPropertyDescriptor(n,e);if(t.get)try{return t.get()}catch{return t.get}return n[e]}function Jg(n,e){return n.length===0?[]:n.slice(1).reduce((t,s)=>t.concat([e,s]),[n[0]])}var Ld=({data:n})=>{const e=bn("ObjectPreview"),t=n;if(typeof t!="object"||t===null||t instanceof Date||t instanceof RegExp)return q.createElement(Ra,{object:t});if(Array.isArray(t)){const s=e.arrayMaxProperties,r=t.slice(0,s).map((l,u)=>q.createElement(Ra,{key:u,object:l}));t.length>s&&r.push(q.createElement("span",{key:"ellipsis"},"…"));const a=t.length;return q.createElement(q.Fragment,null,q.createElement("span",{style:e.objectDescription},a===0?"":`(${a}) `),q.createElement("span",{style:e.preview},"[",Jg(r,", "),"]"))}else{const s=e.objectMaxProperties,r=[];for(const l in t)if(Dx.call(t,l)){let u;r.length===s-1&&Object.keys(t).length>s&&(u=q.createElement("span",{key:"ellipsis"},"…"));const d=Ad(t,l);if(r.push(q.createElement("span",{key:l},q.createElement(Cf,{name:l||'""'}),": ",q.createElement(Ra,{object:d}),u)),u)break}const a=t.constructor?t.constructor.name:"Object";return q.createElement(q.Fragment,null,q.createElement("span",{style:e.objectDescription},a==="Object"?"":`${a} `),q.createElement("span",{style:e.preview},"{",Jg(r,", "),"}"))}},R6=({name:n,data:e})=>typeof n=="string"?q.createElement("span",null,q.createElement(Cf,{name:n}),q.createElement("span",null,": "),q.createElement(Ld,{data:e})):q.createElement(Ld,{data:e}),P6=({name:n,data:e,isNonenumerable:t=!1})=>{const s=e;return q.createElement("span",null,typeof n=="string"?q.createElement(Cf,{name:n,dimmed:t}):q.createElement(Ld,{data:n}),q.createElement("span",null,": "),q.createElement(Ra,{object:s}))},z6=(n,e)=>function*(s){if(!(typeof s=="object"&&s!==null||typeof s=="function"))return;const a=Array.isArray(s);if(!a&&s[Symbol.iterator]){let l=0;for(const u of s){if(Array.isArray(u)&&u.length===2){const[d,f]=u;yield{name:d,data:f}}else yield{name:l.toString(),data:u};l++}}else{const l=Object.getOwnPropertyNames(s);e===!0&&!a?l.sort():typeof e=="function"&&l.sort(e);for(const u of l)if(O6.call(s,u)){const d=Ad(s,u);yield{name:u||'""',data:d}}else if(n){let d;try{d=Ad(s,u)}catch{}d!==void 0&&(yield{name:u,data:d,isNonenumerable:!0})}n&&s!==Object.prototype&&(yield{name:"__proto__",data:Object.getPrototypeOf(s),isNonenumerable:!0})}},B6=({depth:n,name:e,data:t,isNonenumerable:s})=>n===0?q.createElement(R6,{name:e,data:t}):q.createElement(P6,{name:e,data:t,isNonenumerable:s}),V6=({showNonenumerable:n=!1,sortObjectKeys:e,nodeRenderer:t,...s})=>{const r=z6(n,e),a=t||B6;return q.createElement(Mx,{nodeRenderer:a,dataIterator:r,...s})},$6=_f(V6);function F6(n){if(typeof n=="object"){let e=[];if(Array.isArray(n)){const s=n.length;e=[...Array(s).keys()]}else n!==null&&(e=Object.keys(n));const t=e.reduce((s,r)=>{const a=n[r];return typeof a=="object"&&a!==null&&Object.keys(a).reduce((u,d)=>(u.includes(d)||u.push(d),u),s),s},[]);return{rowHeaders:e,colHeaders:t}}}var H6=({rows:n,columns:e,rowsData:t})=>{const s=bn("TableInspectorDataContainer"),r=bn("TableInspectorLeftBorder");return q.createElement("div",{style:s.div},q.createElement("table",{style:s.table},q.createElement("colgroup",null),q.createElement("tbody",null,n.map((a,l)=>q.createElement("tr",{key:a,style:s.tr},q.createElement("td",{style:{...s.td,...r.none}},a),e.map(u=>{const d=t[l];return typeof d=="object"&&d!==null&&Dx.call(d,u)?q.createElement("td",{key:u,style:{...s.td,...r.solid}},q.createElement(Ra,{object:d[u]})):q.createElement("td",{key:u,style:{...s.td,...r.solid}})}))))))},U6=n=>q.createElement("div",{style:{position:"absolute",top:1,right:0,bottom:1,display:"flex",alignItems:"center"}},n.children),W6=({sortAscending:n})=>{const e=bn("TableInspectorSortIcon"),t=n?"▲":"▼";return q.createElement("div",{style:e},t)},qg=({sortAscending:n=!1,sorted:e=!1,onClick:t=void 0,borderStyle:s={},children:r,...a})=>{const l=bn("TableInspectorTH"),[u,d]=v.useState(!1),f=v.useCallback(()=>d(!0),[]),p=v.useCallback(()=>d(!1),[]);return q.createElement("th",{...a,style:{...l.base,...s,...u?l.base[":hover"]:{}},onMouseEnter:f,onMouseLeave:p,onClick:t},q.createElement("div",{style:l.div},r),e&&q.createElement(U6,null,q.createElement(W6,{sortAscending:n})))},Y6=({indexColumnText:n="(index)",columns:e=[],sorted:t,sortIndexColumn:s,sortColumn:r,sortAscending:a,onTHClick:l,onIndexTHClick:u})=>{const d=bn("TableInspectorHeaderContainer"),f=bn("TableInspectorLeftBorder");return q.createElement("div",{style:d.base},q.createElement("table",{style:d.table},q.createElement("tbody",null,q.createElement("tr",null,q.createElement(qg,{borderStyle:f.none,sorted:t&&s,sortAscending:a,onClick:u},n),e.map(p=>q.createElement(qg,{borderStyle:f.solid,key:p,sorted:t&&r===p,sortAscending:a,onClick:l.bind(null,p)},p))))))},K6=({data:n,columns:e})=>{const t=bn("TableInspector"),[{sorted:s,sortIndexColumn:r,sortColumn:a,sortAscending:l},u]=v.useState({sorted:!1,sortIndexColumn:!1,sortColumn:void 0,sortAscending:!1}),d=v.useCallback(()=>{u(({sortIndexColumn:k,sortAscending:_})=>({sorted:!0,sortIndexColumn:!0,sortColumn:void 0,sortAscending:k?!_:!0}))},[]),f=v.useCallback(k=>{u(({sortColumn:_,sortAscending:C})=>({sorted:!0,sortIndexColumn:!1,sortColumn:k,sortAscending:k===_?!C:!0}))},[]);if(typeof n!="object"||n===null)return q.createElement("div",null);let{rowHeaders:p,colHeaders:g}=F6(n);e!==void 0&&(g=e);let y=p.map(k=>n[k]),w;if(a!==void 0?w=y.map((k,_)=>typeof k=="object"&&k!==null?[k[a],_]:[void 0,_]):r&&(w=p.map((k,_)=>[p[_],_])),w!==void 0){const k=(C,S)=>(M,I)=>{const L=C(M),O=C(I),K=typeof L,E=typeof O,R=(J,oe)=>J<oe?-1:J>oe?1:0;let F;if(K===E)F=R(L,O);else{const J={string:0,number:1,object:2,symbol:3,boolean:4,undefined:5,function:6};F=R(J[K],J[E])}return S||(F=-F),F},_=w.sort(k(C=>C[0],l)).map(C=>C[1]);p=_.map(C=>p[C]),y=_.map(C=>y[C])}return q.createElement("div",{style:t.base},q.createElement(Y6,{columns:g,sorted:s,sortIndexColumn:r,sortColumn:a,sortAscending:l,onTHClick:f,onIndexTHClick:d}),q.createElement(H6,{rows:p,columns:g,rowsData:y}))},Q6=_f(K6),Z6=80,Tx=n=>n.childNodes.length===0||n.childNodes.length===1&&n.childNodes[0].nodeType===Node.TEXT_NODE&&n.textContent.length<Z6,G6=({tagName:n,attributes:e,styles:t})=>q.createElement("span",{style:t.base},"<",q.createElement("span",{style:t.tagName},n),(()=>{if(e){const s=[];for(let r=0;r<e.length;r++){const a=e[r];s.push(q.createElement("span",{key:r}," ",q.createElement("span",{style:t.htmlAttributeName},a.name),'="',q.createElement("span",{style:t.htmlAttributeValue},a.value),'"'))}return s}})(),">"),Xg=({tagName:n,isChildNode:e=!1,styles:t})=>q.createElement("span",{style:Object.assign({},t.base,e&&t.offsetLeft)},"</",q.createElement("span",{style:t.tagName},n),">"),J6={1:"ELEMENT_NODE",3:"TEXT_NODE",7:"PROCESSING_INSTRUCTION_NODE",8:"COMMENT_NODE",9:"DOCUMENT_NODE",10:"DOCUMENT_TYPE_NODE",11:"DOCUMENT_FRAGMENT_NODE"},q6=({isCloseTag:n,data:e,expanded:t})=>{const s=bn("DOMNodePreview");if(n)return q.createElement(Xg,{styles:s.htmlCloseTag,isChildNode:!0,tagName:e.tagName});switch(e.nodeType){case Node.ELEMENT_NODE:return q.createElement("span",null,q.createElement(G6,{tagName:e.tagName,attributes:e.attributes,styles:s.htmlOpenTag}),Tx(e)?e.textContent:!t&&"…",!t&&q.createElement(Xg,{tagName:e.tagName,styles:s.htmlCloseTag}));case Node.TEXT_NODE:return q.createElement("span",null,e.textContent);case Node.CDATA_SECTION_NODE:return q.createElement("span",null,"<![CDATA["+e.textContent+"]]>");case Node.COMMENT_NODE:return q.createElement("span",{style:s.htmlComment},"<!--",e.textContent,"-->");case Node.PROCESSING_INSTRUCTION_NODE:return q.createElement("span",null,e.nodeName);case Node.DOCUMENT_TYPE_NODE:return q.createElement("span",{style:s.htmlDoctype},"<!DOCTYPE ",e.name,e.publicId?` PUBLIC "${e.publicId}"`:"",!e.publicId&&e.systemId?" SYSTEM":"",e.systemId?` "${e.systemId}"`:"",">");case Node.DOCUMENT_NODE:return q.createElement("span",null,e.nodeName);case Node.DOCUMENT_FRAGMENT_NODE:return q.createElement("span",null,e.nodeName);default:return q.createElement("span",null,J6[e.nodeType])}},X6=function*(n){if(n&&n.childNodes){if(Tx(n))return;for(let t=0;t<n.childNodes.length;t++){const s=n.childNodes[t];s.nodeType===Node.TEXT_NODE&&s.textContent.trim().length===0||(yield{name:`${s.tagName}[${t}]`,data:s})}n.tagName&&(yield{name:"CLOSE_TAG",data:{tagName:n.tagName},isCloseTag:!0})}},e8=n=>q.createElement(Mx,{nodeRenderer:q6,dataIterator:X6,...n}),t8=_f(e8),n8=S6(D6()),s8=({table:n=!1,data:e,...t})=>n?q.createElement(Q6,{data:e,...t}):(0,n8.default)(e)?q.createElement(t8,{data:e,...t}):q.createElement($6,{data:e,...t});const Nf=({value:n,...e})=>{const{darkMode:t}=hs();return n?c.jsx("div",{className:"w-full overflow-auto",children:c.jsx("div",{className:"w-fit min-w-[50rem]",children:c.jsx(s8,{theme:{...t?Cx:Nx,BASE_BACKGROUND_COLOR:"",TREENODE_FONT_SIZE:"14px"},data:n})})}):null},vs=({value:n,setError:e,...t})=>{if(!n)return null;const s=v.useMemo(()=>c.jsx(wf,{value:JSON.stringify(n)}),[n]);return c.jsx("div",{...t,children:c.jsx(Ts,{className:"w-full h-fit",name:"JSON",desc:"View the RAW JSON data",rightView:s,children:c.jsx(Nf,{value:n})})})},r8=({action:n,onClick:e})=>c.jsx(ls,{classNameLeft:"w-fit",title:n.description,Icon:void 0,text:n.name,show:!0,onClick:()=>e(n),keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit text-base underline "}),i8=({full_order:n,onCreate:e})=>{const{page:t}=fr("payments/gateways"),s=v.useRef(void 0);return n!=null&&n.id?c.jsxs("div",{className:"w-full h-fit flex flex-col gap-2",children:[c.jsx("p",{className:"text-base",children:"Choose Payment Gateway"}),c.jsxs("div",{className:"w-full flex flex-row flex-wrap justify-between items-center",children:[c.jsx("select",{ref:s,name:"pg",className:`h-8 px-1 rounded-md text-sm
|
413
|
+
bg-slate-50 dark:bg-slate-800
|
414
|
+
border shelf-border-color focus:outline-none`,children:t==null?void 0:t.map(r=>c.jsx("option",{value:r.handle,children:r.info.name},r.handle))}),c.jsx(ls,{Icon:void 0,text:"create checkout",show:!0,onClick:()=>e(s.current.value),keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit text-base shelf-text-label-color underline self-end "})]})]}):c.jsx(a8,{})},a8=({})=>c.jsx("p",{className:"text-base",children:"To create a payment checkout, first save the order"}),o8=({field:n,value:e,onChange:t,setError:s,context:r,...a})=>{const{sdk:l}=bt(),{comp_params:u}=n,[d,f]=v.useState((e==null?void 0:e.latest_status)??{messages:[],actions:[]}),p=r==null?void 0:r.data,g=v.useCallback(async()=>{var _;if((e==null?void 0:e.gateway_handle)!==void 0)try{const C=await l.payments.paymentStatusOfOrder(p.id);t({...e,latest_status:C}),f(C),console.log("stat",C)}catch(C){s((_=Td(C))==null?void 0:_.at(0))}},[e,p,t]),y=v.useCallback(async _=>{var C;try{const S=await l.payments.invokeAction(_.handle,p.id);t({...e,latest_status:S}),f(S)}catch(S){s((C=Td(S))==null?void 0:C.at(0))}},[e,p,t]),w=v.useCallback(async _=>{await r.create_checkout(_)},[r]);if(v.useEffect(()=>{g()},[]),!(e!=null&&e.gateway_handle))return c.jsx(i8,{full_order:p,onCreate:w});const k=new URL(`/api/payments/buy_ui/${r.data.id}`,l.config.endpoint??window.location.origin);return c.jsxs("div",{...u,children:[c.jsxs("div",{className:"w-full flex flex-row justify-between",children:[c.jsx("p",{children:"Status",className:"text-gray-400 --bg-pink-50 text-xl font-bold"}),c.jsx(ls,{Icon:void 0,text:"reload",show:!0,keep_text_on_load:!0,onClick:g,classNameLoading:"text-xs",className:"w-fit text-base underline shelf-text-label-color"})]}),c.jsx(lt,{className:""}),c.jsx("ul",{className:`flex md-view rounded-md
|
415
|
+
flex-col items-start mt-3 w-full h-fit
|
416
|
+
text-gray-500 text-base`,children:d.messages.map((_,C)=>c.jsx(It,{value:_,className:"border-b-2 py-2 stroke-2 dash shelf-border-color border-dashed w-full"},C))}),c.jsx("p",{children:"Actions",className:"text-gray-400 mt-5 --bg-pink-50 text-xl font-bold"}),c.jsx(lt,{className:"--my-5"}),c.jsxs("div",{className:"flex flex-row items-center justify-between shelf-text-label-color mt-3",children:[c.jsx("div",{className:"w-fit flex flex-row gap-3 shelf-text-label-color",children:d.actions.map(_=>c.jsx(r8,{action:_,onClick:y},_.handle))}),c.jsx("a",{className:"underline w-fit text-base",children:"buy link",target:"_blank",href:k.toString()})]})]})},l8=({attribute:n,onChange:e,onDelete:t,className:s})=>{const r=v.useCallback((a,l)=>{const u={...n,[a]:l.currentTarget.value};e(u)},[e,n]);return c.jsx(Je,{className:`shadow-md shadow-slate-300 dark:shadow-slate-800 ${s}`,rounded:"rounded-lg",children:c.jsxs("div",{className:`w-full relative rounded-lg
|
417
|
+
shelf-bling-fill
|
418
|
+
p-3 border
|
419
|
+
dark:border-slate-600`,children:[c.jsx("p",{children:"Key",className:""}),c.jsx(Qe,{className:"mt-1",stroke:"border-b",onChange:a=>r("key",a),value:n.key,placeholder:"attribute key",type:"text"}),c.jsx("p",{children:"Value",className:"mt-3"}),c.jsx(Qe,{className:"mt-1",stroke:"border-b",onChange:a=>r("value",a),value:n.value,placeholder:"attribute value",type:"text"}),c.jsx(X1,{className:"absolute top-3 right-3 cursor-pointer text-lg",onClick:t})]})})},As=({field:n,value:e=[],onChange:t,setError:s,...r})=>{const[a,l]=v.useState(e),u=v.useCallback(()=>{const p=[...a,{key:"",value:""}];l(p),t(p)},[a,t]),d=v.useCallback((p,g)=>{const y=[...a];y[p]=g,l(y),t(y)},[a,t]),f=v.useCallback(p=>{const g=a.filter((y,w)=>p!==w);l(g),t(g)},[a,t]);return c.jsx("div",{...r,children:c.jsxs("div",{className:`w-full flex flex-col justify-center
|
420
|
+
items-center gap-5`,children:[c.jsx(qa,{onClick:u,Icon:J1,className:`cursor-pointer text-6xl hover:scale-110
|
421
|
+
transition-transform`}),a==null?void 0:a.map((p,g)=>c.jsx(l8,{attribute:p,className:"w-full",onDelete:()=>f(g),onChange:y=>d(g,y)},g))]})})},c8=n=>n==null?void 0:n.match(/\S+/g),u8=({onAdd:n,...e})=>{const t=v.useRef(null),s=v.useRef(null),r=v.useCallback(a=>{const l=c8(s.current.value.toString()),u=t.current.value;if(!l)return;const d=l.map(f=>`${u}_${f}`);n(d)},[n]);return c.jsxs("div",{...e,children:[c.jsx("p",{children:"Name",className:"text-gray-500 dark:text-gray-400"}),c.jsx(Qe,{ref:t,placeholder:"name of the tag",type:"text",className:"mt-1"}),c.jsx("p",{children:"Tag Values",className:"mt-3 text-gray-500 dark:text-gray-400"}),c.jsxs("div",{className:"flex flex-row items-center h-fit w-full mt-1 gap-3",children:[c.jsx(Qe,{ref:s,placeholder:"values of the tag",type:"text",className:"mt-1 flex-1"}),c.jsx(Xt,{children:"add",className:"h-10 ",onClick:r})]})]})},Ix=({onSelect:n,header:e,limit:t=100,layout:s=0,className:r,clsHeader:a,clsReload:l,...u})=>{const d=v.useCallback(f=>f?f.reduce((p,g)=>[...p,...((g==null?void 0:g.values)??[]).map(y=>`${g.handle}_${y}`)],[]):[],[]);return c.jsx(so,{transform_fn:d,name_fn:f=>f,onSelect:n,header:e,resource:"tags",limit:t,layout:s,className:r,clsHeader:a,clsReload:l,...u})},Ls=({field:n,context:e,value:t=[],onChange:s,setError:r,...a})=>{const[l,u]=v.useState(t),{navWithState:d}=Gn(),f=v.useCallback(y=>{let w=y.filter(k=>l.indexOf(k)==-1);w=[...l,...w],s&&s(w),u(w)},[l,s]),p=v.useCallback(y=>{const w=l.indexOf(y);if(w==-1)return;l.splice(w,1);const k=[...l];s(k),u(k)},[l,s]),g=v.useCallback(y=>{const w=y.split("_")[0],k=e==null?void 0:e.getState();d(`/pages/tags/${w}`,k)},[d,e]);return c.jsxs("div",{...a,children:[c.jsx(u8,{onAdd:f}),c.jsx(lt,{className:"mt-5"}),c.jsx(Ix,{onSelect:y=>f([y]),layout:1,className:"mt-3",clsReload:"text-pink-500 text-3xl",header:"Select tags you used"}),(l==null?void 0:l.length)>0&&c.jsx(lt,{className:"my-5"}),c.jsx(ps,{tags:l,onClick:g,onRemove:p,clsCapsule:"bg-pink-500 dark:bg-pink-500/80",className:"mt-3"})]})};function as(){return as=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},as.apply(null,arguments)}function it(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Od(n,e){return Od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},Od(n,e)}function rt(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,Od(n,e)}var Dl,h8=new Uint8Array(16);function d8(){if(!Dl&&(Dl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Dl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dl(h8)}const f8=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function p8(n){return typeof n=="string"&&f8.test(n)}var Vt=[];for(var Ph=0;Ph<256;++Ph)Vt.push((Ph+256).toString(16).substr(1));function m8(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Vt[n[e+0]]+Vt[n[e+1]]+Vt[n[e+2]]+Vt[n[e+3]]+"-"+Vt[n[e+4]]+Vt[n[e+5]]+"-"+Vt[n[e+6]]+Vt[n[e+7]]+"-"+Vt[n[e+8]]+Vt[n[e+9]]+"-"+Vt[n[e+10]]+Vt[n[e+11]]+Vt[n[e+12]]+Vt[n[e+13]]+Vt[n[e+14]]+Vt[n[e+15]]).toLowerCase();if(!p8(t))throw TypeError("Stringified UUID is invalid");return t}function $a(n,e,t){n=n||{};var s=n.random||(n.rng||d8)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=s[r];return e}return m8(s)}function Mt(n){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+n.type})}function g8(n){return v.createElement("div",{className:"rc-md-navigation "+(n.visible?"visible":"in-visible")},v.createElement("div",{className:"navigation-nav left"},v.createElement("div",{className:"button-wrap"},n.left)),v.createElement("div",{className:"navigation-nav right"},v.createElement("div",{className:"button-wrap"},n.right)))}function v8(n){return v.createElement("div",{className:"tool-bar",style:n.style},n.children)}var zh={exports:{}},e1;function x8(){return e1||(e1=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function r(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,g,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var w=new r(p,g||d,y),k=t?t+f:f;return d._events[k]?d._events[k].fn?d._events[k]=[d._events[k],w]:d._events[k].push(w):(d._events[k]=w,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new s:delete d._events[f]}function u(){this._events=new s,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)e.call(p,g)&&f.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=t?t+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var y=0,w=g.length,k=new Array(w);y<w;y++)k[y]=g[y].fn;return k},u.prototype.listenerCount=function(f){var p=t?t+f:f,g=this._events[p];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,p,g,y,w,k){var _=t?t+f:f;if(!this._events[_])return!1;var C=this._events[_],S=arguments.length,M,I;if(C.fn){switch(C.once&&this.removeListener(f,C.fn,void 0,!0),S){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,p),!0;case 3:return C.fn.call(C.context,p,g),!0;case 4:return C.fn.call(C.context,p,g,y),!0;case 5:return C.fn.call(C.context,p,g,y,w),!0;case 6:return C.fn.call(C.context,p,g,y,w,k),!0}for(I=1,M=new Array(S-1);I<S;I++)M[I-1]=arguments[I];C.fn.apply(C.context,M)}else{var L=C.length,O;for(I=0;I<L;I++)switch(C[I].once&&this.removeListener(f,C[I].fn,void 0,!0),S){case 1:C[I].fn.call(C[I].context);break;case 2:C[I].fn.call(C[I].context,p);break;case 3:C[I].fn.call(C[I].context,p,g);break;case 4:C[I].fn.call(C[I].context,p,g,y);break;default:if(!M)for(O=1,M=new Array(S-1);O<S;O++)M[O-1]=arguments[O];C[I].fn.apply(C[I].context,M)}}return!0},u.prototype.on=function(f,p,g){return a(this,f,p,g,!1)},u.prototype.once=function(f,p,g){return a(this,f,p,g,!0)},u.prototype.removeListener=function(f,p,g,y){var w=t?t+f:f;if(!this._events[w])return this;if(!p)return l(this,w),this;var k=this._events[w];if(k.fn)k.fn===p&&(!y||k.once)&&(!g||k.context===g)&&l(this,w);else{for(var _=0,C=[],S=k.length;_<S;_++)(k[_].fn!==p||y&&!k[_].once||g&&k[_].context!==g)&&C.push(k[_]);C.length?this._events[w]=C.length===1?C[0]:C:l(this,w)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=t?t+f:f,this._events[p]&&l(this,p)):(this._events=new s,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=t,u.EventEmitter=u,n.exports=u}(zh)),zh.exports}var y8=x8(),Ax=function(n){rt(e,n);function e(){for(var t,s=arguments.length,r=new Array(s),a=0;a<s;a++)r[a]=arguments[a];return t=n.call.apply(n,[this].concat(r))||this,t.EVENT_CHANGE="a1",t.EVENT_FULL_SCREEN="a2",t.EVENT_VIEW_CHANGE="a3",t.EVENT_KEY_DOWN="a4",t.EVENT_EDITOR_KEY_DOWN="a5",t.EVENT_FOCUS="a5",t.EVENT_BLUR="a6",t.EVENT_SCROLL="a7",t.EVENT_LANG_CHANGE="b1",t}return e}(y8.EventEmitter),or=new Ax;const w8={clearTip:"Are you sure you want to clear all contents?",btnHeader:"Header",btnClear:"Clear",btnBold:"Bold",btnItalic:"Italic",btnUnderline:"Underline",btnStrikethrough:"Strikethrough",btnUnordered:"Unordered list",btnOrdered:"Ordered list",btnQuote:"Quote",btnLineBreak:"Line break",btnInlineCode:"Inline code",btnCode:"Code",btnTable:"Table",btnImage:"Image",btnLink:"Link",btnUndo:"Undo",btnRedo:"Redo",btnFullScreen:"Full screen",btnExitFullScreen:"Exit full screen",btnModeEditor:"Only display editor",btnModePreview:"Only display preview",btnModeAll:"Display both editor and preview",selectTabMap:"Actual input when typing a Tab key",tab:"Tab",spaces:"Spaces"},b8={clearTip:"您确定要清空所有内容吗?",btnHeader:"标题",btnClear:"清空",btnBold:"加粗",btnItalic:"斜体",btnUnderline:"下划线",btnStrikethrough:"删除线",btnUnordered:"无序列表",btnOrdered:"有序列表",btnQuote:"引用",btnLineBreak:"换行",btnInlineCode:"行内代码",btnCode:"代码块",btnTable:"表格",btnImage:"图片",btnLink:"链接",btnUndo:"撤销",btnRedo:"重做",btnFullScreen:"全屏",btnExitFullScreen:"退出全屏",btnModeEditor:"仅显示编辑器",btnModePreview:"仅显示预览",btnModeAll:"显示编辑器与预览",selectTabMap:"按下 Tab 键时实际的输入",tab:"制表符",spaces:"空格"};var k8=function(){function n(){this.langs={enUS:w8,zhCN:b8},this.current="enUS",this.setUp()}var e=n.prototype;return e.setUp=function(){if(!(typeof window>"u")){var s="enUS";if(navigator.language){var r=navigator.language.split("-");s=r[0],r.length!==1&&(s+=r[r.length-1].toUpperCase())}if(navigator.browserLanguage){var a=navigator.browserLanguage.split("-");s=a[0],a[1]&&(s+=a[1].toUpperCase())}this.current!==s&&this.isAvailable(s)&&(this.current=s,or.emit(or.EVENT_LANG_CHANGE,this,s,this.langs[s]))}},e.isAvailable=function(s){return typeof this.langs[s]<"u"},e.add=function(s,r){this.langs[s]=r},e.setCurrent=function(s){if(!this.isAvailable(s))throw new Error("Language "+s+" is not exists");this.current!==s&&(this.current=s,or.emit(or.EVENT_LANG_CHANGE,this,s,this.langs[s]))},e.get=function(s,r){var a=this.langs[this.current][s]||"";return r&&Object.keys(r).forEach(function(l){a=a.replace(new RegExp("\\{"+l+"\\}","g"),r[l])}),a},e.getCurrent=function(){return this.current},n}(),st=new k8;function Fa(n){"@babel/helpers - typeof";return Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fa(n)}function _8(n,e){if(Fa(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var s=t.call(n,e);if(Fa(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function C8(n){var e=_8(n,"string");return Fa(e)=="symbol"?e:e+""}function N8(n,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,C8(s.key),s)}}function Lx(n,e,t){return e&&N8(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}var kt=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.getConfig=function(r,a){return typeof this.props.config[r]<"u"&&this.props.config[r]!==null?this.props.config[r]:a},Lx(e,[{key:"editor",get:function(){return this.props.editor}},{key:"editorConfig",get:function(){return this.props.editorConfig}}]),e}(v.Component);kt.pluginName="";kt.align="left";kt.defaultConfig={};var Rd=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){return v.createElement("span",{className:"rc-md-divider"})},e}(kt);Rd.pluginName="divider";var j8={start:0,end:0,text:""};function S8(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=E8(n))||e){t&&(n=t);var s=0;return function(){return s>=n.length?{done:!0}:{done:!1,value:n[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
422
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E8(n,e){if(n){if(typeof n=="string")return t1(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return t1(n,e)}}function t1(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=n[t];return s}function jf(n){return n&&(n instanceof Promise||(typeof n=="object"||typeof n=="function")&&typeof n.then=="function")}function M8(n,e){for(var t="",s=e;s--;)t+=n;return t}function D8(n,e){var t=e.withKey,s=e.keyCode,r=e.key,a=e.aliasCommand,l={ctrlKey:n.ctrlKey,metaKey:n.metaKey,altKey:n.altKey,shiftKey:n.shiftKey,keyCode:n.keyCode,key:n.key};if(a&&(l.ctrlKey=l.ctrlKey||l.metaKey),t&&t.length>0)for(var u=S8(t),d;!(d=u()).done;){var f=d.value;if(typeof l[f]<"u"&&!l[f])return!1}else if(l.metaKey||l.ctrlKey||l.shiftKey||l.altKey)return!1;return l.key?l.key===r:l.keyCode===s}function Bh(n,e){var t=n.split(`
|
423
|
+
`),s=n.substr(0,e).split(`
|
424
|
+
`),r=s.length,a=s[s.length-1].length,l=t[s.length-1],u=s.length>1?s[s.length-2]:null,d=t.length>s.length?t[s.length]:null;return{line:r,col:a,beforeText:n.substr(0,e),afterText:n.substr(e),curLine:l,prevLine:u,nextLine:d}}var xi={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:[`
|
425
|
+
> `,`
|
426
|
+
`],inlinecode:["`","`"],code:["\n```\n","\n```\n"]};for(var Tl=1;Tl<=6;Tl++)xi["h"+Tl]=[`
|
427
|
+
`+M8("#",Tl)+" ",`
|
428
|
+
`];function T8(n){for(var e=n.row,t=e===void 0?2:e,s=n.col,r=s===void 0?2:s,a=["|"],l=["|"],u=["|"],d="",f=1;f<=r;f++)a.push(" Head |"),u.push(" --- |"),l.push(" Data |");for(var p=1;p<=t;p++)d+=`
|
429
|
+
`+l.join("");return a.join("")+`
|
430
|
+
`+u.join("")+d}function n1(n,e){var t=e;if(t.substr(0,1)!==`
|
431
|
+
`&&(t=`
|
432
|
+
`+t),n==="unordered")return t.length>1?t.replace(/\n/g,`
|
433
|
+
* `).trim():"* ";var s=1;return t.length>1?t.replace(/\n/g,function(){return`
|
434
|
+
`+s+++". "}).trim():"1. "}function Vh(n,e){return{text:n,newBlock:e,selection:{start:n.length,end:n.length}}}function Pd(n,e,t){if(typeof xi[e]<"u")return{text:""+xi[e][0]+n+xi[e][1],selection:{start:xi[e][0].length,end:xi[e][0].length+n.length}};switch(e){case"tab":var s=t.tabMapValue===1?" ":" ".repeat(t.tabMapValue),r=s+n.replace(/\n/g,`
|
435
|
+
`+s),a=n.includes(`
|
436
|
+
`)?n.match(/\n/g).length:0;return{text:r,selection:{start:t.tabMapValue,end:t.tabMapValue*(a+1)+n.length}};case"unordered":return Vh(n1("unordered",n),!0);case"order":return Vh(n1("order",n),!0);case"hr":return Vh("---",!0);case"table":return{text:T8(t),newBlock:!0};case"image":return{text:"+")",selection:{start:2,end:n.length+2}};case"link":return{text:"["+n+"]("+(t.linkUrl||"")+")",selection:{start:1,end:n.length+1}}}return{text:n,selection:{start:0,end:n.length}}}function Ox(n,e){var t={};return Object.keys(n).forEach(function(s){if(typeof e[s]>"u"){t[s]=n[s];return}if(typeof e[s]=="object"){Array.isArray(e[s])?t[s]=[].concat(e[s]):t[s]=Ox(n[s],e[s]);return}t[s]=e[s]}),t}function I8(n){for(var e=as({},n),t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return s.forEach(function(a){typeof a=="object"&&(e=Ox(e,a))}),e}function Rx(n,e){var t=Pd("","image",{target:"Uploading_"+$a(),imageUrl:""}).text,s=new Promise(function(r){var a=!0,l=function(f){a&&console.warn("Deprecated: onImageUpload should return a Promise, callback will be removed in future"),r(Pd("","image",{target:n.name,imageUrl:f}).text)},u=e(n,l);jf(u)&&(a=!1,u.then(l))});return{placeholder:t,uploaded:s}}var s1={theme:"default",view:{menu:!0,md:!0,html:!0},canView:{menu:!0,md:!0,html:!0,both:!0,fullScreen:!0,hideMenu:!0},htmlClass:"",markdownClass:"",syncScrollMode:["rightFollowLeft","leftFollowRight"],imageUrl:"",imageAccept:"",linkUrl:"",loggerMaxSize:100,loggerInterval:600,table:{maxRow:4,maxCol:6},allowPasteImage:!0,onImageUpload:void 0,onCustomImageUpload:void 0,shortcuts:!0,onChangeTrigger:"both"},A8=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.el=v.createRef(),r}var t=e.prototype;return t.getElement=function(){return this.el.current},t.getHeight=function(){return this.el.current?this.el.current.offsetHeight:0},e}(v.Component),L8=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.getHtml=function(){return typeof this.props.html=="string"?this.props.html:this.el.current?this.el.current.innerHTML:""},t.render=function(){return typeof this.props.html=="string"?v.createElement("div",{ref:this.el,dangerouslySetInnerHTML:{__html:this.props.html},className:this.props.className||"custom-html-style"}):v.createElement("div",{ref:this.el,className:this.props.className||"custom-html-style"},this.props.html)},e}(A8);function $h(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=O8(n))||e){t&&(n=t);var s=0;return function(){return s>=n.length?{done:!0}:{done:!1,value:n[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
437
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O8(n,e){if(n){if(typeof n=="string")return r1(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r1(n,e)}}function r1(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=n[t];return s}var xt=function(n){rt(e,n),e.use=function(r,a){a===void 0&&(a={});for(var l=0;l<e.plugins.length;l++)if(e.plugins[l].comp===r){e.plugins.splice(l,1,{comp:r,config:a});return}e.plugins.push({comp:r,config:a})},e.unuse=function(r){for(var a=0;a<e.plugins.length;a++)if(e.plugins[a].comp===r){e.plugins.splice(a,1);return}},e.unuseAll=function(){e.plugins=[]};function e(s){var r;return r=n.call(this,s)||this,r.nodeMdText=v.createRef(),r.nodeMdPreview=v.createRef(),r.nodeMdPreviewWrapper=v.createRef(),r.hasContentChanged=!0,r.composing=!1,r.pluginApis=new Map,r.scrollScale=1,r.isSyncingScroll=!1,r.shouldSyncScroll="md",r.keyboardListeners=[],r.emitter=new Ax,r.config=I8(s1,r.props.config,r.props),r.state={text:(r.props.value||r.props.defaultValue||"").replace(/↵/g,`
|
438
|
+
`),html:"",view:r.config.view||s1.view,fullScreen:!1,plugins:r.getPlugins()},r.config.canView&&!r.config.canView.menu&&(r.state.view.menu=!1),r.nodeMdText=v.createRef(),r.nodeMdPreviewWrapper=v.createRef(),r.handleChange=r.handleChange.bind(it(r)),r.handlePaste=r.handlePaste.bind(it(r)),r.handleDrop=r.handleDrop.bind(it(r)),r.handleToggleMenu=r.handleToggleMenu.bind(it(r)),r.handleKeyDown=r.handleKeyDown.bind(it(r)),r.handleEditorKeyDown=r.handleEditorKeyDown.bind(it(r)),r.handleLocaleUpdate=r.handleLocaleUpdate.bind(it(r)),r.handleFocus=r.handleFocus.bind(it(r)),r.handleBlur=r.handleBlur.bind(it(r)),r.handleInputScroll=r.handleSyncScroll.bind(it(r),"md"),r.handlePreviewScroll=r.handleSyncScroll.bind(it(r),"html"),r}var t=e.prototype;return t.componentDidMount=function(){var r=this.state.text;this.renderHTML(r),or.on(or.EVENT_LANG_CHANGE,this.handleLocaleUpdate),st.setUp()},t.componentWillUnmount=function(){or.off(or.EVENT_LANG_CHANGE,this.handleLocaleUpdate)},t.componentDidUpdate=function(r){if(typeof this.props.value<"u"&&this.props.value!==this.state.text){var a=this.props.value;typeof a!="string"&&(a=String(a).toString()),a=a.replace(/↵/g,`
|
439
|
+
`),this.state.text!==a&&(this.setState({text:a}),this.renderHTML(a))}r.plugins!==this.props.plugins&&this.setState({plugins:this.getPlugins()})},t.isComposing=function(){return this.composing},t.getPlugins=function(){var r=this,a=[];if(this.props.plugins)for(var l=function(y){if(y===Rd.pluginName){a.push({comp:Rd,config:{}});return}for(var w=$h(e.plugins),k;!(k=w()).done;){var _=k.value;if(_.comp.pluginName===y){a.push(_);return}}},u=$h(this.props.plugins),d;!(d=u()).done;){var f=d.value;f==="fonts"?(l("font-bold"),l("font-italic"),l("font-underline"),l("font-strikethrough"),l("list-unordered"),l("list-ordered"),l("block-quote"),l("block-wrap"),l("block-code-inline"),l("block-code-block")):l(f)}else a=[].concat(e.plugins);var p={};return a.forEach(function(g){typeof p[g.comp.align]>"u"&&(p[g.comp.align]=[]);var y=g.comp.pluginName==="divider"?$a():g.comp.pluginName;p[g.comp.align].push(v.createElement(g.comp,{editor:r,editorConfig:r.config,config:as({},g.comp.defaultConfig||{},g.config||{}),key:y}))}),p},t.handleSyncScroll=function(r,a){var l=this;if(r===this.shouldSyncScroll){this.props.onScroll&&this.props.onScroll(a,r),this.emitter.emit(this.emitter.EVENT_SCROLL,a,r);var u=this.config.syncScrollMode,d=u===void 0?[]:u;d.includes(r==="md"?"rightFollowLeft":"leftFollowRight")&&(this.hasContentChanged&&this.nodeMdText.current&&this.nodeMdPreviewWrapper.current&&(this.scrollScale=this.nodeMdText.current.scrollHeight/this.nodeMdPreviewWrapper.current.scrollHeight,this.hasContentChanged=!1),this.isSyncingScroll||(this.isSyncingScroll=!0,requestAnimationFrame(function(){l.nodeMdText.current&&l.nodeMdPreviewWrapper.current&&(r==="md"?l.nodeMdPreviewWrapper.current.scrollTop=l.nodeMdText.current.scrollTop/l.scrollScale:l.nodeMdText.current.scrollTop=l.nodeMdPreviewWrapper.current.scrollTop*l.scrollScale),l.isSyncingScroll=!1})))}},t.renderHTML=function(r){var a=this;if(!this.props.renderHTML)return console.error("renderHTML props is required!"),Promise.resolve();var l=this.props.renderHTML(r);return jf(l)?l.then(function(u){return a.setHtml(u)}):typeof l=="function"?this.setHtml(l()):this.setHtml(l)},t.setHtml=function(r){var a=this;return new Promise(function(l){a.setState({html:r},l)})},t.handleToggleMenu=function(){this.setView({menu:!this.state.view.menu})},t.handleFocus=function(r){var a=this.props.onFocus;a&&a(r),this.emitter.emit(this.emitter.EVENT_FOCUS,r)},t.handleBlur=function(r){var a=this.props.onBlur;a&&a(r),this.emitter.emit(this.emitter.EVENT_BLUR,r)},t.handleChange=function(r){r.persist();var a=r.target.value;this.setText(a,r)},t.handlePaste=function(r){if(!(!this.config.allowPasteImage||!this.config.onImageUpload)){var a=r.nativeEvent,l=(a.clipboardData||window.clipboardData).items;l&&(r.preventDefault(),this.uploadWithDataTransfer(l))}},t.handleDrop=function(r){if(this.config.onImageUpload){var a=r.nativeEvent;if(a.dataTransfer){var l=a.dataTransfer.items;l&&(r.preventDefault(),this.uploadWithDataTransfer(l))}}},t.handleEditorKeyDown=function(r){var a=this,l=r.keyCode,u=r.key,d=r.currentTarget;if((l===13||u==="Enter")&&this.composing===!1){var f=d.value,p=d.selectionStart,g=Bh(f,p),y=function(){var M=d.value.substr(0,p-g.curLine.length)+d.value.substr(p);a.setText(M,void 0,{start:p-g.curLine.length,end:p-g.curLine.length}),r.preventDefault()},w=function(M){a.insertText(`
|
440
|
+
`+M,!1,{start:M.length+1,end:M.length+1}),r.preventDefault()},k=g.curLine.match(/^(\s*?)\* /);if(k){if(/^(\s*?)\* $/.test(g.curLine)){y();return}w(k[0]);return}var _=g.curLine.match(/^(\s*?)(\d+)\. /);if(_){if(/^(\s*?)(\d+)\. $/.test(g.curLine)){y();return}var C=""+_[1]+(parseInt(_[2],10)+1)+". ";w(C);return}}this.emitter.emit(this.emitter.EVENT_EDITOR_KEY_DOWN,r)},t.handleLocaleUpdate=function(){this.forceUpdate()},t.getMdElement=function(){return this.nodeMdText.current},t.getHtmlElement=function(){return this.nodeMdPreviewWrapper.current},t.clearSelection=function(){this.nodeMdText.current&&this.nodeMdText.current.setSelectionRange(0,0,"none")},t.getSelection=function(){var r=this.nodeMdText.current;if(!r)return as({},j8);var a=r.selectionStart,l=r.selectionEnd,u=(r.value||"").slice(a,l);return{start:a,end:l,text:u}},t.setSelection=function(r){this.nodeMdText.current&&(this.nodeMdText.current.setSelectionRange(r.start,r.end,"forward"),this.nodeMdText.current.focus())},t.insertMarkdown=function(r,a){a===void 0&&(a={});var l=this.getSelection(),u=a?as({},a):{};if(r==="image"&&(u=as({},u,{target:a.target||l.text||"",imageUrl:a.imageUrl||this.config.imageUrl})),r==="link"&&(u=as({},u,{linkUrl:this.config.linkUrl})),r==="tab"&&l.start!==l.end){var d=this.getMdValue().slice(0,l.start).lastIndexOf(`
|
441
|
+
`)+1;this.setSelection({start:d,end:l.end})}var f=Pd(l.text,r,u),p=f.text,g=f.selection;if(f.newBlock){var y=Bh(this.getMdValue(),l.start),w=y.col,k=y.curLine;w>0&&k.length>0&&(p=`
|
442
|
+
`+p,g&&(g.start++,g.end++));var _=y.afterText;l.start!==l.end&&(_=Bh(this.getMdValue(),l.end).afterText),_.trim()!==""&&_.substr(0,2)!==`
|
443
|
+
|
444
|
+
`&&(_.substr(0,1)!==`
|
445
|
+
`&&(p+=`
|
446
|
+
`),p+=`
|
447
|
+
`)}this.insertText(p,!0,g)},t.insertPlaceholder=function(r,a){var l=this;this.insertText(r,!0),a.then(function(u){var d=l.getMdValue().replace(r,u);l.setText(d)})},t.insertText=function(r,a,l){r===void 0&&(r=""),a===void 0&&(a=!1);var u=this.state.text,d=this.getSelection(),f=u.slice(0,d.start),p=u.slice(a?d.end:d.start,u.length);this.setText(f+r+p,void 0,l?{start:l.start+f.length,end:l.end+f.length}:{start:d.start,end:d.start})},t.setText=function(r,a,l){var u=this;r===void 0&&(r="");var d=this.config.onChangeTrigger,f=d===void 0?"both":d,p=r.replace(/↵/g,`
|
448
|
+
`);if(this.state.text!==r){this.setState({text:p}),this.props.onChange&&(f==="both"||f==="beforeRender")&&this.props.onChange({text:p,html:this.getHtmlValue()},a),this.emitter.emit(this.emitter.EVENT_CHANGE,r,a,typeof a>"u"),l&&setTimeout(function(){return u.setSelection(l)}),this.hasContentChanged||(this.hasContentChanged=!0);var g=this.renderHTML(p);(f==="both"||f==="afterRender")&&g.then(function(){u.props.onChange&&u.props.onChange({text:u.state.text,html:u.getHtmlValue()},a)})}},t.getMdValue=function(){return this.state.text},t.getHtmlValue=function(){return typeof this.state.html=="string"?this.state.html:this.nodeMdPreview.current?this.nodeMdPreview.current.getHtml():""},t.onKeyboard=function(r){var a=this;if(Array.isArray(r)){r.forEach(function(l){return a.onKeyboard(l)});return}this.keyboardListeners.includes(r)||this.keyboardListeners.push(r)},t.offKeyboard=function(r){var a=this;if(Array.isArray(r)){r.forEach(function(u){return a.offKeyboard(u)});return}var l=this.keyboardListeners.indexOf(r);l>=0&&this.keyboardListeners.splice(l,1)},t.handleKeyDown=function(r){for(var a=$h(this.keyboardListeners),l;!(l=a()).done;){var u=l.value;if(D8(r,u)){r.preventDefault(),u.callback(r);return}}this.emitter.emit(this.emitter.EVENT_KEY_DOWN,r)},t.getEventType=function(r){switch(r){case"change":return this.emitter.EVENT_CHANGE;case"fullscreen":return this.emitter.EVENT_FULL_SCREEN;case"viewchange":return this.emitter.EVENT_VIEW_CHANGE;case"keydown":return this.emitter.EVENT_KEY_DOWN;case"editor_keydown":return this.emitter.EVENT_EDITOR_KEY_DOWN;case"blur":return this.emitter.EVENT_BLUR;case"focus":return this.emitter.EVENT_FOCUS;case"scroll":return this.emitter.EVENT_SCROLL}},t.on=function(r,a){var l=this.getEventType(r);l&&this.emitter.on(l,a)},t.off=function(r,a){var l=this.getEventType(r);l&&this.emitter.off(l,a)},t.setView=function(r){var a=this,l=as({},this.state.view,r);this.setState({view:l},function(){a.emitter.emit(a.emitter.EVENT_VIEW_CHANGE,l)})},t.getView=function(){return as({},this.state.view)},t.fullScreen=function(r){var a=this;this.state.fullScreen!==r&&this.setState({fullScreen:r},function(){a.emitter.emit(a.emitter.EVENT_FULL_SCREEN,r)})},t.registerPluginApi=function(r,a){this.pluginApis.set(r,a)},t.unregisterPluginApi=function(r){this.pluginApis.delete(r)},t.callPluginApi=function(r){var a=this.pluginApis.get(r);if(!a)throw new Error("API "+r+" not found");for(var l=arguments.length,u=new Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];return a.apply(void 0,u)},t.isFullScreen=function(){return this.state.fullScreen},t.uploadWithDataTransfer=function(r){var a=this,l=this.config.onImageUpload;if(l){var u=[];Array.prototype.forEach.call(r,function(d){if(d.kind==="file"&&d.type.includes("image")){var f=d.getAsFile();if(f){var p=Rx(f,l);u.push(Promise.resolve(p.placeholder)),p.uploaded.then(function(g){var y=a.getMdValue().replace(p.placeholder,g),w=g.length-p.placeholder.length,k=a.getSelection();a.setText(y,void 0,{start:k.start+w,end:k.start+w})})}}else d.kind==="string"&&d.type==="text/plain"&&u.push(new Promise(function(g){return d.getAsString(g)}))}),Promise.all(u).then(function(d){var f=d.join(""),p=a.getSelection();a.insertText(f,!0,{start:p.start===p.end?f.length:0,end:f.length})})}},t.render=function(){var r=this,a=this.state,l=a.view,u=a.fullScreen,d=a.text,f=a.html,p=this.props,g=p.id,y=p.className,w=y===void 0?"":y,k=p.style,_=p.name,C=_===void 0?"textarea":_,S=p.autoFocus,M=p.placeholder,I=p.readOnly,L=this.config.canView&&this.config.canView.hideMenu&&!this.config.canView.menu,O=function(J){return r.state.plugins[J]||[]},K=!!l.menu,E=g?g+"_md":void 0,R=g?g+"_html":void 0;return v.createElement("div",{id:g,className:"rc-md-editor "+(u?"full":"")+" "+w,style:k,onKeyDown:this.handleKeyDown,onDrop:this.handleDrop},v.createElement(g8,{visible:K,left:O("left"),right:O("right")}),v.createElement("div",{className:"editor-container"},L&&v.createElement(v8,null,v.createElement("span",{className:"button button-type-menu",title:K?"hidden menu":"show menu",onClick:this.handleToggleMenu},v.createElement(Mt,{type:"expand-"+(K?"less":"more")}))),v.createElement("section",{className:"section sec-md "+(l.md?"visible":"in-visible")},v.createElement("textarea",{id:E,ref:this.nodeMdText,name:C,autoFocus:S,placeholder:M,readOnly:I,value:d,className:"section-container input "+(this.config.markdownClass||""),wrap:"hard",onChange:this.handleChange,onScroll:this.handleInputScroll,onMouseOver:function(){return r.shouldSyncScroll="md"},onKeyDown:this.handleEditorKeyDown,onCompositionStart:function(){return r.composing=!0},onCompositionEnd:function(){return r.composing=!1},onPaste:this.handlePaste,onFocus:this.handleFocus,onBlur:this.handleBlur})),v.createElement("section",{className:"section sec-html "+(l.html?"visible":"in-visible")},v.createElement("div",{id:R,className:"section-container html-wrap",ref:this.nodeMdPreviewWrapper,onMouseOver:function(){return r.shouldSyncScroll="html"},onScroll:this.handlePreviewScroll},v.createElement(L8,{html:f,className:this.config.htmlClass,ref:this.nodeMdPreview})))))},e}(v.Component);xt.plugins=[];xt.addLocale=st.add.bind(st);xt.useLocale=st.setCurrent.bind(st);xt.getLocale=st.getCurrent.bind(st);var Px=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-code-block",title:st.get("btnCode"),onClick:function(){return r.editor.insertMarkdown("code")}},v.createElement(Mt,{type:"code-block"}))},e}(kt);Px.pluginName="block-code-block";var zx=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-code-inline",title:st.get("btnInlineCode"),onClick:function(){return r.editor.insertMarkdown("inlinecode")}},v.createElement(Mt,{type:"code"}))},e}(kt);zx.pluginName="block-code-inline";var Bx=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-quote",title:st.get("btnQuote"),onClick:function(){return r.editor.insertMarkdown("quote")}},v.createElement(Mt,{type:"quote"}))},e}(kt);Bx.pluginName="block-quote";var Vx=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-wrap",title:st.get("btnLineBreak"),onClick:function(){return r.editor.insertMarkdown("hr")}},v.createElement(Mt,{type:"wrap"}))},e}(kt);Vx.pluginName="block-wrap";var $x=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleClick=r.handleClick.bind(it(r)),r}var t=e.prototype;return t.handleClick=function(){if(this.editor.getMdValue()!==""&&window.confirm&&typeof window.confirm=="function"){var r=window.confirm(st.get("clearTip"));r&&this.editor.setText("")}},t.render=function(){return v.createElement("span",{className:"button button-type-clear",title:st.get("btnClear"),onClick:this.handleClick},v.createElement(Mt,{type:"delete"}))},e}(kt);$x.pluginName="clear";var Fx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"b",keyCode:66,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return r.editor.insertMarkdown("bold")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-bold",title:st.get("btnBold"),onClick:function(){return r.editor.insertMarkdown("bold")}},v.createElement(Mt,{type:"bold"}))},e}(kt);Fx.pluginName="font-bold";var Hx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"i",keyCode:73,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return r.editor.insertMarkdown("italic")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-italic",title:st.get("btnItalic"),onClick:function(){return r.editor.insertMarkdown("italic")}},v.createElement(Mt,{type:"italic"}))},e}(kt);Hx.pluginName="font-italic";var Ux=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"d",keyCode:68,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return r.editor.insertMarkdown("strikethrough")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-strikethrough",title:st.get("btnStrikethrough"),onClick:function(){return r.editor.insertMarkdown("strikethrough")}},v.createElement(Mt,{type:"strikethrough"}))},e}(kt);Ux.pluginName="font-strikethrough";var Wx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"u",keyCode:85,withKey:["ctrlKey"],callback:function(){return r.editor.insertMarkdown("underline")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-underline",title:st.get("btnUnderline"),onClick:function(){return r.editor.insertMarkdown("underline")}},v.createElement(Mt,{type:"underline"}))},e}(kt);Wx.pluginName="font-underline";var Sf=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleClick=r.handleClick.bind(it(r)),r.handleChange=r.handleChange.bind(it(r)),r.state={enable:r.editor.isFullScreen()},r}var t=e.prototype;return t.handleClick=function(){this.editor.fullScreen(!this.state.enable)},t.handleChange=function(r){this.setState({enable:r})},t.componentDidMount=function(){this.editor.on("fullscreen",this.handleChange)},t.componentWillUnmount=function(){this.editor.off("fullscreen",this.handleChange)},t.render=function(){if(this.editorConfig.canView&&this.editorConfig.canView.fullScreen){var r=this.state.enable;return v.createElement("span",{className:"button button-type-fullscreen",title:st.get(r?"btnExitFullScreen":"btnFullScreen"),onClick:this.handleClick},v.createElement(Mt,{type:r?"fullscreen-exit":"fullscreen"}))}return null},e}(kt);Sf.pluginName="full-screen";Sf.align="right";var Yx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleClose=r.handleClose.bind(it(r)),r}var t=e.prototype;return t.handleClose=function(r){r.stopPropagation();var a=this.props.onClose;typeof a=="function"&&a()},t.render=function(){return v.createElement("div",{className:"drop-wrap "+(this.props.show?"show":"hidden"),onClick:this.handleClose},this.props.children)},e}(v.Component),R8=function(n){rt(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.handleHeader=function(r){var a=this.props.onSelectHeader;typeof a=="function"&&a(r)},t.render=function(){return v.createElement("ul",{className:"header-list"},v.createElement("li",{className:"list-item"},v.createElement("h1",{onClick:this.handleHeader.bind(this,"h1")},"H1")),v.createElement("li",{className:"list-item"},v.createElement("h2",{onClick:this.handleHeader.bind(this,"h2")},"H2")),v.createElement("li",{className:"list-item"},v.createElement("h3",{onClick:this.handleHeader.bind(this,"h3")},"H3")),v.createElement("li",{className:"list-item"},v.createElement("h4",{onClick:this.handleHeader.bind(this,"h4")},"H4")),v.createElement("li",{className:"list-item"},v.createElement("h5",{onClick:this.handleHeader.bind(this,"h5")},"H5")),v.createElement("li",{className:"list-item"},v.createElement("h6",{onClick:this.handleHeader.bind(this,"h6")},"H6")))},e}(v.Component),Kx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.show=r.show.bind(it(r)),r.hide=r.hide.bind(it(r)),r.state={show:!1},r}var t=e.prototype;return t.show=function(){this.setState({show:!0})},t.hide=function(){this.setState({show:!1})},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-header",title:st.get("btnHeader"),onMouseEnter:this.show,onMouseLeave:this.hide},v.createElement(Mt,{type:"font-size"}),v.createElement(Yx,{show:this.state.show,onClose:this.hide},v.createElement(R8,{onSelectHeader:function(l){return r.editor.insertMarkdown(l)}})))},e}(kt);Kx.pluginName="header";var P8=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.timerId=void 0,r.locked=!1,r.input=v.createRef(),r}var t=e.prototype;return t.click=function(){var r=this;this.locked||!this.input.current||(this.locked=!0,this.input.current.value="",this.input.current.click(),this.timerId&&window.clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){r.locked=!1,window.clearTimeout(r.timerId),r.timerId=void 0},200))},t.componentWillUnmount=function(){this.timerId&&window.clearTimeout(this.timerId)},t.render=function(){return v.createElement("input",{type:"file",ref:this.input,accept:this.props.accept,style:{position:"absolute",zIndex:-1,left:0,top:0,width:0,height:0,opacity:0},onChange:this.props.onChange})},e}(v.Component),Qx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.inputFile=v.createRef(),r.onImageChanged=r.onImageChanged.bind(it(r)),r.handleCustomImageUpload=r.handleCustomImageUpload.bind(it(r)),r.handleImageUpload=r.handleImageUpload.bind(it(r)),r.state={show:!1},r}var t=e.prototype;return t.handleImageUpload=function(){var r=this.editorConfig.onImageUpload;typeof r=="function"?this.inputFile.current&&this.inputFile.current.click():this.editor.insertMarkdown("image")},t.onImageChanged=function(r){var a=this.editorConfig.onImageUpload;if(a){var l=Rx(r,a);this.editor.insertPlaceholder(l.placeholder,l.uploaded)}},t.handleCustomImageUpload=function(r){var a=this,l=this.editorConfig.onCustomImageUpload;if(l){var u=l.call(this,r);jf(u)&&u.then(function(d){d&&d.url&&a.editor.insertMarkdown("image",{target:d.text,imageUrl:d.url})})}},t.render=function(){var r=this,a=!!this.editorConfig.onCustomImageUpload;return a?v.createElement("span",{className:"button button-type-image",title:st.get("btnImage"),onClick:this.handleCustomImageUpload},v.createElement(Mt,{type:"image"})):v.createElement("span",{className:"button button-type-image",title:st.get("btnImage"),onClick:this.handleImageUpload,style:{position:"relative"}},v.createElement(Mt,{type:"image"}),v.createElement(P8,{accept:this.editorConfig.imageAccept||"",ref:this.inputFile,onChange:function(u){u.persist(),u.target.files&&u.target.files.length>0&&r.onImageChanged(u.target.files[0])}}))},e}(kt);Qx.pluginName="image";var Zx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"k",keyCode:75,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return r.editor.insertMarkdown("link")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-link",title:st.get("btnLink"),onClick:function(){return r.editor.insertMarkdown("link")}},v.createElement(Mt,{type:"link"}))},e}(kt);Zx.pluginName="link";var Gx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"7",keyCode:55,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return r.editor.insertMarkdown("order")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-ordered",title:st.get("btnOrdered"),onClick:function(){return r.editor.insertMarkdown("order")}},v.createElement(Mt,{type:"list-ordered"}))},e}(kt);Gx.pluginName="list-ordered";var Jx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboard={key:"8",keyCode:56,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return r.editor.insertMarkdown("unordered")}},r}var t=e.prototype;return t.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},t.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},t.render=function(){var r=this;return v.createElement("span",{className:"button button-type-unordered",title:st.get("btnUnordered"),onClick:function(){return r.editor.insertMarkdown("unordered")}},v.createElement(Mt,{type:"list-unordered"}))},e}(kt);Jx.pluginName="list-unordered";var z8=100,B8=function(){function n(t){t===void 0&&(t={}),this.record=[],this.recycle=[],this.initValue="";var s=t,r=s.maxSize,a=r===void 0?z8:r;this.maxSize=a}var e=n.prototype;return e.push=function(s){for(var r=this.record.push(s);this.record.length>this.maxSize;)this.record.shift();return r},e.get=function(){return this.record},e.getLast=function(){var s=this.record.length;return this.record[s-1]},e.undo=function(s){var r=this.record.pop();if(typeof r>"u")return this.initValue;if(r!==s)return this.recycle.push(r),r;var a=this.record.pop();return typeof a>"u"?(this.recycle.push(r),this.initValue):(this.recycle.push(r),a)},e.redo=function(){var s=this.recycle.pop();if(typeof s<"u")return this.push(s),s},e.cleanRedo=function(){this.recycle=[]},e.getUndoCount=function(){return this.undo.length},e.getRedoCount=function(){return this.recycle.length},n}(),qx=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleKeyboards=[],r.lastPop=null,r.handleChange=r.handleChange.bind(it(r)),r.handleRedo=r.handleRedo.bind(it(r)),r.handleUndo=r.handleUndo.bind(it(r)),r.handleKeyboards=[{key:"y",keyCode:89,withKey:["ctrlKey"],callback:r.handleRedo},{key:"z",keyCode:90,withKey:["metaKey","shiftKey"],callback:r.handleRedo},{key:"z",keyCode:90,aliasCommand:!0,withKey:["ctrlKey"],callback:r.handleUndo}],r.logger=new B8({maxSize:r.editorConfig.loggerMaxSize}),r.editor.registerPluginApi("undo",r.handleUndo),r.editor.registerPluginApi("redo",r.handleRedo),r}var t=e.prototype;return t.handleUndo=function(){var r=this.logger.undo(this.editor.getMdValue());typeof r<"u"&&(this.pause(),this.lastPop=r,this.editor.setText(r),this.forceUpdate())},t.handleRedo=function(){var r=this.logger.redo();typeof r<"u"&&(this.lastPop=r,this.editor.setText(r),this.forceUpdate())},t.handleChange=function(r,a,l){var u=this;if(!(this.logger.getLast()===r||this.lastPop!==null&&this.lastPop===r)){if(this.logger.cleanRedo(),l){this.logger.push(r),this.lastPop=null,this.forceUpdate();return}this.timerId&&(window.clearTimeout(this.timerId),this.timerId=0),this.timerId=window.setTimeout(function(){u.logger.getLast()!==r&&(u.logger.push(r),u.lastPop=null,u.forceUpdate()),window.clearTimeout(u.timerId),u.timerId=0},this.editorConfig.loggerInterval)}},t.componentDidMount=function(){var r=this;this.editor.on("change",this.handleChange),this.handleKeyboards.forEach(function(a){return r.editor.onKeyboard(a)}),this.logger.initValue=this.editor.getMdValue(),this.forceUpdate()},t.componentWillUnmount=function(){var r=this;this.timerId&&window.clearTimeout(this.timerId),this.editor.off("change",this.handleChange),this.editor.unregisterPluginApi("undo"),this.editor.unregisterPluginApi("redo"),this.handleKeyboards.forEach(function(a){return r.editor.offKeyboard(a)})},t.pause=function(){this.timerId&&(window.clearTimeout(this.timerId),this.timerId=void 0)},t.render=function(){var r=this.logger.getUndoCount()>1||this.logger.initValue!==this.editor.getMdValue(),a=this.logger.getRedoCount()>0;return v.createElement(v.Fragment,null,v.createElement("span",{className:"button button-type-undo "+(r?"":"disabled"),title:st.get("btnUndo"),onClick:this.handleUndo},v.createElement(Mt,{type:"undo"})),v.createElement("span",{className:"button button-type-redo "+(a?"":"disabled"),title:st.get("btnRedo"),onClick:this.handleRedo},v.createElement(Mt,{type:"redo"})))},e}(kt);qx.pluginName="logger";var Qt;(function(n){n[n.SHOW_ALL=0]="SHOW_ALL",n[n.SHOW_MD=1]="SHOW_MD",n[n.SHOW_HTML=2]="SHOW_HTML"})(Qt||(Qt={}));var Ef=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.handleClick=r.handleClick.bind(it(r)),r.handleChange=r.handleChange.bind(it(r)),r.state={view:r.editor.getView()},r}var t=e.prototype;return t.handleClick=function(){switch(this.next){case Qt.SHOW_ALL:this.editor.setView({html:!0,md:!0});break;case Qt.SHOW_HTML:this.editor.setView({html:!0,md:!1});break;case Qt.SHOW_MD:this.editor.setView({html:!1,md:!0});break}},t.handleChange=function(r){this.setState({view:r})},t.componentDidMount=function(){this.editor.on("viewchange",this.handleChange)},t.componentWillUnmount=function(){this.editor.off("viewchange",this.handleChange)},t.getDisplayInfo=function(){var r=this.next;switch(r){case Qt.SHOW_ALL:return{icon:"view-split",title:"All"};case Qt.SHOW_HTML:return{icon:"visibility",title:"Preview"};default:return{icon:"keyboard",title:"Editor"}}},t.render=function(){if(this.isDisplay){var r=this.getDisplayInfo();return v.createElement("span",{className:"button button-type-mode",title:st.get("btnMode"+r.title),onClick:this.handleClick},v.createElement(Mt,{type:r.icon}))}return null},Lx(e,[{key:"isDisplay",get:function(){var r=this.editorConfig.canView;return r?[r.html,r.md,r.both].filter(function(a){return a}).length>=2:!1}},{key:"next",get:function(){var r=this.editorConfig.canView,a=this.state.view,l=[Qt.SHOW_ALL,Qt.SHOW_MD,Qt.SHOW_HTML];r&&(r.both||l.splice(l.indexOf(Qt.SHOW_ALL),1),r.md||l.splice(l.indexOf(Qt.SHOW_MD),1),r.html||l.splice(l.indexOf(Qt.SHOW_HTML),1));var u=Qt.SHOW_MD;if(a.html&&(u=Qt.SHOW_HTML),a.html&&a.md&&(u=Qt.SHOW_ALL),l.length===0)return u;if(l.length===1)return l[0];var d=l.indexOf(u);return d<l.length-1?l[d+1]:l[0]}}]),e}(kt);Ef.pluginName="mode-toggle";Ef.align="right";var V8=function(n){rt(e,n);function e(s){var r;r=n.call(this,s)||this,r.config={padding:3,width:20,height:20};var a=s.maxRow,l=a===void 0?5:a,u=s.maxCol,d=u===void 0?6:u;return r.state={maxRow:l,maxCol:d,list:r.formatTableModel(l,d)},r}var t=e.prototype;return t.formatTableModel=function(r,a){r===void 0&&(r=0),a===void 0&&(a=0);var l=new Array(r).fill(void 0);return l.map(function(u){return new Array(a).fill(0)})},t.calcWrapStyle=function(){var r=this.state,a=r.maxRow,l=r.maxCol,u=this.config,d=u.width,f=u.height,p=u.padding,g=(d+p)*l-p,y=(f+p)*a-p;return{width:g+"px",height:y+"px"}},t.calcItemStyle=function(r,a){r===void 0&&(r=0),a===void 0&&(a=0);var l=this.config,u=l.width,d=l.height,f=l.padding,p=(d+f)*r,g=(u+f)*a;return{top:p+"px",left:g+"px"}},t.getList=function(r,a){var l=this.state.list;return l.map(function(u,d){return u.map(function(f,p){return d<=r&&p<=a?1:0})})},t.handleHover=function(r,a){this.setState({list:this.getList(r,a)})},t.handleSetTable=function(r,a){var l=this.props.onSetTable;typeof l=="function"&&l({row:r+1,col:a+1})},t.componentDidUpdate=function(r){this.props.visibility===!1&&r.visibility!==this.props.visibility&&this.setState({list:this.getList(-1,-1)})},t.render=function(){var r=this;return v.createElement("ul",{className:"table-list wrap",style:this.calcWrapStyle()},this.state.list.map(function(a,l){return a.map(function(u,d){return v.createElement("li",{className:"list-item "+(u===1?"active":""),key:l+"-"+d,style:r.calcItemStyle(l,d),onMouseOver:r.handleHover.bind(r,l,d),onClick:r.handleSetTable.bind(r,l,d)})})}))},e}(v.Component),Mf=function(n){rt(e,n);function e(s){var r;return r=n.call(this,s)||this,r.show=r.show.bind(it(r)),r.hide=r.hide.bind(it(r)),r.state={show:!1},r}var t=e.prototype;return t.show=function(){this.setState({show:!0})},t.hide=function(){this.setState({show:!1})},t.render=function(){var r=this,a=this.editorConfig.table||this.props.config;return v.createElement("span",{className:"button button-type-table",title:st.get("btnTable"),onMouseEnter:this.show,onMouseLeave:this.hide},v.createElement(Mt,{type:"grid"}),v.createElement(Yx,{show:this.state.show,onClose:this.hide},v.createElement(V8,{visibility:this.state.show,maxRow:a.maxRow,maxCol:a.maxCol,onSetTable:function(u){return r.editor.insertMarkdown("table",u)}})))},e}(kt);Mf.pluginName="table";Mf.defaultConfig={maxRow:6,maxCol:6};var Fh={exports:{}};/*!
|
449
|
+
Copyright (c) 2018 Jed Watson.
|
450
|
+
Licensed under the MIT License (MIT), see
|
451
|
+
http://jedwatson.github.io/classnames
|
452
|
+
*/var i1;function $8(){return i1||(i1=1,function(n){(function(){var e={}.hasOwnProperty;function t(){for(var a="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(a=r(a,s(u)))}return a}function s(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var l="";for(var u in a)e.call(a,u)&&a[u]&&(l=r(l,u));return l}function r(a,l){return l?a?a+" "+l:a+l:a}n.exports?(t.default=t,n.exports=t):window.classNames=t})()}(Fh)),Fh.exports}var F8=$8();const H8=Za(F8);xt.use(Kx);xt.use(Fx);xt.use(Hx);xt.use(Wx);xt.use(Ux);xt.use(Jx);xt.use(Gx);xt.use(Bx);xt.use(Vx);xt.use(zx);xt.use(Px);xt.use(Mf);xt.use(Qx);xt.use(Zx);xt.use($x);xt.use(qx);xt.use(Ef);xt.use(Sf);const Os=({field:n,value:e,onChange:t,...s})=>{const[r,a]=v.useState(e),{comp_params:l}=n,{darkMode:u}=hs(),d=f=>{console.log("value",f),t(f.text),a(f.text)};return c.jsx("div",{children:c.jsx(xt,{...l,className:"h-[300px] "+(u?"dark":"light"),value:r,renderHTML:f=>ht.parse(f),onChange:d})})},On=(n,e,t,s="edit",r)=>{const a=v.useRef(void 0),{doc:l,loading:u,hasLoaded:d,error:f,op:p,sdk:g,actions:{reload:y,reload_hard:w,upsert:k,setError:_,remove:C}}=cf(n,e),{nav:S,navWithState:M,state:I}=Gn(),L=v.useMemo(()=>{let B={};try{B=r?u3(r):{}}catch{}return{...B,...l,...I!=null&&I.hasChanged?I==null?void 0:I.data:{}}},[l,r,I]),O=v.useRef(void 0),K=(I==null?void 0:I.hasChanged)??!1,E=s==="edit",R=s==="create",F=!(E||R),J=v.useMemo(()=>({getState:()=>{var X;const B=(X=a.current.get(!1))==null?void 0:X.data,Z=!!O.current.get();return{data:B,hasChanged:Z}}}),[]),oe=v.useCallback(async(B={})=>{const Z=J.getState(),X={data:{...Z==null?void 0:Z.data,handle:void 0,id:void 0,updated_at:void 0,created_at:void 0,search:void 0,_published:void 0,...B},hasChanged:!0};O.current.set(!1),t&&M(`${t}/create`,Z,X)},[M,J,t]),Ne=v.useCallback(async()=>{const B=a.current.get(),{data:Z}=B,X={...L,...Z};console.log("final ",X);const ne=await k(X);return console.log("new doc",ne),t&&S(`${t}/${ne.handle??ne.id}`,{replace:!0}),ne},[k,S,L,t]),Ee=v.useCallback(async(B=!1)=>{t&&S(`${t}/${L.handle??L.id}`,{replace:!0}),await y(B)},[y,S,L,t]),be=v.useCallback(async()=>{const B=await C();return t&&S(-2),B},[C,S,t]),te=v.useMemo(()=>JSON.stringify(L),[L]);return{actions:{reloadPromise:Ee,reload_hard:w,savePromise:Ne,deletePromise:be,duplicate:oe,navWithState:M,reload:y,setError:_},error:f,key:te,ref_head:O,ref_root:a,doc:L,sdk:g,isEditMode:E,isCreateMode:R,isViewMode:F,op:p,loading:u,hasChanged:K,hasLoaded:d,context:J}},U8={name:"🙋🏻♂️ Contact Info",key:"contact",comp:ce(We,{className:""}),comp_params:{className:"w-full"},fields:[{key:"email",name:"Email",type:"email",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full h-fit mt-5 text-gray-400"}},{key:"firstname",name:"First Name",type:"text",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full h-fit mt-5 text-gray-400"}},{key:"lastname",name:"Last Name",type:"text",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full h-fit mt-5 text-gray-400"}},{key:"phone_number",name:"Phone Number",type:"number",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10",type:"tel"},!1),comp_params:{className:"w-full h-fit mt-5 text-gray-400"}},{key:"customer_id",name:"User ID (UID)",type:"text",validate:!1,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full h-fit mt-5 text-gray-400"}}]},W8={name:"✉︎ Address Info",key:"address",comp:ce(We,{className:"w-full flex flex-row flex-wrap gap-3"}),comp_params:{className:"w-full --lg:w-1/2 "},fields:[{key:"firstname",name:"First Name",type:"text",validate:!1,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"lastname",name:"Last Name",type:"text",validate:!1,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"company",name:"Company",type:"text",validate:!1,editable:!0,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"street1",name:"Street #1",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"street2",name:"Street #2",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"city",name:"City",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"country",name:"Country",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"state",name:"State",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"zip_code",name:"ZIP Code",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"postal_code",name:"Postal Code",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}},{key:"phone_number",name:"Phone Number",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10"},!1),comp_params:{className:"w-full lg:w-[30%] h-fit text-gray-400"}}]},Y8={name:"☑ Status",key:"status",comp:ce(We,{className:""}),comp_params:{className:"w-full"},fields:[{key:"payment",name:"Payment Status",type:"text",validate:!1,desc:"What is the payment status",defaultValue:kd.unpaid,comp:ce($e(zl(Object.values(kd))),{className:"text-gray-600"},!1),comp_params:{className:"text-gray-500"}},{key:"fulfillment",name:"Fulfillment Status",type:"text",validate:!1,desc:"What is the fulfillment status",defaultValue:bd.draft,comp:ce($e(zl(Object.values(bd))),{className:"text-gray-600"},!1),comp_params:{className:"text-gray-500 mt-5"}},{key:"checkout",name:"Checkout Status",type:"text",validate:!1,desc:"How did the costumer complete checkout",defaultValue:K0.created,comp:ce($e(zl(Object.values(K0))),{className:"text-gray-600"},!1),comp_params:{className:"text-gray-500 mt-5"}}]},K8={name:"Right",comp:We,comp_params:{className:"flex flex-col w-full lg:w-[19rem] gap-5"},fields:[{key:"pricing",name:"🧾 Pricing",validate:!1,desc:"Decide the total price of the order including shipping and discounts",comp:ce(v6,{}),comp_params:{className:"w-full h-fit"}},{key:"shipping_method",name:"⛟ Delivery Method",type:"compound",validate:!1,editable:!0,desc:"Decide the delivery method",comp:ce(u6,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full "}},{key:"coupons",name:"🎟️ Coupons",type:"compound",validate:!1,editable:!0,desc:"Which coupons will be applied",comp:ce(h6,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full"}},Y8,{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach small attributes",comp:ce(Ls)}]},Q8={name:"Main",comp:We,comp_params:{className:`w-full gap-5 items-center
|
453
|
+
lg:items-start lg:w-[35rem] flex flex-col `},fields:[{key:"payment_gateway",name:"💳 Payments",desc:"Let's see what the payment gateway status is",comp:ce(o8,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full text-xs py-auto --font-semibold"}},{key:"line_items",name:"🛍️ Line Items",type:"compound",validate:!1,editable:!0,desc:"Which items are included in the order",defaultValue:[],comp:ce(g6,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full text-xs py-auto --font-semibold"}},U8,W8,{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{key:"notes",name:"🗒 Notes",type:"text",desc:"Notes help you add extra information about the order",validate:!1,editable:!0,comp:ce(Os),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},Z8={name:"Root",comp:We,comp_params:{className:`w-full gap-5 --justify-center --bg-red-100 items-center
|
454
|
+
lg:max-w-max lg:items-start lg:w-fit flex flex-col
|
455
|
+
lg:flex-row --mx-auto`},fields:[Q8,K8]},Hh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l,setError:u,duplicate:d},context:f,key:p,doc:g,isCreateMode:y,isEditMode:w,isViewMode:k,hasChanged:_,hasLoaded:C,error:S,ref_head:M,ref_root:I,sdk:L}=On("orders",t,"/pages/orders",n,s),O=v.useCallback(async R=>{const F=g;console.log("doc",g);try{const J=await L.checkout.create(F,R),oe=J==null?void 0:J.validation;if(console.log("valid_errors",oe),oe!=null&&oe.length){u({messages:oe});return}}catch(J){console.log("e",J),u(J);return}try{await l(!1)}catch(J){console.log("e",J)}},[r,u,L,l,g]),K=v.useMemo(()=>({...f,create_checkout:O}),[f,O]),E=v.useCallback(()=>d({payment_gateway:void 0,pricing:void 0,line_items:g.line_items.map(R=>({...R,stock_reserved:0}))}),[d,g]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["orders",t??"create"],className:""}),c.jsx(gs,{doc:g,className:"mt-5",collectionId:"orders"}),c.jsx(ms,{id:g==null?void 0:g.id,onClickSave:w?r:void 0,onClickCreate:y?r:void 0,onClickDelete:y?void 0:a,onClickDuplicate:y?void 0:E,onClickReload:y?void 0:async()=>l(!1),className:"mt-5 "}),c.jsx(us,{changes_made:_,ref:M,time:g==null?void 0:g.created_at,className:"mt-8"},g==null?void 0:g.updated_at),c.jsx(_e,{show:C&&w||y,children:c.jsxs("div",{className:"w-full mx-auto ",children:[c.jsx(jn,{error:S,className:"w-full"}),c.jsx(Ln,{ref:I,field:Z8,value:g??{},context:K,isViewMode:k,className:"mt-8 mx-auto"},p)]})})]})},Xx=n=>n!=null&&n.firstname?(n==null?void 0:n.firstname)+(n!=null&&n.lastname?" "+(n==null?void 0:n.lastname):""):(n==null?void 0:n.email)??"anonymous",G8=[{key:void 0,name:"Full Name",comp:wt,transform:n=>Xx(n),comp_params:{className:"font-semibold"}},{key:"email",name:"Email",comp:wt},{key:"updated_at",name:"Last Updated",comp:fs},{key:"auth_id",name:"UID",comp:wt,comp_params:{extra:"max-w-[4rem]"}},{key:void 0,name:"Actions",comp:Cn}],a1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("customers","/pages/customers");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
456
|
+
shelf-border-color shadow-md mt-5
|
457
|
+
dark:shadow-slate-900`,children:[c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/customers/create",searchTitle:"Search by name, email, uid...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:G8}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},J8=v.forwardRef(({resource:n,limit:e=5,context:t,schema:s,...r},a)=>{bt();const{page:l,actions:{prev:u,next:d,query:f}}=fr(n,Oi,!1);return df(),v.useEffect(()=>{f({limit:e,sortBy:["updated_at","id"]})},[f,e]),v.useImperativeHandle(a,()=>({refresh:()=>f({limit:e})}),[f,e]),c.jsxs(c.Fragment,{children:[c.jsx(hn,{context:t,data:l,fields:s}),c.jsx(_n,{prev:u,next:d,onLimitChange:void 0})]})}),q8=({context:n,value:e,children:t,className:s,extra:r="max-w-[8rem] md:max-w-[12rem]",url_fn:a,get_state:l,...u})=>{const f=`overflow-x-auto inline-block whitespace-nowrap shelf-text-label-color ${s} ${r}`;return c.jsx("div",{className:f,...u,children:c.jsx(to,{current_state:l,children:e??t,to:a==null?void 0:a(n.item),className:"underline"})})},X8=({value:n,field:e,context:t,error:s,setError:r,...a})=>{const l=v.useRef([{key:"id",name:"ID",comp:({...u})=>c.jsx(q8,{...u,url_fn:d=>`/pages/orders/${d==null?void 0:d.id}`,get_state:()=>t.getState()})},{key:"updated_at",name:"Last Updated",comp:fs},{key:"pricing.total",name:"Price",comp:wt,comp_params:{className:"font-bold"}},{key:"status.fulfillment.name",name:"Status",comp:({value:u})=>u&&c.jsx(It,{value:`**\`${u.toString()}\`**`,className:"overflow-x-auto max-w-20 flex-shrink"})}]);return c.jsx("div",{...a,children:c.jsx(J8,{limit:5,resource:`customers/${n==null?void 0:n.email}/orders`,schema:l.current})})},eN={comp:We,comp_params:{className:"w-full gap-5 items-center lg:items-start lg:w-[35rem] flex flex-col "},fields:[{key:void 0,name:"🛍️ Orders",desc:"Here are the orders made by ",comp:ce(X8,{className:"w-full"}),comp_params:{className:"w-full h-fit"}},{key:"firstname",name:"First Name",type:"text",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"}),comp_params:{className:"w-full h-fit"}},{key:"lastname",name:"Last Name",type:"text",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"}),comp_params:{className:"w-full h-fit"}},{key:"email",name:"Email",type:"email",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"}),comp_params:{className:"w-full h-fit"}},{key:"phone_number",name:"Phone number",type:"text",validate:!1,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"}),comp_params:{className:"w-full h-fit"}},{key:"auth_id",name:"UID",type:"text",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10 w-full"}),desc:"The authentication platform user id",comp_params:{className:"w-full h-fit"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},tN={key:"address",name:"📬 Address",comp:ce(We,{className:"flex flex-col gap-5"}),desc:"Address information of your user",comp_params:{className:"w-full h-fit "},fields:[{key:"street1",name:"Street 1",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full",placeholder:""},!1),comp_params:{className:"text-gray-500"}},{key:"street2",name:"Street 2",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full",placeholder:""},!1),comp_params:{className:"text-gray-500"}},{key:"city",name:"City",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"text-gray-500"}},{key:"country",name:"Country",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"text-gray-500"}},{key:"state",name:"State",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"text-gray-500"}},{key:"zip_code",name:"Zip Code",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"text-gray-500"}},{key:"postal_code",name:"Postal Code",type:"text",validate:!1,comp:ce($e(Fe),{className:"h-10 w-full"},!1),comp_params:{className:"text-gray-500"}}]},nN={name:"right",comp:We,comp_params:{className:"w-full lg:w-[19rem] h-fit flex flex-col gap-5"},fields:[{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,comp:ce(Ls),desc:"Add tags to your users to better categorize them",comp_params:{className:"w-full "}},tN]},sN={name:"Root",comp:We,comp_params:{className:"w-full gap-5 lg:justify-center mx-auto lg:w-fit flex flex-col justify-start lg:flex-row "},fields:[eN,nN]},Uh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l},context:u,key:d,doc:f,isCreateMode:p,isEditMode:g,isViewMode:y,hasChanged:w,hasLoaded:k,error:_,ref_head:C,ref_root:S}=On("customers",t,"/pages/customers",n,s);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["customers",t??"create"],className:""}),c.jsx(gs,{doc:f,className:"mt-5",collectionId:"customers"}),c.jsx(ms,{id:f==null?void 0:f.id,onClickSave:g?r:void 0,onClickCreate:p?r:void 0,onClickReload:p?void 0:async()=>l(!1),onClickDelete:p?void 0:a,className:"mt-5"}),c.jsx(us,{ref:C,time:f==null?void 0:f.created_at,className:"mt-8",changes_made:w},f==null?void 0:f.updated_at),c.jsx(_e,{show:k&&g||p,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:_,className:"w-full"}),c.jsx(Ln,{ref:S,field:sN,value:f??{},context:u,isViewMode:y,className:"mt-8"},d)]})})]})},rN=[{key:"handle",name:"Name",comp:wt,comp_params:{className:"font-semibold"}},{key:"values",name:"Values",comp:xx,comp_params:{className:"font-semibold"}},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],o1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("tags","/pages/tags");return c.jsx("div",{className:"w-full h-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
458
|
+
shelf-border-color shadow-md mt-5
|
459
|
+
dark:shadow-slate-900`,children:[c.jsx(ds,{isCollectionEmpty:!1,ref:t,reload:g,createLink:"/pages/tags/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:rN}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},iN=n=>n==null?void 0:n.match(/\S+/g),aN=({field:n,value:e,onChange:t,...s})=>{const{comp_params:r}=n,[a,l]=v.useState(e??[]),u=v.useRef(null),d=v.useCallback(p=>{const g=iN(u.current.value.toString()).map(w=>S3(w));if(!g)return;for(let w of g)a.indexOf(w)==-1&&a.push(w);const y=[...a];t(y),l(y)},[a,t]),f=v.useCallback(p=>{const g=a.indexOf(p);if(g==-1)return;a.splice(g,1);const y=[...a];t(y),l(y)},[a,t]);return c.jsxs("div",{...r,children:[c.jsxs("div",{className:"flex flex-row items-center h-9 w-full gap-3 ",children:[c.jsx(Qe,{placeholder:"space separated values",className:"flex-grow",rounded:"rounded-md",ref:u,type:"text"}),c.jsx(Xt,{children:"Add",stroke:"border-2 h-10",onClick:d})]}),c.jsx(ps,{tags:a,onClick:f,onRemove:f,clsCapsule:"bg-pink-500",className:"mt-3"})]})},oN=n=>{const e=Array.isArray(n)&&n.length;return[e,e?"":"Empty values"]},lN={name:"Root",comp:We,comp_params:{className:"flex flex-col gap-5 w-full max-w-[35rem]"},fields:[{key:"handle",name:"Name",type:"text",validate:!0,desc:"Use simple key names, like `color` for quick attributes creation",comp:ce($e(Fe),{className:"h-9",placeholder:"enter the key / name of the tag"}),comp_params:{className:"w-full "}},{key:"values",name:"Values",type:"text",validate:!0,desc:"Use simple value names, like `red`, `green`, `white` for quick attributes creation",validator:oN,comp:ce(aN),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{key:"description",name:"📝 Description",type:"text",validate:!1,editable:!0,desc:"Describe the purpose of this tag",comp:ce(Os),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},Wh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l},context:u,key:d,doc:f,isCreateMode:p,isEditMode:g,isViewMode:y,hasChanged:w,hasLoaded:k,error:_,ref_head:C,ref_root:S}=On("tags",t,"/pages/tags",n,s);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["tags",t??"create"],className:""}),c.jsx(gs,{doc:f,className:"mt-5",collectionId:"tags"}),c.jsx(ms,{id:f.handle,onClickSave:g?r:void 0,onClickCreate:p?r:void 0,onClickReload:p?void 0:async()=>l(!1),onClickDelete:p?void 0:a,className:"mt-5"}),c.jsx(us,{ref:C,time:f==null?void 0:f.created_at,className:"mt-8",changes_made:w},f==null?void 0:f.updated_at),c.jsxs(_e,{show:k&&g||p,children:[c.jsx(jn,{error:_,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Ln,{ref:S,field:lN,value:f??{},context:u,isViewMode:y,className:"mx-auto"},d)]})]})},cN=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold"}},{key:"handle",name:"Handle",comp:wt,comp_params:{className:"font-semibold"}},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],l1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("templates","/apps/templates");return c.jsx("div",{className:"w-full h-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
460
|
+
shelf-border-color shadow-md mt-5
|
461
|
+
dark:shadow-slate-900`,children:[c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/apps/templates/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:cN}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})};function uN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c1(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,s)}return t}function u1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?c1(Object(t),!0).forEach(function(s){uN(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):c1(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function hN(n,e){if(n==null)return{};var t={},s=Object.keys(n),r,a;for(a=0;a<s.length;a++)r=s[a],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function dN(n,e){if(n==null)return{};var t=hN(n,e),s,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)s=a[r],!(e.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(n,s)&&(t[s]=n[s])}return t}function fN(n,e){return pN(n)||mN(n,e)||gN(n,e)||vN()}function pN(n){if(Array.isArray(n))return n}function mN(n,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(n)))){var t=[],s=!0,r=!1,a=void 0;try{for(var l=n[Symbol.iterator](),u;!(s=(u=l.next()).done)&&(t.push(u.value),t.length!==e);s=!0);}catch(d){r=!0,a=d}finally{try{!s&&l.return!=null&&l.return()}finally{if(r)throw a}}return t}}function gN(n,e){if(n){if(typeof n=="string")return h1(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h1(n,e)}}function h1(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=n[t];return s}function vN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
462
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function d1(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,s)}return t}function f1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?d1(Object(t),!0).forEach(function(s){xN(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):d1(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function yN(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(s){return e.reduceRight(function(r,a){return a(r)},s)}}function Ea(n){return function e(){for(var t=this,s=arguments.length,r=new Array(s),a=0;a<s;a++)r[a]=arguments[a];return r.length>=n.length?n.apply(this,r):function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return e.apply(t,[].concat(r,u))}}}function rc(n){return{}.toString.call(n).includes("Object")}function wN(n){return!Object.keys(n).length}function Ha(n){return typeof n=="function"}function bN(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function kN(n,e){return rc(e)||ur("changeType"),Object.keys(e).some(function(t){return!bN(n,t)})&&ur("changeField"),e}function _N(n){Ha(n)||ur("selectorType")}function CN(n){Ha(n)||rc(n)||ur("handlerType"),rc(n)&&Object.values(n).some(function(e){return!Ha(e)})&&ur("handlersType")}function NN(n){n||ur("initialIsRequired"),rc(n)||ur("initialType"),wN(n)&&ur("initialContent")}function jN(n,e){throw new Error(n[e]||n.default)}var SN={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ur=Ea(jN)(SN),Il={changes:kN,selector:_N,handler:CN,initial:NN};function EN(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Il.initial(n),Il.handler(e);var t={current:n},s=Ea(TN)(t,e),r=Ea(DN)(t),a=Ea(Il.changes)(n),l=Ea(MN)(t);function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Il.selector(f),f(t.current)}function d(f){yN(s,r,a,l)(f)}return[u,d]}function MN(n,e){return Ha(e)?e(n.current):e}function DN(n,e){return n.current=f1(f1({},n.current),e),e}function TN(n,e,t){return Ha(e)?e(n.current):Object.keys(t).forEach(function(s){var r;return(r=e[s])===null||r===void 0?void 0:r.call(e,n.current[s])}),t}var IN={create:EN},AN={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function LN(n){return function e(){for(var t=this,s=arguments.length,r=new Array(s),a=0;a<s;a++)r[a]=arguments[a];return r.length>=n.length?n.apply(this,r):function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return e.apply(t,[].concat(r,u))}}}function ON(n){return{}.toString.call(n).includes("Object")}function RN(n){return n||p1("configIsRequired"),ON(n)||p1("configType"),n.urls?(PN(),{paths:{vs:n.urls.monacoBase}}):n}function PN(){console.warn(ey.deprecation)}function zN(n,e){throw new Error(n[e]||n.default)}var ey={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
463
|
+
You are using deprecated way of configuration.
|
464
|
+
|
465
|
+
Instead of using
|
466
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
467
|
+
use
|
468
|
+
monaco.config({ paths: { vs: '...' } })
|
469
|
+
|
470
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
471
|
+
`},p1=LN(zN)(ey),BN={config:RN},VN=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return function(r){return t.reduceRight(function(a,l){return l(a)},r)}};function ty(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],ty(n[t],e[t]))}),u1(u1({},n),e)}var $N={type:"cancelation",msg:"operation is manually canceled"};function Yh(n){var e=!1,t=new Promise(function(s,r){n.then(function(a){return e?r($N):s(a)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var FN=IN.create({config:AN,isInitialized:!1,resolve:null,reject:null,monaco:null}),ny=fN(FN,2),io=ny[0],kc=ny[1];function HN(n){var e=BN.config(n),t=e.monaco,s=dN(e,["monaco"]);kc(function(r){return{config:ty(r.config,s),monaco:t}})}function UN(){var n=io(function(e){var t=e.monaco,s=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:s,resolve:r}});if(!n.isInitialized){if(kc({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),Yh(Kh);if(window.monaco&&window.monaco.editor)return sy(window.monaco),n.resolve(window.monaco),Yh(Kh);VN(WN,KN)(QN)}return Yh(Kh)}function WN(n){return document.body.appendChild(n)}function YN(n){var e=document.createElement("script");return n&&(e.src=n),e}function KN(n){var e=io(function(s){var r=s.config,a=s.reject;return{config:r,reject:a}}),t=YN("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function QN(){var n=io(function(t){var s=t.config,r=t.resolve,a=t.reject;return{config:s,resolve:r,reject:a}}),e=window.require;e.config(n.config),e(["vs/editor/editor.main"],function(t){sy(t),n.resolve(t)},function(t){n.reject(t)})}function sy(n){io().monaco||kc({monaco:n})}function ZN(){return io(function(n){var e=n.monaco;return e})}var Kh=new Promise(function(n,e){return kc({resolve:n,reject:e})}),ic={config:HN,init:UN,__getMonacoInstance:ZN},GN={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Qh=GN,JN={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},qN=JN;function XN({children:n}){return q.createElement("div",{style:qN.container},n)}var ej=XN,tj=ej;function nj({width:n,height:e,isEditorReady:t,loading:s,_ref:r,className:a,wrapperProps:l}){return q.createElement("section",{style:{...Qh.wrapper,width:n,height:e},...l},!t&&q.createElement(tj,null,s),q.createElement("div",{ref:r,style:{...Qh.fullWidth,...!t&&Qh.hide},className:a}))}var sj=nj,ry=v.memo(sj);function rj(n){v.useEffect(n,[])}var Df=rj;function ij(n,e,t=!0){let s=v.useRef(!0);v.useEffect(s.current||!t?()=>{s.current=!1}:n,e)}var vn=ij;function Pa(){}function wi(n,e,t,s){return aj(n,s)||oj(n,e,t,s)}function aj(n,e){return n.editor.getModel(iy(n,e))}function oj(n,e,t,s){return n.editor.createModel(e,t,s?iy(n,s):void 0)}function iy(n,e){return n.Uri.parse(e)}function lj({original:n,modified:e,language:t,originalLanguage:s,modifiedLanguage:r,originalModelPath:a,modifiedModelPath:l,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:g={},height:y="100%",width:w="100%",className:k,wrapperProps:_={},beforeMount:C=Pa,onMount:S=Pa}){let[M,I]=v.useState(!1),[L,O]=v.useState(!0),K=v.useRef(null),E=v.useRef(null),R=v.useRef(null),F=v.useRef(S),J=v.useRef(C),oe=v.useRef(!1);Df(()=>{let te=ic.init();return te.then(B=>(E.current=B)&&O(!1)).catch(B=>(B==null?void 0:B.type)!=="cancelation"&&console.error("Monaco initialization: error:",B)),()=>K.current?be():te.cancel()}),vn(()=>{if(K.current&&E.current){let te=K.current.getOriginalEditor(),B=wi(E.current,n||"",s||t||"text",a||"");B!==te.getModel()&&te.setModel(B)}},[a],M),vn(()=>{if(K.current&&E.current){let te=K.current.getModifiedEditor(),B=wi(E.current,e||"",r||t||"text",l||"");B!==te.getModel()&&te.setModel(B)}},[l],M),vn(()=>{let te=K.current.getModifiedEditor();te.getOption(E.current.editor.EditorOption.readOnly)?te.setValue(e||""):e!==te.getValue()&&(te.executeEdits("",[{range:te.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),te.pushUndoStop())},[e],M),vn(()=>{var te,B;(B=(te=K.current)==null?void 0:te.getModel())==null||B.original.setValue(n||"")},[n],M),vn(()=>{let{original:te,modified:B}=K.current.getModel();E.current.editor.setModelLanguage(te,s||t||"text"),E.current.editor.setModelLanguage(B,r||t||"text")},[t,s,r],M),vn(()=>{var te;(te=E.current)==null||te.editor.setTheme(f)},[f],M),vn(()=>{var te;(te=K.current)==null||te.updateOptions(g)},[g],M);let Ne=v.useCallback(()=>{var Z;if(!E.current)return;J.current(E.current);let te=wi(E.current,n||"",s||t||"text",a||""),B=wi(E.current,e||"",r||t||"text",l||"");(Z=K.current)==null||Z.setModel({original:te,modified:B})},[t,e,r,n,s,a,l]),Ee=v.useCallback(()=>{var te;!oe.current&&R.current&&(K.current=E.current.editor.createDiffEditor(R.current,{automaticLayout:!0,...g}),Ne(),(te=E.current)==null||te.editor.setTheme(f),I(!0),oe.current=!0)},[g,f,Ne]);v.useEffect(()=>{M&&F.current(K.current,E.current)},[M]),v.useEffect(()=>{!L&&!M&&Ee()},[L,M,Ee]);function be(){var B,Z,X,ne;let te=(B=K.current)==null?void 0:B.getModel();u||((Z=te==null?void 0:te.original)==null||Z.dispose()),d||((X=te==null?void 0:te.modified)==null||X.dispose()),(ne=K.current)==null||ne.dispose()}return q.createElement(ry,{width:w,height:y,isEditorReady:M,loading:p,_ref:R,className:k,wrapperProps:_})}var cj=lj;v.memo(cj);function uj(){let[n,e]=v.useState(ic.__getMonacoInstance());return Df(()=>{let t;return n||(t=ic.init(),t.then(s=>{e(s)})),()=>t==null?void 0:t.cancel()}),n}var ay=uj;function hj(n){let e=v.useRef();return v.useEffect(()=>{e.current=n},[n]),e.current}var dj=hj,Al=new Map;function fj({defaultValue:n,defaultLanguage:e,defaultPath:t,value:s,language:r,path:a,theme:l="light",line:u,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:g=!0,keepCurrentModel:y=!1,width:w="100%",height:k="100%",className:_,wrapperProps:C={},beforeMount:S=Pa,onMount:M=Pa,onChange:I,onValidate:L=Pa}){let[O,K]=v.useState(!1),[E,R]=v.useState(!0),F=v.useRef(null),J=v.useRef(null),oe=v.useRef(null),Ne=v.useRef(M),Ee=v.useRef(S),be=v.useRef(),te=v.useRef(s),B=dj(a),Z=v.useRef(!1),X=v.useRef(!1);Df(()=>{let $=ic.init();return $.then(ie=>(F.current=ie)&&R(!1)).catch(ie=>(ie==null?void 0:ie.type)!=="cancelation"&&console.error("Monaco initialization: error:",ie)),()=>J.current?D():$.cancel()}),vn(()=>{var ie,ge,le,se;let $=wi(F.current,n||s||"",e||r||"",a||t||"");$!==((ie=J.current)==null?void 0:ie.getModel())&&(g&&Al.set(B,(ge=J.current)==null?void 0:ge.saveViewState()),(le=J.current)==null||le.setModel($),g&&((se=J.current)==null||se.restoreViewState(Al.get(a))))},[a],O),vn(()=>{var $;($=J.current)==null||$.updateOptions(f)},[f],O),vn(()=>{!J.current||s===void 0||(J.current.getOption(F.current.editor.EditorOption.readOnly)?J.current.setValue(s):s!==J.current.getValue()&&(X.current=!0,J.current.executeEdits("",[{range:J.current.getModel().getFullModelRange(),text:s,forceMoveMarkers:!0}]),J.current.pushUndoStop(),X.current=!1))},[s],O),vn(()=>{var ie,ge;let $=(ie=J.current)==null?void 0:ie.getModel();$&&r&&((ge=F.current)==null||ge.editor.setModelLanguage($,r))},[r],O),vn(()=>{var $;u!==void 0&&(($=J.current)==null||$.revealLine(u))},[u],O),vn(()=>{var $;($=F.current)==null||$.editor.setTheme(l)},[l],O);let ne=v.useCallback(()=>{var $;if(!(!oe.current||!F.current)&&!Z.current){Ee.current(F.current);let ie=a||t,ge=wi(F.current,s||n||"",e||r||"",ie||"");J.current=($=F.current)==null?void 0:$.editor.create(oe.current,{model:ge,automaticLayout:!0,...f},p),g&&J.current.restoreViewState(Al.get(ie)),F.current.editor.setTheme(l),u!==void 0&&J.current.revealLine(u),K(!0),Z.current=!0}},[n,e,t,s,r,a,f,p,g,l,u]);v.useEffect(()=>{O&&Ne.current(J.current,F.current)},[O]),v.useEffect(()=>{!E&&!O&&ne()},[E,O,ne]),te.current=s,v.useEffect(()=>{var $,ie;O&&I&&(($=be.current)==null||$.dispose(),be.current=(ie=J.current)==null?void 0:ie.onDidChangeModelContent(ge=>{X.current||I(J.current.getValue(),ge)}))},[O,I]),v.useEffect(()=>{if(O){let $=F.current.editor.onDidChangeMarkers(ie=>{var le;let ge=(le=J.current.getModel())==null?void 0:le.uri;if(ge&&ie.find(se=>se.path===ge.path)){let se=F.current.editor.getModelMarkers({resource:ge});L==null||L(se)}});return()=>{$==null||$.dispose()}}return()=>{}},[O,L]);function D(){var $,ie;($=be.current)==null||$.dispose(),y?g&&Al.set(a,J.current.saveViewState()):(ie=J.current.getModel())==null||ie.dispose(),J.current.dispose()}return q.createElement(ry,{width:w,height:k,isEditorReady:O,loading:d,_ref:oe,className:_,wrapperProps:C})}var pj=fj,zd=v.memo(pj);function m1(n){return ye({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2 1.00073L1 2.00073V14.0007L2 15.0007H14L15 14.0007V2.00073L14 1.00073H2ZM2 14.0007V2.00073H6V14.0007H2ZM7 14.0007V2.00073H14V14.0007H7Z"}}]})(n)}const mj=({children:n,...e})=>{const[t,s]=v.useState(!1),r=v.useRef(null),a=v.useRef(null),l=v.useRef(null),u=v.Children.toArray(n);return v.useEffect(()=>{const d={x:0,y:0},f={x:0,y:0};r.current.onmousedown=p;function p(y){return d.x=y.clientX,d.y=y.clientY,document.onmousemove=g,document.onmouseup=()=>{s(!1),document.onmousemove=document.onmouseup=null},!0}function g(y){if(s(!0),!r.current)return;const w=y.clientX,k=y.clientY;f.x=w-d.x,f.y=k-d.y;const _=r.current.offsetLeft;let C=a.current.offsetWidth,S=l.current.offsetWidth;return r.current.style.left=_+f.x+"px",C+=f.x,S-=f.x,d.x=w,d.y=k,a.current.style.width=C+"px",l.current.style.width=S+"px",!0}return()=>{r.current&&(r.current.onmousedown=void 0)}},[]),c.jsx("div",{...e,children:c.jsxs("div",{className:"w-full h-full flex flex-row",children:[c.jsx("div",{children:u[0],className:"w-1/2 flex-grow "+(t?"pointer-events-none":""),ref:a}),c.jsx("div",{className:`h-full w-[10px] gap-px flex flex-row items-center justify-evenly
|
472
|
+
bg-gray-500 cursor-col-resize`,ref:r,children:c.jsx("span",{className:"w-1 h-10 bg-black/80"})}),c.jsx("div",{children:u[1],className:"w-1/2 "+(t?"pointer-events-none":""),ref:l})]})})},gj=({mode:n=0,onChange:e})=>{const t=v.useCallback(s=>{e&&e(s)},[e]);return c.jsxs("div",{className:`flex flex-row gap-3 items-center p-2
|
473
|
+
rounded-md border w-fit shelf-border-color
|
474
|
+
relative text-base`,children:[c.jsx(m1,{title:"Show Preview to the right",className:"cursor-pointer z-10 transition-transform duration-100 "+(n==0?"scale-150":""),onClick:()=>t(0)}),c.jsx(m1,{title:"Show Preview to the bottom",className:"cursor-pointer rotate-90 z-10 transition-transform duration-100 "+(n==1?"scale-150":""),onClick:()=>t(1)}),c.jsx(H5,{title:"Enter Fullscreen",className:"cursor-pointer z-10 transition-transform duration-100 "+(n==2?"scale-150":""),onClick:()=>t(2)})]})},Zh=({field:n,context:e,setError:t,value:s,onChange:r,dash:{isHtml:a=!0,editor:l,defaultMode:u=0,showLayoutSwitcher:d=!0},...f})=>{const p=ay(),[g,y]=v.useState(u),[w,k]=v.useState({}),[_,C]=v.useState(s),{darkMode:S}=hs(),M=v.useCallback(O=>{C(O),r(O)},[r]),I=v.useCallback(O=>{y(O)},[]),L=v.useMemo(()=>{try{let K=R3.compile(_)(w??{});return a||(K=`<pre>${K}</pre>`),K}catch(O){return O}},[_,w,a]);return v.useEffect(()=>e.pubsub.add_sub((O,K)=>{O==="reference_example_input"&&k(K)}),[e]),v.useEffect(()=>{p&&p.editor.defineTheme("coblat",{base:"vs-dark",inherit:!0,rules:[{background:"002240",token:""},{foreground:"e1efff",token:"punctuation - (punctuation.definition.string || punctuation.definition.comment)"},{foreground:"ff628c",token:"constant"},{foreground:"ffdd00",token:"entity"},{foreground:"ff9d00",token:"keyword"},{foreground:"ffee80",token:"storage"},{foreground:"3ad900",token:"string -string.unquoted.old-plist -string.unquoted.heredoc"},{foreground:"3ad900",token:"string.unquoted.heredoc string"},{foreground:"0088ff",fontStyle:"italic",token:"comment"},{foreground:"80ffbb",token:"support"},{foreground:"cccccc",token:"variable"},{foreground:"ff80e1",token:"variable.language"},{foreground:"ffee80",token:"meta.function-call"},{foreground:"f8f8f8",background:"800f00",token:"invalid"},{foreground:"ffffff",background:"223545",token:"text source"},{foreground:"ffffff",background:"223545",token:"string.unquoted.heredoc"},{foreground:"ffffff",background:"223545",token:"source source"},{foreground:"80fcff",fontStyle:"italic",token:"entity.other.inherited-class"},{foreground:"9eff80",token:"string.quoted source"},{foreground:"80ff82",token:"string constant"},{foreground:"80ffc2",token:"string.regexp"},{foreground:"edef7d",token:"string variable"},{foreground:"ffb054",token:"support.function"},{foreground:"eb939a",token:"support.constant"},{foreground:"ff1e00",token:"support.type.exception"},{foreground:"8996a8",token:"meta.preprocessor.c"},{foreground:"afc4db",token:"meta.preprocessor.c keyword"},{foreground:"73817d",token:"meta.sgml.html meta.doctype"},{foreground:"73817d",token:"meta.sgml.html meta.doctype entity"},{foreground:"73817d",token:"meta.sgml.html meta.doctype string"},{foreground:"73817d",token:"meta.xml-processing"},{foreground:"73817d",token:"meta.xml-processing entity"},{foreground:"73817d",token:"meta.xml-processing string"},{foreground:"9effff",token:"meta.tag"},{foreground:"9effff",token:"meta.tag entity"},{foreground:"9effff",token:"meta.selector.css entity.name.tag"},{foreground:"ffb454",token:"meta.selector.css entity.other.attribute-name.id"},{foreground:"5fe461",token:"meta.selector.css entity.other.attribute-name.class"},{foreground:"9df39f",token:"support.type.property-name.css"},{foreground:"f6f080",token:"meta.property-group support.constant.property-value.css"},{foreground:"f6f080",token:"meta.property-value support.constant.property-value.css"},{foreground:"f6aa11",token:"meta.preprocessor.at-rule keyword.control.at-rule"},{foreground:"edf080",token:"meta.property-value support.constant.named-color.css"},{foreground:"edf080",token:"meta.property-value constant"},{foreground:"eb939a",token:"meta.constructor.argument.css"},{foreground:"f8f8f8",background:"000e1a",token:"meta.diff"},{foreground:"f8f8f8",background:"000e1a",token:"meta.diff.header"},{foreground:"f8f8f8",background:"4c0900",token:"markup.deleted"},{foreground:"f8f8f8",background:"806f00",token:"markup.changed"},{foreground:"f8f8f8",background:"154f00",token:"markup.inserted"},{background:"8fddf630",token:"markup.raw"},{background:"004480",token:"markup.quote"},{background:"130d26",token:"markup.list"},{foreground:"c1afff",fontStyle:"bold",token:"markup.bold"},{foreground:"b8ffd9",fontStyle:"italic",token:"markup.italic"},{foreground:"c8e4fd",background:"001221",fontStyle:"bold",token:"markup.heading"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#1e293b","editor.selectionBackground":"#B36539BF","editor.lineHighlightBackground":"#00000059","editorCursor.foreground":"#FFFFFF","editorWhitespace.foreground":"#FFFFFF26"}})},[p]),v.useEffect(()=>{const O=K=>{g==2&&K.key==="Escape"&&y(0)};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O)}},[g]),c.jsx("div",{...f,children:c.jsxs("div",{className:"flex flex-col w-full gap-5",children:[d&&c.jsx(gj,{onChange:I,mode:g}),g<2&&c.jsxs("div",{className:"w-full flex flex-col gap-5 relative",children:[c.jsx(zd,{options:{tabSize:2,minimap:{autohide:!0},...l==null?void 0:l.options},width:(l==null?void 0:l.width)??"100%",height:(l==null?void 0:l.height)??"500px",className:"rounded-md border shelf-border-color overflow-clip",onChange:M,value:_,theme:S?"coblat":"light",defaultLanguage:"handlebars"}),c.jsx("iframe",{srcDoc:L,className:`${g==0?"absolute translate-x-10 left-full top-0 w-full ":""}
|
475
|
+
rounded-md border shelf-border-color resize overflow-auto bg-white`,height:(l==null?void 0:l.height)??"500px"})]}),g==2&&c.jsxs(mj,{className:"z-[100] fixed left-0 top-0 w-full h-full",children:[c.jsx(zd,{options:{tabSize:2},width:(l==null?void 0:l.width)??"100%",height:"100%",className:"--overflow-auto",onChange:M,value:_,theme:S?"coblat":"light",defaultLanguage:"handlebars"}),c.jsxs("div",{className:"w-full h-full flex-col items-center",children:[c.jsxs("div",{className:`flex flex-row items-center text-2xl
|
476
|
+
shelf-plain-card-soft justify-between w-full p-3`,children:[c.jsx("span",{children:"Preview"}),c.jsx(Eb,{onClick:()=>y(0),className:"cursor-pointer"})]}),c.jsx("iframe",{width:"100%",srcDoc:L,className:" border shelf-border-color bg-white",height:"100%"})]})]})]})})},vj=({field:n,context:e,setError:t,value:s={},onChange:r,...a})=>{const l=ay(),[u,d]=v.useState(s),{darkMode:f}=hs(),p=v.useCallback((y,w)=>{t(void 0);try{let k=JSON.parse(y);d(k),r(k)}catch(k){t((k==null?void 0:k.message)??"JSON Error")}},[r]),g=v.useMemo(()=>{try{return JSON.stringify(u,null,2)}catch(y){return y}},[u]);return v.useEffect(()=>{l&&l.editor.defineTheme("coblat",{base:"vs-dark",inherit:!0,rules:[{background:"002240",token:""},{foreground:"e1efff",token:"punctuation - (punctuation.definition.string || punctuation.definition.comment)"},{foreground:"ff628c",token:"constant"},{foreground:"ffdd00",token:"entity"},{foreground:"ff9d00",token:"keyword"},{foreground:"ffee80",token:"storage"},{foreground:"3ad900",token:"string -string.unquoted.old-plist -string.unquoted.heredoc"},{foreground:"3ad900",token:"string.unquoted.heredoc string"},{foreground:"0088ff",fontStyle:"italic",token:"comment"},{foreground:"80ffbb",token:"support"},{foreground:"cccccc",token:"variable"},{foreground:"ff80e1",token:"variable.language"},{foreground:"ffee80",token:"meta.function-call"},{foreground:"f8f8f8",background:"800f00",token:"invalid"},{foreground:"ffffff",background:"223545",token:"text source"},{foreground:"ffffff",background:"223545",token:"string.unquoted.heredoc"},{foreground:"ffffff",background:"223545",token:"source source"},{foreground:"80fcff",fontStyle:"italic",token:"entity.other.inherited-class"},{foreground:"9eff80",token:"string.quoted source"},{foreground:"80ff82",token:"string constant"},{foreground:"80ffc2",token:"string.regexp"},{foreground:"edef7d",token:"string variable"},{foreground:"ffb054",token:"support.function"},{foreground:"eb939a",token:"support.constant"},{foreground:"ff1e00",token:"support.type.exception"},{foreground:"8996a8",token:"meta.preprocessor.c"},{foreground:"afc4db",token:"meta.preprocessor.c keyword"},{foreground:"73817d",token:"meta.sgml.html meta.doctype"},{foreground:"73817d",token:"meta.sgml.html meta.doctype entity"},{foreground:"73817d",token:"meta.sgml.html meta.doctype string"},{foreground:"73817d",token:"meta.xml-processing"},{foreground:"73817d",token:"meta.xml-processing entity"},{foreground:"73817d",token:"meta.xml-processing string"},{foreground:"9effff",token:"meta.tag"},{foreground:"9effff",token:"meta.tag entity"},{foreground:"9effff",token:"meta.selector.css entity.name.tag"},{foreground:"ffb454",token:"meta.selector.css entity.other.attribute-name.id"},{foreground:"5fe461",token:"meta.selector.css entity.other.attribute-name.class"},{foreground:"9df39f",token:"support.type.property-name.css"},{foreground:"f6f080",token:"meta.property-group support.constant.property-value.css"},{foreground:"f6f080",token:"meta.property-value support.constant.property-value.css"},{foreground:"f6aa11",token:"meta.preprocessor.at-rule keyword.control.at-rule"},{foreground:"edf080",token:"meta.property-value support.constant.named-color.css"},{foreground:"edf080",token:"meta.property-value constant"},{foreground:"eb939a",token:"meta.constructor.argument.css"},{foreground:"f8f8f8",background:"000e1a",token:"meta.diff"},{foreground:"f8f8f8",background:"000e1a",token:"meta.diff.header"},{foreground:"f8f8f8",background:"4c0900",token:"markup.deleted"},{foreground:"f8f8f8",background:"806f00",token:"markup.changed"},{foreground:"f8f8f8",background:"154f00",token:"markup.inserted"},{background:"8fddf630",token:"markup.raw"},{background:"004480",token:"markup.quote"},{background:"130d26",token:"markup.list"},{foreground:"c1afff",fontStyle:"bold",token:"markup.bold"},{foreground:"b8ffd9",fontStyle:"italic",token:"markup.italic"},{foreground:"c8e4fd",background:"001221",fontStyle:"bold",token:"markup.heading"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#1e293b","editor.selectionBackground":"#B36539BF","editor.lineHighlightBackground":"#00000059","editorCursor.foreground":"#FFFFFF","editorWhitespace.foreground":"#FFFFFF26"}})},[l]),c.jsx("div",{...a,children:c.jsx("div",{className:"flex flex-col w-full gap-5",children:c.jsx(zd,{options:{tabSize:2,minimap:{enabled:!1}},width:"100%",height:"300px",className:"rounded-md border shelf-border-color overflow-clip",onChange:p,value:g,theme:f?"coblat":"light",defaultLanguage:"json"})})})},xj={name:"Root",comp:We,comp_params:{className:"flex flex-col gap-5 w-full max-w-[35rem]"},fields:[{key:"title",name:"Title",type:"text",validate:!0,comp:ce($e(Fe,{}),{className:"h-9",placeholder:"enter the key / name of the tag"}),comp_params:{className:"w-full "}},{key:"template_subject",name:"Email Subject Template",defaultValue:"Hello {{name}}",desc:"Use [Handlebars](https://handlebarsjs.com/) syntax to create a fabulous `email` Subject",comp:ce(Zh,{dash:{isHtml:!1,defaultMode:1,showLayoutSwitcher:!1,editor:{width:"100%",height:"40px",options:{lineNumbers:"off",minimap:{enabled:!1},folding:!1}}},className:"w-full"}),comp_params:{className:"w-full"}},{key:"template_html",name:"HTML Body Template",defaultValue:"<html></html>",desc:"Use [Handlebars](https://handlebarsjs.com/) syntax to create a fabulous `email` template",comp:ce(Zh,{dash:{isHtml:!0}}),comp_params:{className:"w-full"}},{key:"template_text",name:"Text Body Template",defaultValue:"Hello",desc:"Use [Handlebars](https://handlebarsjs.com/) syntax to create a fabulous `email` template",comp:ce(Zh,{dash:{isHtml:!1,editor:{options:{lineNumbers:"off"}}}}),comp_params:{className:"w-full"}},{key:"reference_example_input",name:"Input for template",defaultValue:{},desc:"Play with various inputs for your `Handlebars` template",comp:ce(vj),comp_params:{className:"w-full"}},{key:"description",name:"📝 Description",type:"text",validate:!1,editable:!0,desc:"Describe the purpose of this tag",comp:ce(Os),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:({value:n})=>c.jsx(vs,{value:{...n,template_html:"...",template_text:"..."}}),comp_params:{className:"w-full"}}]},Gh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l,duplicate:u},context:d,key:f,doc:p,isCreateMode:g,isEditMode:y,isViewMode:w,hasChanged:k,hasLoaded:_,error:C,ref_head:S,ref_root:M}=On("templates",t,"/apps/templates",n,s),I=v.useCallback(()=>u({title:(p==null?void 0:p.title)+" duplicate"}),[p,u]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["templates",t??"create"],className:""}),c.jsx(gs,{doc:p,className:"mt-5",collectionId:"tags"}),c.jsx(ms,{id:p.handle,onClickSave:y?r:void 0,onClickCreate:g?r:void 0,onClickDuplicate:g?void 0:I,onClickReload:g?void 0:async()=>l(!1),onClickDelete:g?void 0:a,className:"mt-5"}),c.jsx(us,{ref:S,time:p==null?void 0:p.created_at,className:"mt-8",changes_made:k},p==null?void 0:p.updated_at),c.jsxs(_e,{show:_&&y||g,children:[c.jsx(jn,{error:C,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Ln,{ref:M,field:xj,value:p??{},context:d,isViewMode:w,className:"mx-auto"},f)]})]})},yj=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold max-w-[8rem] "}},{key:"price",name:"Price",comp:wt},{key:"collections",name:"Collections",comp:xx,comp_params:{className:`p-3 font-bold max-w-[8rem] sm:max-w-[12rem] xl:max-w-[24rem]
|
477
|
+
inline-block whitespace-nowrap`,name_fn:n=>n.handle}},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],g1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("products","/pages/products");return c.jsx("div",{className:"w-full h-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
478
|
+
shelf-border-color shadow-md mt-5
|
479
|
+
dark:shadow-slate-900 `,children:[c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/products/create",searchTitle:"Search by Name, Handle, Tag values, Collections...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:yj}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},ac={x:0,y:0,width:0,height:0,unit:"px"},mi=(n,e,t)=>Math.min(Math.max(n,e),t),wj=(...n)=>n.filter(e=>e&&typeof e=="string").join(" "),v1=(n,e)=>n===e||n.width===e.width&&n.height===e.height&&n.x===e.x&&n.y===e.y&&n.unit===e.unit;function gi(n,e,t){return n.unit==="%"?{...ac,...n,unit:"%"}:{unit:"%",x:n.x?n.x/e*100:0,y:n.y?n.y/t*100:0,width:n.width?n.width/e*100:0,height:n.height?n.height/t*100:0}}function nr(n,e,t){return n.unit?n.unit==="px"?{...ac,...n,unit:"px"}:{unit:"px",x:n.x?n.x*e/100:0,y:n.y?n.y*t/100:0,width:n.width?n.width*e/100:0,height:n.height?n.height*t/100:0}:{...ac,...n,unit:"px"}}function x1(n,e,t,s,r,a=0,l=0,u=s,d=r){const f={...n};let p=Math.min(a,s),g=Math.min(l,r),y=Math.min(u,s),w=Math.min(d,r);e&&(e>1?(p=l?l*e:p,g=p/e,y=u*e):(g=a?a/e:g,p=g*e,w=d/e)),f.y<0&&(f.height=Math.max(f.height+f.y,g),f.y=0),f.x<0&&(f.width=Math.max(f.width+f.x,p),f.x=0);const k=s-(f.x+f.width);k<0&&(f.x=Math.min(f.x,s-p),f.width+=k);const _=r-(f.y+f.height);if(_<0&&(f.y=Math.min(f.y,r-g),f.height+=_),f.width<p&&((t==="sw"||t=="nw")&&(f.x-=p-f.width),f.width=p),f.height<g&&((t==="nw"||t=="ne")&&(f.y-=g-f.height),f.height=g),f.width>y&&((t==="sw"||t=="nw")&&(f.x-=y-f.width),f.width=y),f.height>w&&((t==="nw"||t=="ne")&&(f.y-=w-f.height),f.height=w),e){const C=f.width/f.height;if(C<e){const S=Math.max(f.width/e,g);(t==="nw"||t=="ne")&&(f.y-=S-f.height),f.height=S}else if(C>e){const S=Math.max(f.height*e,p);(t==="sw"||t=="nw")&&(f.x-=S-f.width),f.width=S}}return f}function bj(n,e,t,s){const r={...n};return e==="ArrowLeft"?s==="nw"?(r.x-=t,r.y-=t,r.width+=t,r.height+=t):s==="w"?(r.x-=t,r.width+=t):s==="sw"?(r.x-=t,r.width+=t,r.height+=t):s==="ne"?(r.y+=t,r.width-=t,r.height-=t):s==="e"?r.width-=t:s==="se"&&(r.width-=t,r.height-=t):e==="ArrowRight"&&(s==="nw"?(r.x+=t,r.y+=t,r.width-=t,r.height-=t):s==="w"?(r.x+=t,r.width-=t):s==="sw"?(r.x+=t,r.width-=t,r.height-=t):s==="ne"?(r.y-=t,r.width+=t,r.height+=t):s==="e"?r.width+=t:s==="se"&&(r.width+=t,r.height+=t)),e==="ArrowUp"?s==="nw"?(r.x-=t,r.y-=t,r.width+=t,r.height+=t):s==="n"?(r.y-=t,r.height+=t):s==="ne"?(r.y-=t,r.width+=t,r.height+=t):s==="sw"?(r.x+=t,r.width-=t,r.height-=t):s==="s"?r.height-=t:s==="se"&&(r.width-=t,r.height-=t):e==="ArrowDown"&&(s==="nw"?(r.x+=t,r.y+=t,r.width-=t,r.height-=t):s==="n"?(r.y+=t,r.height-=t):s==="ne"?(r.y+=t,r.width-=t,r.height-=t):s==="sw"?(r.x-=t,r.width+=t,r.height+=t):s==="s"?r.height+=t:s==="se"&&(r.width+=t,r.height+=t)),r}const vi={capture:!0,passive:!1};let kj=0;const sr=class Wn extends v.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=v.createRef(),this.mediaRef=v.createRef(),this.initChangeCalled=!1,this.instanceId=`rc-${kj++}`,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{const{crop:t,disabled:s}=this.props,r=this.getBox();if(!t)return;const a=nr(t,r.width,r.height);if(s)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const l=e.target.dataset.ord,u=!!l;let d=e.clientX,f=e.clientY,p=a.x,g=a.y;if(l){const y=e.clientX-r.x,w=e.clientY-r.y;let k=0,_=0;l==="ne"||l=="e"?(k=y-(a.x+a.width),_=w-a.y,p=a.x,g=a.y+a.height):l==="se"||l==="s"?(k=y-(a.x+a.width),_=w-(a.y+a.height),p=a.x,g=a.y):l==="sw"||l=="w"?(k=y-a.x,_=w-(a.y+a.height),p=a.x+a.width,g=a.y):(l==="nw"||l=="n")&&(k=y-a.x,_=w-a.y,p=a.x+a.width,g=a.y+a.height),d=p+r.x+k,f=g+r.y+_}this.evData={startClientX:d,startClientY:f,startCropX:p,startCropY:g,clientX:e.clientX,clientY:e.clientY,isResize:u,ord:l},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{const{crop:t,disabled:s,locked:r,keepSelection:a,onChange:l}=this.props,u=this.getBox();if(s||r||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const d=e.clientX-u.x,f=e.clientY-u.y,p={unit:"px",x:d,y:f,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:d,startCropY:f,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,l(nr(p,u.width,u.height),gi(p,u.width,u.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{const{crop:t,disabled:s,onChange:r,onDragStart:a}=this.props,l=this.getBox();if(s||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));const{evData:u}=this;u.clientX=e.clientX,u.clientY=e.clientY;let d;u.isResize?d=this.resizeCrop():d=this.dragCrop(),v1(t,d)||r(nr(d,l.width,l.height),gi(d,l.width,l.height))},this.onComponentKeyDown=e=>{const{crop:t,disabled:s,onChange:r,onComplete:a}=this.props;if(s)return;const l=e.key;let u=!1;if(!t)return;const d=this.getBox(),f=this.makePixelCrop(d),p=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Wn.nudgeStepLarge:e.shiftKey?Wn.nudgeStepMedium:Wn.nudgeStep;if(l==="ArrowLeft"?(f.x-=p,u=!0):l==="ArrowRight"?(f.x+=p,u=!0):l==="ArrowUp"?(f.y-=p,u=!0):l==="ArrowDown"&&(f.y+=p,u=!0),u){e.cancelable&&e.preventDefault(),f.x=mi(f.x,0,d.width-f.width),f.y=mi(f.y,0,d.height-f.height);const g=nr(f,d.width,d.height),y=gi(f,d.width,d.height);r(g,y),a&&a(g,y)}},this.onHandlerKeyDown=(e,t)=>{const{aspect:s=0,crop:r,disabled:a,minWidth:l=0,minHeight:u=0,maxWidth:d,maxHeight:f,onChange:p,onComplete:g}=this.props,y=this.getBox();if(a||!r)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;const w=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Wn.nudgeStepLarge:e.shiftKey?Wn.nudgeStepMedium:Wn.nudgeStep,k=nr(r,y.width,y.height),_=bj(k,e.key,w,t),C=x1(_,s,t,y.width,y.height,l,u,d,f);if(!v1(r,C)){const S=gi(C,y.width,y.height);p(C,S),g&&g(C,S)}},this.onDocPointerDone=e=>{const{crop:t,disabled:s,onComplete:r,onDragEnd:a}=this.props,l=this.getBox();this.unbindDocMove(),!(s||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),r&&r(nr(t,l.width,l.height),gi(t,l.width,l.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=()=>{var e;(e=this.componentRef.current)==null||e.scrollTo(0,0)}}get document(){return document}getBox(){const e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};const{x:t,y:s,width:r,height:a}=e.getBoundingClientRect();return{x:t,y:s,width:r,height:a}}componentDidUpdate(e){const{crop:t,onComplete:s}=this.props;if(s&&!e.crop&&t){const{width:r,height:a}=this.getBox();r&&a&&s(nr(t,r,a),gi(t,r,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,vi),this.document.addEventListener("pointerup",this.onDocPointerDone,vi),this.document.addEventListener("pointercancel",this.onDocPointerDone,vi),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,vi),this.document.removeEventListener("pointerup",this.onDocPointerDone,vi),this.document.removeEventListener("pointercancel",this.onDocPointerDone,vi),this.docMoveBound=!1)}getCropStyle(){const{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){const{evData:e}=this,t=this.getBox(),s=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return s.x=mi(e.startCropX+r,0,t.width-s.width),s.y=mi(e.startCropY+a,0,t.height-s.height),s}getPointRegion(e,t,s,r){const{evData:a}=this,l=a.clientX-e.x,u=a.clientY-e.y;let d;r&&t?d=t==="nw"||t==="n"||t==="ne":d=u<a.startCropY;let f;return s&&t?f=t==="nw"||t==="w"||t==="sw":f=l<a.startCropX,f?d?"nw":"sw":d?"ne":"se"}resolveMinDimensions(e,t,s=0,r=0){const a=Math.min(s,e.width),l=Math.min(r,e.height);return!t||!a&&!l?[a,l]:t>1?a?[a,a/t]:[l*t,l]:l?[l*t,l]:[a,a/t]}resizeCrop(){const{evData:e}=this,{aspect:t=0,maxWidth:s,maxHeight:r}=this.props,a=this.getBox(),[l,u]=this.resolveMinDimensions(a,t,this.props.minWidth,this.props.minHeight);let d=this.makePixelCrop(a);const f=this.getPointRegion(a,e.ord,l,u),p=e.ord||f;let g=e.clientX-e.startClientX,y=e.clientY-e.startClientY;(l&&p==="nw"||p==="w"||p==="sw")&&(g=Math.min(g,-l)),(u&&p==="nw"||p==="n"||p==="ne")&&(y=Math.min(y,-u));const w={unit:"px",x:0,y:0,width:0,height:0};f==="ne"?(w.x=e.startCropX,w.width=g,t?(w.height=w.width/t,w.y=e.startCropY-w.height):(w.height=Math.abs(y),w.y=e.startCropY-w.height)):f==="se"?(w.x=e.startCropX,w.y=e.startCropY,w.width=g,t?w.height=w.width/t:w.height=y):f==="sw"?(w.x=e.startCropX+g,w.y=e.startCropY,w.width=Math.abs(g),t?w.height=w.width/t:w.height=y):f==="nw"&&(w.x=e.startCropX+g,w.width=Math.abs(g),t?(w.height=w.width/t,w.y=e.startCropY-w.height):(w.height=Math.abs(y),w.y=e.startCropY+y));const k=x1(w,t,f,a.width,a.height,l,u,s,r);return t||Wn.xyOrds.indexOf(p)>-1?d=k:Wn.xOrds.indexOf(p)>-1?(d.x=k.x,d.width=k.width):Wn.yOrds.indexOf(p)>-1&&(d.y=k.y,d.height=k.height),d.x=mi(d.x,0,a.width-d.width),d.y=mi(d.y,0,a.height-d.height),d}renderCropSelection(){const{ariaLabels:e=Wn.defaultProps.ariaLabels,disabled:t,locked:s,renderSelectionAddon:r,ruleOfThirds:a,crop:l}=this.props,u=this.getCropStyle();if(l)return q.createElement("div",{style:u,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!t&&!s&&q.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},q.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),q.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),q.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),q.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"nw"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"n"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"ne"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"e"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"se"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"s"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"sw"),role:"button"}),q.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:d=>this.onHandlerKeyDown(d,"w"),role:"button"})),r&&q.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:d=>d.stopPropagation()},r(this.state)),a&&q.createElement(q.Fragment,null,q.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),q.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){const t={...ac,...this.props.crop||{}};return nr(t,e.width,e.height)}render(){const{aspect:e,children:t,circularCrop:s,className:r,crop:a,disabled:l,locked:u,style:d,ruleOfThirds:f}=this.props,{cropIsActive:p,newCropIsBeingDrawn:g}=this.state,y=a?this.renderCropSelection():null,w=wj("ReactCrop",r,p&&"ReactCrop--active",l&&"ReactCrop--disabled",u&&"ReactCrop--locked",g&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&s&&"ReactCrop--circular-crop",a&&f&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",s&&"ReactCrop--no-animate");return q.createElement("div",{ref:this.componentRef,className:w,style:d},q.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?q.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},q.createElement("defs",null,q.createElement("mask",{id:`hole-${this.instanceId}`},q.createElement("rect",{width:"100%",height:"100%",fill:"white"}),s?q.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):q.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),q.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,y)}};sr.xOrds=["e","w"],sr.yOrds=["n","s"],sr.xyOrds=["nw","ne","se","sw"],sr.nudgeStep=1,sr.nudgeStepMedium=10,sr.nudgeStepLarge=100,sr.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};let _j=sr;const Cj=(n=!1)=>{const[e,t]=v.useState(n),s=v.useCallback(()=>{t(r=>!r)},[]);return[e,s]},Nj=({className:n,open:e=!0,...t})=>{const s=H8("overflow-hidden h-fit","transition-max-height","ease-linear",{"max-h-[300px]":e},{"max-h-0":!e},n);return c.jsx("div",{className:s,...t})},oc=v.forwardRef(({src:n,...e},t)=>{const s=v.useRef(void 0),[r,a]=v.useState(),{sdk:l}=bt();return v.useEffect(()=>{async function u(){const d=await l.storage.getSource(n);s.current=d,a(d)}return u(),()=>{s.current&&URL.revokeObjectURL(s.current)}},[n]),c.jsx("img",{...e,ref:t,src:r})}),jj=({left:n=!0,onSwitch:e,children:t,className:s,...r})=>{const[a,l]=v.useState(n),u=v.useCallback(()=>{l(w=>(e(!w),!w))},[e]);let d=`p-0 relative transition-all duration-300
|
480
|
+
border border-gray-400 rounded-full cursor-pointer
|
481
|
+
w-14 h-7 sm:w-24 sm:h-12 flex flex-row
|
482
|
+
${s} `;const f="absolute w-1/2 h-full ",p="transition-all duration-300",g=a?"top-0 left-px":"top-0 left-1/2",y=f+" "+g+" "+p;return c.jsxs("div",{className:d,onClick:u,...r,children:[c.jsx("div",{className:`${y} pr-px pb-px pt-px`,children:c.jsx("div",{className:`relative rounded-full w-full h-full
|
483
|
+
bg-gray-50 dark:bg-gray-800 border
|
484
|
+
border-gray-400`})}),c.jsx("div",{className:`flex flex-row justify-between w-full
|
485
|
+
h-full items-center z-10`,children:t})]})},Jh=v.forwardRef(({header:n="??",selectedDefault:e=0,options:t=[],...s},r)=>{const[a,l]=v.useState(e);return v.useImperativeHandle(r,()=>({get:()=>t[a]}),[t,a]),c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("p",{children:n,className:"tracking-wider font-bold"}),c.jsx("div",{className:"flex flex-row flex-wrap gap-1",children:t.map((u,d)=>c.jsx("div",{children:u,className:`rounded-md shelf-border-color border px-2 py-px
|
486
|
+
cursor-pointer
|
487
|
+
${a==d?"bg-black/10 dark:bg-black/50":"bg-transparent"}`,onClick:f=>l(d)},u))})]})}),Sj=({values:n,notify:e,onComplete:t,onEditingApproved:s,className:r,...a})=>{const[l,u]=Cj(!1),d=v.useRef(void 0),f=v.useRef(void 0),p=v.useRef(void 0),g=v.useCallback(()=>{const y={format:d.current.get(),quality:f.current.get(),height:p.current.get()};s&&s(y)},[s]);return c.jsxs("div",{className:"w-full",children:[c.jsxs("div",{className:`flex flex-row justify-between items-center w-full
|
488
|
+
py-3 px-3 text-xl sm:text-2xl
|
489
|
+
rounded-t-3xl ${r}`,...a,children:[c.jsx(xk,{onClick:u,className:`cursor-pointer rounded-full text-3xl p-1
|
490
|
+
${l?"bg-white dark:bg-white/10":""} `}),c.jsx(m3,{onClick:()=>e({...n,scale:n.scale/2}),className:"cursor-pointer text-xl sm:text-2xl",title:"Scale Down"}),c.jsx(g3,{onClick:()=>e({...n,scale:n.scale*2}),className:"cursor-pointer text-xl sm:text-2xl",title:"Scale Up"}),c.jsxs(jj,{onSwitch:y=>e({...n,mode:y?"move":"crop"}),left:(n==null?void 0:n.mode)==="move",children:[c.jsx(Ub,{className:`cursor-pointer text-xl translate-x-1
|
491
|
+
scale-90 sm:translate-x-[14px]`,title:"Move"}),c.jsx(Vb,{className:`cursor-pointer text-xl scale-90
|
492
|
+
-translate-x-1 sm:scale-105
|
493
|
+
sm:-translate-x-[13px]`,title:"Crop"})]}),c.jsx(Wb,{onClick:()=>e({...n,rotate:n.rotate+90}),className:"cursor-pointer text-2xl",title:"Rotate Right"}),c.jsx(Wd,{onClick:()=>t(void 0),className:"cursor-pointer text-xl sm:text-2xl",title:"Close"}),c.jsx(U1,{onClick:g,className:"cursor-pointer text-xl sm:text-2xl",title:"Approve"})]}),c.jsx(Nj,{open:l,children:c.jsxs("div",{className:"p-3 h-fit flex flex-col gap-2 bg-white/50 dark:bg-white/5",children:[c.jsx(Jh,{header:"Format",selectedDefault:0,ref:d,options:["jpeg","png","webp"]}),c.jsx(Jh,{header:"Quality",selectedDefault:1,ref:f,options:[.5,.75,.8,.9,1]}),c.jsx(Jh,{header:"Height",selectedDefault:3,ref:p,options:[128,256,384,512,640,768,896,1024]})]})})]})},Ej={scale:1,rotate:0,trans:{x:0,y:0},mode:"crop"},Mj=({source:n,name:e,onComplete:t,className:s,...r})=>{const a=v.useRef(null),[l,u]=v.useState(),[d,f]=v.useState(),p=v.useRef(void 0),[g,y]=v.useState(!1),[w,k]=v.useState(Ej),_=v.useCallback(L=>{f({unit:"%",x:0,y:0,width:100,height:100})},[]),C=v.useCallback(L=>{const O=a.current,K=document.createElement("canvas"),{rotate:E,trans:R,scale:F}=w;console.log("completedCrop",l);const J={width:O.width*l.width/100,height:O.height*l.height/100,x:O.width*l.x/100,y:O.height*l.y/100},oe=K.getContext("2d"),Ne=Math.PI/180;if(console.log("options",L),!oe)throw new Error("No 2d context");const Ee=O.naturalWidth,be=O.naturalHeight,te=Ee,B=L.height??be,Z=Math.min(1,te/Ee,B/be),X=Ee/O.width,ne=be/O.height,D=Z;K.width=Math.floor(J.width*X*D),K.height=Math.floor(J.height*ne*D),console.log("h ",be,D,K.height),oe.fillStyle=L.format==="jpeg"?"white":"transparent",oe.fillRect(0,0,K.width,K.height),oe.scale(D,D),oe.imageSmoothingQuality="high";const $=J.x*X,ie=J.y*ne,ge=E*Ne,le=O.naturalWidth/2,se=O.naturalHeight/2;oe.save(),oe.translate(-$,-ie),oe.translate(R.x*X,R.y*ne),oe.translate(le,se),oe.scale(F,F),oe.rotate(ge),oe.translate(-le,-se),oe.drawImage(O,0,0,Ee,be,0,0,Ee,be),oe.restore(),y(!0),K.toBlob(Me=>{y(!1),t(Me,L.format,e,K.width,K.height)},`image/${L.format}`,L.quality)},[l,w,e,t]),S=v.useRef(void 0),M=w.mode==="crop",I=v.useCallback(L=>{if(M)return;L.preventDefault(),L.stopPropagation(),p.current=L;const O=E=>{E.preventDefault(),p.current!==void 0&&k({...w,trans:{x:w.trans.x+(E.pageX-p.current.pageX),y:w.trans.y+(E.pageY-p.current.pageY)}})},K=E=>{E.preventDefault(),E.stopPropagation(),p.current=void 0,S.current.removeEventListener("pointermove",O),S.current.removeEventListener("pointerup",K),S.current.removeEventListener("pointerdown",I)};S.current.addEventListener("pointermove",O),S.current.addEventListener("pointerup",K)},[w]);return c.jsxs("div",{className:s,...r,children:[c.jsx(Sj,{values:w,notify:k,onComplete:t,onEditingApproved:C}),c.jsx("div",{className:"w-full touch-none",ref:S,onPointerDown:M?void 0:I,children:c.jsx(_j,{disabled:!M,ruleOfThirds:!0,className:"m-0 w-full",crop:d,onChange:(L,O)=>f(O),onComplete:(L,O)=>u(O),aspect:void 0,children:c.jsx(oc,{crossOrigin:"anonymous",className:"w-full m-0",ref:a,alt:"Crop me",src:n,style:{transform:`translate(${w.trans.x}px, ${w.trans.y}px)
|
494
|
+
scale(${w.scale})
|
495
|
+
rotate(${w.rotate}deg) `},onLoad:_})})}),c.jsx("input",{value:e,readOnly:!0,className:`w-full p-3 mt-0 whitespace-pre break-words
|
496
|
+
--rounded-b-3xl --border
|
497
|
+
bg-transparent
|
498
|
+
dark:border-slate-600
|
499
|
+
`})]})},Dj=()=>c.jsx("div",{className:"w-full h-full bg-slate-500/40 animate-pulse rounded-md"}),Tj=({src:n,children:e=Dj(),...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState("opacity-0"),[u,d]=v.useState(void 0),{sdk:f}=bt(),p=v.useCallback(async g=>{"naturalHeight"in g&&g.naturalHeight+g.naturalWidth===0||(r(!0),requestAnimationFrame(()=>{l("opacity-100")}))},[]);return v.useEffect(()=>{f.storage.getSource(n,!0).then(d)},[n]),c.jsx("div",{...t,children:c.jsxs("div",{className:"w-full h-full relative cursor-pointer",children:[c.jsx("div",{className:"absolute w-full h-full inset-0 transition-all duration-500 "+(s?"opacity-0":"opacity-100"),children:e}),u&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-full h-full absolute inset-0 duration-500 transition-all "+(s?"opacity-100":"opacity-0"),children:c.jsx("img",{src:u,...t,onLoad:p,className:"w-full h-full opacity-40 object-cover rounded-md"})}),c.jsx("div",{className:"w-full h-full absolute inset-0 duration-500 transition-all "+(s?"opacity-100":"opacity-0"),children:c.jsx("img",{src:u,...t,onLoad:p,className:"w-full h-full object-contain p-2"})})]})]})})},Ij=({data:n,onClickImage:e=()=>{},className:t,...s})=>{const{url:r,handle:a}=n;return c.jsxs("div",{className:`inline-block w-24 h-fit
|
500
|
+
--pb-2 sm:w-40 shadow-sm group transition-colors duration-300
|
501
|
+
rounded-lg overflow-hidden ${t}`,...s,children:[c.jsx(Ht,{to:`/apps/gallery/img/${a}`,draggable:"false",onClick:l=>e(l,n),children:c.jsx("div",{className:"w-full h-24 sm:h-40 relative rounded-md overflow-hidden",children:c.jsx(Tj,{src:r,crossOrigin:"anonymous",draggable:"false",className:`object-cover w-[99%] mx-auto h-full -opacity-20
|
502
|
+
group-hover:opacity-100 transition-opacity duration-300
|
503
|
+
ease-linear`})})}),c.jsx("div",{className:"mx-px --my-2",children:c.jsx("input",{value:r,readOnly:!0,className:`w-full p-1 mt-0 whitespace-pre break-words
|
504
|
+
border bg-gray-200 text-gray-600 rounded-b-md`})})]})},Aj=({images:n,onClickImage:e,className:t,...s})=>c.jsx("div",{className:`${t} overflow-y-auto`,...s,children:c.jsx("div",{className:`w-fit flex flex-row flex-wrap gap-10 --mx-10
|
505
|
+
place-content-center --justify-items-center --justify-center mx-auto `,children:n.map((r,a)=>c.jsx(Ij,{data:r,onClickImage:e},r.handle))})}),Lj=v.forwardRef(({count:n,reload:e,searchTitle:t,isLoading:s,...r},a)=>{const[l,u]=v.useState("");v.useImperativeHandle(a,()=>({getSearch:()=>l,setSearch:u}),[l]);const d=v.useCallback(f=>{f.key==="Enter"&&(f.preventDefault(),e())},[e]);return c.jsx("div",{...r,children:c.jsxs("div",{className:`py-5 w-full text-grey-800
|
506
|
+
flex flex-row justify-between items-center px-3`,children:[c.jsx("span",{children:`${n>=0?`(${n})`:""}`,className:"text-2xl w-fit font-mono min-w-[5rem]"}),c.jsx(Qe,{className:"m-1 flex-1 max-w-[30rem] h-12",stroke:"border-none",type:"search",placeholder:t,value:l,onChange:f=>u(f.currentTarget.value),onKeyPress:d}),c.jsx(sv,{className:" bg-kf-500 text-3xl cursor-pointer transition-all duration-300 rounded-full hover:bg-pink-400 text-white p-1.5 hover:p-1 "+(s?"animate-spin":""),onClick:e})]})})}),oy=({query_params:n={},onClickImage:e,useSearchParamsForQuery:t=!0,className:s,...r})=>{const{query_api:a,ref_actions:l,page:u,pages:d,loading:f,queryCount:p,actions:{onLimitChange:g,onReload:y,prev:w,next:k}}=Nn("images","/apps/gallery");return c.jsxs("div",{className:`flex flex-col justify-between ${s}`,...r,children:[c.jsx(Je,{rounded:"rounded-md",className:"shadow-md w-full h-fit",children:c.jsx(Lj,{ref:l,count:p,reload:()=>y(t),className:"shelf-card rounded-md",searchTitle:"search by used products/collections/tags",isLoading:f})}),c.jsx(Aj,{images:u,className:"mt-5 w-full --h-fit flex-1",onClickImage:e}),c.jsx(_e,{show:d==null?void 0:d.length,children:c.jsx(Je,{rounded:"rounded-md",className:"mt-5 shadow-md w-full h-fit",children:c.jsx(_n,{prev:()=>w(t),next:()=>k(t),limit:(a==null?void 0:a.limit)??5,onLimitChange:_=>g(_,t),className:"rounded-md shelf-card"})})})]})},ly=v.forwardRef(({query_params:n,onSelect:e,...t},s)=>{const r=v.useCallback((a,l)=>{e!==void 0&&(a.preventDefault(),a.stopPropagation(),s.current.hide(),e(l))},[e]);return c.jsx(Is,{ref:s,children:c.jsx("div",{className:"w-full h-full max-w-[60rem] px-5 py-10 ",children:c.jsx(oy,{useSearchParamsForQuery:!1,query_params:n,onClickImage:r,onClick:a=>a.stopPropagation(),className:`w-full h-full bg-slate-100 dark:bg-slate-700 border
|
507
|
+
shelf-border-color p-5 rounded-lg`})})})});var $l={exports:{}},Oj=$l.exports,y1;function Rj(){return y1||(y1=1,function(n,e){(function(t,s){n.exports=s()})(Oj,function(){return function(t){function s(a){if(r[a])return r[a].exports;var l=r[a]={i:a,l:!1,exports:{}};return t[a].call(l.exports,l,l.exports,s),l.l=!0,l.exports}var r={};return s.m=t,s.c=r,s.i=function(a){return a},s.d=function(a,l,u){s.o(a,l)||Object.defineProperty(a,l,{configurable:!1,enumerable:!0,get:u})},s.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(l,"a",l),l},s.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},s.p="",s(s.s=17)}([function(t,s,r){function a(w){return w.ref!==void 0}function l(w){return w.key!==void 0}var u=r(2),d=r(10),f=(r(4),r(13),Object.prototype.hasOwnProperty),p=r(11),g={key:!0,ref:!0,__self:!0,__source:!0},y=function(w,k,_,C,S,M,I){var L={$$typeof:p,type:w,key:k,ref:_,props:I,_owner:M};return L};y.createElement=function(w,k,_){var C,S={},M=null,I=null;if(k!=null){a(k)&&(I=k.ref),l(k)&&(M=""+k.key);for(C in k)f.call(k,C)&&!g.hasOwnProperty(C)&&(S[C]=k[C])}var L=arguments.length-2;if(L===1)S.children=_;else if(L>1){for(var O=Array(L),K=0;K<L;K++)O[K]=arguments[K+2];S.children=O}if(w&&w.defaultProps){var E=w.defaultProps;for(C in E)S[C]===void 0&&(S[C]=E[C])}return y(w,M,I,0,0,d.current,S)},y.createFactory=function(w){var k=y.createElement.bind(null,w);return k.type=w,k},y.cloneAndReplaceKey=function(w,k){return y(w.type,k,w.ref,w._self,w._source,w._owner,w.props)},y.cloneElement=function(w,k,_){var C,S=u({},w.props),M=w.key,I=w.ref,L=w._owner;if(k!=null){a(k)&&(I=k.ref,L=d.current),l(k)&&(M=""+k.key);var O;w.type&&w.type.defaultProps&&(O=w.type.defaultProps);for(C in k)f.call(k,C)&&!g.hasOwnProperty(C)&&(k[C]===void 0&&O!==void 0?S[C]=O[C]:S[C]=k[C])}var K=arguments.length-2;if(K===1)S.children=_;else if(K>1){for(var E=Array(K),R=0;R<K;R++)E[R]=arguments[R+2];S.children=E}return y(w.type,M,I,0,0,L,S)},y.isValidElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===p},t.exports=y},function(t,s,r){function a(l,u,d,f,p,g,y,w){if(!l){var k;if(u===void 0)k=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var _=[d,f,p,g,y,w],C=0;k=new Error(u.replace(/%s/g,function(){return _[C++]})),k.name="Invariant Violation"}throw k.framesToPop=1,k}}t.exports=a},function(t,s,r){function a(f){if(f==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}/*
|
508
|
+
object-assign
|
509
|
+
(c) Sindre Sorhus
|
510
|
+
@license MIT
|
511
|
+
*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de",Object.getOwnPropertyNames(f)[0]==="5")return!1;for(var p={},g=0;g<10;g++)p["_"+String.fromCharCode(g)]=g;if(Object.getOwnPropertyNames(p).map(function(w){return p[w]}).join("")!=="0123456789")return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(w){y[w]=w}),Object.keys(Object.assign({},y)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(f,p){for(var g,y,w=a(f),k=1;k<arguments.length;k++){g=Object(arguments[k]);for(var _ in g)u.call(g,_)&&(w[_]=g[_]);if(l){y=l(g);for(var C=0;C<y.length;C++)d.call(g,y[C])&&(w[y[C]]=g[y[C]])}}return w}},function(t,s,r){function a(l){for(var u=arguments.length-1,d="Minified React error #"+l+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+l,f=0;f<u;f++)d+="&args[]="+encodeURIComponent(arguments[f+1]);d+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var p=new Error(d);throw p.name="Invariant Violation",p.framesToPop=1,p}t.exports=a},function(t,s,r){var a=r(5),l=a;t.exports=l},function(t,s,r){function a(u){return function(){return u}}var l=function(){};l.thatReturns=a,l.thatReturnsFalse=a(!1),l.thatReturnsTrue=a(!0),l.thatReturnsNull=a(null),l.thatReturnsThis=function(){return this},l.thatReturnsArgument=function(u){return u},t.exports=l},function(t,s,r){var a={};t.exports=a},function(t,s,r){t.exports=r(21)()},function(t,s,r){t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,s,r){function a(y,w,k){this.props=y,this.context=w,this.refs=g,this.updater=k||p}function l(y,w,k){this.props=y,this.context=w,this.refs=g,this.updater=k||p}function u(){}var d=r(3),f=r(2),p=r(12),g=(r(13),r(6));r(1),r(32),a.prototype.isReactComponent={},a.prototype.setState=function(y,w){typeof y!="object"&&typeof y!="function"&&y!=null&&d("85"),this.updater.enqueueSetState(this,y),w&&this.updater.enqueueCallback(this,w,"setState")},a.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this),y&&this.updater.enqueueCallback(this,y,"forceUpdate")},u.prototype=a.prototype,l.prototype=new u,l.prototype.constructor=l,f(l.prototype,a.prototype),l.prototype.isPureReactComponent=!0,t.exports={Component:a,PureComponent:l}},function(t,s,r){var a={current:null};t.exports=a},function(t,s,r){var a=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=a},function(t,s,r){var a=(r(4),{isMounted:function(l){return!1},enqueueCallback:function(l,u){},enqueueForceUpdate:function(l){},enqueueReplaceState:function(l,u){},enqueueSetState:function(l,u){}});t.exports=a},function(t,s,r){var a=!1;t.exports=a},function(t,s,r){t.exports=r(25)},function(t,s,r){function a(L){return L&&L.__esModule?L:{default:L}}function l(L){if(Array.isArray(L)){for(var O=0,K=Array(L.length);O<L.length;O++)K[O]=L[O];return K}return Array.from(L)}function u(L,O){if(!(L instanceof O))throw new TypeError("Cannot call a class as a function")}function d(L,O){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!O||typeof O!="object"&&typeof O!="function"?L:O}function f(L,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);L.prototype=Object.create(O&&O.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(L,O):L.__proto__=O)}function p(L){return(L.buttons||L.which||L.button)===1}function g(){var L=document.createElement("div");L.style.cssText="position:fixed; top: 0; left: 0",document.body.appendChild(L);var O=L.getBoundingClientRect();return document.body.removeChild(L),[O.left,O.top]}function y(){return Math.abs(1-document.body.clientWidth/window.innerWidth)>.02}Object.defineProperty(s,"__esModule",{value:!0});var w=function(){function L(O,K){var E=[],R=!0,F=!1,J=void 0;try{for(var oe,Ne=O[Symbol.iterator]();!(R=(oe=Ne.next()).done)&&(E.push(oe.value),!K||E.length!==K);R=!0);}catch(Ee){F=!0,J=Ee}finally{try{!R&&Ne.return&&Ne.return()}finally{if(F)throw J}}return E}return function(O,K){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return L(O,K);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=function(){function L(O,K){for(var E=0;E<K.length;E++){var R=K[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}return function(O,K,E){return K&&L(O.prototype,K),E&&L(O,E),O}}(),_=r(14),C=a(_),S=r(7),M=a(S),I=function(L){function O(K){u(this,O);var E=d(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,K));return E.addListeners=function(R){R.addEventListener("mousedown",function(F){E.handleMouseDown(F)},!1),R.addEventListener("touchstart",function(F){E.handleTouchStart(F)},!1),R.addEventListener("touchmove",E.handleTouchMove,{passive:!1}),R.addEventListener("touchend",E.handleTouchEnd)},E.buildCustomEvent=function(R){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=void 0;return typeof window.CustomEvent!="function"?(J=document.createEvent("CustomEvent"),J.initCustomEvent(R,!0,!0,{})):J=new CustomEvent(R,{bubbles:!0,cancelable:!0}),Object.assign(J,{dragData:E.props.dragData,dragElem:E.dragElem,containerElem:E.containerElem,sourceElem:E.sourceElem},F),J},E.setCurrentTarget=function(R,F){E.dragElem.style.zIndex=-1;var J=document.elementFromPoint(R,F)||document.body;E.dragElem.style.zIndex=E.props.zIndex,E.currentTarget=E.dragElem.contains(J)?document.body:J},E.setFixedOffset=function(){if(y()){var R=g(),F=w(R,2);E.fixedOffsetLeft=F[0],E.fixedOffsetTop=F[1]}},E.doScroll=function(){window.scrollBy(E.xScroll,E.yScroll),E.setFixedOffset()},E.startScrolling=function(R,F){var J=[R,F];E.xScroll=J[0],E.yScroll=J[1],E.scrollTimer||(E.scrollTimer=setInterval(E.doScroll,50))},E.stopScrolling=function(){clearInterval(E.scrollTimer),E.scrollTimer=null},E.generateEnterLeaveEvents=function(R,F){var J=E.props.targetKey;E.setCurrentTarget(R,F),E.currentTarget!==E.prevTarget&&(E.prevTarget&&E.prevTarget.dispatchEvent(E.buildCustomEvent(J+"DragLeave")),E.currentTarget&&E.currentTarget.dispatchEvent(E.buildCustomEvent(J+"DragEnter"))),E.prevTarget=E.currentTarget},E.generateDropEvent=function(R,F){E.setCurrentTarget(R,F);var J=E.buildCustomEvent(E.props.targetKey+"Drop",{x:R,y:F});E.currentTarget.dispatchEvent(J)},E.handleMouseDown=function(R){p(R)&&!E.props.noDragging&&(document.addEventListener("mousemove",E.handleMouseMove),document.addEventListener("mouseup",E.handleMouseUp),E.startDrag(R.clientX,R.clientY))},E.handleTouchStart=function(R){E.props.noDragging||(R.stopPropagation(),E.setFixedOffset(),E.startDrag(R.targetTouches[0].clientX,R.targetTouches[0].clientY))},E.startDrag=function(R,F){document.addEventListener(E.props.targetKey+"Dropped",E.props.onDrop);var J=E.containerElem.getBoundingClientRect();E.setState({clicked:!0,leftOffset:J.left-R,topOffset:J.top-F,left:J.left,top:J.top}),E.props.onDragStart(E.props.dragData)},E.handleMouseMove=function(R){E.props.noDragging||(R.preventDefault(),E.state.clicked&&(E.drag(R.clientX,R.clientY),window.getSelection().removeAllRanges()))},E.handleTouchMove=function(R){E.props.noDragging||(R.preventDefault(),E.state.clicked&&E.drag(R.targetTouches[0].clientX,R.targetTouches[0].clientY))},E.getOffscreenCoordinates=function(R,F){var J=window.innerWidth-10,oe=window.innerHeight-10,Ne=R<10?R-10:R>J?R-J:0,Ee=F<10?F-10:F>oe?F-oe:0;return!(!Ee&&!Ne)&&[Ne,Ee]},E.drag=function(R,F){E.generateEnterLeaveEvents(R,F);var J={dragging:!0},oe=E.getOffscreenCoordinates(R,F);oe?E.startScrolling.apply(E,l(oe)):(E.stopScrolling(),E.props.yOnly||(J.left=E.state.leftOffset+R-E.fixedOffsetLeft),E.props.xOnly||(J.top=E.state.topOffset+F-E.fixedOffsetTop)),E.setState(J),E.props.onDrag(E.props.dragData,E.currentTarget,R,F)},E.handleMouseUp=function(R){E.setState({clicked:!1}),E.state.dragging&&(document.removeEventListener("mousemove",E.handleMouseMove),document.removeEventListener("mouseup",E.handleMouseUp),E.drop(R.clientX,R.clientY),window.getSelection().removeAllRanges())},E.handleTouchEnd=function(R){E.setState({clicked:!1}),E.state.dragging&&E.drop(R.changedTouches[0].clientX,R.changedTouches[0].clientY)},E.drop=function(R,F){E.stopScrolling(),E.generateDropEvent(R,F),document.removeEventListener(E.props.targetKey+"Dropped",E.props.onDrop),E._isMounted&&E.setState({dragging:!1}),E.props.onDragEnd(E.props.dragData,E.currentTarget,R,F)},E.getDisplayMode=function(){return!E.state.dragging||E.props.dragClone||E.props.customDragElement?"normal":E.props.disappearDraggedElement?"disappeared":"hidden"},E.state={leftOffset:0,topOffset:0,left:0,top:0,clicked:!1,dragging:!1},E.dragElem=null,E.containerElem=null,E.sourceElem=null,E.currentTarget=null,E.prevTarget=null,E._isMounted=!0,E.fixedOffsetLeft=0,E.fixedOffsetTop=0,E.scrollTimer=null,E.xScroll=0,E.yScroll=0,E}return f(O,L),k(O,[{key:"componentDidMount",value:function(){for(var K=this.containerElem.getElementsByTagName("IMG"),E=0;E<K.length;E+=1)K[E].setAttribute("draggable","false");if(this.props.dragHandleClassName)for(var R=this.containerElem.getElementsByClassName(this.props.dragHandleClassName),F=0;F<R.length;F+=1)this.addListeners(R[F]),R[F].style.cursor="move";else this.addListeners(this.containerElem),this.containerElem.style.cursor="move"}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var K=this,E=this.props.render?this.props.render(this.state):this.props.children,R=this.getDisplayMode(),F=void 0;F=this.props.customDragElement?this.props.customDragElement:E;var J={position:"fixed",cursor:"move",left:this.state.left,top:this.state.top,zIndex:this.props.zIndex,opacity:this.props.dragElemOpacity,display:this.state.dragging?"block":"none"},oe=C.default.createElement("div",{className:"ddcontainerghost",style:J,ref:function(be){K.dragElem=be}},F),Ne={position:R==="disappeared"?"absolute":"relative",display:"inline-block"},Ee={display:R==="disappeared"?"none":"inherit",visibility:R==="hidden"?"hidden":"inherit"};return C.default.createElement("div",{className:"ddcontainer",style:Ne,ref:function(be){K.containerElem=be}},C.default.createElement("span",{className:"ddcontainersource",style:Ee,ref:function(be){K.sourceElem=be}},E),oe)}}]),O}(C.default.Component);I.propTypes={children:M.default.node,targetKey:M.default.string,customDragElement:M.default.oneOfType([M.default.string,M.default.node]),disappearDraggedElement:M.default.bool,dragClone:M.default.bool,dragElemOpacity:M.default.number,dragData:M.default.object,dragHandleClassName:M.default.string,noDragging:M.default.bool,onDrop:M.default.func,onDrag:M.default.func,onDragEnd:M.default.func,onDragStart:M.default.func,render:M.default.func,xOnly:M.default.bool,yOnly:M.default.bool,zIndex:M.default.number},I.defaultProps={targetKey:"ddc",children:null,customDragElement:null,disappearDraggedElement:!1,dragClone:!1,dragElemOpacity:.9,dragData:{},dragHandleClassName:"",onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onDrop:function(){},noDragging:!1,render:null,xOnly:!1,yOnly:!1,zIndex:1e3},s.default=I},function(t,s,r){function a(_){return _&&_.__esModule?_:{default:_}}function l(_,C){if(!(_ instanceof C))throw new TypeError("Cannot call a class as a function")}function u(_,C){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!C||typeof C!="object"&&typeof C!="function"?_:C}function d(_,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);_.prototype=Object.create(C&&C.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(_,C):_.__proto__=C)}Object.defineProperty(s,"__esModule",{value:!0});var f=function(){function _(C,S){for(var M=0;M<S.length;M++){var I=S[M];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(C,I.key,I)}}return function(C,S,M){return S&&_(C.prototype,S),M&&_(C,M),C}}(),p=r(14),g=a(p),y=r(7),w=a(y),k=function(_){function C(S){l(this,C);var M=u(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,S));return M.handleDrop=function(I){var L=M.createEvent(M.props.targetKey+"Dropped",{dragData:I.dragData,dropElem:M.elem,dropData:M.props.dropData});I.containerElem.dispatchEvent(L),M.props.onHit(I),M.setState({highlighted:!1})},M.handleDragEnter=function(I){console.log("enter");var L=I;M.props.highlightClassName&&M.setState({highlighted:!0}),M.props.onDragEnter(L)},M.handleDragLeave=function(I){var L=I;M.props.highlightClassName&&M.setState({highlighted:!1}),M.props.onDragLeave(L)},M.elem=null,M.state={highlighted:!1},M}return d(C,_),f(C,[{key:"componentDidMount",value:function(){this.elem.addEventListener(this.props.targetKey+"DragEnter",this.handleDragEnter,!1),this.elem.addEventListener(this.props.targetKey+"DragLeave",this.handleDragLeave,!1),this.elem.addEventListener(this.props.targetKey+"Drop",this.handleDrop,!1)}},{key:"createEvent",value:function(S,M){var I=void 0;return typeof window.CustomEvent!="function"?(I=document.createEvent("CustomEvent"),I.initCustomEvent(S,!0,!0,{})):I=new CustomEvent(S,{bubbles:!0,cancelable:!0}),Object.assign(I,M),I}},{key:"render",value:function(){var S=this,M="droptarget "+(this.state.highlighted?this.props.highlightClassName:"");return g.default.createElement("span",{ref:function(I){S.elem=I},className:M},this.props.render?this.props.render():this.props.children)}}]),C}(g.default.Component);k.propTypes={children:w.default.node,render:w.default.func,highlightClassName:w.default.string,targetKey:w.default.string,dropData:w.default.object,onDragEnter:w.default.func,onDragLeave:w.default.func,onHit:w.default.func},k.defaultProps={children:null,targetKey:"ddc",onDragEnter:function(){},onDragLeave:function(){},onHit:function(){return function(){}},dropData:{},highlightClassName:"highlighted",render:null},s.default=k},function(t,s,r){function a(p){return p&&p.__esModule?p:{default:p}}var l=r(15),u=a(l),d=r(16),f=a(d);t.exports={DragDropContainer:u.default,DropTarget:f.default}},function(t,s,r){function a(g){return g}function l(g,y,w){function k(te,B){var Z=R.hasOwnProperty(B)?R[B]:null;Ee.hasOwnProperty(B)&&f(Z==="OVERRIDE_BASE","ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",B),te&&f(Z==="DEFINE_MANY"||Z==="DEFINE_MANY_MERGED","ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",B)}function _(te,B){if(B){f(typeof B!="function","ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),f(!y(B),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var Z=te.prototype,X=Z.__reactAutoBindPairs;B.hasOwnProperty(p)&&J.mixins(te,B.mixins);for(var ne in B)if(B.hasOwnProperty(ne)&&ne!==p){var D=B[ne],$=Z.hasOwnProperty(ne);if(k($,ne),J.hasOwnProperty(ne))J[ne](te,D);else{var ie=R.hasOwnProperty(ne),ge=typeof D=="function",le=ge&&!ie&&!$&&B.autobind!==!1;if(le)X.push(ne,D),Z[ne]=D;else if($){var se=R[ne];f(ie&&(se==="DEFINE_MANY_MERGED"||se==="DEFINE_MANY"),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",se,ne),se==="DEFINE_MANY_MERGED"?Z[ne]=M(Z[ne],D):se==="DEFINE_MANY"&&(Z[ne]=I(Z[ne],D))}else Z[ne]=D}}}}function C(te,B){if(B)for(var Z in B){var X=B[Z];if(B.hasOwnProperty(Z)){var ne=Z in J;f(!ne,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',Z);var D=Z in te;if(D){var $=F.hasOwnProperty(Z)?F[Z]:null;return f($==="DEFINE_MANY_MERGED","ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",Z),void(te[Z]=M(te[Z],X))}te[Z]=X}}}function S(te,B){f(te&&B&&typeof te=="object"&&typeof B=="object","mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var Z in B)B.hasOwnProperty(Z)&&(f(te[Z]===void 0,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",Z),te[Z]=B[Z]);return te}function M(te,B){return function(){var Z=te.apply(this,arguments),X=B.apply(this,arguments);if(Z==null)return X;if(X==null)return Z;var ne={};return S(ne,Z),S(ne,X),ne}}function I(te,B){return function(){te.apply(this,arguments),B.apply(this,arguments)}}function L(te,B){var Z=B.bind(te);return Z}function O(te){for(var B=te.__reactAutoBindPairs,Z=0;Z<B.length;Z+=2){var X=B[Z],ne=B[Z+1];te[X]=L(te,ne)}}function K(te){var B=function(X,ne,D){this.__reactAutoBindPairs.length&&O(this),this.props=X,this.context=ne,this.refs=d,this.updater=D||w,this.state=null;var $=this.getInitialState?this.getInitialState():null;f(typeof $=="object"&&!Array.isArray($),"%s.getInitialState(): must return an object or null",B.displayName||"ReactCompositeComponent"),this.state=$};B.prototype=new be,B.prototype.constructor=B,B.prototype.__reactAutoBindPairs=[],E.forEach(_.bind(null,B)),_(B,oe),_(B,te),_(B,Ne),B.getDefaultProps&&(B.defaultProps=B.getDefaultProps()),f(B.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var Z in R)B.prototype[Z]||(B.prototype[Z]=null);return B}var E=[],R={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},F={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},J={displayName:function(te,B){te.displayName=B},mixins:function(te,B){if(B)for(var Z=0;Z<B.length;Z++)_(te,B[Z])},childContextTypes:function(te,B){te.childContextTypes=u({},te.childContextTypes,B)},contextTypes:function(te,B){te.contextTypes=u({},te.contextTypes,B)},getDefaultProps:function(te,B){te.getDefaultProps?te.getDefaultProps=M(te.getDefaultProps,B):te.getDefaultProps=B},propTypes:function(te,B){te.propTypes=u({},te.propTypes,B)},statics:function(te,B){C(te,B)},autobind:function(){}},oe={componentDidMount:function(){this.__isMounted=!0}},Ne={componentWillUnmount:function(){this.__isMounted=!1}},Ee={replaceState:function(te,B){this.updater.enqueueReplaceState(this,te,B)},isMounted:function(){return!!this.__isMounted}},be=function(){};return u(be.prototype,g.prototype,Ee),K}var u=r(2),d=r(6),f=r(1),p="mixins";t.exports=l},function(t,s,r){function a(l,u,d,f,p){}t.exports=a},function(t,s,r){var a=r(22);t.exports=function(l){return a(l,!1)}},function(t,s,r){function a(){}var l=r(8);t.exports=function(){function u(p,g,y,w,k,_){if(_!==l){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}function d(){return u}u.isRequired=u;var f={array:u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:d,element:u,instanceOf:d,node:u,objectOf:d,oneOf:d,oneOfType:d,shape:d,exact:d};return f.checkPropTypes=a,f.PropTypes=f,f}},function(t,s,r){function a(){return null}var l=r(2),u=r(8),d=r(19);t.exports=function(f,p){function g(B){var Z=B&&(Ne&&B[Ne]||B[Ee]);if(typeof Z=="function")return Z}function y(B,Z){return B===Z?B!==0||1/B==1/Z:B!==B&&Z!==Z}function w(B){this.message=B,this.stack=""}function k(B){function Z(ne,D,$,ie,ge,le,se){if(ie=ie||be,le=le||$,se!==u&&p){var Me=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Me.name="Invariant Violation",Me}return D[$]==null?ne?new w(D[$]===null?"The "+ge+" `"+le+"` is marked as required in `"+ie+"`, but its value is `null`.":"The "+ge+" `"+le+"` is marked as required in `"+ie+"`, but its value is `undefined`."):null:B(D,$,ie,ge,le)}var X=Z.bind(null,!1);return X.isRequired=Z.bind(null,!0),X}function _(B){function Z(X,ne,D,$,ie,ge){var le=X[ne];return F(le)!==B?new w("Invalid "+$+" `"+ie+"` of type `"+J(le)+"` supplied to `"+D+"`, expected `"+B+"`."):null}return k(Z)}function C(B){function Z(X,ne,D,$,ie){if(typeof B!="function")return new w("Property `"+ie+"` of component `"+D+"` has invalid PropType notation inside arrayOf.");var ge=X[ne];if(!Array.isArray(ge))return new w("Invalid "+$+" `"+ie+"` of type `"+F(ge)+"` supplied to `"+D+"`, expected an array.");for(var le=0;le<ge.length;le++){var se=B(ge,le,D,$,ie+"["+le+"]",u);if(se instanceof Error)return se}return null}return k(Z)}function S(B){function Z(X,ne,D,$,ie){if(!(X[ne]instanceof B)){var ge=B.name||be;return new w("Invalid "+$+" `"+ie+"` of type `"+oe(X[ne])+"` supplied to `"+D+"`, expected instance of `"+ge+"`.")}return null}return k(Z)}function M(B){function Z(X,ne,D,$,ie){for(var ge=X[ne],le=0;le<B.length;le++)if(y(ge,B[le]))return null;return new w("Invalid "+$+" `"+ie+"` of value `"+ge+"` supplied to `"+D+"`, expected one of "+JSON.stringify(B)+".")}return Array.isArray(B)?k(Z):a}function I(B){function Z(X,ne,D,$,ie){if(typeof B!="function")return new w("Property `"+ie+"` of component `"+D+"` has invalid PropType notation inside objectOf.");var ge=X[ne],le=F(ge);if(le!=="object")return new w("Invalid "+$+" `"+ie+"` of type `"+le+"` supplied to `"+D+"`, expected an object.");for(var se in ge)if(ge.hasOwnProperty(se)){var Me=B(ge,se,D,$,ie+"."+se,u);if(Me instanceof Error)return Me}return null}return k(Z)}function L(B){function Z(D,$,ie,ge,le){for(var se=0;se<B.length;se++)if((0,B[se])(D,$,ie,ge,le,u)==null)return null;return new w("Invalid "+ge+" `"+le+"` supplied to `"+ie+"`.")}if(!Array.isArray(B))return a;for(var X=0;X<B.length;X++){var ne=B[X];if(typeof ne!="function")return a}return k(Z)}function O(B){function Z(X,ne,D,$,ie){var ge=X[ne],le=F(ge);if(le!=="object")return new w("Invalid "+$+" `"+ie+"` of type `"+le+"` supplied to `"+D+"`, expected `object`.");for(var se in B){var Me=B[se];if(Me){var He=Me(ge,se,D,$,ie+"."+se,u);if(He)return He}}return null}return k(Z)}function K(B){function Z(X,ne,D,$,ie){var ge=X[ne],le=F(ge);if(le!=="object")return new w("Invalid "+$+" `"+ie+"` of type `"+le+"` supplied to `"+D+"`, expected `object`.");var se=l({},X[ne],B);for(var Me in se){var He=B[Me];if(!He)return new w("Invalid "+$+" `"+ie+"` key `"+Me+"` supplied to `"+D+"`.\nBad object: "+JSON.stringify(X[ne],null," ")+`
|
512
|
+
Valid keys: `+JSON.stringify(Object.keys(B),null," "));var Re=He(ge,Me,D,$,ie+"."+Me,u);if(Re)return Re}return null}return k(Z)}function E(B){switch(typeof B){case"number":case"string":case"undefined":return!0;case"boolean":return!B;case"object":if(Array.isArray(B))return B.every(E);if(B===null||f(B))return!0;var Z=g(B);if(!Z)return!1;var X,ne=Z.call(B);if(Z!==B.entries){for(;!(X=ne.next()).done;)if(!E(X.value))return!1}else for(;!(X=ne.next()).done;){var D=X.value;if(D&&!E(D[1]))return!1}return!0;default:return!1}}function R(B,Z){return B==="symbol"||Z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Z instanceof Symbol}function F(B){var Z=typeof B;return Array.isArray(B)?"array":B instanceof RegExp?"object":R(Z,B)?"symbol":Z}function J(B){if(B==null)return""+B;var Z=F(B);if(Z==="object"){if(B instanceof Date)return"date";if(B instanceof RegExp)return"regexp"}return Z}function oe(B){return B.constructor&&B.constructor.name?B.constructor.name:be}var Ne=typeof Symbol=="function"&&Symbol.iterator,Ee="@@iterator",be="<<anonymous>>",te={array:_("array"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:function(){return k(a)}(),arrayOf:C,element:function(){function B(Z,X,ne,D,$){var ie=Z[X];return f(ie)?null:new w("Invalid "+D+" `"+$+"` of type `"+F(ie)+"` supplied to `"+ne+"`, expected a single ReactElement.")}return k(B)}(),instanceOf:S,node:function(){function B(Z,X,ne,D,$){return E(Z[X])?null:new w("Invalid "+D+" `"+$+"` supplied to `"+ne+"`, expected a ReactNode.")}return k(B)}(),objectOf:I,oneOf:M,oneOfType:L,shape:O,exact:K};return w.prototype=Error.prototype,te.checkPropTypes=d,te.PropTypes=te,te}},function(t,s,r){function a(d){var f={"=":"=0",":":"=2"};return"$"+(""+d).replace(/[=:]/g,function(p){return f[p]})}function l(d){var f=/(=0|=2)/g,p={"=0":"=","=2":":"};return(""+(d[0]==="."&&d[1]==="$"?d.substring(2):d.substring(1))).replace(f,function(g){return p[g]})}var u={escape:a,unescape:l};t.exports=u},function(t,s,r){var a=r(3),l=(r(1),function(k){var _=this;if(_.instancePool.length){var C=_.instancePool.pop();return _.call(C,k),C}return new _(k)}),u=function(k,_){var C=this;if(C.instancePool.length){var S=C.instancePool.pop();return C.call(S,k,_),S}return new C(k,_)},d=function(k,_,C){var S=this;if(S.instancePool.length){var M=S.instancePool.pop();return S.call(M,k,_,C),M}return new S(k,_,C)},f=function(k,_,C,S){var M=this;if(M.instancePool.length){var I=M.instancePool.pop();return M.call(I,k,_,C,S),I}return new M(k,_,C,S)},p=function(k){var _=this;k instanceof _||a("25"),k.destructor(),_.instancePool.length<_.poolSize&&_.instancePool.push(k)},g=l,y=function(k,_){var C=k;return C.instancePool=[],C.getPooled=_||g,C.poolSize||(C.poolSize=10),C.release=p,C},w={addPoolingTo:y,oneArgumentPooler:l,twoArgumentPooler:u,threeArgumentPooler:d,fourArgumentPooler:f};t.exports=w},function(t,s,r){var a=r(2),l=r(9),u=r(26),d=r(27),f=r(0),p=r(28),g=r(29),y=r(30),w=r(33),k=f.createElement,_=f.createFactory,C=f.cloneElement,S=a,M=function(L){return L},I={Children:{map:u.map,forEach:u.forEach,count:u.count,toArray:u.toArray,only:w},Component:l.Component,PureComponent:l.PureComponent,createElement:k,cloneElement:C,isValidElement:f.isValidElement,PropTypes:p,createClass:y,createFactory:_,createMixin:M,DOM:d,version:g,__spread:S};t.exports=I},function(t,s,r){function a(R){return(""+R).replace(K,"$&/")}function l(R,F){this.func=R,this.context=F,this.count=0}function u(R,F,J){var oe=R.func,Ne=R.context;oe.call(Ne,F,R.count++)}function d(R,F,J){if(R==null)return R;var oe=l.getPooled(F,J);I(R,u,oe),l.release(oe)}function f(R,F,J,oe){this.result=R,this.keyPrefix=F,this.func=J,this.context=oe,this.count=0}function p(R,F,J){var oe=R.result,Ne=R.keyPrefix,Ee=R.func,be=R.context,te=Ee.call(be,F,R.count++);Array.isArray(te)?g(te,oe,J,M.thatReturnsArgument):te!=null&&(S.isValidElement(te)&&(te=S.cloneAndReplaceKey(te,Ne+(!te.key||F&&F.key===te.key?"":a(te.key)+"/")+J)),oe.push(te))}function g(R,F,J,oe,Ne){var Ee="";J!=null&&(Ee=a(J)+"/");var be=f.getPooled(F,Ee,oe,Ne);I(R,p,be),f.release(be)}function y(R,F,J){if(R==null)return R;var oe=[];return g(R,oe,null,F,J),oe}function w(R,F,J){return null}function k(R,F){return I(R,w,null)}function _(R){var F=[];return g(R,F,null,M.thatReturnsArgument),F}var C=r(24),S=r(0),M=r(5),I=r(34),L=C.twoArgumentPooler,O=C.fourArgumentPooler,K=/\/+/g;l.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},C.addPoolingTo(l,L),f.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},C.addPoolingTo(f,O);var E={forEach:d,map:y,mapIntoWithKeyPrefixInternal:g,count:k,toArray:_};t.exports=E},function(t,s,r){var a=r(0),l=a.createFactory,u={a:l("a"),abbr:l("abbr"),address:l("address"),area:l("area"),article:l("article"),aside:l("aside"),audio:l("audio"),b:l("b"),base:l("base"),bdi:l("bdi"),bdo:l("bdo"),big:l("big"),blockquote:l("blockquote"),body:l("body"),br:l("br"),button:l("button"),canvas:l("canvas"),caption:l("caption"),cite:l("cite"),code:l("code"),col:l("col"),colgroup:l("colgroup"),data:l("data"),datalist:l("datalist"),dd:l("dd"),del:l("del"),details:l("details"),dfn:l("dfn"),dialog:l("dialog"),div:l("div"),dl:l("dl"),dt:l("dt"),em:l("em"),embed:l("embed"),fieldset:l("fieldset"),figcaption:l("figcaption"),figure:l("figure"),footer:l("footer"),form:l("form"),h1:l("h1"),h2:l("h2"),h3:l("h3"),h4:l("h4"),h5:l("h5"),h6:l("h6"),head:l("head"),header:l("header"),hgroup:l("hgroup"),hr:l("hr"),html:l("html"),i:l("i"),iframe:l("iframe"),img:l("img"),input:l("input"),ins:l("ins"),kbd:l("kbd"),keygen:l("keygen"),label:l("label"),legend:l("legend"),li:l("li"),link:l("link"),main:l("main"),map:l("map"),mark:l("mark"),menu:l("menu"),menuitem:l("menuitem"),meta:l("meta"),meter:l("meter"),nav:l("nav"),noscript:l("noscript"),object:l("object"),ol:l("ol"),optgroup:l("optgroup"),option:l("option"),output:l("output"),p:l("p"),param:l("param"),picture:l("picture"),pre:l("pre"),progress:l("progress"),q:l("q"),rp:l("rp"),rt:l("rt"),ruby:l("ruby"),s:l("s"),samp:l("samp"),script:l("script"),section:l("section"),select:l("select"),small:l("small"),source:l("source"),span:l("span"),strong:l("strong"),style:l("style"),sub:l("sub"),summary:l("summary"),sup:l("sup"),table:l("table"),tbody:l("tbody"),td:l("td"),textarea:l("textarea"),tfoot:l("tfoot"),th:l("th"),thead:l("thead"),time:l("time"),title:l("title"),tr:l("tr"),track:l("track"),u:l("u"),ul:l("ul"),var:l("var"),video:l("video"),wbr:l("wbr"),circle:l("circle"),clipPath:l("clipPath"),defs:l("defs"),ellipse:l("ellipse"),g:l("g"),image:l("image"),line:l("line"),linearGradient:l("linearGradient"),mask:l("mask"),path:l("path"),pattern:l("pattern"),polygon:l("polygon"),polyline:l("polyline"),radialGradient:l("radialGradient"),rect:l("rect"),stop:l("stop"),svg:l("svg"),text:l("text"),tspan:l("tspan")};t.exports=u},function(t,s,r){var a=r(0),l=a.isValidElement,u=r(20);t.exports=u(l)},function(t,s,r){t.exports="15.6.2"},function(t,s,r){var a=r(9),l=a.Component,u=r(0),d=u.isValidElement,f=r(12),p=r(18);t.exports=p(l,d,f)},function(t,s,r){function a(d){var f=d&&(l&&d[l]||d[u]);if(typeof f=="function")return f}var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";t.exports=a},function(t,s,r){var a=function(){};t.exports=a},function(t,s,r){function a(d){return u.isValidElement(d)||l("143"),d}var l=r(3),u=r(0);r(1),t.exports=a},function(t,s,r){function a(k,_){return k&&typeof k=="object"&&k.key!=null?g.escape(k.key):_.toString(36)}function l(k,_,C,S){var M=typeof k;if(M!=="undefined"&&M!=="boolean"||(k=null),k===null||M==="string"||M==="number"||M==="object"&&k.$$typeof===f)return C(S,k,_===""?y+a(k,0):_),1;var I,L,O=0,K=_===""?y:_+w;if(Array.isArray(k))for(var E=0;E<k.length;E++)I=k[E],L=K+a(I,E),O+=l(I,L,C,S);else{var R=p(k);if(R){var F,J=R.call(k);if(R!==k.entries)for(var oe=0;!(F=J.next()).done;)I=F.value,L=K+a(I,oe++),O+=l(I,L,C,S);else for(;!(F=J.next()).done;){var Ne=F.value;Ne&&(I=Ne[1],L=K+g.escape(Ne[0])+w+a(I,0),O+=l(I,L,C,S))}}else if(M==="object"){var Ee="",be=String(k);d("31",be==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":be,Ee)}}return O}function u(k,_,C){return k==null?0:l(k,"",_,C)}var d=r(3),f=(r(10),r(11)),p=r(31),g=(r(1),r(23)),y=(r(4),"."),w=":";t.exports=u}])})}($l)),$l.exports}var w1=Rj();const Pj=({onFile:n,className:e,...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState(),u=v.useCallback(p=>{r(!1),l(p),n(p)},[n]),d=v.useCallback(p=>{p.preventDefault(),u(p.currentTarget.files)},[u]),f=s?"border-teal-600":"border-gray-300 ";return c.jsxs("label",{className:`flex flex-col justify-center items-center p-2
|
513
|
+
rounded-lg border-4 border-dashed cursor-pointer
|
514
|
+
shelf-media-source ${f} ${e}`,children:[c.jsxs("div",{className:"flex flex-col justify-center items-center",children:[c.jsx(Ib,{className:"w-10 h-10 text-gray-500 dark:text-gray-400"}),c.jsx("p",{className:"text-lg text-gray-500 mt-0 font-thin",children:"Camera"})]}),c.jsx("input",{type:"file",className:"hidden",capture:!0,accept:"image/*",onChange:d})]})},zj=({onFile:n,className:e,...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState(!1),[u,d]=v.useState();v.useEffect(()=>{r(Av())},[]);const f=v.useCallback(C=>{l(!1),d(C),n(C)},[n]),p=v.useCallback(C=>{C.preventDefault(),f(C.dataTransfer.files)},[f]),g=v.useCallback(C=>{C.preventDefault(),f(C.currentTarget.files)},[f]),y=v.useCallback(C=>{C.preventDefault()},[]),w=v.useCallback(C=>{C.preventDefault(),l(!1)},[]),k=v.useCallback(C=>{C.preventDefault(),l(!0)},[]),_=a?"border-teal-600":"border-gray-300 ";return c.jsxs("label",{onDrop:p,onDragEnter:y,onDragOver:k,onDragLeave:w,htmlFor:"dropzone-file",className:`flex flex-col justify-center items-center p-2
|
515
|
+
shelf-media-source
|
516
|
+
border-4 border-dashed cursor-pointer rounded-lg
|
517
|
+
${_} ${e}`,children:[c.jsxs("div",{className:`flex flex-col justify-center items-center
|
518
|
+
text-gray-500 dark:text-gray-400`,children:[c.jsx(nk,{className:"w-10 h-10 text-gray-400"}),c.jsx("p",{className:"text-lg --text-gray-500 --mt-3 font-light",children:"browse local"}),c.jsxs(_e,{show:!s,children:[c.jsx("p",{className:"text-xs --text-gray-500",children:"or"}),c.jsx("p",{className:"text-sm --text-gray-500 font-semibold",children:"DRAG & DROP"})]})]}),c.jsx("input",{id:"dropzone-file",type:"file",className:"hidden",accept:"image/*",multiple:!0,onChange:g})]})},Bj=({onFinish:n,className:e,...t})=>{const s=v.useRef(void 0);return c.jsxs(c.Fragment,{children:[c.jsx("label",{onClick:()=>s.current.show(),className:`flex flex-col justify-center items-center p-2
|
519
|
+
shelf-media-source rounded-lg
|
520
|
+
border-4 border-dashed cursor-pointer
|
521
|
+
${e}`,...t,children:c.jsxs("div",{className:"flex flex-col justify-center items-center",children:[c.jsx(d3,{className:"w-10 h-10 text-gray-400 stroke-red-400"}),c.jsx("p",{className:"text-lg text-gray-500 dark:text-gray-400 font-thin",children:"browse"}),c.jsx("p",{className:"text-xl text-gray-400 font-semibold",children:"Gallery"})]})}),c.jsx(ly,{ref:s,onSelect:r=>n(r.url)},"gallery")]})},Vj=({onFinish:n,className:e,...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState(),[u,d]=v.useState(void 0),f=v.useCallback(g=>{if(g===void 0)return;let y=/\b(https?:\/\/.*?\.[a-z]{2,4}\/[^\s]*\b)/g;d(void 0),g.match(y)?n(g,s):d("Bad URL")},[s,n]),p=v.useCallback(async()=>{const g=await pd();g!==void 0&&(l(g),f(g))},[f]);return c.jsx("div",{className:`p-3 --h-32 shelf-text-minor
|
522
|
+
text-xs font-semibold
|
523
|
+
rounded-lg shelf-media-source
|
524
|
+
border-4 border-dashed cursor-pointer
|
525
|
+
${e}`,children:c.jsxs("div",{className:"flex flex-col justify-start items-center ",children:[c.jsxs("div",{className:"flex flex-row justify-between items-center w-full mb-3",children:[c.jsx(Xt,{children:"from url",className:"w-fit h-9",onClick:g=>f(a)}),c.jsx(tk,{className:"text-2xl text-kf-400",onClick:p}),c.jsxs("label",{htmlFor:"cb_url",className:"flex flex-row items-center",children:[c.jsx("span",{children:"edit",className:"text-center align-middle"}),c.jsx("input",{id:"cb_url",type:"checkbox",className:`ml-1 accent-pink-500 w-4 h-4
|
526
|
+
bg-white dark:bg-slate-600`,onChange:g=>r(g.currentTarget.checked)})]})]}),c.jsx("p",{children:u??"",className:"text-red-600"}),c.jsx(Qe,{className:"mt-1 w-full",placeholder:"from URL..",type:"text",value:a,onChange:g=>l(g.currentTarget.value)})]})})},Ri=({field:n,value:e=[],onChange:t,className:s,...r})=>{const{sdk:a}=bt(),[l,u]=v.useState(!1),[d,f]=v.useState([]),[p,g]=v.useState(e??[]),[y,w]=v.useState(),[k,_]=v.useState("");v.useEffect(()=>{u(Av())},[]);const C=v.useCallback((E,R)=>{w(F=>{try{URL.revokeObjectURL(F)}catch{}return E}),_(R)},[]),S=v.useCallback(E=>{const R=URL.createObjectURL(E[0]);C(R,E[0].name)},[C]),M=v.useCallback((E,R=!1)=>{if(R)C(E,E);else{const F=[E,...p];g(F),t&&t(F)}},[C,p,t]),I=v.useCallback(async(E,R,F,J,oe)=>{if(C(void 0),E==null)return;const Ne=URL.createObjectURL(E),Ee=Date.now();f(be=>[{status:"working",id:Ee,preview:Ne},...be]),F=decodeURIComponent(F.toString()).split("/").pop(),F.includes(".")&&(F=F.split(".").slice(0,-1).join(".")),F=`${F}_${Date.now()}_w_${J}_h_${oe}.${R}`;try{const be=`images/${F}`;if(!await a.storage.putBytes(be,E))throw"wow";const Z=[`storage://${be}`,...p];g(Z),t&&t(Z),f(X=>X.filter(ne=>ne.id!==Ee)),URL.revokeObjectURL(Ne)}catch(be){console.log(be),f(te=>{let B=te.find(Z=>Z.id===Ee);return B.status="failed",B.error_code=be.code,[...te]})}},[C,p,t]),L=v.useCallback(E=>{console.log(E,p);const R=[...p];R.splice(E,1),g(R),t&&t(R)},[p,t]),O=v.useCallback(E=>{C(p[E],p[E])},[p,C]),K=v.useCallback((E,R)=>{console.log(E,"-",R);const F=[...p],J=F[R];F[R]=F[E],F[E]=J,g(F),t&&t(F)},[p,t]);return c.jsxs("div",{className:s,children:[c.jsxs("div",{className:"w-full flex flex-row flex-wrap gap-3",children:[l&&c.jsx(Pj,{onFile:S,className:"flex-1 min-w-fit h-32"}),c.jsx(zj,{onFile:S,className:"flex-1 min-w-fit h-32"}),c.jsx(Vj,{onFinish:M,className:"flex-1 min-w-fit h-32"}),c.jsx(Bj,{onFinish:M,className:"flex-1 min-w-fit h-32"})]}),c.jsx(_e,{show:y,children:c.jsx(Mj,{onComplete:I,name:k,source:y,className:`w-full mt-6
|
527
|
+
shelf-border-color border
|
528
|
+
bg-slate-200 dark:bg-slate-200/10
|
529
|
+
rounded-3xl overflow-clip`})}),c.jsx($j,{urls:p,uploads:d,onImageOrder:K,onImageClick:O,onImageRemove:L})]})},$j=({urls:n,uploads:e,onImageClick:t,onImageRemove:s,onImageOrder:r,className:a,...l})=>{const[u,d]=v.useState(-1),[f,p]=v.useState(-1),g=v.useRef(void 0),y=v.useCallback((C,S)=>{g.current=S,S.dragElem.style.display="block",d(C)},[]),w=v.useCallback((C,S)=>{u==C&&d(-1)},[u]),k=v.useCallback((C,S)=>{d(-1),r(C,parseInt(S.dragData))},[r]),_=v.useCallback((C,S,M,I)=>{var L;(L=g.current)!=null&&L.dragElem&&(g.current.dragElem.style.display="none"),g.current=void 0},[]);return c.jsxs("div",{className:"w-full overflow-x-auto h-fit mt-6",children:[c.jsxs("div",{className:`text-gray-400 whitespace-pre-wrap
|
530
|
+
text-sm tracking-wider flex flex-col gap-1`,children:[c.jsxs("div",{className:"",children:[c.jsx("span",{children:"tip",className:`rounded-md inline --border px-1
|
531
|
+
bg-pink-50 dark:bg-pink-50/10
|
532
|
+
text-kf-500 dark:text-kf-400 `})," Click on an image icon to open the image editor."]}),c.jsxs("div",{className:"",children:[c.jsx("span",{children:"tip",className:`rounded-md inline --border px-1
|
533
|
+
bg-pink-50 dark:bg-pink-50/10
|
534
|
+
text-kf-500 dark:text-kf-400 `})," Drag and Drop thumbnails to change images order."]})]}),c.jsx(lt,{className:"my-4"}),c.jsxs("div",{className:`flex flex-row justify-start flex-wrap w-full
|
535
|
+
h-fit gap-3 `,children:[e==null?void 0:e.map((C,S)=>c.jsx("div",{className:"py-3 w-24 h-24 relative --bg-red-200",children:c.jsxs("div",{className:"relative w-20 h-20",children:[c.jsx(oc,{src:C.preview,crossOrigin:"anonymous",className:`object-cover w-20 h-20 rounded-xl shadow-lg
|
536
|
+
border border-black opacity-30 relative`}),c.jsx("div",{className:`w-full h-full --bg-red-400 absolute top-0 flex
|
537
|
+
flex-row animate-spin justify-center items-center`,children:c.jsx(Y1,{className:"text-5xl text-gray-500"})})]})},S)),n==null?void 0:n.map((C,S)=>c.jsx(w1.DragDropContainer,{dragData:S,dragClone:!0,targetKey:"obi",onDragEnd:_,children:c.jsx(w1.DropTarget,{onDragEnter:M=>y(S,M),onDragLeave:M=>w(S,M),onHit:M=>k(S,M),targetKey:"obi",children:c.jsxs("div",{className:"py-3 w-24 h-24 relative",id:`urls_draggable_${S+e.length}`,children:[c.jsx(oc,{src:C,onClick:M=>t(S),crossOrigin:"anonymous",className:"object-cover cursor-pointer w-20 h-20 rounded-xl ---transition-transform shadow-lg border-2 border-black opacity-100 "+(f!=S&&u==S?"border-kf-500 scale-110 ":"")}),c.jsx(Wd,{onClick:M=>s(S),className:`text-black dark:text-gray-400 cursor-pointer
|
538
|
+
text-2xl absolute top-0 right-0`})]})})},`urls_draggable_${S+e.length}`))]})]})},Fj=({context:n,product:e,onRemove:t})=>{const{navWithState:s}=Gn(),r=v.useCallback(()=>{const a=n==null?void 0:n.getState();s(`/pages/products/${e.handle}`,a)},[s,e,n]);return c.jsxs("div",{className:`w-full flex flex-row justify-between
|
539
|
+
items-center py-3 border-b shelf-border-color`,children:[c.jsx(bi,{children:c.jsx("a",{onClick:r,className:"cursor-pointer",children:c.jsx("span",{children:e==null?void 0:e.title})})}),c.jsx(Yl,{className:`cursor-pointer h-6 w-9 pl-3
|
540
|
+
border-l shelf-border-color
|
541
|
+
flex-shrink-0`,onClick:t})]})},Hj=({field:n,context:e,value:t=[],onChange:s,setError:r,...a})=>{const[l,u]=v.useState(t??[]),d=v.useRef(void 0),f=v.useCallback(g=>{const y=[...g.filter(w=>l.find(k=>k.handle===w.handle)===void 0),...l];u(y),console.log("pra",y),s&&s(y),d.current.hide()},[l,s]),p=v.useCallback(g=>{const y=l.filter(w=>w.handle!==g);u(y),s&&s(y)},[l,s]);return c.jsxs("div",{...a,children:[c.jsx(Xt,{children:"Browse products",stroke:"border-2",className:"w-40 h-10 mx-auto",onClick:()=>d.current.show()}),c.jsx(Is,{ref:d,children:c.jsx(ro,{onSave:f,onCancel:()=>d.current.hide()})}),(l==null?void 0:l.length)>0&&c.jsx(lt,{className:"mt-5"}),l.map(g=>c.jsx(Fj,{product:g,context:e,onRemove:()=>p(g.handle)},g.handle))]})},Uj=({option:n,onRemove:e,onChange:t})=>{var p;const[s,r]=v.useState(n),a=v.useRef(void 0),l=v.useCallback(g=>{r(g),t&&t(g)},[t]),u=v.useCallback(g=>{var w;const y={...s,values:[...(w=s==null?void 0:s.values)==null?void 0:w.filter(k=>(k==null?void 0:k.id)!==(g==null?void 0:g.id))]};l(y)},[s,l]),d=v.useCallback(g=>{const y=g.currentTarget.value,w={...s,name:y};l(w)},[s,l]),f=v.useCallback(g=>{var C;const y=String(a.current.value);if((y==null?void 0:y.trim())==="")return;const w={id:$a(),value:y};if((C=s==null?void 0:s.values)==null?void 0:C.some(S=>S.value===w.value))return;const _={...s,values:[w,...(s==null?void 0:s.values)??[]]};l(_)},[s,$a,l]);return c.jsxs("div",{className:"relative w-full shadow-md",children:[c.jsxs("fieldset",{className:"border shelf-border-color p-5 ",children:[c.jsx("legend",{className:"text-base",children:c.jsx(Qe,{ref:a,placeholder:"Option Name",from:"from-kf-400",to:"to-pink-400/25",inputClsName:" text-base px-1 shelf-input-color hover:ring-pink-400 hover:ring-2 rounded-md h-10",overrideClass:!0,onChange:d,value:s==null?void 0:s.name,type:"text",rounded:"rounded-md"})}),c.jsx(_e,{show:(((p=s==null?void 0:s.values)==null?void 0:p.length)??0)>0,children:c.jsx(ps,{tags:s==null?void 0:s.values,name_fn:g=>g==null?void 0:g.value,onRemove:u,onClick:u})}),c.jsxs("div",{className:"flex flex-row items-center h-fit w-full mt-5 gap-3",children:[c.jsx(Qe,{ref:a,placeholder:"Add new option",inputClsName:"text-base px-1 shelf-card w-full rounded-md h-10 hover:ring-pink-400 hover:ring-2",overrideClass:!0,type:"text",className:"mt-1 flex-1",rounded:"rounded-md",stroke:"border-b"}),c.jsx(Xt,{children:"add",className:"h-10 ",onClick:f})]})]}),c.jsx(X1,{className:"absolute right-0 top-0 cursor-pointer text-xl",onClick:g=>e(s)})]})},Wj=({options:n=[],onChange:e})=>{const[t,s]=v.useState(n),r=v.useCallback(u=>{const d=t==null?void 0:t.findIndex(p=>p.id===u.id);if(d<0)return;let f=[...t];f[d]=u,s(f),e&&e(f)},[t,e]),a=v.useCallback(u=>{let d=[...t.filter(f=>f.id!==u.id)];s(d),e&&e(d)},[t,e]),l=v.useCallback(()=>{const u={id:$a(),name:"",values:[]},d=[...t,u];s(d),e&&e(d)},[t,e]);return c.jsxs("div",{className:"w-full flex flex-col gap-5 items-center",children:[n.map(u=>c.jsx(Uj,{option:u,onRemove:a,onChange:r},u==null?void 0:u.id)),c.jsx(qa,{onClick:l,Icon:J1,className:`cursor-pointer text-6xl hover:scale-110
|
542
|
+
transition-transform`})]})},cy=(n,e=[])=>{let t=[];if(n==e.length)return[];if(n==e.length-1)return e[n].map(r=>[r]);let s=cy(n+1,e)??[[]];for(let r=0;r<e[n].length;r++)for(let a=0;a<s.length;a++){const l=[e[n][r],...s[a]];t.push(l)}return t},Yj=(n,e)=>n.every(t=>e.some(s=>s.option_id===t.option_id&&s.value_id===t.value_id)),Kj=({combination:n,options:e,context:t,setError:s})=>{var g,y;v.useEffect(()=>{t==null||t.query.all.get()},[t]);const r=v.useMemo(()=>n.map(w=>e.find(k=>k.id===w.option_id).values.find(k=>k.id==w.value_id).value).join(" / "),[n,e]),a=(y=(g=t==null?void 0:t.data)==null?void 0:g.variants)==null?void 0:y.reduce((w,k)=>(w[k.handle]={product:k,selection:k.variant_hint},w),{}),l=v.useMemo(()=>{var w,k;return a&&((k=(w=Object.values(a).find(_=>Yj(n,_.selection)))==null?void 0:w.product)==null?void 0:k.handle)},[a,n]),{navWithState:u}=Gn(),d=v.useCallback(async()=>{const w=(t==null?void 0:t.getState)&&(t==null?void 0:t.getState()),k=`/pages/products/${l}`;u(k,w)},[l,u,t]),f=v.useCallback(async()=>{try{t!=null&&t.removeVariant&&await t.removeVariant(l)}catch(w){console.log(w),s("There was a problem removing the variant 😔")}},[l,u,t]),p=v.useCallback(async()=>{try{await(t==null?void 0:t.preCreateVariant());const w=t==null?void 0:t.getState(),k={...t==null?void 0:t.data,...w==null?void 0:w.data},_={data:{...k,handle:void 0,id:void 0,parent_handle:k.handle,parent_id:k.id,variant_hint:n,title:`${k.title} ${r}`},hasChanged:!0};u("/pages/products/create",w,_)}catch(w){s("Unable to save this parent document 😔"),console.error(w)}},[t,u,n,r]);return c.jsxs("div",{className:`w-full flex flex-row justify-between
|
543
|
+
shelf-border-color border-b pb-3`,children:[c.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[c.jsx(_e,{show:!!l,children:c.jsx(U1,{className:"text-lg text-green-500"})}),c.jsx("p",{children:r,className:"text-base font-medium flex-1"})]}),c.jsxs(Qd,{toggle:!!l,children:[c.jsxs("div",{className:"flex flex-row gap-3 flex-shrink-0 items-center",children:[c.jsx(bi,{children:c.jsx(ls,{Icon:void 0,text:"remove",show:!0,onClick:f,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit underline "})}),c.jsx("span",{children:"/",className:"font-normal text-xl"}),c.jsx(bi,{children:c.jsx("span",{children:"view",className:"cursor-pointer",onClick:d})})]}),c.jsx(bi,{children:c.jsx(ls,{Icon:void 0,text:"create",show:!0,onClick:p,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit underline "})})]})]})},Qj=({options:n,context:e,setError:t})=>{const s=v.useMemo(()=>{const r=n==null?void 0:n.map(l=>l.values.map(u=>({option_id:l.id,value_id:u.id}))).filter(l=>l.length>=2);return cy(0,r)},[n]);return c.jsx("div",{className:"w-full flex flex-col gap-2",children:s.map(r=>c.jsx(Kj,{combination:r,context:e,options:n,setError:t},r==null?void 0:r.map(a=>a.value_id).join("_")))})},Zj="‼️ Create at least ONE Option with two values",Gj=({context:n,...e})=>{const t=n==null?void 0:n.data;return c.jsxs("div",{className:"text-base",children:[c.jsx("span",{children:"This product is a variant of "}),c.jsx(to,{to:`/pages/products/${t==null?void 0:t.parent_handle}`,current_state:n==null?void 0:n.getState,children:c.jsx(bi,{children:t==null?void 0:t.parent_handle})})]})},Jj=({value:n,onChange:e,context:t,setError:s,...r})=>{var d,f;const[a,l]=v.useState(n),u=v.useCallback(p=>{l(p),e&&e(p)},[a,e]);return(d=t==null?void 0:t.data)!=null&&d.parent_handle?c.jsx(Gj,{context:t}):(f=t==null?void 0:t.data)!=null&&f.handle?c.jsx("div",{...r,children:c.jsxs("div",{className:"flex flex-col gap-5 w-full items-center",children:[c.jsx("p",{children:"Product Options",className:"text-xl w-full font-semibold"}),c.jsx(Wj,{options:a,onChange:u}),c.jsx(lt,{className:"w-full ",dashed:!0}),c.jsxs("div",{className:"flex flex-row w-full items-center gap-1",children:[c.jsx(e4,{className:"text-xl "}),c.jsx("p",{children:"Variants",className:"text-xl w-full font-semibold"})]}),c.jsxs(Qd,{toggle:(a==null?void 0:a.length)??!1,className:"w-full",children:[c.jsx(Qj,{options:a,context:t,setError:s}),c.jsx("div",{className:"w-full shelf-text-minor-light text-base",children:Zj})]})]})}):"You have to create the product before you add variants"},qj=({value:n,onClick:e})=>c.jsxs("div",{className:`w-full flex flex-col gap-2
|
544
|
+
py-3 border-b shelf-border-color`,children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx(bi,{children:c.jsx("a",{onClick:()=>e(n),className:"cursor-pointer",children:c.jsx("span",{children:n==null?void 0:n.title})})}),c.jsx(It,{value:`**\`${n.info.details.meta.name}\`**`,className:"text-right"})]}),c.jsx(It,{value:(n==null?void 0:n.description)??"Discount does not have `description`"})]}),Xj=({field:n,context:e,value:t=[],onChange:s,setError:r,...a})=>{const l=t.length>0,{navWithState:u}=Gn(),d=v.useCallback(f=>{const p=e==null?void 0:e.getState();u(`/pages/discounts/${f.handle}`,p)},[u,e]);return c.jsxs("div",{...a,children:[c.jsx(_e,{show:!l,children:c.jsx(It,{value:"This `product` is not **eligible** for `discounts`"})}),c.jsx(_e,{show:l,children:c.jsx("div",{className:"flex flex-col max-h-52 overflow-y-scroll",children:t.map(f=>c.jsx(qj,{value:f,onClick:d},f.id))})})]})},eS={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[35rem] flex flex-col gap-5"},fields:[{key:"discounts",name:"🎁 Eligible Discounts",desc:"The following discounts may be applied to this product",comp:ce(Xj,{className:""},!0,!1),comp_params:{className:"w-full h-fit"}},{key:"title",name:"Title",type:"text",validate:!0,editable:!0,desc:"Give an accurate title of the product",comp:ce($e(Fe),{className:"h-10"},!0,!0),comp_params:{className:"w-full h-fit"}},{key:"handle",name:"🔗 Handle",type:"text",validate:!1,editable:!0,comp:ce(bc,{className:"w-full h-fit"}),desc:`Product handle uniquely identifies the product.
|
545
|
+
Will be computed automatically if not filled by the product title`,comp_params:{className:"w-full h-fit"}},{key:"isbn",name:"ISBN 𝄃𝄃𝄂𝄂𝄀𝄁𝄃𝄂𝄂𝄃",type:"text",validate:!1,editable:!0,comp:ce(Qg),desc:"Set ISBN identifier",comp_params:{className:"w-full h-fit"}},{key:"variants_options",name:"Product Variants",validate:!1,editable:!0,comp:ce(Jj,{className:"w-full h-fit"}),desc:"Product variants represent children product, that varies with options, such as SIZE / COLOR for a shirt",comp_params:{className:"w-full h-fit"}},{key:"description",name:"📝 Description",type:"text",validate:!1,editable:!0,desc:"Further describe the product you are selling",comp:ce(Os),comp_params:{className:"w-full"}},{key:"media",name:"📀 Media",type:"text",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:ce(Ri),comp_params:{className:"w-full"}},{key:"video",name:"🎥 Video",type:"text",validate:!1,editable:!0,comp:ce(Qg),desc:"Add a video, that demonstrates the product",comp_params:{className:"w-full h-fit"}},{key:"price",name:"🏷️ Price",type:"number",validate:!0,editable:!0,comp:ce($e(Fe),{className:"h-10",type:"number"}),desc:"How much will you sell the product for ?",comp_params:{className:"w-full"}},{key:"compare_at_price",name:"Compare At Price",type:"number",validate:!1,editable:!0,desc:"Compare at price reveals the competitiveness of your price",comp:ce($e(Fe),{className:"h-10",type:"number"}),comp_params:{className:"w-full"}},{key:"qty",name:"📦 Quantity",type:"number",validate:!0,editable:!0,desc:"How many units you have in stock for that product",comp:ce($e(Fe),{className:"h-10",type:"number",min:"0",step:"1"}),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},tS=n=>n,nS={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[tS({key:"active",name:"Active",validate:!0,desc:"activate or deactivate the product (It won't be published in a collection)",editable:!0,defaultValue:!0,comp:ce(no,{className:"text-gray-600"},!0),comp_params:{}}),{key:"related_products",name:"Related Products",type:"compund",validate:!1,editable:!0,desc:"Which other products are similar ? Offer your customers similar products",comp:ce(Hj)},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach attributes to products",comp:ce(Ls)},{key:"collections",name:"🗂️ Collections",type:"compund",validate:!1,editable:!0,desc:"Which collections does this product belong to ?",comp:ce(Sa,{resource:"collections",slug:"/pages/collections"})}]},sS={name:"Root",comp:We,comp_params:{className:"w-full --max-w-[35rem] --bg-red-100 items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row gap-5 mx-auto"},fields:[eS,nS]},qh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,duplicate:l,reload:u},context:d,key:f,sdk:p,doc:g,isCreateMode:y,isEditMode:w,isViewMode:k,hasChanged:_,hasLoaded:C,error:S,ref_head:M,ref_root:I}=On("products",t,"/pages/products",n,s),L=v.useCallback(()=>l({discounts:void 0,title:(g==null?void 0:g.title)+" duplicate"}),[g,l]),O=v.useMemo(()=>({...d,getState:()=>{const E=d.getState();return console.log("state",E),E==null||delete E.variants,{data:E.data,hasChanged:E.hasChanged}},removeVariant:async E=>{await p.products.remove(E),await u()},preCreateVariant:async()=>{var R,F;const E=(F=(R=I.current.get(!1))==null?void 0:R.data)==null?void 0:F.variants_options;await p.products.upsert({...g,variants_options:E})}}),[g,u,d]);let K=[t??"create"];return g&&"parent_handle"in g&&(K=[g==null?void 0:g.parent_handle,"variants",...K]),c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["products",...K],className:""}),c.jsx(gs,{doc:g,className:"mt-5",collectionId:"products"}),c.jsx(ms,{onClickSave:w?r:void 0,onClickCreate:y?r:void 0,onClickDelete:y?void 0:a,onClickDuplicate:y?void 0:L,onClickReload:y?void 0:()=>u(!1),id:t,className:"mt-5"}),c.jsx(us,{ref:M,time:g==null?void 0:g.created_at,className:"mt-8",changes_made:_},g==null?void 0:g.updated_at),c.jsx(_e,{show:C&&w||y,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:S,className:"w-full"}),c.jsx(Ln,{ref:I,context:O,field:sS,value:g??{},isViewMode:k,className:"mt-8"},f)]})})]})},rS=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],b1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,hasLoaded:a,error:l,queryCount:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("collections","/pages/collections");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(_e,{show:!l,children:c.jsx(dn,{should_onboard:f,overallCollectionCount:u,hasLoaded:a,resource:d})}),c.jsx(_e,{show:l,children:l==null?void 0:l.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
546
|
+
shelf-border-color shadow-md mt-5
|
547
|
+
dark:shadow-slate-900 `,children:[c.jsx(ds,{isCollectionEmpty:!1,ref:t,reload:g,createLink:"/pages/collections/create",searchTitle:"Search by Name or Handle",isLoading:r}),c.jsxs(_e,{show:!l&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:rS}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},iS=[{key:"title",name:"Title",comp:wt},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn}],aS=v.forwardRef(({collection_handle_or_id:n,limit:e=5,context:t,onLoaded:s,...r},a)=>{const{sdk:l}=bt(),{page:u,queryCount:d,actions:{prev:f,next:p,query:g}}=fr(`collections/${n}/products`,Oi,!1),y=df();v.useEffect(()=>{s&&s(d)},[d,s]),v.useEffect(()=>{g({limit:e,sortBy:["updated_at","id"]})},[g,e]),v.useImperativeHandle(a,()=>({refresh:()=>g({limit:e})}),[g,e]);const w=v.useMemo(()=>({getState:()=>t==null?void 0:t.getState(),editDocumentUrl:k=>`/pages/products/${k}`,deleteDocument:async k=>{const _=u.findIndex(M=>M.id===k||M.handle===k);if(_==-1)return;const C=t.data,S=u[_];await l.products.batchRemoveProductsFromCollection([S],C),u.splice(_,1),y()}}),[y,u,t]);return c.jsxs(c.Fragment,{children:[c.jsx(hn,{context:w,data:u,fields:iS}),c.jsx(_n,{prev:f,next:p,onLimitChange:void 0})]})}),oS=({value:n,context:e})=>{const{sdk:t}=bt(),[s,r]=v.useState(!1),[a,l]=v.useState(-1),[u,d]=v.useState(void 0),f=v.useRef(void 0),p=v.useRef(void 0),g=v.useCallback(async y=>{r(!0);try{await t.products.batchAddProductsToCollection(y,n),p.current.refresh()}catch{d(u)}finally{r(!1)}f.current.hide()},[u,n==null?void 0:n.handle]);return c.jsxs(Ts,{name:"🎁 Products in collection "+(a>=0?`(${a})`:""),className:"w-full --lg:w-[30rem] h-fit",border:!0,error:u,children:[c.jsxs(_e,{show:n==null?void 0:n.handle,children:[c.jsx(aS,{ref:p,collection_handle_or_id:n==null?void 0:n.handle,context:e,onLoaded:l}),c.jsx("div",{className:"flex flex-row justify-end",children:c.jsxs("div",{className:"flex flex-row items-center w-fit gap-3 mt-7",children:[c.jsx("span",{children:"Add Product",className:"text-gray-500"}),c.jsx(Je,{className:`text-gray-500 text-sm w-fit mx-auto
|
548
|
+
shadow-gray-800/25 shadow-lg hover:scale-110
|
549
|
+
transition-transform cursor-pointer`,stroke:"border-2",rounded:"rounded-full",from:"from-pink-500",to:"to-kf-500",onClick:()=>!s&&f.current.show(),children:c.jsx(W5,{className:"text-4xl text-white "+(s?"animate-spin":"")})})]})}),c.jsx(Is,{ref:f,children:c.jsx(ro,{onSave:g,onCancel:()=>f.current.hide()})})]}),c.jsx(_e,{show:!(n!=null&&n.handle),children:c.jsx("p",{children:`Only after Collection is created,
|
550
|
+
you will be able to add products here`,className:"text-2xl font-semibold text-gray-400"})})]})},lS=({collectionId:n,value:e})=>{const[t,s]=v.useState([]),[r,a]=v.useState(),{sdk:l}=bt();n=(e==null?void 0:e.handle)??n;const u=v.useCallback(async(d=!0)=>{try{a(void 0),await l.collections.bulkAddRemoveTags(n,t,d)}catch(f){console.error(f),a((f==null?void 0:f.message)??String(f))}},[t,n]);return n?c.jsxs(Ts,{name:"Add tags to all products in Collection",className:"w-full h-fit",error:r,desc:"Add/Remove all tags at once",children:[c.jsx(Ls,{className:"w-full h-fit",onChange:s}),c.jsx(lt,{className:"my-5"}),c.jsxs("div",{className:"flex flex-row justify-between w-full --mt-5",children:[c.jsx(Zn,{text:"Add Tags",keep_text_on_load:!0,className:"w-fit",onClick:d=>u(!0)}),c.jsx(Zn,{text:"Remove Tags",keep_text_on_load:!0,className:"w-fit",onClick:d=>u(!1)})]})]}):null},cS={name:"Root",comp:We,comp_params:{className:"w-full flex flex-col gap-5 max-w- lg:w-[35rem]"},fields:[{comp:oS,comp_params:{className:"w-full"}},{key:"title",name:"Title",type:"text",validate:!0,editable:!0,desc:"Give an efficient title to the collection, e.g. - Women shirts",comp:ce($e(Fe),{className:"w-full h-10"}),comp_params:{className:"w-full h-fit"}},{key:"handle",name:"🔗 Handle",type:"text",validate:!1,editable:!0,desc:`A handle uniquely identifies the collection.
|
551
|
+
Will be computed automatically if not filled by the product title`,comp:ce(bc,{className:"w-full h-fit"}),comp_params:{className:"w-full h-fit"}},{key:"desc",name:"📝 Description",type:"text",validate:!1,editable:!0,desc:"Describe the collection for your customers",comp:ce(Os),comp_params:{className:"w-full"}},{key:"media",name:"🎥 Media",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:ce(Ri),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},uS={name:"Main",comp:We,comp_params:{className:`w-full items-center lg:items-start lg:w-[18rem]
|
552
|
+
flex flex-col gap-5`},fields:[{key:"active",name:"Active",validate:!0,desc:"activate or deactivate the collection",editable:!0,defaultValue:!0,comp:ce(no,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Use tags to attach attributes to the collection",comp:ce(Ls),comp_params:{className:"w-full "}},{comp:lS,comp_params:{className:"w-full"}}]},hS={name:"Root",comp:We,comp_params:{className:"w-full gap-5 --justify-center --bg-red-100 items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row --mx-auto"},fields:[cS,uS]},dS=({onClickSave:n=void 0,onClickCreate:e=void 0,onClickDelete:t=void 0,onClickPublish:s=void 0,onClickDuplicate:r=void 0,onClickReload:a,id:l,className:u})=>c.jsx(ms,{id:l,className:u,onClickCreate:e,onClickDelete:t,onClickDuplicate:r,onClickReload:a,onClickSave:n,children:c.jsx(Zn,{Icon:c.jsx(q1,{}),text:"publish",keep_text_on_load:!0,show:!!s,onClick:s,className:""})}),Xh=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,setError:l,reload:u,duplicate:d},context:f,key:p,sdk:g,doc:y,isCreateMode:w,isEditMode:k,isViewMode:_,hasChanged:C,hasLoaded:S,error:M,ref_head:I,ref_root:L}=On("collections",t,"/pages/collections",n,s),O=v.useCallback(()=>d({title:(y==null?void 0:y.title)+" duplicate"}),[y,d]),K=v.useCallback(async()=>{await r(),l(void 0);try{await g.collections.publish(t,400),await u()}catch(E){l({messages:[{message:E.toString()}]})}},[t,r,u]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["collections",t??"create"],className:""}),c.jsx(gs,{doc:y,className:"mt-5",collectionId:"collections"}),c.jsx(dS,{onClickSave:k?r:void 0,onClickCreate:w?r:void 0,onClickPublish:w?void 0:K,onClickDelete:w?void 0:a,onClickDuplicate:w?void 0:O,onClickReload:w?void 0:async()=>u(!1),id:t,className:"mt-5"}),c.jsx(us,{changes_made:C,ref:I,time:y==null?void 0:y.created_at,className:"mt-8"},y==null?void 0:y.updated_at),c.jsx(_e,{show:S&&k||w,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:M,className:"w-full"}),c.jsx(Ln,{ref:L,field:hS,context:f,value:y??{},isViewMode:_,className:"mt-8"},p)]})})]})},Fl=n=>{switch(n){case xn.regular.type:return"bg-teal-600 dark:bg-teal-600/40";case xn.bulk.type:return"bg-red-400 dark:bg-red-400/40";case xn.buy_x_get_y.type:return"bg-cyan-500 dark:bg-cyan-500/40";case xn.order.type:return"bg-kf-400 dark:bg-kf-400/40";case xn.bundle.type:return"bg-sky-500 dark:bg-sky-400/40";default:return"bg-slate-400 dark:bg-slate-400/20"}},fS=({value:n,...e})=>{const t=v.useMemo(()=>{var r;return(r=Object.values(xn).find(a=>a.type===(n==null?void 0:n.type)))==null?void 0:r.name.split(" ")[0]},[n]),s="text-white rounded-xl py-px px-2 whitespace-nowrap border shelf-border-color-blend "+Fl(n==null?void 0:n.type);return c.jsx("span",{className:s+" bg-",children:t})},pS=({...n})=>c.jsxs("div",{...n,children:[c.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[c.jsx(Ht,{to:"/pages/discounts",draggable:"false",children:c.jsx(ar,{value:"all",bgColor:"bg-pink-400 dark:bg-pink-400/60"})}),Object.values(xn).filter(e=>!!e.type).map(e=>c.jsx(Ht,{draggable:"false",to:`/pages/discounts/q/vql=type:${e.id}`,children:c.jsx(ar,{value:e.name,bgColor:Fl(e.type)})},e.id))]}),c.jsxs("div",{className:"flex flex-row flex-wrap gap-2 mt-1",children:[Object.values(Ei).map(e=>c.jsx(Ht,{draggable:"false",to:`/pages/discounts/q/vql=app:${e.name.toLowerCase()}`,children:c.jsx(ar,{value:e.name,bgColor:Fl(void 0)})},e.id)),[{name:"enabled",v:!0},{name:"disabled",v:!1}].map((e,t)=>c.jsx(Ht,{draggable:"false",to:`/pages/discounts/q/vql=active:${e.v}`,children:c.jsx(ar,{value:e.name,bgColor:Fl(void 0)})},t))]})]}),mS=({value:n,context:e,...t})=>{const s=e.item.active?"bg-teal-500":"bg-red-500",r="whitespace-nowrap pr-2 font-semibold text-base max-w-[150px] sm:max-w-max overflow-clip hover:overflow-x-auto",a=e.item.application.id===Ei.Manual.id;return c.jsxs("div",{className:r,children:[c.jsx("span",{children:n}),a&&c.jsx(h3,{className:`block --text-xl text-white --p-0.5
|
553
|
+
align-middle text-center ${s}`}),!a&&c.jsx("span",{children:"AUTO",className:`block text-xs text-white w-fit px-1 border shelf-border-color-blend
|
554
|
+
align-middle text-center ${s}`})]})},gS=[{key:"handle",name:"Code",comp:mS},{key:"info.details.meta",name:"Type",comp:fS},{key:"updated_at",name:"Last Updated",comp:fs,comp_params:{className:"font-semibold"}},{key:void 0,name:"Actions",comp:Cn}],k1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("discounts","/pages/discounts");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsx(pS,{className:"mt-5"}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
555
|
+
shelf-border-color dark:shadow-slate-900
|
556
|
+
shadow-md mt-5`,children:[c.jsx(ds,{isCollectionEmpty:f,reload:g,ref:t,createLink:"/pages/discounts/create",searchTitle:"Search by Code, type...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:gS}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})};var Na={},_1;function vS(){if(_1)return Na;_1=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.default=void 0;var n={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",dateFormat:"MM/dd/yyyy",timeFormat:"hh:mm aa",firstDay:0};return Na.default=n,Na}var xS=vS();const yS=Za(xS);var Hl={exports:{}},wS=Hl.exports,C1;function bS(){return C1||(C1=1,function(n,e){(function(t,s){n.exports=s()})(wS,function(){return function(){var t={d:function(Y,j){for(var z in j)t.o(j,z)&&!t.o(Y,z)&&Object.defineProperty(Y,z,{enumerable:!0,get:j[z]})},o:function(Y,j){return Object.prototype.hasOwnProperty.call(Y,j)}},s={};t.d(s,{default:function(){return Re}});var r={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},a={classes:"",inline:!1,locale:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вос","Пон","Вто","Сре","Чет","Пят","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:r.days,minView:r.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function l(Y){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;return typeof Y=="string"?j.querySelector(Y):Y}function u(){let{tagName:Y="div",className:j="",innerHtml:z="",id:T="",attrs:U={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=document.createElement(Y);return j&&H.classList.add(...j.split(" ")),T&&(H.id=T),z&&(H.innerHTML=z),U&&d(H,U),H}function d(Y,j){for(let[z,T]of Object.entries(j))T!==void 0&&Y.setAttribute(z,T);return Y}function f(Y){return new Date(Y.getFullYear(),Y.getMonth()+1,0).getDate()}function p(Y){let j=Y.getHours(),{hours:z,dayPeriod:T}=g(j);return{year:Y.getFullYear(),month:Y.getMonth(),fullMonth:Y.getMonth()+1<10?"0"+(Y.getMonth()+1):Y.getMonth()+1,date:Y.getDate(),fullDate:Y.getDate()<10?"0"+Y.getDate():Y.getDate(),day:Y.getDay(),hours:j,fullHours:y(j),hours12:z,dayPeriod:T,fullHours12:y(z),minutes:Y.getMinutes(),fullMinutes:Y.getMinutes()<10?"0"+Y.getMinutes():Y.getMinutes()}}function g(Y){return{dayPeriod:Y>11?"pm":"am",hours:Y%12==0?12:Y%12}}function y(Y){return Y<10?"0"+Y:Y}function w(Y){let j=10*Math.floor(Y.getFullYear()/10);return[j,j+9]}function k(){let Y=[];for(var j=arguments.length,z=new Array(j),T=0;T<j;T++)z[T]=arguments[T];return z.forEach(U=>{if(typeof U=="object")for(let H in U)U[H]&&Y.push(H);else U&&Y.push(U)}),Y.join(" ")}function _(Y,j){let z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.days;if(!Y||!j)return!1;let T=p(Y),U=p(j);return{[r.days]:T.date===U.date&&T.month===U.month&&T.year===U.year,[r.months]:T.month===U.month&&T.year===U.year,[r.years]:T.year===U.year}[z]}function C(Y,j,z){let T=M(Y,!1).getTime(),U=M(j,!1).getTime();return z?T>=U:T>U}function S(Y,j){return!C(Y,j,!0)}function M(Y){let j=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],z=new Date(Y.getTime());return typeof j!="boolean"||j||function(T){T.setHours(0,0,0,0)}(z),z}function I(Y,j,z){Y.length?Y.forEach(T=>{T.addEventListener(j,z)}):Y.addEventListener(j,z)}function L(Y,j){return!(!Y||Y===document||Y instanceof DocumentFragment)&&(Y.matches(j)?Y:L(Y.parentNode,j))}function O(Y,j,z){return Y>z?z:Y<j?j:Y}function K(Y){for(var j=arguments.length,z=new Array(j>1?j-1:0),T=1;T<j;T++)z[T-1]=arguments[T];return z.filter(U=>U).forEach(U=>{for(let[H,P]of Object.entries(U))if(P!==void 0&&P.toString()==="[object Object]"){let Q=Y[H]!==void 0?Y[H].toString():void 0,ae=P.toString(),he=Array.isArray(P)?[]:{};Y[H]=Y[H]?Q!==ae?he:Y[H]:he,K(Y[H],P)}else Y[H]=P}),Y}function E(Y){let j=Y;return Y instanceof Date||(typeof Y=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(Y)&&(Y+="T00:00:00"),j=new Date(Y)),isNaN(j.getTime())&&(console.log(`Unable to convert value "${Y}" to Date object`),j=!1),j}function R(Y){let j="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+j+")("+Y+")($|<|"+j+")","g")}function F(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}class J{constructor(){let{type:j,date:z,dp:T,opts:U,body:H}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};F(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),F(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),F(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),F(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),F(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),F(this,"onChangeFocusDate",P=>{if(!P)return void(this.focused&&this.removeFocus());let Q=_(P,this.date,this.type);Q?this.focus():!Q&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()}),F(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=j,this.singleType=this.type.slice(0,-1),this.date=z,this.dp=T,this.opts=U,this.body=H,this.customData=!1,this.init()}init(){var j;let{onRenderCell:z}=this.opts;z&&(this.customData=z({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),(j=this.customData)!==null&&j!==void 0&&j.disabled&&this.dp.disableDate(this.date)}_bindDatepickerEvents(){this.dp.on(r.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(r.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(r.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(r.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var j;let{year:z,month:T,date:U}=p(this.date),H=((j=this.customData)===null||j===void 0?void 0:j.attrs)||{};this.$cell=u({attrs:{"data-year":z,"data-month":T,"data-date":U,...H}}),this.$cell.adpCell=this}_getClassName(){var j;let z=new Date,{selectOtherMonths:T,selectOtherYears:U}=this.opts,{minDate:H,maxDate:P,isDateDisabled:Q}=this.dp,{day:ae}=p(this.date),he=this._isOutOfMinMaxRange(),je=Q(this.date),Ce=k("air-datepicker-cell",`-${this.singleType}-`,{"-current-":_(z,this.date,this.type),"-min-date-":H&&_(H,this.date,this.type),"-max-date-":P&&_(P,this.date,this.type)}),Oe="";switch(this.type){case r.days:Oe=k({"-weekend-":this.dp.isWeekend(ae),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!T||he||je});break;case r.months:Oe=k({"-disabled-":he});break;case r.years:Oe=k({"-other-decade-":this.isOtherDecade,"-disabled-":he||this.isOtherDecade&&!U})}return k(Ce,Oe,(j=this.customData)===null||j===void 0?void 0:j.classes).split(" ")}_getHtml(){var j;let{year:z,month:T,date:U}=p(this.date),{showOtherMonths:H,showOtherYears:P}=this.opts;if((j=this.customData)!==null&&j!==void 0&&j.html)return this.customData.html;switch(this.type){case r.days:return!H&&this.isOtherMonth?"":U;case r.months:return this.dp.locale[this.opts.monthsField][T];case r.years:return!P&&this.isOtherDecade?"":z}}_isOutOfMinMaxRange(){let{minDate:j,maxDate:z}=this.dp,{type:T,date:U}=this,{month:H,year:P,date:Q}=p(U),ae=T===r.days,he=T===r.years,je=!!j&&new Date(P,he?j.getMonth():H,ae?Q:j.getDate()),Ce=!!z&&new Date(P,he?z.getMonth():H,ae?Q:z.getDate());return j&&z?S(je,j)||C(Ce,z):j?S(je,j):z?C(Ce,z):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:j,focusDate:z,rangeDateTo:T,rangeDateFrom:U}=this.dp,H=j.length;if(!H)return;let P=U,Q=T;if(H===1&&z){const Oe=C(z,j[0]);P=Oe?j[0]:z,Q=Oe?z:j[0]}let ae=k({"-in-range-":P&&Q&&(he=this.date,je=P,Ce=Q,C(he,je)&&S(he,Ce)),"-range-from-":P&&_(this.date,P,this.type),"-range-to-":Q&&_(this.date,Q,this.type)});var he,je,Ce;this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),ae&&this.$cell.classList.add(...ae.split(" "))}_handleSelectedStatus(){let j=this.dp._checkIfDateIsSelected(this.date,this.type);j?this.select():!j&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){_(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function oe(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}let Ne={[r.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${r.days}-"></div>`,[r.months]:`<div class="air-datepicker-body--cells -${r.months}-"></div>`,[r.years]:`<div class="air-datepicker-body--cells -${r.years}-"></div>`};const Ee=".air-datepicker-cell";class be{constructor(j){let{dp:z,type:T,opts:U}=j;oe(this,"handleClick",H=>{let P=H.target.closest(Ee).adpCell;if(P.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let Q=this.dp._checkIfDateIsSelected(P.date,P.type);Q?this.dp._handleAlreadySelectedDates(Q,P.date):this.dp.selectDate(P.date)}),oe(this,"handleDayNameClick",H=>{let P=H.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(P),datepicker:this.dp})}),oe(this,"onChangeCurrentView",H=>{H!==this.type?this.hide():(this.show(),this.render())}),oe(this,"onMouseOverCell",H=>{let P=L(H.target,Ee);this.dp.setFocusDate(!!P&&P.adpCell.date)}),oe(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),oe(this,"onClickBody",H=>{let{onClickDayName:P}=this.opts,Q=H.target;Q.closest(Ee)&&this.handleClick(H),P&&Q.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(H)}),oe(this,"onMouseDown",H=>{this.pressed=!0;let P=L(H.target,Ee),Q=P&&P.adpCell;_(Q.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),_(Q.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),oe(this,"onMouseMove",H=>{if(!this.pressed||!this.dp.isMinViewReached)return;H.preventDefault();let P=L(H.target,Ee),Q=P&&P.adpCell,{selectedDates:ae,rangeDateTo:he,rangeDateFrom:je}=this.dp;if(!Q||Q.isDisabled)return;let{date:Ce}=Q;if(ae.length===2){if(this.rangeFromFocused&&!C(Ce,he)){let{hours:Oe,minutes:qe}=p(je);Ce.setHours(Oe),Ce.setMinutes(qe),this.dp.rangeDateFrom=Ce,this.dp.replaceDate(je,Ce)}if(this.rangeToFocused&&!S(Ce,je)){let{hours:Oe,minutes:qe}=p(he);Ce.setHours(Oe),Ce.setMinutes(qe),this.dp.rangeDateTo=Ce,this.dp.replaceDate(he,Ce)}}}),oe(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),oe(this,"onChangeViewDate",(H,P)=>{if(!this.isVisible)return;let Q=w(H),ae=w(P);switch(this.dp.currentView){case r.days:if(_(H,P,r.months))return;break;case r.months:if(_(H,P,r.years))return;break;case r.years:if(Q[0]===ae[0]&&Q[1]===ae[1])return}this.render()}),oe(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(H=>{this.$cells.appendChild(H.render())})}),this.dp=z,this.type=T,this.opts=U,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===r.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:j,dynamicRange:z}=this.opts;I(this.$el,"mouseover",this.onMouseOverCell),I(this.$el,"mouseout",this.onMouseOutCell),I(this.$el,"click",this.onClickBody),j&&z&&(I(this.$el,"mousedown",this.onMouseDown),I(this.$el,"mousemove",this.onMouseMove),I(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(r.eventChangeViewDate,this.onChangeViewDate),this.dp.on(r.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=u({className:`air-datepicker-body -${this.type}-`,innerHtml:Ne[this.type]}),this.$names=l(".air-datepicker-body--day-names",this.$el),this.$cells=l(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.dp.locale.firstDay,z="",T=this.dp.isWeekend,{onClickDayName:U}=this.opts,H=j,P=0;for(;P<7;){let Q=H%7;z+=`<div class="${k("air-datepicker-body--day-name",{[r.cssClassWeekend]:T(Q),"-clickable-":!!U})}" data-day-index='${Q}'>${this.dp.locale.daysMin[Q]}</div>`,P++,H++}return z}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(j){let{type:z,dp:T,opts:U}=this;return new J({type:z,dp:T,opts:U,date:j,body:this})}_generateCells(){be.getDatesFunction(this.type)(this.dp,j=>{this.cells.push(this._generateCell(j))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(j=>j.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(r.eventChangeViewDate,this.onChangeViewDate),this.dp.off(r.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(j,z){let{viewDate:T,opts:{fixedHeight:U},locale:{firstDay:H}}=j,P=f(T),{year:Q,month:ae}=p(T),he=new Date(Q,ae,1),je=new Date(Q,ae,P),Ce=he.getDay()-H,Oe=6-je.getDay()+H;Ce=Ce<0?Ce+7:Ce,Oe=Oe>6?Oe-7:Oe;let qe=function(ve,Ae){let{year:nt,month:Xe,date:Hr}=p(ve);return new Date(nt,Xe,Hr-Ae)}(he,Ce),_t=P+Ce+Oe,dt=qe.getDate(),{year:xs,month:Rn}=p(qe),Ct=0;U&&(_t=42);const ue=[];for(;Ct<_t;){let ve=new Date(xs,Rn,dt+Ct);z&&z(ve),ue.push(ve),Ct++}return ue}static getMonthsDates(j,z){let{year:T}=j.parsedViewDate,U=0,H=[];for(;U<12;){const P=new Date(T,U);H.push(P),z&&z(P),U++}return H}static getYearsDates(j,z){let T=w(j.viewDate),U=T[0]-1,H=T[1]+1,P=U,Q=[];for(;P<=H;){const ae=new Date(P,0);Q.push(ae),z&&z(ae),P++}return Q}static getDatesFunction(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.days;return{[r.days]:be.getDaysDates,[r.months]:be.getMonthsDates,[r.years]:be.getYearsDates}[j]}}function te(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}class B{constructor(j){let{dp:z,opts:T}=j;te(this,"onClickNav",U=>{let H=L(U.target,".air-datepicker-nav--action");if(!H)return;let P=H.dataset.action;this.dp[P]()}),te(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),te(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),te(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),te(this,"update",()=>{let{prevHtml:U,nextHtml:H}=this.opts;this.$prev.innerHTML=U,this.$next.innerHTML=H,this._resetNavStatus(),this.render(),this.handleNavStatus()}),te(this,"renderDelay",()=>{setTimeout(this.render)}),te(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(U,H){for(let P in H)H[P]?U.classList.add(P):U.classList.remove(P)}(this.$title,{"-disabled-":this.dp.isFinalView})}),this.dp=z,this.opts=T,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=l(".air-datepicker-nav--title",this.$el),this.$prev=l('[data-action="prev"]',this.$el),this.$next=l('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(r.eventChangeViewDate,this.onChangeViewDate),this.dp.on(r.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(r.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(r.eventChangeTime,this.render))}destroy(){this.dp.off(r.eventChangeViewDate,this.onChangeViewDate),this.dp.off(r.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(r.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(r.eventChangeTime,this.render))}_createElement(){this.$el=u({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:j,opts:z}=this,T=z.navTitles[j.currentView];return typeof T=="function"?T(j):j.formatDate(j.viewDate,T)}handleNavStatus(){let{disableNavWhenOutOfRange:j}=this.opts,{minDate:z,maxDate:T}=this.dp;if(!z&&!T||!j)return;let{year:U,month:H}=this.dp.parsedViewDate,P=!!z&&p(z),Q=!!T&&p(T);switch(this.dp.currentView){case r.days:z&&P.month>=H&&P.year>=U&&this._disableNav("prev"),T&&Q.month<=H&&Q.year<=U&&this._disableNav("next");break;case r.months:z&&P.year>=U&&this._disableNav("prev"),T&&Q.year<=U&&this._disableNav("next");break;case r.years:{let ae=w(this.dp.viewDate);z&&P.year>=ae[0]&&this._disableNav("prev"),T&&Q.year<=ae[1]&&this._disableNav("next");break}}}_disableNav(j){l('[data-action="'+j+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){(function(j){for(var z=arguments.length,T=new Array(z>1?z-1:0),U=1;U<z;U++)T[U-1]=arguments[U];j.length?j.forEach(H=>{H.classList.remove(...T)}):j.classList.remove(...T)})(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:j,nextHtml:z}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${j}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${z}</div>`}get isNavIsFunction(){let{navTitles:j}=this.opts;return Object.keys(j).find(z=>typeof j[z]=="function")}}var Z={today:{content:Y=>Y.locale.today,onClick:Y=>Y.setViewDate(new Date)},clear:{content:Y=>Y.locale.clear,onClick:Y=>Y.clear()}};class X{constructor(j){let{dp:z,opts:T}=j;this.dp=z,this.opts=T,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=u({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:j}=this.opts;Array.isArray(j)||(j=[j]),j.forEach(z=>{let T=z;typeof z=="string"&&Z[z]&&(T=Z[z]);let U=this.createButton(T);T.onClick&&this.attachEventToButton(U,T.onClick),this.$el.appendChild(U)})}attachEventToButton(j,z){j.addEventListener("click",()=>{z(this.dp)})}createButton(j){let{content:z,className:T,tagName:U="button",attrs:H={}}=j;return u({tagName:U,innerHtml:`<span tabindex='-1'>${typeof z=="function"?z(this.dp):z}</span>`,className:k("air-datepicker-button",T),attrs:H})}render(){this.generateButtons()}}function ne(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}class D{constructor(){let{opts:j,dp:z}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ne(this,"toggleTimepickerIsActive",U=>{this.dp.timepickerIsActive=U}),ne(this,"onChangeSelectedDate",U=>{let{date:H,updateTime:P=!1}=U;H&&(this.setMinMaxTime(H),this.setCurrentTime(!!P&&H),this.addTimeToDate(H))}),ne(this,"onChangeLastSelectedDate",U=>{U&&(this.setTime(U),this.render())}),ne(this,"onChangeInputRange",U=>{let H=U.target;this[H.getAttribute("name")]=H.value,this.updateText(),this.dp.trigger(r.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),ne(this,"onMouseEnterLeave",U=>{let H=U.target.getAttribute("name"),P=this.$minutesText;H==="hours"&&(P=this.$hoursText),P.classList.toggle("-focus-")}),ne(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),ne(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=j,this.dp=z;let{timeFormat:T}=this.dp.locale;T&&(T.match(R("h"))||T.match(R("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(r.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(r.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let j="input";navigator.userAgent.match(/trident/gi)&&(j="change"),I(this.$ranges,j,this.onChangeInputRange),I(this.$ranges,"mouseenter",this.onMouseEnterLeave),I(this.$ranges,"mouseleave",this.onMouseEnterLeave),I(this.$ranges,"focus",this.onFocus),I(this.$ranges,"mousedown",this.onFocus),I(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=u({className:k("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(r.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(r.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:j,hours:z,displayHours:T,minutes:U,minHours:H,minMinutes:P,maxHours:Q,maxMinutes:ae,dayPeriod:he,opts:{hoursStep:je,minutesStep:Ce}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${y(T)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${y(U)}</span> `+(j?`<span class='air-datepicker-time--current-ampm'>${he}</span>`:"")+`</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row"> <input type="range" name="hours" value="${z}" min="${H}" max="${Q}" step="${je}"/> </div> <div class="air-datepicker-time--row"> <input type="range" name="minutes" value="${U}" min="${P}" max="${ae}" step="${Ce}"/> </div></div>`}defineDOM(){let j=z=>l(z,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=j('[name="hours"]'),this.$minutes=j('[name="minutes"]'),this.$hoursText=j(".air-datepicker-time--current-hours"),this.$minutesText=j(".air-datepicker-time--current-minutes"),this.$ampm=j(".air-datepicker-time--current-ampm")}setTime(j){this.setMinMaxTime(j),this.setCurrentTime(j)}addTimeToDate(j){j&&(j.setHours(this.hours),j.setMinutes(this.minutes))}setMinMaxTime(j){if(this.setMinMaxTimeFromOptions(),j){let{minDate:z,maxDate:T}=this.dp;z&&_(j,z)&&this.setMinTimeFromMinDate(z),T&&_(j,T)&&this.setMaxTimeFromMaxDate(T)}}setCurrentTime(j){let{hours:z,minutes:T}=j?p(j):this;this.hours=O(z,this.minHours,this.maxHours),this.minutes=O(T,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:j,minMinutes:z,maxHours:T,maxMinutes:U}=this.opts;this.minHours=O(j,0,23),this.minMinutes=O(z,0,59),this.maxHours=O(T,0,23),this.maxMinutes=O(U,0,59)}setMinTimeFromMinDate(j){let{lastSelectedDate:z}=this.dp;this.minHours=j.getHours(),z&&z.getHours()>j.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=j.getMinutes()}setMaxTimeFromMaxDate(j){let{lastSelectedDate:z}=this.dp;this.maxHours=j.getHours(),z&&z.getHours()<j.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=j.getMinutes()}updateSliders(){d(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,d(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=y(this.displayHours),this.$minutesText.innerHTML=y(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(j){this._hours=j;let{hours:z,dayPeriod:T}=g(j);this.displayHours=this.ampm?z:j,this.dayPeriod=T}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function $(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}class ie{constructor(j){let{dp:z,opts:T}=j;$(this,"pressedKeys",new Set),$(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],U=>U.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],U=>U.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],U=>U.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],U=>U.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],U=>U.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],U=>U.year-=10],[["Control","Shift","ArrowUp"],(U,H)=>H.up()]])),$(this,"handleHotKey",U=>{let H=this.hotKeys.get(U),P=p(this.getInitialFocusDate());H(P,this.dp);let{year:Q,month:ae,date:he}=P,je=f(new Date(Q,ae));je<he&&(he=je);let Ce=this.dp.getClampedDate(new Date(Q,ae,he));this.dp.setFocusDate(Ce,{viewDateTransition:!0})}),$(this,"isHotKeyPressed",()=>{let U=!1,H=this.pressedKeys.size,P=Q=>this.pressedKeys.has(Q);for(let[Q]of this.hotKeys){if(U)break;if(Array.isArray(Q[0]))Q.forEach(ae=>{U||H!==ae.length||(U=ae.every(P)&&Q)});else{if(H!==Q.length)continue;U=Q.every(P)&&Q}}return U}),$(this,"isArrow",U=>U>=37&&U<=40),$(this,"onKeyDown",U=>{let{key:H,which:P}=U,{dp:Q,dp:{focusDate:ae},opts:he}=this;this.registerKey(H);let je=this.isHotKeyPressed();if(je)return U.preventDefault(),void this.handleHotKey(je);if(this.isArrow(P))return U.preventDefault(),void this.focusNextCell(H);if(H==="Enter"){if(Q.currentView!==he.minView)return void Q.down();if(ae){let Ce=Q._checkIfDateIsSelected(ae);return void(Ce?Q._handleAlreadySelectedDates(Ce,ae):Q.selectDate(ae))}}H==="Escape"&&this.dp.hide()}),$(this,"onKeyUp",U=>{this.removeKey(U.key)}),this.dp=z,this.opts=T,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:j}=this.dp;j.addEventListener("keydown",this.onKeyDown),j.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:j}=this.dp;j.removeEventListener("keydown",this.onKeyDown),j.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:j,currentView:z,selectedDates:T,parsedViewDate:{year:U,month:H}}=this.dp,P=j||T[T.length-1];if(!P)switch(z){case r.days:P=new Date(U,H,new Date().getDate());break;case r.months:P=new Date(U,H,1);break;case r.years:P=new Date(U,0,1)}return P}focusNextCell(j){let z=this.getInitialFocusDate(),{currentView:T}=this.dp,{days:U,months:H,years:P}=r,Q=p(z),ae=Q.year,he=Q.month,je=Q.date;switch(j){case"ArrowLeft":T===U&&(je-=1),T===H&&(he-=1),T===P&&(ae-=1);break;case"ArrowUp":T===U&&(je-=7),T===H&&(he-=3),T===P&&(ae-=4);break;case"ArrowRight":T===U&&(je+=1),T===H&&(he+=1),T===P&&(ae+=1);break;case"ArrowDown":T===U&&(je+=7),T===H&&(he+=3),T===P&&(ae+=4)}let Ce=this.dp.getClampedDate(new Date(ae,he,je));this.dp.setFocusDate(Ce,{viewDateTransition:!0})}registerKey(j){this.pressedKeys.add(j)}removeKey(j){this.pressedKeys.delete(j)}}let ge={on(Y,j){this.__events||(this.__events={}),this.__events[Y]?this.__events[Y].push(j):this.__events[Y]=[j]},off(Y,j){this.__events&&this.__events[Y]&&(this.__events[Y]=this.__events[Y].filter(z=>z!==j))},removeAllEvents(){this.__events={}},trigger(Y){for(var j=arguments.length,z=new Array(j>1?j-1:0),T=1;T<j;T++)z[T-1]=arguments[T];this.__events&&this.__events[Y]&&this.__events[Y].forEach(U=>{U(...z)})}};function le(Y,j,z){return(j=function(T){var U=function(H,P){if(typeof H!="object"||H===null)return H;var Q=H[Symbol.toPrimitive];if(Q!==void 0){var ae=Q.call(H,"string");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}(T);return typeof U=="symbol"?U:String(U)}(j))in Y?Object.defineProperty(Y,j,{value:z,enumerable:!0,configurable:!0,writable:!0}):Y[j]=z,Y}let se="",Me="",He=!1;class Re{static buildGlobalContainer(j){He=!0,se=u({className:j,id:j}),l("body").appendChild(se)}constructor(j,z){var T=this;if(le(this,"viewIndexes",[r.days,r.months,r.years]),le(this,"next",()=>{let{year:P,month:Q}=this.parsedViewDate;switch(this.currentView){case r.days:this.setViewDate(new Date(P,Q+1,1));break;case r.months:this.setViewDate(new Date(P+1,Q,1));break;case r.years:this.setViewDate(new Date(P+10,0,1))}}),le(this,"prev",()=>{let{year:P,month:Q}=this.parsedViewDate;switch(this.currentView){case r.days:this.setViewDate(new Date(P,Q-1,1));break;case r.months:this.setViewDate(new Date(P-1,Q,1));break;case r.years:this.setViewDate(new Date(P-10,0,1))}}),le(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),le(this,"setPosition",function(P){let Q=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof(P=P||T.opts.position)=="function")return void(T.customHide=P({$datepicker:T.$datepicker,$target:T.$el,$pointer:T.$pointer,isViewChange:Q,done:T._finishHide}));let ae,he,{isMobile:je}=T.opts,Ce=T.$el.getBoundingClientRect(),Oe=T.$el.getBoundingClientRect(),qe=T.$datepicker.offsetParent,_t=T.$el.offsetParent,dt=T.$datepicker.getBoundingClientRect(),xs=P.split(" "),Rn=window.scrollY,Ct=window.scrollX,ue=T.opts.offset,ve=xs[0],Ae=xs[1];if(je)T.$datepicker.style.cssText="left: 50%; top: 50%";else{if(qe===_t&&qe!==document.body&&(Oe={top:T.$el.offsetTop,left:T.$el.offsetLeft,width:Ce.width,height:T.$el.offsetHeight},Rn=0,Ct=0),qe!==_t&&qe!==document.body){let nt=qe.getBoundingClientRect();Oe={top:Ce.top-nt.top,left:Ce.left-nt.left,width:Ce.width,height:Ce.height},Rn=0,Ct=0}switch(ve){case"top":ae=Oe.top-dt.height-ue;break;case"right":he=Oe.left+Oe.width+ue;break;case"bottom":ae=Oe.top+Oe.height+ue;break;case"left":he=Oe.left-dt.width-ue}switch(Ae){case"top":ae=Oe.top;break;case"right":he=Oe.left+Oe.width-dt.width;break;case"bottom":ae=Oe.top+Oe.height-dt.height;break;case"left":he=Oe.left;break;case"center":/left|right/.test(ve)?ae=Oe.top+Oe.height/2-dt.height/2:he=Oe.left+Oe.width/2-dt.width/2}T.$datepicker.style.cssText=`left: ${he+Ct}px; top: ${ae+Rn}px`}}),le(this,"_setInputValue",()=>{let{opts:P,$altField:Q,locale:{dateFormat:ae}}=this,{altFieldDateFormat:he,altField:je}=P;je&&Q&&(Q.value=this._getInputValue(he)),this.$el.value=this._getInputValue(ae)}),le(this,"_getInputValue",P=>{let{selectedDates:Q,opts:ae}=this,{multipleDates:he,multipleDatesSeparator:je}=ae;if(!Q.length)return"";let Ce=typeof P=="function",Oe=Ce?P(he?Q:Q[0]):Q.map(qe=>this.formatDate(qe,P));return Oe=Ce?Oe:Oe.join(je),Oe}),le(this,"_checkIfDateIsSelected",function(P){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.days,ae=!1;return T.selectedDates.some(he=>{let je=_(P,he,Q);return ae=je&&he,je}),ae}),le(this,"_scheduleCallAfterTransition",P=>{this._cancelScheduledCall(),P&&P(!1),this._onTransitionEnd=()=>{P&&P(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),le(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),le(this,"setViewDate",P=>{if(!((P=E(P))instanceof Date)||_(P,this.viewDate))return;let Q=this.viewDate;this.viewDate=P;let{onChangeViewDate:ae}=this.opts;if(ae){let{month:he,year:je}=this.parsedViewDate;ae({month:he,year:je,decade:this.curDecade})}this.trigger(r.eventChangeViewDate,P,Q)}),le(this,"setFocusDate",function(P){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!P||(P=E(P))instanceof Date)&&(T.focusDate=P,T.trigger(r.eventChangeFocusDate,P,Q))}),le(this,"setCurrentView",function(P){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(T.viewIndexes.includes(P)){if(T.currentView=P,T.elIsInput&&T.visible&&T.setPosition(void 0,!0),T.trigger(r.eventChangeCurrentView,P),!T.views[P]){let ae=T.views[P]=new be({dp:T,opts:T.opts,type:P});T.shouldUpdateDOM&&T.$content.appendChild(ae.$el)}T.opts.onChangeView&&!Q.silent&&T.opts.onChangeView(P)}}),le(this,"_updateLastSelectedDate",P=>{this.lastSelectedDate=P,this.trigger(r.eventChangeLastSelectedDate,P)}),le(this,"destroy",()=>{if(this.isDestroyed)return;let{showEvent:P,isMobile:Q}=this.opts,ae=this.$datepicker.parentNode;ae&&ae.removeChild(this.$datepicker),this.$el.removeEventListener(P,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),Q&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0}),le(this,"update",function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ae=K({},T.opts),{silent:he}=Q;K(T.opts,P);let{timepicker:je,buttons:Ce,range:Oe,selectedDates:qe,isMobile:_t}=T.opts,dt=T.visible||T.treatAsInline;T._createMinMaxDates(),T._limitViewDateByMaxMinDates(),T._handleLocale(),qe&&(T.selectedDates=[],T.selectDate(qe,{silent:he})),P.view&&T.setCurrentView(P.view,{silent:he}),T._setInputValue(),ae.range&&!Oe?(T.rangeDateTo=!1,T.rangeDateFrom=!1):!ae.range&&Oe&&T.selectedDates.length&&(T.rangeDateFrom=T.selectedDates[0],T.rangeDateTo=T.selectedDates[1]),ae.timepicker&&!je?(dt&&T.timepicker.destroy(),T.timepicker=!1,T.$timepicker.parentNode.removeChild(T.$timepicker)):!ae.timepicker&&je&&T._addTimepicker(),!ae.buttons&&Ce?T._addButtons():ae.buttons&&!Ce?(T.buttons.destroy(),T.$buttons.parentNode.removeChild(T.$buttons)):dt&&ae.buttons&&Ce&&T.buttons.clearHtml().render(),!ae.isMobile&&_t?(T.treatAsInline||Me||T._createMobileOverlay(),T._addMobileAttributes(),T.visible&&T._showMobileOverlay()):ae.isMobile&&!_t&&(T._removeMobileAttributes(),T.visible&&(Me.classList.remove("-active-"),typeof T.opts.position!="function"&&T.setPosition())),dt&&(T.nav.update(),T.views[T.currentView].render(),T.currentView===r.days&&T.views[T.currentView].renderDayNames())}),le(this,"disableDate",(P,Q)=>{(Array.isArray(P)?P:[P]).forEach(ae=>{let he=E(ae);if(!he)return;let je=Q?"delete":"add";this.disabledDates[je](this.formatDate(he,"yyyy-MM-dd"));let Ce=this.getCell(he,this.currentViewSingular);Ce&&Ce.adpCell.render()},[])}),le(this,"enableDate",P=>{this.disableDate(P,!0)}),le(this,"isDateDisabled",P=>{let Q=E(P);return this.disabledDates.has(this.formatDate(Q,"yyyy-MM-dd"))}),le(this,"isOtherMonth",P=>{let{month:Q}=p(P);return Q!==this.parsedViewDate.month}),le(this,"isOtherYear",P=>{let{year:Q}=p(P);return Q!==this.parsedViewDate.year}),le(this,"isOtherDecade",P=>{let{year:Q}=p(P),[ae,he]=w(this.viewDate);return Q<ae||Q>he}),le(this,"_onChangeSelectedDate",P=>{let{silent:Q}=P;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!Q&&this._triggerOnSelect()})}),le(this,"_onChangeFocusedDate",function(P){let{viewDateTransition:Q}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!P)return;let ae=!1;Q&&(ae=T.isOtherMonth(P)||T.isOtherYear(P)||T.isOtherDecade(P)),ae&&T.setViewDate(P),T.opts.onFocus&&T.opts.onFocus({datepicker:T,date:P})}),le(this,"_onChangeTime",P=>{let{hours:Q,minutes:ae}=P,he=new Date,{lastSelectedDate:je,opts:{onSelect:Ce}}=this,Oe=je;je||(Oe=he);let qe=this.getCell(Oe,this.currentViewSingular),_t=qe&&qe.adpCell;_t&&_t.isDisabled||(Oe.setHours(Q),Oe.setMinutes(ae),je?(this._setInputValue(),Ce&&this._triggerOnSelect()):this.selectDate(Oe))}),le(this,"_onFocus",P=>{this.visible||this.show()}),le(this,"_onBlur",P=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),le(this,"_onMouseDown",P=>{this.inFocus=!0}),le(this,"_onMouseUp",P=>{this.inFocus=!1,this.$el.focus()}),le(this,"_onResize",()=>{this.visible&&typeof this.opts.position!="function"&&this.setPosition()}),le(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),le(this,"getViewDates",function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.days;return be.getDatesFunction(P)(T)}),le(this,"isWeekend",P=>this.opts.weekends.includes(P)),le(this,"getClampedDate",P=>{let{minDate:Q,maxDate:ae}=this,he=P;return ae&&C(P,ae)?he=ae:Q&&S(P,Q)&&(he=Q),he}),this.$el=l(j),!this.$el)return;this.$datepicker=u({className:"air-datepicker"}),this.opts=K({},a,z),this.$customContainer=!!this.opts.container&&l(this.opts.container),this.$altField=l(this.opts.altField||!1);let{view:U,startDate:H}=this.opts;H||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=E(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=U,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:j,treatAsInline:z,opts:{inline:T,isMobile:U,selectedDates:H,keyboardNav:P,onlyTimepicker:Q}}=this,ae=l("body");(!He||He&&se&&!ae.contains(se))&&!T&&this.elIsInput&&!this.$customContainer&&Re.buildGlobalContainer(Re.defaultGlobalContainerId),!U||Me||z||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(T||this._bindEvents(),P&&!Q&&(this.keyboardNav=new ie({dp:this,opts:j}))),H&&this.selectDate(H,{silent:!0}),this.opts.visible&&!z&&this.show(),U&&!z&&this.$el.setAttribute("readonly",!0),z&&this._createComponents()}_createMobileOverlay(){Me=u({className:"air-datepicker-overlay"}),se.appendChild(Me)}_createComponents(){let{opts:j,treatAsInline:z,opts:{inline:T,buttons:U,timepicker:H,position:P,classes:Q,onlyTimepicker:ae,isMobile:he}}=this;this._buildBaseHtml(),this.elIsInput&&(T||this._setPositionClasses(P)),!T&&this.elIsInput||this.$datepicker.classList.add("-inline-"),Q&&this.$datepicker.classList.add(...Q.split(" ")),ae&&this.$datepicker.classList.add("-only-timepicker-"),he&&!z&&this._addMobileAttributes(),this.views[this.currentView]=new be({dp:this,type:this.currentView,opts:j}),this.nav=new B({dp:this,opts:j}),H&&this._addTimepicker(),U&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let j in this.views)this.views[j].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){Me.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){Me.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||this.initialReadonly===""||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:j,maxDate:z}=this.opts;this.minDate=!!j&&E(j),this.maxDate=!!z&&E(z)}_addTimepicker(){this.$timepicker=u({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new D({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=u({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new X({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(r.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(r.eventChangeFocusDate,this._onChangeFocusedDate),this.on(r.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:j}=this.opts;var z,T;this.elIsInput?j?(z=this.$datepicker,(T=this.$el).parentNode.insertBefore(z,T.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=l(".air-datepicker--content",this.$datepicker),this.$pointer=l(".air-datepicker--pointer",this.$datepicker),this.$nav=l(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:j,dateFormat:z,firstDay:T,timepicker:U,onlyTimepicker:H,timeFormat:P,dateTimeSeparator:Q}=this.opts;var ae;this.locale=(ae=j,JSON.parse(JSON.stringify(ae))),z&&(this.locale.dateFormat=z),P!==void 0&&P!==""&&(this.locale.timeFormat=P);let{timeFormat:he}=this.locale;if(T!==""&&(this.locale.firstDay=T),U&&typeof z!="function"){let je=he?Q:"";this.locale.dateFormat=[this.locale.dateFormat,he||""].join(je)}H&&typeof z!="function"&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(j){if(typeof j=="function")return void this.$datepicker.classList.add("-custom-position-");let z=(j=j.split(" "))[0],T=`air-datepicker -${z}-${j[1]}- -from-${z}-`;this.$datepicker.classList.add(...T.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:j,minDate:z,maxDate:T}=this;T&&C(j,T)&&this.setViewDate(T),z&&S(j,z)&&this.setViewDate(z)}formatDate(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.viewDate,z=arguments.length>1?arguments[1]:void 0;if(j=E(j),!(j instanceof Date))return;let T=z,U=this.locale,H=p(j),P=H.dayPeriod,Q=w(j),ae=Re.replacer,he={T:j.getTime(),m:H.minutes,mm:H.fullMinutes,h:H.hours12,hh:H.fullHours12,H:H.hours,HH:H.fullHours,aa:P,AA:P.toUpperCase(),E:U.daysShort[H.day],EEEE:U.days[H.day],d:H.date,dd:H.fullDate,M:H.month+1,MM:H.fullMonth,MMM:U.monthsShort[H.month],MMMM:U.months[H.month],yy:H.year.toString().slice(-2),yyyy:H.year,yyyy1:Q[0],yyyy2:Q[1]};for(let[je,Ce]of Object.entries(he))T=ae(T,R(je),Ce);return T}down(j){this._handleUpDownActions(j,"down")}up(j){this._handleUpDownActions(j,"up")}selectDate(j){let z,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{currentView:U,parsedViewDate:H,selectedDates:P}=this,{updateTime:Q}=T,{moveToOtherMonthsOnSelect:ae,moveToOtherYearsOnSelect:he,multipleDates:je,range:Ce,autoClose:Oe,onBeforeSelect:qe}=this.opts,_t=P.length;if(Array.isArray(j))return j.forEach(dt=>{this.selectDate(dt,T)}),new Promise(dt=>{setTimeout(dt)});if((j=E(j))instanceof Date){if(qe&&!qe({date:j,datepicker:this}))return Promise.resolve();if(U===r.days&&j.getMonth()!==H.month&&ae&&(z=new Date(j.getFullYear(),j.getMonth(),1)),U===r.years&&j.getFullYear()!==H.year&&he&&(z=new Date(j.getFullYear(),0,1)),z&&this.setViewDate(z),je&&!Ce){if(_t===je)return;this._checkIfDateIsSelected(j)||P.push(j)}else if(Ce)switch(_t){case 1:P.push(j),this.rangeDateTo||(this.rangeDateTo=j),C(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=j),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[j],this.rangeDateFrom=j,this.rangeDateTo="";break;default:this.selectedDates=[j],this.rangeDateFrom=j}else this.selectedDates=[j];return this.trigger(r.eventChangeSelectedDate,{action:r.actionSelectDate,silent:T==null?void 0:T.silent,date:j,updateTime:Q}),this._updateLastSelectedDate(j),Oe&&!this.timepickerIsActive&&this.visible&&(je||Ce?Ce&&_t===1&&this.hide():this.hide()),new Promise(dt=>{setTimeout(dt)})}}unselectDate(j){let z=this.selectedDates,T=this;if((j=E(j))instanceof Date)return z.some((U,H)=>{if(_(U,j))return z.splice(H,1),T.selectedDates.length?(T.rangeDateTo="",T.rangeDateFrom=z[0],T._updateLastSelectedDate(T.selectedDates[T.selectedDates.length-1])):(T.rangeDateFrom="",T.rangeDateTo="",T._updateLastSelectedDate(!1)),this.trigger(r.eventChangeSelectedDate,{action:r.actionUnselectDate,date:j}),!0})}replaceDate(j,z){let T=this.selectedDates.find(H=>_(H,j,this.currentView)),U=this.selectedDates.indexOf(T);U<0||_(this.selectedDates[U],z,this.currentView)||(this.selectedDates[U]=z,this.trigger(r.eventChangeSelectedDate,{action:r.actionSelectDate,date:z,updateTime:!0}),this._updateLastSelectedDate(z))}clear(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(r.eventChangeSelectedDate,{action:r.actionUnselectDate,silent:j.silent}),new Promise(z=>{setTimeout(z)})}show(){let{onShow:j,isMobile:z}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,j&&this._scheduleCallAfterTransition(j),z&&this._showMobileOverlay()}hide(){let{onHide:j,isMobile:z}=this.opts,T=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(U=>{!this.customHide&&(U&&T||!U&&!T)&&this._finishHide(),j&&j(U)}),z&&Me.classList.remove("-active-")}_triggerOnSelect(){let j=[],z=[],{selectedDates:T,locale:U,opts:{onSelect:H,multipleDates:P,range:Q}}=this,ae=P||Q,he=typeof U.dateFormat=="function";T.length&&(j=T.map(M),z=he?P?U.dateFormat(j):j.map(je=>U.dateFormat(je)):j.map(je=>this.formatDate(je,U.dateFormat))),H({date:ae?j:j[0],formattedDate:ae?z:z[0],datepicker:this})}_handleAlreadySelectedDates(j,z){let{selectedDates:T,rangeDateFrom:U,rangeDateTo:H}=this,{range:P,toggleSelected:Q}=this.opts,ae=T.length,he=typeof Q=="function"?Q({datepicker:this,date:z}):Q,je=!!(P&&ae===1&&j),Ce=je?M(z):z;P&&!he&&(ae!==2&&this.selectDate(Ce),ae===2&&_(U,H))||(he?this.unselectDate(Ce):this._updateLastSelectedDate(je?Ce:j))}_handleUpDownActions(j,z){if(!((j=E(j||this.focusDate||this.viewDate))instanceof Date))return;let T=z==="up"?this.viewIndex+1:this.viewIndex-1;T>2&&(T=2),T<0&&(T=0),this.setViewDate(new Date(j.getFullYear(),j.getMonth(),1)),this.setCurrentView(this.viewIndexes[T])}getCell(j){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.day;if(!((j=E(j))instanceof Date))return;let{year:T,month:U,date:H}=p(j),P=`[data-year="${T}"]`,Q=`[data-month="${U}"]`,ae={[r.day]:`${P}${Q}[data-date="${H}"]`,[r.month]:`${P}${Q}`,[r.year]:`${P}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(ae[z]):void 0}_showMobileOverlay(){Me.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((j,z)=>parseFloat(z)+j,0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return p(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return w(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===r.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===r.days}get $container(){return this.$customContainer||se}static replacer(j,z,T){return j.replace(z,function(U,H,P,Q){return H+T+Q})}}var pt;return le(Re,"defaults",a),le(Re,"version","3.5.3"),le(Re,"defaultGlobalContainerId","air-datepicker-global-container"),pt=Re.prototype,Object.assign(pt,ge),s.default}()})}(Hl)),Hl.exports}var kS=bS();const _S=Za(kS),CS=({air_datepicker:n,...e})=>{const[t,s]=v.useState(!1),r=v.useRef(void 0);return v.useEffect(()=>{const a=r.current;if(!a)return;const l=new _S(a,n.options);return s(!0),()=>{l.destroy(),s(!1)}},[]),c.jsx("div",{...e,children:c.jsx("input",{className:"dark",type:"text",ref:r})})},NS=n=>((n==null?void 0:n.filter(t=>t.type==="product"))??[]).length==0?[!1,"You have to apply at least ONE Product Filter"]:[!0,void 0],uy=({onChange:n,value:e=[],context:t})=>{const[s,r]=v.useState(e),a=v.useCallback(f=>{if(s.indexOf(f)!=-1)return;const p=[...s,f];n(p),r(p)},[s,n]),l=v.useCallback(f=>{const p=s.indexOf(f);if(p==-1)return;s.splice(p,1);const g=[...s];n(g),r(g)},[s,n]),{navWithState:u}=Gn(),d=v.useCallback(f=>{const p=(t==null?void 0:t.getState)&&(t==null?void 0:t.getState()),g=`/pages/collections/${f.handle}`;u(g,p)},[t,u]);return c.jsxs("div",{className:"w-full",children:[c.jsx(so,{onSelect:a,resource:"collections",header:"Select Collections",clsReload:"text-3xl text-kf-400",name_fn:f=>f.title??f.handle,layout:1}),(s==null?void 0:s.length)>0&&c.jsx(lt,{className:"w-full mt-5"}),c.jsx(ps,{onClick:d,onRemove:l,tags:s,className:"mt-5",name_fn:f=>(f==null?void 0:f.title)??f.handle})]})},jS=({...n})=>c.jsx(uy,{...n}),hy=({onChange:n,value:e=[],context:t})=>{const[s,r]=v.useState(e),a=v.useCallback(u=>{if(s.indexOf(u)!=-1)return;const d=[...s,u];n(d),r(d)},[s,n]),l=v.useCallback(u=>{const d=s.indexOf(u);if(d==-1)return;s.splice(d,1);const f=[...s];n(f),r(f)},[s,n]);return c.jsxs("div",{className:"w-full",children:[c.jsx(Ix,{onSelect:a,header:"Select Tags",clsReload:"text-3xl text-kf-400",layout:1}),(s==null?void 0:s.length)>0&&c.jsx(lt,{className:"w-full mt-5"}),c.jsx(ps,{onRemove:l,onClick:l,tags:s,className:"mt-5"})]})},dy=({onChange:n,value:e=[],context:t})=>{const s=v.useRef(void 0),[r,a]=v.useState(e),l=v.useCallback(p=>{const g=r.indexOf(p);if(g==-1)return;r.splice(g,1);const y=[...r];n(y),a(y)},[r,n]),{navWithState:u}=Gn(),d=v.useCallback(p=>{const g=(t==null?void 0:t.getState)&&(t==null?void 0:t.getState()),y=`/pages/products/${p.handle??p.id}`;u(y,g)},[r,t,u]),f=v.useCallback(p=>{const y=[...p.map(w=>({handle:w.handle,id:w.id,title:w.title})).filter(w=>r.find(k=>k.handle===w.handle)===void 0),...r];n(y),a(y),s.current.hide()},[r,n]);return c.jsxs("div",{className:"w-full",children:[c.jsx(Xt,{className:"text-sm mx-auto h-10 w-40 ",stroke:"border-2",children:"Browse products",onClick:()=>s.current.show()}),c.jsx(Is,{ref:s,children:c.jsx(ro,{onSave:f,onCancel:()=>s.current.hide()})}),(r==null?void 0:r.length)>0&&c.jsx(lt,{className:"w-full mt-5"}),c.jsx(ps,{onRemove:l,onClick:d,tags:r,name_fn:p=>p.title??p.handle??p.id,className:"mt-5"})]})},SS=({...n})=>c.jsx(dy,{...n}),ES=({...n})=>c.jsx(hy,{...n}),MS=({onChange:n,value:e={from:0,to:1/0}})=>{const[t,s]=v.useState(e);v.useEffect(()=>{n(t)},[]);const r=v.useCallback((l,u)=>{const d={...t,[l]:parseFloat(u.currentTarget.value)};s(d),n(d)},[t,n]),a=[{name:"From",key:"from"},{name:"To",key:"to"}];return c.jsx("div",{className:"w-full flex flex-row items-center flex-wrap gap-5",children:a.map(({name:l,key:u},d)=>c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[l,c.jsx(Qe,{type:"number",step:"1",min:"0",value:t[u],className:"w-20 rounded-md",onWheel:f=>f.target.blur(),onChange:f=>r(u,f)})]},d))})},DS=()=>c.jsx("p",{children:"All products are eligible"}),TS=({onChange:n,value:e={from:0,to:1/0}})=>{const[t,s]=v.useState(e),r=v.useCallback((l,u)=>{const d={...t,[l]:parseFloat(u.currentTarget.value)};s(d),n(d)},[t,n]),a=[{name:"From",key:"from"},{name:"To",key:"to"}];return c.jsx("div",{className:"w-full flex flex-row items-center flex-wrap gap-5",children:a.map(({name:l,key:u},d)=>c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[l,c.jsx(Qe,{type:"number",step:"1",min:"0",value:t[u],className:"w-20 rounded-md ",onWheel:f=>f.target.blur(),onChange:f=>r(u,f)})]},d))})},IS=({onChange:n,value:e={from:0,to:1/0}})=>{const[t,s]=v.useState(e),r=v.useCallback((l,u)=>{const d={...t,[l]:parseInt(u.currentTarget.value)};s(d),n(d)},[t,n]),a=[{name:"From",key:"from"},{name:"To",key:"to"}];return c.jsx("div",{className:"w-full flex flex-row items-center flex-wrap gap-5",children:a.map(({name:l,key:u},d)=>c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[l,c.jsx(Qe,{type:"number",step:"1",min:"0",value:t[u],className:"w-20 rounded-md ",onWheel:f=>f.target.blur(),onChange:f=>r(u,f)})]},d))})},AS=({onChange:n,value:e={from:new Date().toISOString(),to:new Date().toISOString()}})=>{const[t,s]=v.useState(e),{darkMode:r}=hs(),a=v.useCallback((u,d)=>{const f={...t,[u]:d.toISOString()};s(f),n(f)},[t,n]),l=[{name:"From",key:"from"},{name:"To",key:"to"}];return c.jsx("div",{className:"w-full flex flex-row gap-5 flex-wrap",children:l.map(({name:u,key:d},f)=>c.jsxs("div",{className:"flex flex-row --items-center flex-wrap gap-3",children:[c.jsx("span",{children:u}),c.jsx(CS,{className:"border p-3 shelf-card outline-none",air_datepicker:{options:{classes:r?"dark":"light",isMobile:!0,inline:!1,autoClose:!0,timepicker:!0,locale:yS,minDate:new Date(0),maxDate:new Date(9999,11,31),dateFormat:"MMMM d, yyyy h:mm aa",timeFormat:"HH:mm",selectedDates:[new Date(t[d]??null)],onSelect:p=>{a(d,p.date)}}}})]},f+String(r)))})},LS=({onChange:n,value:e=[],context:t})=>{const s=v.useRef(void 0),[r,a]=v.useState(e),l=v.useCallback(p=>{const g=r.indexOf(p);if(g==-1)return;r.splice(g,1);const y=[...r];n(y),a(y)},[r,n]),{navWithState:u}=Gn(),d=v.useCallback(p=>{const g=(t==null?void 0:t.getState)&&(t==null?void 0:t.getState()),y=`/pages/customers/${p.id}`;u(y,g)},[t,u]),f=v.useCallback(p=>{const g=[...p.filter(y=>r.find(w=>w.id===y.id)===void 0),...r];n(g),a(g),s.current.hide()},[r,n]);return c.jsxs("div",{className:"w-full",children:[c.jsx(Xt,{children:"Browse Customers",className:"text-sm mx-auto h-10 w-40",stroke:"border-2",onClick:()=>s.current.show()}),c.jsx(Is,{ref:s,children:c.jsx(p6,{onSave:f,onCancel:()=>s.current.hide()})}),(r==null?void 0:r.length)>0&&c.jsx(lt,{className:"w-full mt-5"}),c.jsx(ps,{onRemove:l,onClick:d,name_fn:Xx,tags:r,className:"mt-5"})]})},OS=({name:n,value:e,type:t,Comp:s,CompParams:r,onChange:a,onRemove:l,ix:u,context:d,...f})=>{const[p,g]=v.useState(void 0);return c.jsxs("div",{className:`shelf-card-light w-full h-fit p-5 border shadow-lg
|
557
|
+
text-sm rounded-lg`,...f,children:[c.jsxs("div",{className:`shelf-border-color border-b pb-2 flex
|
558
|
+
flex-row justify-between mb-5`,children:[c.jsxs("div",{className:"flex flex-row flex-wrap gap-3 items-center",children:[c.jsx("span",{children:`${t} Filter`,className:`p-1 text-white rounded-md bg-gradient-to-r
|
559
|
+
border whitespace-nowrap
|
560
|
+
${t==="product"?"from-pink-500 to-kf-500 border-kf-300/50":"from-teal-500 to-teal-400 border-teal-500"}`}),c.jsx("span",{children:n,className:"pr-3"})]}),c.jsx(Y5,{onClick:l,className:`text-base items-center
|
561
|
+
cursor-pointer hover:text-teal-600
|
562
|
+
flex-shrink-0`})]}),s&&c.jsx(s,{...r,context:d,onChange:a,value:e}),c.jsx(_e,{show:p,children:c.jsx("p",{children:p,className:"text-red-600 py-3"})})]})},lc=[{...Tt.p_in_collections,Comp:uy,CompParams:{}},{...Tt.p_not_in_collections,Comp:jS,CompParams:{}},{...Tt.p_in_products,Comp:dy,CompParams:{}},{...Tt.p_not_in_products,Comp:SS,CompParams:{}},{...Tt.p_in_tags,Comp:hy,CompParams:{}},{...Tt.p_not_in_tags,Comp:ES,CompParams:{}},{...Tt.p_in_price_range,Comp:MS,CompParams:{}},{...Tt.p_all,Comp:DS,CompParams:{}},{...Tt.o_subtotal_in_range,Comp:TS,CompParams:{}},{...Tt.o_items_count_in_range,Comp:IS,CompParams:{}},{...Tt.o_date_in_range,Comp:AS,CompParams:{}},{...Tt.o_has_customer,Comp:LS,CompParams:{}}],RS=n=>{const e=lc.find(t=>t.id===n);return{name:e==null?void 0:e.name,Comp:e==null?void 0:e.Comp,CompParams:e==null?void 0:e.CompParams}},PS=({type:n,onAdd:e})=>{const t=lc.filter(s=>s.type===n);return c.jsxs("button",{className:`shelf-bling-fill shelf-border-color
|
563
|
+
rounded-lg w-full border pl-2 sm:px-3 --pl-3
|
564
|
+
py-2 shadow-lg flex overflow-x-hidden
|
565
|
+
flex-col justify-between h-full text-base`,children:[c.jsx("p",{children:`${n} Filter`,className:"shelf-text-minor-2 overflow-x-hidden whitespace-nowrap"}),c.jsxs("select",{value:"-1",className:"w-full h-9 bg-transparent outline-none text-gray-500 p-0",onChange:s=>e(s.currentTarget.value),children:[c.jsx("option",{children:"Add Filter",value:"-1",className:"p-0 appearance-none"},"-1"),t.map((s,r)=>c.jsx("option",{children:s.name,value:s.id},r))]})]})},fy=({value:n,onChange:e,types:t=["product","order"],context:s,...r})=>{const[a,l]=v.useState(n??[]),u=v.useCallback(g=>{l(g),e&&e(g)},[e]),d=v.useCallback((g,y)=>{a[g].value=y;const w=[...a];u(w)},[a,u]),f=v.useCallback(g=>{a.splice(g,1),u([...a])},[a,u]),p=v.useCallback(g=>{const y=lc.find(_=>_.id==g),w={meta:{id:y.id,type:y.type,op:y.op},value:void 0},k=[...a,w];u(k)},[a,u,lc]);return c.jsxs("div",{className:"w-full",children:[c.jsx("div",{className:"flex flex-row gap-4 mt-3 w-full ",children:t.map((g,y)=>c.jsx(Je,{className:"flex-1",rounded:"rounded-lg",children:c.jsx(PS,{type:g,onAdd:p})},y))}),c.jsx(_e,{show:a.length,children:c.jsx("p",{children:"",className:`mt-5 h-0.5 mb-5 bg-gradient-to-r
|
566
|
+
from-pink-500/50 to-kf-500/50`})}),c.jsx("div",{className:"w-full flex flex-col gap-5",children:a.map((g,y)=>{var w,k,_;return v.createElement(OS,{...RS((w=g==null?void 0:g.meta)==null?void 0:w.id),context:s,onChange:C=>d(y,C),onRemove:()=>f(y),key:y,ix:y,value:g.value,id:String((k=g.meta)==null?void 0:k.id),type:(_=g.meta)==null?void 0:_.type})})})]})},zS=n=>n===void 0?[!1,"You have to choose a Discount"]:[!0,void 0],N1=[{id:0,type:"regular",name:"Regular Discount",desc:"All Filtered products you defined will get the same discount. For Example: Every shirt will have 10% discount"},{id:1,type:"bulk",name:"Bulk Discount",desc:"Set an exact bulk discount on filtered products. for Example, 3 for 100$, 5 for 5% off"},{id:2,type:"buy_x_get_y",name:"Buy X Get Y",desc:"Buy some from the filtered products and get Y for discount. For Example: Buy 3 pants, get a Shirt for 50% off"},{id:3,type:"order",name:"Order Discount",desc:"Offer a discount on the total order including perks such as Free Shipping"},{id:4,type:"bundle",name:"Bundle Discount",desc:"Offer a discount on a bundle of products. For Example, buy a Laptop + Headset at discount 💲"}],BS=({selectedType:n,onChange:e})=>{const t=v.useMemo(()=>{var r;return(r=N1.find(a=>a.id===(n==null?void 0:n.id)))==null?void 0:r.desc},[n,N1]),s=({type:r})=>c.jsxs("div",{className:"",children:[c.jsx("input",{type:"radio",id:r.type,name:"discount_type",value:r.type,className:"accent-pink-500",checked:r.type===(n==null?void 0:n.type),onChange:a=>e(r)}),c.jsx("label",{htmlFor:r.type,children:r.name,onClick:a=>e(r),className:"mx-3"})]});return c.jsxs("div",{className:"flex flex-row flex-wrap gap-5 --items-start",children:[c.jsx("div",{className:"flex flex-col gap-2 --flex-shrink-0 w-fit",children:Object.values(xn).filter(r=>r.type).map((r,a)=>c.jsx(s,{type:r},r.type))}),c.jsx("div",{className:"pl-5 border-l-2 shelf-border-color flex-1 min-w-[13rem]",children:c.jsx("p",{children:t,className:"text-gray-500 text-sm tracking-wide"})})]})},VS=(n,e,t)=>{e=Number.isNaN(e)?0:e,t=Number.isNaN(t)?0:t;const s=(100-e)/100,r=Number.isNaN(t)?"":Math.abs(t)!=0?`${t<0?" - ":" + "} ${Math.abs(t)}`:"";let a=(100-e)/100;return a=typeof s=="number"&&!Number.isNaN(s)?s:"(100 - Percents)/100",a==0?Number.isNaN(t)?0:t:a==1?n+r:n+" * "+a+r},$S=({type:n,value:e,onChange:t})=>{const[s,r]=v.useState(e),a=v.useCallback((l,u)=>{const d={...s,[l]:u};r(d),t(d)},[s,t]);return c.jsxs("div",{className:"shelf-text-title-color",children:[c.jsx("p",{children:"Quantity Discount",className:"text-lg font-bold "}),c.jsxs("div",{className:`w-full mt-3 flex flex-row gap-3 items-end
|
567
|
+
flex-wrap text-base `,children:[c.jsxs("p",{children:[c.jsx(on,{children:"Customer"})," buys a ",c.jsx(on,{children:"Quantity"})," of"]}),c.jsx(Qe,{type:"number",min:"1",step:"1",onWheel:l=>l.target.blur(),value:s.qty,onChange:l=>a("qty",Math.max(parseInt(l.currentTarget.value),1)),inputClsName:"h-7",stroke:"border-b",className:"rounded-md w-14"}),c.jsxs("p",{children:[c.jsx(on,{children:"products"})," specified by the filters ",c.jsx("b",{children:"ABOVE ⬆️"})]})]}),c.jsx("p",{children:`How to discount a bulk of ${s.qty} items`,className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"w-full mt-5 flex flex-row flex-wrap gap-3 items-center ",children:[c.jsx("label",{children:"Percents off"}),c.jsx(Qe,{type:"number",min:"0",max:"100",step:"1",onWheel:l=>l.target.blur(),value:s.percent,onChange:l=>a("percent",Math.min(parseFloat(l.currentTarget.value),100)),inputClsName:"h-7",className:"rounded-lg w-16"}),c.jsx("span",{children:"+",className:"text-2xl font-bold"}),c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[c.jsx("label",{children:"Fixed Price"}),c.jsx(Qe,{type:"number",value:s.fixed,onWheel:l=>l.target.blur(),onChange:l=>a("fixed",parseFloat(l.currentTarget.value)),inputClsName:"h-7",className:"rounded-lg w-16"})]})]}),c.jsx("p",{children:"* Fixed Price may be negative.",className:"text-sm mt-5 tracking-wider"}),c.jsx("p",{children:"Other Options",className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[c.jsx("input",{id:"cb_recursive",type:"checkbox",checked:s.recursive===!0,onChange:l=>a("recursive",!s.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
568
|
+
focus:ring-0`}),c.jsx("label",{htmlFor:"cb_recursive",children:"Recursive"}),c.jsx("span",{children:"(Apply the discount as much as possible)",className:" text-sm"})]}),c.jsx(ao,{prefix:`total price of ${Number.isNaN(s==null?void 0:s.qty)?1:s.qty}`,percent:s==null?void 0:s.percent,fixed:s==null?void 0:s.fixed})]})},FS=n=>{switch(n.meta.op){case Tt.p_all.op:return c.jsxs(c.Fragment,{children:[c.jsx("b",{children:"any"})," product"]});case Tt.p_in_collections.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that belongs to any of the following ",c.jsx("b",{children:"collections"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t.title,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_not_in_collections.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that ",c.jsx("span",{className:"underline",children:"does not"})," belong to the following ",c.jsx("b",{children:"collections"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t.title,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_in_tags.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that has any of the following ",c.jsx("b",{children:"tags"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_not_in_tags.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that has ",c.jsx("span",{className:"underline",children:"does not"})," have any of the following ",c.jsx("b",{children:"tags"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_in_products.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that is any of the ",c.jsx("b",{children:"following"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t.title,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_not_in_products.op:{const e=n.value??[];return c.jsxs(c.Fragment,{children:["a product, that is ",c.jsx("span",{className:"underline",children:"not"}),"any of the following ",c.jsx("b",{children:"products"}),":",c.jsx("ol",{className:"list-disc list-inside",children:e.map((t,s)=>c.jsx("li",{children:t.title,className:"font-semibold shelf-text-label-color-second"},s))})]})}case Tt.p_in_price_range.op:{const e=n.value;return c.jsxs(c.Fragment,{children:["a product, that is ",c.jsx("b",{children:"priced"})," between",c.jsx("b",{children:` ${(e==null?void 0:e.from)??0}`,className:"shelf-text-label-color-second"})," to",c.jsx("b",{className:"shelf-text-label-color-second",children:` ${(e==null?void 0:e.to)??"Infinity"}`})]})}default:return"WHAT"}},HS=n=>{switch(n){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return`${n}th`}},j1=n=>n.meta.type==="product",US=({meta:n,value:e,context:t,onChange:s})=>{const[r,a]=v.useState([]),[l,u]=v.useState(e);v.useEffect(()=>{var p;return(()=>{var y;const g=((y=t==null?void 0:t.query["info.filters"])==null?void 0:y.get())??[];a([...g].filter(j1))})(),(p=t==null?void 0:t.pubsub)==null?void 0:p.add_sub((g,y=[])=>{g==="info.filters"&&a(y.filter(j1))})},[t]);const d=v.useCallback((f,p)=>{const g={...l,[f]:p};u(g),s(g)},[l,s]);return c.jsxs("div",{className:"shelf-text-title-color",children:[c.jsx("p",{children:"Bundle Breakdown",className:"text-lg font-bold "}),c.jsxs("div",{className:`w-full mt-2 flex flex-col gap-3 --items-end
|
569
|
+
text-base `,children:[c.jsx(_e,{show:r==null?void 0:r.length,children:r.map((f,p)=>c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx(on,{children:HS(p+1),className:"text-lg shelf-text-label-color"})," item in bundle is ",FS(f)]}),c.jsx(lt,{})]},p))}),c.jsx(_e,{show:!(r!=null&&r.length),children:c.jsxs("p",{className:"text-base mt-3",children:["Use the ",c.jsx(on,{children:"products"})," filters ",c.jsx("b",{children:"ABOVE ⬆️"}),". ",c.jsx("br",{}),"Each ",c.jsx(on,{children:"filter"})," is a bundle item"]})})]}),c.jsx("p",{children:"How to discount a Bundle",className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"w-full mt-5 flex flex-row flex-wrap gap-3 items-center ",children:[c.jsx("label",{children:"Percents off"}),c.jsx(Qe,{type:"number",min:"0",max:"100",step:"1",onWheel:f=>f.target.blur(),value:l.percent,onChange:f=>d("percent",Math.min(parseFloat(f.currentTarget.value),100)),inputClsName:"h-7",className:"rounded-lg w-16"}),c.jsx("span",{children:"+",className:"text-2xl font-bold"}),c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[c.jsx("label",{children:"Fixed Price"}),c.jsx(Qe,{type:"number",value:l.fixed,onWheel:f=>f.target.blur(),onChange:f=>d("fixed",parseFloat(f.currentTarget.value)),inputClsName:"h-7",className:"rounded-lg w-16"})]})]}),c.jsx("p",{children:"* Fixed Price may be negative. ",className:"text-sm mt-5 tracking-wider"}),c.jsx("p",{children:"Other Options",className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[c.jsx("input",{id:"cb_recursive",type:"checkbox",checked:l.recursive===!0,onChange:f=>d("recursive",!l.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
570
|
+
focus:ring-0`}),c.jsx("label",{htmlFor:"cb_recursive",children:"Recursive"}),c.jsx("span",{children:"(Apply the discount as much as possible)",className:" text-sm"})]}),c.jsx(ao,{prefix:"Bundle Price",percent:l==null?void 0:l.percent,fixed:l==null?void 0:l.fixed})]})},ao=({prefix:n,percent:e,fixed:t})=>{const s=VS(`(${n})`,e,t),r=Number.isNaN(e)||e==0?"Percents":`${e}%`;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-lg font-bold mt-6 flex flex-row items-center gap-2",children:[c.jsx(zb,{}),c.jsx("span",{children:"Pricing Explanation"})]}),c.jsx("p",{children:`(${n}) * (100% - ${r}) + Fixed = `,className:"text-base mt-5 font-mono tracking-wide font-semibold"}),c.jsx("p",{children:s,className:"text-base font-mono tracking-wide font-semibold "})]})},WS=({type:n,value:e,onChange:t})=>{const[s,r]=v.useState(e),a=v.useCallback((l,u)=>{const d={...s,[l]:parseFloat(u)};r(d),t(d)},[s,t]);return c.jsxs("div",{className:"shelf-text-title-color",children:[c.jsx("p",{children:"Eligible Products",className:"text-lg font-bold"}),c.jsxs("p",{className:"text-base mt-3",children:[c.jsx(on,{children:"products"})," specified by the ",c.jsx("b",{children:"product"})," filters ",c.jsx("b",{children:"ABOVE ⬆️"})]}),c.jsx("p",{children:"How to discount each item",className:"text-lg font-bold mt-5"}),c.jsxs("div",{className:`w-full mt-5 flex flex-row flex-wrap
|
571
|
+
gap-3 items-center `,children:[c.jsx("label",{children:"Percents off"}),c.jsx(Qe,{type:"number",onWheel:l=>l.target.blur(),onChange:l=>a("percent",Math.min(parseFloat(l.currentTarget.value),100)),value:s.percent,min:"0",max:"100",step:"1",inputClsName:"h-7",className:"rounded-lg w-14"}),c.jsx("span",{children:"+",className:"text-2xl font-bold"}),c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[c.jsx("label",{children:"Fixed Price"}),c.jsx(Qe,{type:"number",onWheel:l=>l.target.blur(),onChange:l=>a("fixed",parseFloat(l.currentTarget.value)),value:s==null?void 0:s.fixed,inputClsName:"h-7",className:"rounded-lg w-14"})]})]}),c.jsx("p",{children:"* Fixed Price may be negative",className:"text-sm mt-5 tracking-wider"}),c.jsx(ao,{prefix:"Product Price",percent:s==null?void 0:s.percent,fixed:s==null?void 0:s.fixed})]})},on=({className:n="",...e})=>c.jsx("span",{className:`font-semibold border-b-2
|
572
|
+
shelf-border-color border-dashed ${n}`,...e}),YS=({type:n,value:e,onChange:t,context:s})=>{const[r,a]=v.useState(e),l=v.useCallback((u,d)=>{const f={...r,[u]:d};a(f),t&&t(f)},[r,t]);return c.jsxs("div",{className:"shelf-text-title-color",children:[c.jsx("p",{children:"Customer Buys X",className:"text-lg font-bold "}),c.jsxs("div",{className:`w-full mt-1 flex flex-row flex-wrap gap-3 items-end text-base
|
573
|
+
`,children:[c.jsxs("p",{children:[c.jsx(on,{children:"Customer"})," buys a ",c.jsx(on,{children:"Quantity"})," of"]}),c.jsx(Qe,{type:"number",min:"1",step:"1",onWheel:u=>u.target.blur(),value:r.qty_x,onChange:u=>l("qty_x",Math.max(parseInt(u.currentTarget.value),1)),inputClsName:"h-7",stroke:"border-b",className:"rounded-lg w-14 inline-block"}),c.jsxs("p",{children:[c.jsx(on,{children:"products"})," specified by the filters ",c.jsx("b",{children:"ABOVE ⬆️"})]})]}),c.jsx("p",{children:"Customer Gets Y",className:"text-lg font-bold mt-5 "}),c.jsxs("div",{className:`w-full mt-1 flex flex-row gap-3 items-end
|
574
|
+
flex-wrap text-base`,children:[c.jsxs("p",{children:[c.jsx(on,{children:"Customer"})," gets a ",c.jsx(on,{children:"Quantity"})," of"]}),c.jsx(Qe,{inputClsName:"h-7 rounded-md",type:"number",min:"1",step:"1",onWheel:u=>u.target.blur(),value:r.qty_y,onChange:u=>l("qty_y",Math.max(parseInt(u.currentTarget.value),1)),stroke:"border-b",className:"w-14"}),c.jsxs("p",{children:[c.jsx(on,{children:"products"})," specified by the filters ",c.jsx("b",{children:"BELOW ⬇️"})]})]}),c.jsx(fy,{types:["product"],context:s,value:r.filters_y,onChange:u=>l("filters_y",u)}),c.jsx("p",{children:`How to discount the ${r.qty_y} items`,className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"w-full mt-5 flex flex-row flex-wrap gap-3 items-center ",children:[c.jsx("label",{children:"Percents off"}),c.jsx(Qe,{type:"number",min:"0",max:"100",step:"1",onWheel:u=>u.target.blur(),value:r.percent,onChange:u=>l("percent",Math.min(parseFloat(u.currentTarget.value),100)),inputClsName:"h-7",className:"rounded-lg w-16"}),c.jsx("span",{children:"+",className:"text-2xl font-bold"}),c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[c.jsx("label",{children:"Fixed Price"}),c.jsx(Qe,{type:"number",value:r.fixed,onWheel:u=>u.target.blur(),onChange:u=>l("fixed",parseFloat(u.currentTarget.value)),inputClsName:"h-7",className:"rounded-lg w-16"})]})]}),c.jsx("p",{children:"* Fixed Price may be negative.",className:"text-sm mt-5 tracking-wider"}),c.jsx("p",{children:"Other Options",className:"text-lg font-bold mt-6"}),c.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[c.jsx("input",{id:"cb_recursive",type:"checkbox",checked:r.recursive===!0,onChange:u=>l("recursive",!r.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
575
|
+
focus:ring-0`}),c.jsx("label",{htmlFor:"cb_recursive",children:"Recursive"}),c.jsx("span",{children:"(Apply the discount as much as possible)",className:" text-sm"})]}),c.jsx(ao,{prefix:`total price of ${Number.isNaN(r==null?void 0:r.qty_y)?1:r.qty_y}`,percent:r==null?void 0:r.percent,fixed:r==null?void 0:r.fixed})]})},KS=({type:n,value:e,onChange:t})=>{const[s,r]=v.useState(e),a=v.useCallback((l,u)=>{const d={...s,[l]:u};r(d),t(d)},[s,t]);return c.jsxs("div",{className:"shelf-text-title-color",children:[c.jsx("p",{children:"Eligible Orders",className:"text-lg font-bold"}),c.jsxs("p",{className:"text-base mt-3",children:[c.jsx(on,{children:"Orders"})," specified by the ",c.jsx("b",{children:"order"})," filters ",c.jsx("b",{children:"ABOVE ⬆️"})]}),c.jsx("p",{children:"How to discount Total Price",className:"text-lg font-bold mt-5"}),c.jsxs("div",{className:`w-full mt-5 flex flex-row flex-wrap gap-3 items-center
|
576
|
+
`,children:[c.jsx("label",{children:"Percents off"}),c.jsx(Qe,{type:"number",onWheel:l=>l.target.blur(),onChange:l=>a("percent",Math.min(parseFloat(l.currentTarget.value),100)),value:s.percent,min:"0",max:"100",step:"1",inputClsName:"h-7",className:"rounded-lg w-14"}),c.jsx("span",{children:"+",className:"text-2xl font-bold"}),c.jsxs("div",{className:"flex flex-row items-center gap-3",children:[c.jsx("label",{children:"Fixed Price"}),c.jsx(Qe,{min:"-10000",type:"number",onWheel:l=>l.target.blur(),onChange:l=>a("fixed",parseFloat(l.currentTarget.value)),inputClsName:"h-7",value:s.fixed,className:"rounded-lg w-14"})]})]}),c.jsx("p",{children:"More Options",className:"text-lg font-bold mt-5"}),c.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[c.jsx("input",{id:"cb",type:"checkbox",checked:s.free_shipping==!0,onChange:l=>a("free_shipping",!s.free_shipping),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
577
|
+
focus:ring-0`}),c.jsx("label",{htmlFor:"cb",children:"Free Shipping"})]}),c.jsx("p",{children:"* Fixed Price may be negative.",className:"text-sm mt-5 tracking-wider"}),c.jsx(ao,{prefix:"Order Total",percent:s==null?void 0:s.percent,fixed:s==null?void 0:s.fixed})]})},QS=[{type:"regular",Comp:WS,CompParams:{}},{type:"bulk",Comp:$S,CompParams:{}},{type:"buy_x_get_y",Comp:YS,CompParams:{}},{type:"order",Comp:KS,CompParams:{}},{type:"bundle",Comp:US,CompParams:{}}],ZS=({meta:n,context:e,onChange:t,value:s,...r})=>{const a=QS.find(d=>d.type===(n==null?void 0:n.type));if(!a)return c.jsx(c.Fragment,{});const{Comp:l,CompParams:u}=a;return c.jsx(l,{...u,onChange:t,value:s,meta:n,type:n.type,context:e,...r})},GS=n=>{switch(n.id){case xn.regular.id:return{percent:0,fixed:0};case xn.bulk.id:return{percent:0,fixed:0,qty:3,recursive:!1};case xn.order.id:return{percent:0,fixed:0,free_shipping:!1};case xn.buy_x_get_y.id:return{percent:0,fixed:0,qty_x:1,qty_y:1,filters_y:[]};case xn.bundle.id:return{percent:0,fixed:0};default:return}},JS=({field:n,value:e,context:t,onChange:s,...r})=>{const[a,l]=v.useState(e==null?void 0:e.meta),[u,d]=v.useState(e==null?void 0:e.extra),f=v.useCallback((y,w)=>{l(y),d(w),s&&s({meta:y,extra:w})},[s]),p=v.useCallback(y=>{f(y,GS(y))},[f]),g=v.useCallback(y=>{f(a,y)},[a,f]);return c.jsxs("div",{className:"w-full",children:[c.jsx(BS,{onChange:p,selectedType:a}),c.jsx(_e,{show:a,children:c.jsx("p",{children:"",className:`border-b-g mt-5 h-0.5 mb-5 bg-gradient-to-r
|
578
|
+
from-pink-400 to-kf-300`})}),c.jsx(ZS,{meta:a,context:t,onChange:g,value:e==null?void 0:e.extra})]})},qS=({field:n,context:e,error:t,setError:s,...r})=>{const{sdk:a}=bt(),[l,u]=v.useState({affected_products_count:void 0,affected_orders_count:void 0,loaded:!1}),d=e==null?void 0:e.data;v.useEffect(()=>{async function p(){const g=await a.statistics.countOf("products",{vql:`discount:${d.handle} | discount:${d.id}`}),y=await a.statistics.countOf("orders",{vql:`discount:${d.handle} | discount:${d.id}`});u({affected_products_count:g,affected_orders_count:y,loaded:!0})}p().catch(g=>s("ouch, something wrong happened"))},[d]);let f="";return l.loaded&&(f=`> This \`discount\` is **eligible** for **${l.affected_products_count}** \`products\`
|
579
|
+
|
580
|
+
`,f+=`> Also, This \`discount\` was applied in **${l.affected_orders_count}** \`orders\`
|
581
|
+
|
582
|
+
`),c.jsx("div",{...r,children:c.jsx(_e,{show:l.loaded,children:c.jsx(It,{value:f})})})},XS=n=>n===void 0?[!1,"Empty Code"]:/\s/g.test(n)?[!1,"Code cannot contain whitespace/s"]:[!0,void 0],e9={key:"info",name:"Info",comp:We,comp_params:{className:"w-full flex flex-col gap-5"},validate:!1,fields:[{key:"filters",name:"🔎 Filters",validate:!0,validator:NS,desc:"Define which products or orders (by date, amount or customers) are eligible for discount",comp:ce(fy,{className:"w-full h-9"},!0),comp_params:{className:"w-full"}},{key:"details",name:"⚙️ Discount Details",validate:!0,validator:zS,desc:"Choose the type of discount and its behaviour",comp:ce(JS,{className:"w-full h-9"},!0),comp_params:{className:"w-full"}}]},t9={name:"Main",comp:We,comp_params:{className:`w-full --max-w-[35rem] gap-5 items-center
|
583
|
+
lg:items-start lg:w-[35rem] flex flex-col `},fields:[{key:"title",name:"Title",type:"text",validate:!0,desc:"A short and catchy title: 10% OFF for Orders above 100$",comp:ce($e(Fe),{className:"w-full h-10"},!0),comp_params:{className:"w-full"}},{key:"handle",name:"🎟️ Discount Code",type:"text",validate:!0,validator:XS,editable:!0,desc:"A short word identifier for the discount",comp:ce(bc,{className:"w-full h-fit",type:"text",placeholder:"code ..."}),comp_params:{className:"w-full text-xs py-auto --font-semibold"}},e9,{key:"media",name:"🎥 Media",type:"text",desc:"Manage and edit your media files",validate:!1,editable:!0,comp:ce(Ri),comp_params:{className:"w-full"}},{key:"description",name:"📝 Description",type:"text",validate:!1,desc:"Optional description",comp:ce(Os),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},n9=`
|
584
|
+
Order determines the order in which automatic discounts are applied.
|
585
|
+
<br/><br/>
|
586
|
+
Discounts are arranged as a stack and the order of application is important.
|
587
|
+
<br/><br/>
|
588
|
+
For Example, A discount with a \`0\` order will be applied before a discount with order 10.
|
589
|
+
<br/><br/>
|
590
|
+
Free Shipping for orders above say 100$ should be applied last and therefore should
|
591
|
+
have a high order number`,s9=`
|
592
|
+
Decide whether the discount is:
|
593
|
+
- **Automatically** applied, or
|
594
|
+
- **Coupon** (applied by user)
|
595
|
+
`,r9={name:"Main",comp:We,comp_params:{className:`w-full items-center lg:items-start lg:w-[18rem]
|
596
|
+
flex flex-col gap-5`},fields:[{key:"active",name:"Enable",validate:!0,desc:"Enable or disable the discount",editable:!0,defaultValue:!0,comp:ce(no,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:void 0,name:"🚀 Performance",desc:"This is how this discount performs",comp:ce(qS,{className:""},!0),comp_params:{className:"w-full"}},{key:"application",name:"Automatic or Coupon",validate:!0,desc:s9,editable:!0,defaultValue:Ei.Auto,comp:ce($e(zl(Object.values(Ei))),{className:"text-gray-600"},!0),comp_params:{className:"w-full text-xs py-auto --font-semibold "}},{key:"priority",name:"Order of discount",type:"number",validate:!0,desc:n9,editable:!0,comp:ce($e(Fe),{className:"h-10",type:"number",min:"0",step:"1"},!0),comp_params:{className:"w-full text-xs py-auto --font-semibold "}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Use Tags to quickly attach small attributes, that describe things",comp:ce(Ls),comp_params:{className:"w-full "}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}}]},i9={name:"Root",comp:We,comp_params:{className:"w-full gap-5 --justify-center --bg-red-100 items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row --mx-auto"},fields:[t9,r9]},a9=({onClickSave:n=void 0,onClickCreate:e=void 0,onClickDelete:t=void 0,onClickPublish:s=void 0,onClickDuplicate:r=void 0,onClickReload:a,id:l,className:u,isExported:d=!1})=>c.jsx(ms,{id:l,className:u,onClickCreate:e,onClickDelete:t,onClickDuplicate:r,onClickReload:a,onClickSave:n,children:c.jsx(Zn,{Icon:c.jsx(Z1,{}),text:`${d?"update":"create"} collection`,show:!!s,onClick:s,className:""})}),ed=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l,setError:u,duplicate:d},context:f,key:p,doc:g,isCreateMode:y,isEditMode:w,isViewMode:k,hasChanged:_,hasLoaded:C,error:S,ref_head:M,ref_root:I}=On("discounts",t,"/pages/discounts",n,s),L=v.useCallback(async()=>{await r(),await l(),u(void 0);try{await l()}catch(O){console.log("e",O),u({error:{messages:[{message:O.toString()}]}})}},[r,l]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["discounts",t??"create"],className:""}),c.jsx(gs,{doc:g,className:"mt-5",collectionId:"discounts"}),c.jsx(a9,{onClickSave:w?r:void 0,onClickCreate:y?r:void 0,onClickPublish:y?void 0:L,onClickDelete:y?void 0:a,onClickDuplicate:y?void 0:()=>d({title:(g==null?void 0:g.title)+" duplicate"}),onClickReload:y?void 0:async()=>l(!1),id:g==null?void 0:g.id,isExported:!!(g!=null&&g.published),className:"mt-5"}),c.jsx(us,{changes_made:_,ref:M,time:g==null?void 0:g.created_at,className:"mt-8"},g==null?void 0:g.updated_at),c.jsx(_e,{show:C&&w||y,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:S,className:"w-full"}),c.jsx(Ln,{ref:I,field:i9,value:g??{},context:f,isViewMode:k,className:"mt-8 mx-auto"},p)]})})]})},o9=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"price",name:"Price",comp:wt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],S1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("shipping","/pages/shipping-methods");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
597
|
+
shelf-border-color shadow-md mt-5
|
598
|
+
dark:shadow-slate-900`,children:[c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/shipping-methods/create",searchTitle:"Search by Name or Handle",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:o9}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},l9={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[35rem] flex flex-col gap-5"},fields:[{key:"title",name:"Title",type:"text",validate:!0,editable:!0,desc:"The name of the shipping method",comp:ce($e(Fe),{className:"h-10"}),comp_params:{className:"w-full h-fit"}},{key:"description",name:"📝 Description",type:"text",validate:!1,editable:!0,desc:"Optional description",comp:ce(Os),comp_params:{className:"w-full"}},{key:"media",name:"🎬 Media",type:"text",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:ce(Ri),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},c9={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[{key:"active",name:"Active",validate:!0,desc:"activate or deactivate the shipping method",editable:!0,defaultValue:!0,comp:ce(no,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:"price",name:"🏷️ Price",type:"number",validate:!0,editable:!0,desc:"The price of the shipping method",comp:ce($e(Fe),{className:"h-10",min:"0",type:"number"}),comp_params:{className:"w-full h-fit"}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach extra attributes to your methods",comp:ce(Ls)}]},u9={name:"Root",comp:We,comp_params:{className:`w-full --max-w-[35rem] --bg-red-100 items-center
|
599
|
+
lg:max-w-max lg:items-start lg:w-fit flex flex-col
|
600
|
+
lg:flex-row gap-5 mx-auto`},fields:[l9,c9]},h9=({onClickSave:n=void 0,onClickCreate:e=void 0,onClickDelete:t=void 0,onClickPublish:s=void 0,onClickDuplicate:r=void 0,onClickReload:a,id:l,className:u})=>c.jsx(ms,{id:l,className:u,onClickCreate:e,onClickDelete:t,onClickDuplicate:r,onClickReload:a,onClickSave:n}),td=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,reload:l,duplicate:u},context:d,key:f,doc:p,isCreateMode:g,isEditMode:y,isViewMode:w,hasChanged:k,hasLoaded:_,error:C,ref_head:S,ref_root:M}=On("shipping",t,"/pages/shipping-methods",n,s),I=v.useCallback(()=>u({title:(p==null?void 0:p.title)+" duplicate"}),[p,u]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["shipping",t??"create"],className:""}),c.jsx(gs,{doc:p,className:"mt-5",collectionId:"shipping"}),c.jsx(h9,{id:p==null?void 0:p.handle,className:"mt-5",onClickSave:y?r:void 0,onClickCreate:g?r:void 0,onClickDuplicate:g?void 0:I,onClickReload:g?void 0:async()=>l(!1),onClickDelete:g?void 0:a}),c.jsx(us,{changes_made:k,ref:S,time:p==null?void 0:p.created_at,className:"mt-8"},p==null?void 0:p.updated_at),c.jsx(_e,{show:_&&y||g,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:C,className:"w-full"}),c.jsx(Ln,{ref:M,field:u9,value:p??{},isViewMode:w,context:d,className:"mt-8"},f)]})})]})},d9=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold "}},{key:"handle",name:"Handle",comp:wt},{key:"updated_at",name:"Last Updated",comp:fs},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],E1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("storefronts","/pages/storefronts");return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
601
|
+
shelf-border-color shadow-md mt-5
|
602
|
+
dark:shadow-slate-900`,children:[c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/storefronts/create",searchTitle:"Search by title or handle",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:d9}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},f9=({field:n,context:e,value:t=[],onChange:s})=>{const r=v.useRef(null),{navWithState:a}=Gn(),l=v.useCallback(f=>{s(t.filter(p=>p.handle!==f.handle))},[t,s]),u=v.useCallback(f=>{const p=f.handle??f.id;a(`/pages/products/${p}`,e==null?void 0:e.getState())},[a,e]),d=v.useCallback(f=>{const p=[...f.filter(g=>!t.find(y=>y.handle===g.handle)),...t];s(p),r.current.hide()},[t,s]);return c.jsxs("div",{className:"w-full",children:[c.jsx(Xt,{children:"Browse products",className:"--w-fit h-10 w-40 mx-auto",onClick:()=>r.current.show()}),c.jsx(Is,{ref:r,children:c.jsx(ro,{onSave:d,onCancel:()=>r.current.hide()})}),(t==null?void 0:t.length)>0&&c.jsx(lt,{className:"my-5"}),c.jsx(ps,{onClick:u,onRemove:l,name_fn:f=>f.title,tags:t,className:"mt-5"})]})},p9={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[34rem] flex flex-col gap-5"},fields:[{key:"title",name:"Title",type:"text",validate:!0,editable:!0,desc:"Give your store a title",comp:ce($e(Fe),{className:"h-10"}),comp_params:{className:"w-full h-fit"}},{key:"handle",name:"🔗 Handle",type:"text",validate:!1,editable:!0,desc:"An identifier for your store",comp:ce(bc,{className:"w-full h-fit"}),comp_params:{className:"w-full h-fit"}},{key:"products",name:"🛍️ Products",type:"text",validate:!1,editable:!0,desc:"Decide which specific products are used by the Store Front",comp:ce(f9,{}),comp_params:{className:"w-full h-fit"}},{key:"collections",name:"🗂️ Collections",type:"text",validate:!1,editable:!0,desc:"Decide which collections meta data is used by the Store Front",comp:ce(Sa,{className:"w-full",add_all:!0,resource:"collections",name_fn:n=>n.title,slug:"/pages/collections"}),comp_params:{className:"w-full h-fit"}},{key:"discounts",name:"🎟️ Discounts",type:"text",validate:!1,editable:!0,desc:"Decide which discounts are used by the Store Front",comp:ce(Sa,{className:"w-full",add_all:!0,resource:"discounts",transform_fn:n=>n.filter(e=>e.application.id===Ei.Auto.id&&e.active),slug:"/pages/discounts"}),comp_params:{className:"w-full h-fit"}},{key:"shipping_methods",name:"🚚 Shipping Methods",type:"text",validate:!1,editable:!0,desc:"Decide which Shipping methods are used by the Store Front",comp:ce(Sa,{className:"w-full",add_all:!0,resource:"shipping",name_fn:n=>n.title,slug:"/pages/shipping-methods"}),comp_params:{className:"w-full h-fit"}},{key:"posts",name:"✍🏼 Posts",type:"text",validate:!1,editable:!0,desc:"Decide which Notes / Posts are used by the Store Front",comp:ce(Sa,{className:"w-full",add_all:!0,resource:"posts",name_fn:n=>n.title,slug:"/pages/posts"}),comp_params:{className:"w-full h-fit"}},{key:"description",name:"📝 Description",type:"text",validate:!1,editable:!0,comp:ce(Os),comp_params:{className:"w-full"}},{key:"media",name:"🖼️ Media",type:"text",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:ce(Ri),comp_params:{className:"w-full "}},{key:"video",name:"🎥 Video",type:"text",validate:!1,editable:!0,desc:"Add a video url to your store front",comp:ce($e(Fe),{className:"h-10"}),comp_params:{className:"w-full h-fit"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:vs,comp_params:{className:"w-full"}}]},m9={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[{key:"active",name:"Enable",validate:!0,desc:"Enable or disable the discount",editable:!0,defaultValue:!0,comp:ce(no,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach extra attributes to your store",comp:ce(Ls)},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}}]},g9={name:"Root",comp:We,comp_params:{className:`w-full --max-w-[35rem] --bg-red-100 items-center
|
603
|
+
lg:max-w-max lg:items-start lg:w-fit flex flex-col
|
604
|
+
lg:flex-row gap-5 mx-auto`},fields:[p9,m9]},v9=({onClickSave:n=void 0,onClickCreate:e=void 0,onClickDelete:t=void 0,onClickPublish:s=void 0,onClickDuplicate:r=void 0,onClickReload:a,id:l,className:u})=>c.jsx(ms,{id:l,className:u,onClickCreate:e,onClickDelete:t,onClickDuplicate:r,onClickReload:a,onClickSave:n,children:c.jsx(Zn,{Icon:c.jsx(q1,{}),text:"publish",keep_text_on_load:!0,show:!!s,onClick:s,className:""})}),nd=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{reloadPromise:r,savePromise:a,deletePromise:l,reload:u,duplicate:d,setError:f},context:p,key:g,sdk:y,doc:w,isCreateMode:k,isEditMode:_,isViewMode:C,hasChanged:S,hasLoaded:M,error:I,ref_head:L,ref_root:O}=On("storefronts",t,"/pages/storefronts",n,s),K=v.useCallback(()=>d({title:(w==null?void 0:w.title)+" duplicate"}),[w,d]),E=v.useCallback(async()=>{await a(),f(void 0);try{await y.storefronts.publish(t),await u()}catch(R){f({messages:[{message:R.toString()}]})}},[a,u,t]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["storefronts",t??"create"],className:""}),c.jsx(gs,{doc:w,className:"mt-5",collectionId:"storefronts"}),c.jsx(v9,{id:(w==null?void 0:w.handle)??(w==null?void 0:w.id),className:"mt-5",onClickSave:_?a:void 0,onClickCreate:k?a:void 0,onClickPublish:k?void 0:E,onClickDuplicate:k?void 0:K,onClickReload:k?void 0:r,onClickDelete:k?void 0:l}),c.jsx(us,{changes_made:S,ref:L,time:w==null?void 0:w.created_at,className:"mt-8"},w==null?void 0:w.updated_at),c.jsx(_e,{show:M&&_||k,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:I,className:"w-full"}),c.jsx(Ln,{ref:O,field:g9,value:w??{},isViewMode:C,context:p,className:"mt-8"},g)]})})]})},x9=[{key:"title",name:"Title",comp:wt,comp_params:{className:"font-semibold"}},{key:"updated_at",name:"Last Updated ",comp:fs,comp_params:{className:"font-semibold"}},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],M1=({})=>{const{query_api:n,context:e,ref_actions:t,page:s,loading:r,error:a,queryCount:l,hasLoaded:u,resource:d,resource_is_probably_empty:f,actions:{onLimitChange:p,onReload:g,prev:y,next:w}}=Nn("posts","/pages/posts");return c.jsx("div",{className:"w-full h-full overflow-x-clip",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto --overflow-x-clip",children:[c.jsx(dn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(_e,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden shadow-md
|
605
|
+
dark:shadow-slate-900 border mt-5
|
606
|
+
shelf-border-color`,children:[c.jsx(ds,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/posts/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(_e,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(hn,{context:e,data:s,fields:x9}),c.jsx(_n,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},y9={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[35rem] flex flex-col gap-5"},fields:[{key:"title",name:"Title",type:"text",validate:!0,desc:"A short title for the post",comp:ce($e(Fe),{className:"h-9",placeholder:"enter a title"}),comp_params:{className:"w-full "}},{key:"text",name:"📝 Post",type:"text",validate:!1,editable:!0,desc:"Write your post with Markdown and HTML",comp:ce(Os),comp_params:{className:"w-full"}},{key:"media",name:"🎬 Media",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:ce(Ri),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:ce(As),comp_params:{className:"w-full"}}]},w9={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach attributes",comp:ce(Ls)}]},b9={name:"Root",comp:We,comp_params:{className:"w-full items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row gap-5 mx-auto"},fields:[y9,w9]},sd=({mode:n,...e})=>{const{id:t,base:s}=un(),{actions:{savePromise:r,deletePromise:a,duplicate:l},context:u,doc:d,isCreateMode:f,isEditMode:p,isViewMode:g,hasChanged:y,hasLoaded:w,error:k,ref_head:_,ref_root:C}=On("posts",t,"/pages/posts",n,s);return v.useCallback(()=>l({title:(d==null?void 0:d.title)+" duplicate"}),[d,l]),c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Jn,{major:["posts",t??"create"],className:""}),c.jsx(gs,{doc:d,className:"mt-5",collectionId:"posts"}),c.jsx(ms,{onClickSave:p?r:void 0,onClickCreate:f?r:void 0,onClickDelete:f?void 0:a,className:"mt-5"}),c.jsx(us,{ref:_,time:d==null?void 0:d.created_at,className:"mt-8",changes_made:y},d==null?void 0:d.updated_at),c.jsxs(_e,{show:w&&p||f,children:[c.jsx(jn,{error:k,className:"w-full max-w-[55rem] mx-auto"}),c.jsx(Ln,{ref:C,field:b9,value:d??{},context:u,isViewMode:g,className:"mx-auto"},d==null?void 0:d.updated_at)]})]})},k9=({value:n,children:e,className:t,context:s,extra:r="max-w-[8rem] md:max-w-[18rem]",...a})=>{var d,f;const u=`overflow-x-auto flex flex-row flex-nowrap items-center gap-2 whitespace-nowrap ${t} ${r}`;return c.jsxs("div",{className:u,...a,children:[c.jsx("img",{src:((f=(d=s==null?void 0:s.item)==null?void 0:d.info)==null?void 0:f.logo_url)??Xa,className:" rounded-md w-6 h-6 object-cover border dark:opacity-80"}),c.jsx("span",{children:String(n)??e})]})},_9=[{key:"info.name",name:"Name",comp:k9,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"handle",name:"Handle",comp:wt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],C9=({})=>{const{context:n,page:e,error:t,hasLoaded:s,resource:r,resource_is_probably_empty:a}=Nn("payments/gateways","/pages/payment-gateways"),l=v.useMemo(()=>{const{viewDocumentUrl:u}=n;return{viewDocumentUrl:u}},[n]);return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(_e,{show:!t,children:c.jsx(dn,{should_onboard:a,overallCollectionCount:(e==null?void 0:e.length)??0,hasLoaded:s,resource:r})}),c.jsx(_e,{show:t,children:t==null?void 0:t.toString()}),c.jsx("div",{className:`w-full rounded-md overflow-hidden border
|
607
|
+
shelf-border-color shadow-md mt-5
|
608
|
+
dark:shadow-slate-900`,children:c.jsx(_e,{show:!t&&(e==null?void 0:e.length),children:c.jsx(hn,{context:l,data:e,fields:_9})})})]})})},N9={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[35rem] flex flex-col gap-5"},fields:[{key:"handle",name:"Handle",type:"text",validate:!1,editable:!0,comp:ce(It,{},!0,!0),comp_params:{className:"w-full"}},{key:"info",comp:We,comp_params:{className:"flex flex-col gap-5 w-full"},fields:[{key:"name",name:"Name",type:"text",validate:!1,editable:!0,comp:ce(It),comp_params:{className:"w-full"}},{key:"description",name:"Description",comp:ce(It),comp_params:{className:"w-full"}},{key:"url",name:"URL",type:"text",validate:!1,editable:!0,comp:ce(It),comp_params:{className:"w-full"}}]}]},j9={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[{key:"config",name:"Config",desc:"RAW Config JSON data",comp:ce(Nf,{},!0,!0),comp_params:{className:"w-full"}}]},S9={name:"Root",comp:We,comp_params:{className:"w-full items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row gap-5 mx-auto"},fields:[N9,j9]},E9=({className:n,...e})=>c.jsx("img",{className:"rounded-md object-cover border dark:opacity-80 "+n,...e}),M9=({})=>{var d,f;const{id:n}=un(),{context:e,key:t,doc:s,hasLoaded:r,error:a,ref_root:l}=On("payments/gateways",n,"/pages/payment-gateways"),u=(d=s==null?void 0:s.info)==null?void 0:d.logo_url;return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsxs("div",{className:"flex flex-col --justify-between --h-full",children:[c.jsx("span",{children:"Payment Gateway",className:"text-3xl text-black dark:text-gray-300"}),c.jsxs("div",{className:"flex flex-row items-center gap-2 h-20",children:[c.jsx(E9,{src:u??Xa,className:"w-8 h-8"}),c.jsx("span",{children:(f=s==null?void 0:s.info)==null?void 0:f.name,className:"text-3xl text-gray-500 tracking-wide"})]})]}),c.jsx(lt,{className:"mt-5"}),c.jsxs(_e,{show:r,children:[c.jsx(jn,{error:a,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Ln,{ref:l,field:S9,value:s??{},context:e,isViewMode:!1,className:"mx-auto"},t)]})]})},D9=({value:n,children:e,className:t,context:s,extra:r="max-w-[8rem] md:max-w-[18rem]",...a})=>{var d,f;const u=`overflow-x-auto flex flex-row items-center gap-2 whitespace-nowrap ${t} ${r}`;return c.jsxs("div",{className:u,...a,children:[c.jsx("img",{src:((f=(d=s==null?void 0:s.item)==null?void 0:d.info)==null?void 0:f.logo_url)??Xa,className:"rounded-md w-6 h-6 object-cover border dark:opacity-80"}),c.jsx("div",{children:n??e})]})},T9=[{key:"info.name",name:"Name",comp:D9,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"handle",name:"Handle",comp:wt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:void 0,name:"Actions",comp:Cn,comp_params:{className:""}}],I9=({})=>{const{context:n,page:e,error:t,hasLoaded:s,resource:r,resource_is_probably_empty:a}=Nn("extensions","/apps/extensions"),l=v.useMemo(()=>{const{viewDocumentUrl:u}=n;return{viewDocumentUrl:u}},[n]);return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(dn,{should_onboard:a,overallCollectionCount:(e==null?void 0:e.length)??0,hasLoaded:s,resource:r}),c.jsx(_e,{show:t,children:t==null?void 0:t.toString()}),c.jsx(_e,{show:!t&&e,children:c.jsx("div",{className:`w-full rounded-md overflow-hidden border
|
609
|
+
shelf-border-color shadow-md mt-5
|
610
|
+
dark:shadow-slate-900`,children:c.jsx(hn,{context:l,data:e,fields:T9})})})]})})},A9={name:"Root",comp:We,comp_params:{className:"w-full lg:w-[35rem] flex flex-col gap-5"},fields:[{key:"handle",name:"Handle",type:"text",validate:!1,editable:!0,comp:ce(It,{},!0,!0),comp_params:{className:"w-full"}},{key:"info",comp:We,comp_params:{className:"flex flex-col gap-5 w-full"},fields:[{key:"name",name:"Name",type:"text",validate:!1,editable:!0,comp:ce(It),comp_params:{className:"w-full"}},{key:"description",name:"Description",type:"text",validate:!1,editable:!0,comp:ce(It),comp_params:{className:"w-full"}},{key:"url",name:"URL",type:"text",validate:!1,editable:!0,comp:ce(It),comp_params:{className:"w-full"}}]}]},L9={name:"Root2",comp:We,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[{key:"config",name:"Config",desc:"RAW Config JSON data",comp:ce(Nf,{},!0,!0),comp_params:{className:"w-full"}}]},O9={name:"Root",comp:We,comp_params:{className:"w-full items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row gap-5 mx-auto"},fields:[A9,L9]},R9=({className:n,...e})=>c.jsx("img",{className:"rounded-md object-cover border dark:opacity-80 "+n,...e}),P9=({})=>{var d,f;const{id:n}=un(),{context:e,key:t,doc:s,hasLoaded:r,error:a,ref_root:l}=On("extensions",n,"/apps/extensions"),u=(d=s==null?void 0:s.info)==null?void 0:d.logo_url;return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsxs("div",{className:"flex flex-col --justify-between --h-full",children:[c.jsx("span",{children:"Extension",className:"text-3xl text-black dark:text-gray-300"}),c.jsxs("div",{className:"flex flex-row items-center gap-2 h-20",children:[c.jsx(R9,{src:u??Xa,className:"w-8 h-8"}),c.jsx("span",{children:(f=s==null?void 0:s.info)==null?void 0:f.name,className:"text-3xl text-gray-500 tracking-wide"})]})]}),c.jsx(lt,{className:"mt-5"}),c.jsxs(_e,{show:r,children:[c.jsx(jn,{error:a,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Ln,{ref:l,field:O9,value:s??{},context:e,isViewMode:!1,className:"mx-auto"},t)]})]})},rd=({value:n,title:e,description:t,...s})=>c.jsx(Ts,{name:e,desc:t,border:!0,...s,children:c.jsx(Je,{stroke:"border-b",rounded:"rounded-lg",children:c.jsx(It,{className:`rounded-md p-3
|
611
|
+
w-full text-base min-h-8 align-middle
|
612
|
+
shelf-input-color flex flex-row items-center`,value:n})})}),z9=({value:n,process_before_copy:e,...t})=>c.jsx("div",{...t,children:c.jsxs("div",{className:`flex flex-row items-center justify-between px-3 gap-3 w-full
|
613
|
+
shelf-input-color shelf-border-color border rounded-md`,children:[c.jsx(It,{className:`rounded-md overflow-x-scroll
|
614
|
+
text-base min-h-8 align-middle
|
615
|
+
flex flex-row items-center`,value:n}),c.jsx(wf,{value:n,process_before_copy:e})]})}),B9=({user:n,removePromise:e})=>c.jsxs("div",{className:`flex flex-row justify-between items-center
|
616
|
+
w-full shelf-input-color p-2 rounded-md `,children:[c.jsxs("div",{className:"w-3/4 overflow-x-scroll ",children:[c.jsx("p",{children:"email: "+n.email,className:"font-mono whitespace-nowrap"}),c.jsx("p",{children:`created at ${new Date(n.created_at).toLocaleDateString()}`,className:"font-mono"})]}),c.jsx(Zn,{text:"revoke",Icon:c.jsx(q5,{}),className:"h-6",rounded:"rounded-md",keep_text_on_load:!0,onClick:()=>e(n)})]}),V9=({...n})=>{var w,k;const{actions:{apikeys:{create:e,list:t},users:{remove:s}}}=uf(),[r,a]=v.useState([]),[l,u]=v.useState(""),[d,f]=v.useState();v.useEffect(()=>{p()},[]);const p=v.useCallback(()=>{t().then(a).catch(f)},[]),g=v.useCallback(_=>s(_.id).then(p).catch(f),[]),y=v.useCallback(()=>e().then(_=>{u(_.apikey),p()}).catch(f),[]);return c.jsxs(Ts,{name:"🔑 API Keys",desc:"Manage your API keys",border:!0,error:(k=(w=d==null?void 0:d.messages)==null?void 0:w[0])==null?void 0:k.message,setError:f,...n,children:[c.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll",children:r.map(_=>c.jsx(B9,{user:_,removePromise:g},_.email))}),c.jsxs("div",{className:"flex flex-col gap-3 mt-3 w-full",children:[c.jsx(ls,{Icon:void 0,text:"+ create new api key",show:!0,onClick:y,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit text-base shelf-text-label-color underline self-end "}),c.jsxs(_e,{show:l,children:[c.jsx(lt,{className:"my-2"}),c.jsx("span",{children:"latest api key (only visible to you)"}),c.jsx(z9,{value:`\`${l}\``,process_before_copy:_=>_.slice(1,-1)})]})]})]})},$9=({...n})=>{var g,y;const{auth:e,actions:{changePassword:t}}=uf(),s=v.useRef(void 0),r=v.useRef(void 0),a=v.useRef(void 0),[l,u]=v.useState(),[d,f]=v.useState(!1),p=v.useCallback(async()=>{try{f(!1),await t({user_id_or_email:e.user_id,current_password:String(s.current.value),new_password:String(r.current.value),confirm_new_password:String(a.current.value)}),f(!0)}catch(w){console.log("ee ",w),u(w)}},[t]);return c.jsxs(Ts,{name:"🔑 Change Password",desc:"Change Your Password",border:!0,error:(y=(g=l==null?void 0:l.messages)==null?void 0:g[0])==null?void 0:y.message,setError:u,...n,children:[c.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll"}),c.jsxs("div",{className:"flex flex-col gap-3 --mt-3 w-full",children:[c.jsx("p",{children:"Current Password"}),c.jsx(Qe,{stroke:"border-none",ref:s}),c.jsx("p",{children:"New Password"}),c.jsx(Qe,{stroke:"border-none",ref:r}),c.jsx("p",{children:"Confirm New Password"}),c.jsx(Qe,{stroke:"border-none",ref:a}),c.jsxs("div",{className:"w-full flex flex-row justify-between mt-3",children:[c.jsxs(Qd,{toggle:d,children:[c.jsxs("div",{className:"w-full flex flex-row items-center gap-2 text-xl text-green-500 dark:text-green-400",children:[c.jsx(t4,{}),c.jsx("span",{children:"All done",className:"text-base font-normal"})]}),c.jsx("span",{})]}),c.jsx(Zn,{Icon:c.jsx(p3,{}),text:"update",show:!0,onClick:p,keep_text_on_load:!0,classNameLoading:"text-xs",rounded:"rounded-md",className:"w-fit text-base shelf-text-label-color self-end "})]})]})]})},F9=n=>{var t,s;let e=`Here is what you need to know:
|
617
|
+
|
618
|
+
`;return n!=null&&n.auth_admins_emails&&(e=`- The following are the **admin** emails:
|
619
|
+
`+(n==null?void 0:n.auth_admins_emails.map(r=>` - ${r}`).join(`
|
620
|
+
`))),n!=null&&n.auth_secret_access_token&&(e+=`
|
621
|
+
- **JWT** access token \`secret\` is **${((t=n==null?void 0:n.auth_secret_access_token)==null?void 0:t.slice(0,4))+"------------"}**`),n!=null&&n.auth_secret_refresh_token&&(e+=`
|
622
|
+
- **JWT** refresh token \`secret\` is **${((s=n==null?void 0:n.auth_secret_refresh_token)==null?void 0:s.slice(0,4))+"------------"}**`),e},H9=n=>{const e=(n==null?void 0:n.general_store_name)??"unknown right now",t=(n==null?void 0:n.general_store_website)??"unknown right now",s=(n==null?void 0:n.general_store_support_email)??"unknown right now",r=(n==null?void 0:n.general_store_description)??"You still have not written one";return`Hi 👋, **your** store name is \`${e}\`, your store's
|
623
|
+
website is ${t} and the support email is ${s} .
|
624
|
+
|
625
|
+
|
626
|
+
<br/>
|
627
|
+
|
628
|
+
The following is the description of your store
|
629
|
+
> ${r}
|
630
|
+
`},U9=n=>{let e=`**Checkout** info
|
631
|
+
|
632
|
+
`;switch(n==null?void 0:n.checkout_reserve_stock_on){case"checkout_create":e+="> Stock is **automatically** reserved upon `checkout creation`";case"checkout_complete":e+="> Stock is **automatically** reserved upon `checkout completion`";default:e+="> Stock is **manually** reserved"}return e+=`
|
633
|
+
|
634
|
+
**Storage** info
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
`,n!=null&&n.storage_rewrite_urls?e+=`> Media urls stored at \`storage\` will be rewritten to ${n.storage_rewrite_urls} **CDN**`:e+="> Media urls stored at `storage` will **not** be rewritten for **CDN**",e},W9=({})=>{const{doc:n,hasLoaded:e,error:t}=cf("reference","settings",!0,!0);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(dn,{hasLoaded:e,resource:"settings"}),c.jsx(lt,{className:"my-5"}),c.jsx(_e,{show:e,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(jn,{error:t,className:"w-full"}),c.jsxs("div",{className:`w-full items-center lg:max-w-max lg:items-start \\
|
639
|
+
lg:w-fit flex flex-col lg:flex-row gap-5 mx-auto`,children:[c.jsxs("div",{className:"w-full lg:w-[35rem] flex flex-col gap-5",children:[c.jsx(V9,{}),c.jsx($9,{}),c.jsx(rd,{value:H9(n),title:"🛍️ Your General Store information"}),c.jsx(rd,{value:F9(n),title:"🔑 Auth information"}),c.jsx(vs,{value:n})]}),c.jsx("div",{className:"w-full lg:w-[19rem] flex flex-col gap-5",children:c.jsx(rd,{value:U9(n),title:"🛒 More information"})})]})]})})]})},D1=({})=>{const n=v.useRef(void 0);return c.jsxs("div",{className:"w-full h-full",children:[c.jsx(dn,{overallCollectionCount:void 0,hasLoaded:!0,resource:"Gallery"}),c.jsx(ly,{ref:n,onSelect:console.log}),c.jsx(oy,{className:"w-full mt-5 "})]})};function Y9(n){return ye({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M33.935 942.336c.336 0 .72 0 1.088-.031 16.193-.529 26.4-13.088 27.777-29.216C63.888 901.217 95.775 614 544.048 614.305l1.008 183.664c0 12.368 7.12 23.664 18.335 28.944 11.088 5.312 24.432 3.68 33.968-4.224l414.976-343.776a31.864 31.864 0 0 0 11.681-24.784c-.032-9.6-4.336-18.687-11.776-24.752L597.28 88.817c-9.569-7.807-22.785-9.311-33.937-4.095-11.152 5.311-18.288 16.56-18.288 28.91l-1.008 179.633c-185.952 5.887-329.968 65.712-423.328 174.96C-31.217 646 2.69 904.385 4.287 915.137c2.368 15.68 13.872 27.199 29.649 27.199zm543.121-392.527h-.063c-320.208.192-442.591 108.32-512.464 203.824 10.224-76.496 40.064-168.72 105.008-244.031 86.336-100.096 225.44-152.848 407.536-152.848 17.68 0 32-14.32 32-32V180.978l332.433 273.344-332.448 275.904v-148.4a31.953 31.953 0 0 0-9.409-22.656 31.96 31.96 0 0 0-22.592-9.36z"}}]})(n)}const id=({label:n="",Icon:e,className:t,...s})=>c.jsxs("p",{className:`text-2xl mb-5 w-full overflow-auto --text-gray-500
|
640
|
+
border-b shelf-border-color pb-2 flex flex-row gap-2 items-center
|
641
|
+
${t}`,...s,children:[e&&c.jsx(e,{className:"inline-block text-kf-500"}),c.jsx("span",{children:n})]}),K9=({value:n,className:e="",label:t=n,bgColor:s="bg-pink-500",...r})=>{const a=typeof s=="function"?s(n):s,l=typeof t=="function"?t(n):typeof t=="string"?t:typeof n=="string"?n:"missing";return c.jsx("div",{className:`font-medium cursor-pointer text-white w-fit
|
642
|
+
p-1 px-3 rounded-full whitespace-nowrap --my-1
|
643
|
+
hover:scale-105 transition-transform inline-block
|
644
|
+
max-w-full overflow-x-auto
|
645
|
+
${e} ${a}`,children:l,...r})},Q9=({search:n=[],className:e,...t})=>c.jsx("div",{className:`flex flex-row flex-wrap gap-2 ${e} `,...t,children:n.map((s,r)=>c.jsx(K9,{value:s},r))}),Z9=({usage:n=[],...e})=>n.length==0?c.jsx("p",{children:"No usage recorded"}):c.jsx("div",{children:n.map((t,s)=>c.jsx(Ht,{to:`/pages/${t}`,draggable:"false",children:c.jsx("p",{children:t,className:"shelf-text-label-color underline font-semibold"})},s))}),G9=({})=>{const{handle:n}=un(),{doc:e,hasLoaded:t,error:s,actions:{remove:r}}=cf("images",n),a=v.useRef(void 0),[l,u]=v.useState(!1),d=Ds(),f=v.useCallback(()=>{a.current.setDataAndMessage(n,`Are you sure you want to remove ${n} ?`),a.current.show()},[n]),p=v.useCallback(async g=>{u(!0);try{await r(),d(-2)}catch(y){console.log(y)}finally{u(!1)}},[r,d]);return c.jsxs("div",{className:"w-full h-full",children:[c.jsx(Jn,{major:["images",n],className:""}),c.jsx(_e,{show:t,children:c.jsx(Ts,{className:"mt-10",error:s,children:c.jsxs("div",{className:"flex flex-col gap-10",children:[c.jsx("div",{className:"self-end",children:c.jsx(Je,{stroke:"border-2",className:"w-fit h-fit",rounded:"rounded-full",children:c.jsx(Ja,{className:`h-6 px-2
|
646
|
+
bg-slate-50 dark:bg-slate-800
|
647
|
+
text-gray-600 dark:text-gray-400
|
648
|
+
rounded-full text-base font-semibold tracking-tight`,Icon:c.jsx(Yd,{className:"--text-red-500 text-base"}),loading:l,text:"delete",onClick:f})})}),c.jsxs(_e,{show:e&&t,children:[c.jsx(oc,{src:e==null?void 0:e.url,draggable:"false",crossOrigin:"anonymous",className:"w-fit mx-auto h-full rounded-lg"}),c.jsxs("div",{className:"w-full",children:[c.jsx(id,{label:"Url",Icon:Ob,className:""}),c.jsx("a",{href:e==null?void 0:e.url,target:"_blank",children:c.jsx("div",{children:e==null?void 0:e.url,className:"break-words w-full underline"})})]}),c.jsxs("div",{className:"w-full",children:[c.jsx(id,{label:"Usage",Icon:Y9,className:""}),c.jsx(Z9,{usage:e==null?void 0:e.usage})]}),c.jsxs("div",{className:"w-full",children:[c.jsx(id,{label:"Tags",Icon:Pb,className:""}),c.jsx(Q9,{search:e==null?void 0:e.search})]})]})]})})}),c.jsx(yf,{ref:a,onApprove:p,title:c.jsxs("p",{className:`text-xl flex
|
649
|
+
flex-row items-center gap-3`,children:[c.jsx(Kd,{className:"text-2xl"}),"Warning"]})})]})};function J9(n){return c.jsxs(db,{children:[c.jsx(ke,{path:"*",element:c.jsx(cb,{to:"home"})}),c.jsx(ke,{path:"home",element:c.jsx(yl,{className:"",children:c.jsx(e6,{})})}),c.jsx(ke,{path:"settings",element:c.jsx(yl,{className:"",children:c.jsx(W9,{})})}),c.jsxs(ke,{path:"apps",element:c.jsx(yl,{className:""}),children:[c.jsxs(ke,{path:"gallery",children:[c.jsx(ke,{path:"",element:c.jsx(D1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(D1,{})}),c.jsx(ke,{path:"img/:handle",element:c.jsx(G9,{})})]}),c.jsxs(ke,{path:"templates",children:[c.jsx(ke,{path:"",element:c.jsx(l1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(l1,{})}),c.jsx(ke,{path:":id",element:c.jsx(Gh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(Gh,{mode:"view"})}),c.jsx(ke,{path:"create",element:c.jsx(Gh,{mode:"create"})})]}),c.jsxs(ke,{path:"extensions",children:[c.jsx(ke,{path:"",element:c.jsx(I9,{})}),c.jsx(ke,{path:":id/view",element:c.jsx(P9,{})})]})]}),c.jsxs(ke,{path:"pages",element:c.jsx(yl,{className:""}),children:[c.jsxs(ke,{path:"storefronts",children:[c.jsx(ke,{path:"",element:c.jsx(E1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(E1,{})}),c.jsx(ke,{path:":id",element:c.jsx(nd,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(nd,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(nd,{mode:"create"})})]}),c.jsxs(ke,{path:"customers",children:[c.jsx(ke,{path:"",element:c.jsx(a1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(a1,{})}),c.jsx(ke,{path:":id",element:c.jsx(Uh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(Uh,{mode:"view"})}),c.jsx(ke,{path:"create",element:c.jsx(Uh,{mode:"create"})})]}),c.jsxs(ke,{path:"tags",children:[c.jsx(ke,{path:"",element:c.jsx(o1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(o1,{})}),c.jsx(ke,{path:":id",element:c.jsx(Wh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(Wh,{mode:"view"})}),c.jsx(ke,{path:"create",element:c.jsx(Wh,{mode:"create"})})]}),c.jsxs(ke,{path:"products",children:[c.jsx(ke,{path:"",element:c.jsx(g1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(g1,{})}),c.jsx(ke,{path:":id",element:c.jsx(qh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(qh,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(qh,{mode:"create"})})]}),c.jsxs(ke,{path:"collections",children:[c.jsx(ke,{path:"",element:c.jsx(b1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(b1,{})}),c.jsx(ke,{path:":id",element:c.jsx(Xh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(Xh,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(Xh,{mode:"create"})})]}),c.jsxs(ke,{path:"orders",children:[c.jsx(ke,{path:"",element:c.jsx(Zg,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(Zg,{})}),c.jsx(ke,{path:":id",element:c.jsx(Hh,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(Hh,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(Hh,{mode:"create"})})]}),c.jsxs(ke,{path:"discounts",children:[c.jsx(ke,{path:"",element:c.jsx(k1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(k1,{})}),c.jsx(ke,{path:":id",element:c.jsx(ed,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(ed,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(ed,{mode:"create"})})]}),c.jsxs(ke,{path:"shipping-methods",children:[c.jsx(ke,{path:"",element:c.jsx(S1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(S1,{})}),c.jsx(ke,{path:":id",element:c.jsx(td,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(td,{mode:"view"})}),c.jsx(ke,{path:"create/:base?",element:c.jsx(td,{mode:"create"})})]}),c.jsxs(ke,{path:"posts",children:[c.jsx(ke,{path:"",element:c.jsx(M1,{})}),c.jsx(ke,{path:"q/:query_params",element:c.jsx(M1,{})}),c.jsx(ke,{path:":id",element:c.jsx(sd,{mode:"edit"})}),c.jsx(ke,{path:":id/view",element:c.jsx(sd,{mode:"view"})}),c.jsx(ke,{path:"create",element:c.jsx(sd,{mode:"create"})})]}),c.jsxs(ke,{path:"payment-gateways",children:[c.jsx(ke,{path:"",element:c.jsx(C9,{})}),c.jsx(ke,{path:":id/view",element:c.jsx(M9,{})})]})]})]})}const q9=({...n})=>c.jsx("div",{...n,children:c.jsxs("div",{className:`w-full h-10 flex flex-row justify-end items-center
|
650
|
+
text-gray-500 gap-3 py-3 px-4`,children:[c.jsx("a",{href:"https://github.com/store-craft/storecraft",title:"Join our Discord",target:"_blank",rel:"noopener noreferrer",children:c.jsx(sk,{className:"text-2xl --animate-pulse"})}),c.jsx("a",{href:"https://github.com/store-craft/storecraft",title:"Fork us on Github",target:"_blank",rel:"noopener noreferrer",children:c.jsx(rk,{className:"text-xl"})}),c.jsx("a",{href:"https://linkedin.com/company/store-craft/",title:"Catch us at Linkedin",target:"_blank",rel:"noopener noreferrer",children:c.jsx(ik,{className:"text-xl"})})]})}),X9=({...n})=>c.jsxs("div",{...n,children:[c.jsxs("div",{className:`w-full h-full px-3
|
651
|
+
flex flex-row items-center
|
652
|
+
bg-gradient-to-r from-transparent to-kf-500
|
653
|
+
justify-between text-sm sm:text-base whitespace-nowrap`,children:[c.jsx("a",{href:"https://storecraft.app",children:c.jsx(Lv,{className:"h-[27px] pl-6"})}),c.jsx("a",{href:"https://storecraft.app/docs",className:"animate-pulse",title:"Read The Docs",children:c.jsx(eE,{})})]}),c.jsx("div",{className:`w-full bg-gradient-to-r
|
654
|
+
from-kf-500 to-pink-500
|
655
|
+
dark:from-pink-500 dark:to-kf-500 h-1
|
656
|
+
dark:shadow-[0px_0px_10px] dark:shadow-pink-500/80`})]}),eE=({})=>c.jsx(Je,{rounded:"rounded-full",stroke:"border-2",from:"from-pink-400",to:"to-pink-500",children:c.jsx("div",{className:`rounded-full my-auto bg-kf-800 w-fit text-sm
|
657
|
+
py-1 px-2 --border text-white font-semibold`,children:c.jsx("span",{children:"Read The docs"})})}),ad=({dash:{value:n,desc:e,id:t,label:s,onChange:r,input_params:a},...l})=>c.jsxs("div",{className:"--text-pink-600 font-semibold",...l,children:[c.jsx("p",{children:s,className:"tracking-widest text-pink-500"}),e&&c.jsx("p",{children:e,className:`tracking-normal font-inter my-3
|
658
|
+
font-normal --text-gray-500`}),c.jsx(Je,{className:"mt-2",children:c.jsx("input",{className:`rounded-md h-10 px-3
|
659
|
+
w-full block
|
660
|
+
shelf-input-color
|
661
|
+
hover:ring-pink-400 hover:ring-2
|
662
|
+
font-normal transition-none `,value:n[t]??"",onChange:u=>r(t,u.currentTarget.value),...a})})]}),tE=n=>{var t,s;return typeof n=="string"?n:((s=(t=n==null?void 0:n.messages)==null?void 0:t[0])==null?void 0:s.message)??"unknown error"},nE=({dash:{onChange:n,onSubmit:e,error:t,credentials:s,is_backend_endpoint_editable:r=!0},...a})=>{const{sdk:l,actions:{updateConfig:u}}=bt(),d=v.useCallback((f,p)=>{u({...l.config,endpoint:p}),n(f,p)},[n,u]);return c.jsx("div",{...a,children:c.jsx(Je,{className:"shadow-xl --shadow-gray-300/10 w-full font-mono",stroke:"border-4",to:"to-kf-400 dark:to-kf-500 ",children:c.jsxs("form",{className:`w-full p-5 shelf-login-form-bg flex flex-col text-sm
|
663
|
+
tracking-wider font-medium gap-5 rounded-md`,onSubmit:e,children:[c.jsx(ad,{dash:{id:"email",label:"Email",input_params:{type:"email",autoComplete:"on",name:"email"},desc:"Email of admin user",value:s,onChange:n}}),c.jsx(ad,{dash:{id:"password",label:"Password",input_params:{type:"password",autoComplete:"on",name:"password"},desc:"Password of admin user. Initial password is 'admin'",value:s,onChange:n}}),c.jsx(lt,{}),c.jsx(Je,{stroke:"border-4 w-full",rounded:"rounded-lg",from:"from-kf-500",to:"to-pink-500",children:c.jsx("input",{type:"submit",value:"LOGIN",title:"Login",alt:"Login",className:`h-10 rounded-md --bg-white tracking-widest
|
664
|
+
w-full shelf-input-color text-sm hover:ring-pink-400 hover:ring-2
|
665
|
+
cursor-pointer`})}),t&&c.jsxs("div",{className:`flex flex-row flex-nowrap items-center text-sm w-full
|
666
|
+
text-red-600 border-red-600
|
667
|
+
dark:text-red-500
|
668
|
+
dark:bg-red-400/10
|
669
|
+
bg-red-400/20
|
670
|
+
border
|
671
|
+
rounded-md p-3 gap-3 `,children:[c.jsx(G1,{className:"flex-inline text-2xl flex-shrink-0 opacity-70"}),c.jsx("div",{children:tE(t),className:"flex-1 whitespace-pre-wrap overflow-x-auto"})]}),c.jsx(_e,{show:r,children:c.jsx(ad,{dash:{id:"endpoint",label:"Backend Endpoint",input_params:{type:"text",autoComplete:"on",name:"endpoint"},desc:"The Storecraft Backend Endpoint",value:s,onChange:d}})}),(!r||r&&s.endpoint)&&c.jsx(sE,{})]})})})},T1=n=>{const e=new URL(window.location.href),t=new URL(e.pathname,e.origin);return t.searchParams.set("provider",n),console.log({redirect:t}),t.toString()},sE=({})=>{const{sdk:n,config:e}=bt(),[t,s]=v.useState([]);v.useEffect(()=>{async function a(){if(n.auth.identity_providers_list().then(l=>{Array.isArray(l)&&s(l)}).catch(l=>{console.log("error",l),s([])}),window.location.search){const l=Object.fromEntries(new URLSearchParams(window.location.search));await n.auth.identity_provider_sign({provider:l.provider,redirect_uri:T1(l.provider),authorization_response:l}),window.history.pushState(null,"","/")}}a()},[n,e]);const r=v.useCallback(async a=>{const l=await n.auth.identity_provider_get_authorization_uri({provider:a.provider,redirect_uri:T1(a.provider)});typeof l.uri=="string"&&(window.location.href=l.uri)},[]);return c.jsx("div",{className:"flex flex-row items-center gap-3 "+(t.length>0?"animate-fadein":"animate-fadeout"),children:t==null?void 0:t.map((a,l)=>c.jsx("img",{onClick:()=>r(a),className:"h-7 cursor-pointer",src:rE(a.logo_url),alt:a.description??a.name},a.provider))})},rE=(n="")=>{try{if(n.startsWith("data:")){const[e,...t]=n.split(","),s=e.split(";").at(0).split("data:").at(-1);return URL.createObjectURL(new Blob([t.join(",")],{type:s}))}}catch(e){console.log(e)}return n},iE=n=>c.jsx("div",{...n,children:c.jsx("p",{className:`w-full py-4 text-sm font-semibold text-center
|
672
|
+
text-gray-400 dark:text-white`,children:`all rights reserved, storecraft (${new Date().getFullYear()})`})}),aE=({commit:n})=>{var e,t;return c.jsxs("div",{className:"w-full flex flex-row gap-3 items-center",children:[c.jsx("a",{href:n==null?void 0:n.html_url,target:"blank",children:c.jsx("div",{className:`text-[10px] font-bold w-11 text-center border rounded-md
|
673
|
+
bg-gradient-to-r
|
674
|
+
from-pink-500/30 border-pink-500/20 px-1 --shadow-md
|
675
|
+
text-pink-500/90 font-mono tracking-wider
|
676
|
+
shadow-pink-500 shadow-[0px_0px_2px]`,children:(e=n==null?void 0:n.sha)==null?void 0:e.slice(-5)})}),c.jsx("div",{className:"w-full line-clamp-1 text-sm",children:(t=n==null?void 0:n.commit)==null?void 0:t.message})]})},oE=({...n})=>{const[e,t]=v.useState([]);return v.useEffect(()=>{async function s(){try{const a=await(await fetch("https://api.github.com/repos/store-craft/storecraft/commits")).json();t(a)}catch{}}s()},[]),e!=null&&e.length?c.jsx("div",{...n,children:c.jsx("div",{className:"flex-1 h-fit md:h-full",children:c.jsxs("div",{className:"w-fit h-fit md:h-full flex flex-col gap-3 mx-auto",children:[c.jsxs("div",{className:"flex flex-row items-center gap-2",children:[c.jsx(Sb,{}),c.jsx("p",{children:"Latest Commits",className:"font-bold font-inter"})]}),c.jsx("div",{className:"flex flex-1 flex-col gap-3 w-full md:overflow-auto p-0.5",children:e.map(s=>c.jsx(aE,{commit:s},s.sha))})]})})}):null},lE=({is_backend_endpoint_editable:n=!0})=>{var g,y,w;const{config:e,sdk:t,actions:{updateConfig:s}}=bt(),[r,a]=v.useState({email:(w=(y=(g=e==null?void 0:e.auth)==null?void 0:g.access_token)==null?void 0:y.claims)==null?void 0:w.email,endpoint:e==null?void 0:e.endpoint}),[l,u]=v.useState(void 0),{darkMode:d}=hs();v.useEffect(()=>{const k=new URLSearchParams(location.search),_=Object.fromEntries(k.entries());a(C=>({...C,..._}))},[location.search]);const f=v.useCallback((k,_)=>{a({...r,[k]:_})},[r]),p=v.useCallback(async k=>{k.preventDefault();try{s({endpoint:r.endpoint}),await t.auth.signin(r.email,r.password)}catch(_){u(_)}},[t,s,r]);return c.jsx("div",{className:"relative w-full h-full "+(d?"dark":""),children:c.jsxs("div",{className:"relative w-full h-full overflow-auto shelf-body-bg ",children:[c.jsx(X9,{className:"w-full h-12 --bg-green-400"}),c.jsx(q9,{className:`absolute w-full --bg-green-300 left-0 top-12 h-fit
|
677
|
+
z-30 --bg-green-300/30 `}),c.jsxs("div",{className:`w-full h-fit md:h-[calc(100%-3rem)]
|
678
|
+
flex flex-col p-10
|
679
|
+
items-center justify-start
|
680
|
+
md:justify-start md:items-start
|
681
|
+
md:flex-row gap-10`,children:[c.jsx("div",{className:`flex-shrink-0 order-first md:order-first
|
682
|
+
--scale-[0.8] origin-top
|
683
|
+
--md:scale-[0.8] md:origin-top-left
|
684
|
+
w-full max-w-[22rem] h-fit
|
685
|
+
rounded-md`,sstyle:{transformOrigin:"top center"},children:c.jsx(nE,{dash:{is_backend_endpoint_editable:n,onSubmit:p,credentials:r,onChange:f,error:l},className:"w-full"})}),c.jsx(oE,{className:"flex-1 h-fit md:h-full "})]}),c.jsx(iE,{className:"relative md:fixed md:left-10 md:bottom-0"})]})})};var Ll={},I1;function cE(){if(I1)return Ll;I1=1;var n=yw();return Ll.createRoot=n.createRoot,Ll.hydrateRoot=n.hydrateRoot,Ll}var uE=cE();const hE=Za(uE),dE=(n,e=!0)=>{const t=hE.createRoot(n);return t.render(c.jsx(fE,{is_backend_endpoint_editable:e})),()=>{t.unmount()}},fE=({is_backend_endpoint_editable:n=!0})=>{const{isAuthenticated:e,actions:{trigger:t}}=bt();return v.useEffect(()=>{if(!e){const s=new URL(window.location.pathname,window.location.origin);window.history.replaceState(null,null,s)}},[e]),console.log("isAuthenticated",e),c.jsx("div",{className:"bg-gray-800 w-screen ",style:{height:"100dvh"},children:c.jsxs("div",{className:"w-full h-full",style:{zoom:.9},children:[e&&c.jsx(yb,{children:c.jsx(J9,{})}),!e&&c.jsx(lE,{trigger:t,is_backend_endpoint_editable:n})]})})};dE(document.getElementById("root"),!0);
|