@storecraft/dashboard 1.0.37 → 1.2.5

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.
Files changed (161) hide show
  1. package/README.md +62 -22
  2. package/dist/lib/src/{src/comps → comps}/discount-details.d.ts +30 -9
  3. package/dist/lib/src/{src/comps → comps}/discount-filters.d.ts +17 -17
  4. package/dist/lib/src/{src/comps → comps}/discounts-table-type.d.ts +2 -2
  5. package/dist/lib/src/{src/comps → comps}/error-message.d.ts +3 -4
  6. package/dist/lib/src/comps/marquee.d.ts +2 -0
  7. package/dist/lib/src/comps/orders-quick-search-actions.d.ts +7 -0
  8. package/dist/lib/src/{src/comps → comps}/table-schema-view.d.ts +1 -0
  9. package/dist/lib/src/{src/hooks → hooks}/use-collections-actions.d.ts +11 -4
  10. package/dist/lib/src/index.js +8318 -7857
  11. package/dist/lib/src/index.umd.cjs +322 -327
  12. package/dist/lib/src/{src/pages → pages}/index.d.ts +1 -0
  13. package/dist/lib/src/pages/tags.d.ts +2 -0
  14. package/dist/lib/src/pages/templates.d.ts +2 -0
  15. package/dist/website/assets/index-Cxf31PAP.js +680 -0
  16. package/dist/website/assets/style-DfVEhj5R.css +1 -0
  17. package/dist/website/index.html +3 -3
  18. package/package.json +4 -4
  19. package/dist/lib/src/src/comps/orders-quick-search-actions.d.ts +0 -4
  20. package/dist/lib/src/src/pages/products.d.ts +0 -2
  21. package/dist/website/assets/index-D81NNPu4.js +0 -685
  22. package/dist/website/assets/style-Bf7QpSCB.css +0 -1
  23. /package/dist/lib/src/{src/apps → apps}/gallery/gallery-image-grid.d.ts +0 -0
  24. /package/dist/lib/src/{src/apps → apps}/gallery/gallery-page.d.ts +0 -0
  25. /package/dist/lib/src/{src/apps → apps}/gallery/gallery-searchbar.d.ts +0 -0
  26. /package/dist/lib/src/{src/apps → apps}/gallery/gallery-select.d.ts +0 -0
  27. /package/dist/lib/src/{src/apps → apps}/gallery/gallery.d.ts +0 -0
  28. /package/dist/lib/src/{src/apps → apps}/gallery/image-header.d.ts +0 -0
  29. /package/dist/lib/src/{src/apps → apps}/gallery/image-page.d.ts +0 -0
  30. /package/dist/lib/src/{src/apps → apps}/gallery/utils.d.ts +0 -0
  31. /package/dist/lib/src/{src/apps → apps}/index.d.ts +0 -0
  32. /package/dist/lib/src/{src/auto-mount.d.ts → auto-mount.d.ts} +0 -0
  33. /package/dist/lib/src/{src/comps → comps}/action-bar.d.ts +0 -0
  34. /package/dist/lib/src/{src/comps → comps}/air-date-picker.d.ts +0 -0
  35. /package/dist/lib/src/{src/comps → comps}/asset-favicon.d.ts +0 -0
  36. /package/dist/lib/src/{src/comps → comps}/attributes.d.ts +0 -0
  37. /package/dist/lib/src/{src/comps → comps}/base-chart-view.d.ts +0 -0
  38. /package/dist/lib/src/{src/comps → comps}/bulk-tag-products-in-collection.d.ts +0 -0
  39. /package/dist/lib/src/{src/comps → comps}/capsule.d.ts +0 -0
  40. /package/dist/lib/src/{src/comps → comps}/capsules-view.d.ts +0 -0
  41. /package/dist/lib/src/{src/comps → comps}/chart.demo.tsx.d.ts +0 -0
  42. /package/dist/lib/src/{src/comps → comps}/client-only.d.ts +0 -0
  43. /package/dist/lib/src/{src/comps → comps}/collection-actions.d.ts +0 -0
  44. /package/dist/lib/src/{src/comps → comps}/collection-products.d.ts +0 -0
  45. /package/dist/lib/src/{src/comps → comps}/common-button.d.ts +0 -0
  46. /package/dist/lib/src/{src/comps → comps}/common-fields.d.ts +0 -0
  47. /package/dist/lib/src/{src/comps → comps}/common-table-fields.d.ts +0 -0
  48. /package/dist/lib/src/{src/comps → comps}/common-ui.d.ts +0 -0
  49. /package/dist/lib/src/{src/comps → comps}/copyable-view.d.ts +0 -0
  50. /package/dist/lib/src/{src/comps → comps}/customer-orders.d.ts +0 -0
  51. /package/dist/lib/src/{src/comps → comps}/dark-mode.d.ts +0 -0
  52. /package/dist/lib/src/{src/comps → comps}/discount-performance.d.ts +0 -0
  53. /package/dist/lib/src/{src/comps → comps}/discounts-quick-search-actions.d.ts +0 -0
  54. /package/dist/lib/src/{src/comps → comps}/discounts-table-code.d.ts +0 -0
  55. /package/dist/lib/src/{src/comps → comps}/document-actions.d.ts +0 -0
  56. /package/dist/lib/src/{src/comps → comps}/document-details.d.ts +0 -0
  57. /package/dist/lib/src/{src/comps → comps}/document-title.d.ts +0 -0
  58. /package/dist/lib/src/{src/comps → comps}/drawer.d.ts +0 -0
  59. /package/dist/lib/src/{src/comps → comps}/fields-view.d.ts +0 -0
  60. /package/dist/lib/src/{src/comps → comps}/gradient-text.d.ts +0 -0
  61. /package/dist/lib/src/{src/comps → comps}/home-header.d.ts +0 -0
  62. /package/dist/lib/src/{src/comps → comps}/home-invite-action-card.d.ts +0 -0
  63. /package/dist/lib/src/{src/comps → comps}/home-performace.d.ts +0 -0
  64. /package/dist/lib/src/{src/comps → comps}/home-sales-chart.d.ts +0 -0
  65. /package/dist/lib/src/{src/comps → comps}/home-stat-card.d.ts +0 -0
  66. /package/dist/lib/src/{src/comps → comps}/home-time-frame.d.ts +0 -0
  67. /package/dist/lib/src/{src/comps → comps}/image-editor.d.ts +0 -0
  68. /package/dist/lib/src/{src/comps → comps}/img.d.ts +0 -0
  69. /package/dist/lib/src/{src/comps → comps}/json.d.ts +0 -0
  70. /package/dist/lib/src/{src/comps → comps}/lazy-carousel.d.ts +0 -0
  71. /package/dist/lib/src/{src/comps → comps}/loading-image.d.ts +0 -0
  72. /package/dist/lib/src/{src/comps → comps}/login-connect.d.ts +0 -0
  73. /package/dist/lib/src/{src/comps → comps}/login-content.d.ts +0 -0
  74. /package/dist/lib/src/{src/comps → comps}/login-copyright.d.ts +0 -0
  75. /package/dist/lib/src/{src/comps → comps}/login-form.d.ts +0 -0
  76. /package/dist/lib/src/{src/comps → comps}/login-latest-updates.d.ts +0 -0
  77. /package/dist/lib/src/{src/comps → comps}/login-marquee.d.ts +0 -0
  78. /package/dist/lib/src/{src/comps → comps}/logo-text.d.ts +0 -0
  79. /package/dist/lib/src/{src/comps → comps}/logo.d.ts +0 -0
  80. /package/dist/lib/src/{src/comps → comps}/markdown-card.d.ts +0 -0
  81. /package/dist/lib/src/{src/comps → comps}/md-editor.d.ts +0 -0
  82. /package/dist/lib/src/{src/comps → comps}/md-view.d.ts +0 -0
  83. /package/dist/lib/src/{src/comps → comps}/media.d.ts +0 -0
  84. /package/dist/lib/src/{src/comps → comps}/modal.d.ts +0 -0
  85. /package/dist/lib/src/{src/comps → comps}/notifications-button.d.ts +0 -0
  86. /package/dist/lib/src/{src/comps → comps}/notifications.d.ts +0 -0
  87. /package/dist/lib/src/{src/comps → comps}/order-coupon-info.d.ts +0 -0
  88. /package/dist/lib/src/{src/comps → comps}/order-delivery-method.d.ts +0 -0
  89. /package/dist/lib/src/{src/comps → comps}/order-line-items.d.ts +0 -0
  90. /package/dist/lib/src/{src/comps → comps}/order-payment-gateway.d.ts +0 -0
  91. /package/dist/lib/src/{src/comps → comps}/order-price.d.ts +0 -0
  92. /package/dist/lib/src/{src/comps → comps}/overlay.d.ts +0 -0
  93. /package/dist/lib/src/{src/comps → comps}/portal-creator.d.ts +0 -0
  94. /package/dist/lib/src/{src/comps → comps}/product-discounts.d.ts +0 -0
  95. /package/dist/lib/src/{src/comps → comps}/product-related-products.d.ts +0 -0
  96. /package/dist/lib/src/{src/comps → comps}/products-variants.d.ts +0 -0
  97. /package/dist/lib/src/{src/comps → comps}/quick-search-browser.d.ts +0 -0
  98. /package/dist/lib/src/{src/comps → comps}/resource-browse.d.ts +0 -0
  99. /package/dist/lib/src/{src/comps → comps}/resource-onboard-svg.d.ts +0 -0
  100. /package/dist/lib/src/{src/comps → comps}/resource-title.d.ts +0 -0
  101. /package/dist/lib/src/{src/comps → comps}/resource-view.d.ts +0 -0
  102. /package/dist/lib/src/{src/comps → comps}/secret-view.d.ts +0 -0
  103. /package/dist/lib/src/{src/comps → comps}/select-resource.d.ts +0 -0
  104. /package/dist/lib/src/{src/comps → comps}/settings-api-keys.d.ts +0 -0
  105. /package/dist/lib/src/{src/comps → comps}/settings-change-password.d.ts +0 -0
  106. /package/dist/lib/src/{src/comps → comps}/show-if.d.ts +0 -0
  107. /package/dist/lib/src/{src/comps → comps}/side-menu.d.ts +0 -0
  108. /package/dist/lib/src/{src/comps → comps}/splitter-view.d.ts +0 -0
  109. /package/dist/lib/src/{src/comps → comps}/storefront-products.d.ts +0 -0
  110. /package/dist/lib/src/{src/comps → comps}/symbols.d.ts +0 -0
  111. /package/dist/lib/src/{src/comps → comps}/tag-values.d.ts +0 -0
  112. /package/dist/lib/src/{src/comps → comps}/tags-edit.d.ts +0 -0
  113. /package/dist/lib/src/{src/comps → comps}/template-example-input.d.ts +0 -0
  114. /package/dist/lib/src/{src/comps → comps}/template-template.d.ts +0 -0
  115. /package/dist/lib/src/{src/comps → comps}/transition.d.ts +0 -0
  116. /package/dist/lib/src/{src/hooks → hooks}/create-media-query-hook.d.ts +0 -0
  117. /package/dist/lib/src/{src/hooks → hooks}/use-dark-mode.d.ts +0 -0
  118. /package/dist/lib/src/{src/hooks → hooks}/use-document-actions.d.ts +0 -0
  119. /package/dist/lib/src/{src/hooks → hooks}/use-interval.d.ts +0 -0
  120. /package/dist/lib/src/{src/hooks → hooks}/use-keyboard-match.d.ts +0 -0
  121. /package/dist/lib/src/{src/hooks → hooks}/use-media-query.d.ts +0 -0
  122. /package/dist/lib/src/{src/hooks → hooks}/use-mounted.d.ts +0 -0
  123. /package/dist/lib/src/{src/hooks → hooks}/use-navigate-with-state.d.ts +0 -0
  124. /package/dist/lib/src/{src/hooks → hooks}/use-on-click-outside.d.ts +0 -0
  125. /package/dist/lib/src/{src/hooks → hooks}/use-preferences.d.ts +0 -0
  126. /package/dist/lib/src/{src/hooks → hooks}/use-scroll-delta.d.ts +0 -0
  127. /package/dist/lib/src/{src/hooks → hooks}/use-toggle.d.ts +0 -0
  128. /package/dist/lib/src/{src/hooks → hooks}/use-trigger.d.ts +0 -0
  129. /package/dist/lib/src/{src/hooks → hooks}/utils.browser.d.ts +0 -0
  130. /package/dist/lib/src/{src/index.d.ts → index.d.ts} +0 -0
  131. /package/dist/lib/src/{src/layout.d.ts → layout.d.ts} +0 -0
  132. /package/dist/lib/src/{src/login.d.ts → login.d.ts} +0 -0
  133. /package/dist/lib/src/{src/pages/collections.d.ts → pages/chats.d.ts} +0 -0
  134. /package/dist/lib/src/{src/pages → pages}/collection.d.ts +0 -0
  135. /package/dist/lib/src/{src/pages/discounts.d.ts → pages/collections.d.ts} +0 -0
  136. /package/dist/lib/src/{src/pages → pages}/customer.d.ts +0 -0
  137. /package/dist/lib/src/{src/pages → pages}/customers.d.ts +0 -0
  138. /package/dist/lib/src/{src/pages → pages}/discount.d.ts +0 -0
  139. /package/dist/lib/src/{src/pages/home.d.ts → pages/discounts.d.ts} +0 -0
  140. /package/dist/lib/src/{src/pages → pages}/extension.d.ts +0 -0
  141. /package/dist/lib/src/{src/pages → pages}/extensions.d.ts +0 -0
  142. /package/dist/lib/src/{src/pages/orders.d.ts → pages/home.d.ts} +0 -0
  143. /package/dist/lib/src/{src/pages → pages}/order.d.ts +0 -0
  144. /package/dist/lib/src/{src/pages/posts.d.ts → pages/orders.d.ts} +0 -0
  145. /package/dist/lib/src/{src/pages → pages}/payment-gateway.d.ts +0 -0
  146. /package/dist/lib/src/{src/pages → pages}/payment-gateways.d.ts +0 -0
  147. /package/dist/lib/src/{src/pages → pages}/post.d.ts +0 -0
  148. /package/dist/lib/src/{src/pages/settings.d.ts → pages/posts.d.ts} +0 -0
  149. /package/dist/lib/src/{src/pages → pages}/product.d.ts +0 -0
  150. /package/dist/lib/src/{src/pages/shipping-methods.d.ts → pages/products.d.ts} +0 -0
  151. /package/dist/lib/src/{src/pages/storefronts.d.ts → pages/settings.d.ts} +0 -0
  152. /package/dist/lib/src/{src/pages → pages}/shipping-method.d.ts +0 -0
  153. /package/dist/lib/src/{src/pages/tags.d.ts → pages/shipping-methods.d.ts} +0 -0
  154. /package/dist/lib/src/{src/pages → pages}/storefront.d.ts +0 -0
  155. /package/dist/lib/src/{src/pages/templates.d.ts → pages/storefronts.d.ts} +0 -0
  156. /package/dist/lib/src/{src/pages → pages}/tag.d.ts +0 -0
  157. /package/dist/lib/src/{src/pages → pages}/template.d.ts +0 -0
  158. /package/dist/lib/src/{src/routes.d.ts → routes.d.ts} +0 -0
  159. /package/dist/lib/src/{src/screens.d.ts → screens.d.ts} +0 -0
  160. /package/dist/lib/src/{src/utils → utils}/index.d.ts +0 -0
  161. /package/dist/lib/src/{src/utils → utils}/time.d.ts +0 -0
@@ -0,0 +1,680 @@
1
+ var bw=Object.defineProperty;var w0=n=>{throw TypeError(n)};var kw=(n,e,t)=>e in n?bw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xe=(n,e,t)=>kw(n,typeof e!="symbol"?e+"":e,t),b0=(n,e,t)=>e.has(n)||w0("Cannot "+t);var Ue=(n,e,t)=>(b0(n,e,"read from private field"),t?t.call(n):e.get(n)),An=(n,e,t)=>e.has(n)?w0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),On=(n,e,t,s)=>(b0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t);function _w(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 Ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gh={exports:{}},wa={},vh={exports:{}},Qe={};/**
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 k0;function Cw(){if(k0)return Qe;k0=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 E(){}E.prototype=C.prototype;function S(D,$,ie){this.props=D,this.context=$,this.refs=_,this.updater=ie||w}var I=S.prototype=new E;I.constructor=S,k(I,C.prototype),I.isPureReactComponent=!0;var O=Array.isArray,R=Object.prototype.hasOwnProperty,Z={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function A(D,$,ie){var ge,le={},se=null,De=null;if($!=null)for(ge in $.ref!==void 0&&(De=$.ref),$.key!==void 0&&(se=""+$.key),$)R.call($,ge)&&!M.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),gt=0;gt<He;gt++)Re[gt]=arguments[gt+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:De,props:le,_owner:Z.current}}function H(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 ae(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?ae(""+D.key):$.toString(36)}function we(D,$,ie,ge,le){var se=typeof D;(se==="undefined"||se==="boolean")&&(D=null);var De=!1;if(D===null)De=!0;else switch(se){case"string":case"number":De=!0;break;case"object":switch(D.$$typeof){case n:case e:De=!0}}if(De)return De=D,le=le(De),D=ge===""?"."+Ee(De,0):ge,O(le)?(ie="",D!=null&&(ie=D.replace(Ne,"$&/")+"/"),we(le,$,ie,"",function(gt){return gt})):le!=null&&(J(le)&&(le=H(le,ie+(!le.key||De&&De.key===le.key?"":(""+le.key).replace(Ne,"$&/")+"/")+D)),$.push(le)),1;if(De=0,ge=ge===""?".":ge+":",O(D))for(var He=0;He<D.length;He++){se=D[He];var Re=ge+Ee(se,He);De+=we(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++),De+=we(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 De}function te(D,$,ie){if(D==null)return D;var ge=[],le=0;return we(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 q={current:null},K={transition:null},ne={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:K,ReactCurrentOwner:Z};return Qe.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}},Qe.Component=C,Qe.Fragment=t,Qe.Profiler=r,Qe.PureComponent=S,Qe.StrictMode=s,Qe.Suspense=d,Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Qe.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,De=D._owner;if($!=null){if($.ref!==void 0&&(se=$.ref,De=Z.current),$.key!==void 0&&(le=""+$.key),D.type&&D.type.defaultProps)var He=D.type.defaultProps;for(Re in $)R.call($,Re)&&!M.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 gt=0;gt<Re;gt++)He[gt]=arguments[gt+2];ge.children=He}return{$$typeof:n,type:D.type,key:le,ref:se,props:ge,_owner:De}},Qe.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},Qe.createElement=A,Qe.createFactory=function(D){var $=A.bind(null,D);return $.type=D,$},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(D){return{$$typeof:u,render:D}},Qe.isValidElement=J,Qe.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:B}},Qe.memo=function(D,$){return{$$typeof:f,type:D,compare:$===void 0?null:$}},Qe.startTransition=function(D){var $=K.transition;K.transition={};try{D()}finally{K.transition=$}},Qe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Qe.useCallback=function(D,$){return q.current.useCallback(D,$)},Qe.useContext=function(D){return q.current.useContext(D)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(D){return q.current.useDeferredValue(D)},Qe.useEffect=function(D,$){return q.current.useEffect(D,$)},Qe.useId=function(){return q.current.useId()},Qe.useImperativeHandle=function(D,$,ie){return q.current.useImperativeHandle(D,$,ie)},Qe.useInsertionEffect=function(D,$){return q.current.useInsertionEffect(D,$)},Qe.useLayoutEffect=function(D,$){return q.current.useLayoutEffect(D,$)},Qe.useMemo=function(D,$){return q.current.useMemo(D,$)},Qe.useReducer=function(D,$,ie){return q.current.useReducer(D,$,ie)},Qe.useRef=function(D){return q.current.useRef(D)},Qe.useState=function(D){return q.current.useState(D)},Qe.useSyncExternalStore=function(D,$,ie){return q.current.useSyncExternalStore(D,$,ie)},Qe.useTransition=function(){return q.current.useTransition()},Qe.version="18.2.0",Qe}var _0;function Ud(){return _0||(_0=1,vh.exports=Cw()),vh.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 C0;function Nw(){if(C0)return wa;C0=1;var n=Ud(),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 wa.Fragment=t,wa.jsx=l,wa.jsxs=l,wa}var N0;function jw(){return N0||(N0=1,gh.exports=Nw()),gh.exports}var c=jw(),v=Ud();const X=Ja(v),Sw=_w({__proto__:null,default:X},[v]);var xh={exports:{}},cn={},yh={exports:{}},wh={};/**
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 j0;function Ew(){return j0||(j0=1,function(n){function e(K,ne){var D=K.length;K.push(ne);e:for(;0<D;){var $=D-1>>>1,ie=K[$];if(0<r(ie,ne))K[$]=ne,K[D]=ie,D=$;else break e}}function t(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var ne=K[0],D=K.pop();if(D!==ne){K[0]=D;e:for(var $=0,ie=K.length,ge=ie>>>1;$<ge;){var le=2*($+1)-1,se=K[le],De=le+1,He=K[De];if(0>r(se,D))De<ie&&0>r(He,se)?(K[$]=He,K[De]=D,$=De):(K[$]=se,K[le]=D,$=le);else if(De<ie&&0>r(He,D))K[$]=He,K[De]=D,$=De;else break e}}return ne}function r(K,ne){var D=K.sortIndex-ne.sortIndex;return D!==0?D:K.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,E=typeof clearTimeout=="function"?clearTimeout:null,S=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(K){for(var ne=t(f);ne!==null;){if(ne.callback===null)s(f);else if(ne.startTime<=K)s(f),ne.sortIndex=ne.expirationTime,e(d,ne);else break;ne=t(f)}}function O(K){if(_=!1,I(K),!k)if(t(d)!==null)k=!0,B(R);else{var ne=t(f);ne!==null&&q(O,ne.startTime-K)}}function R(K,ne){k=!1,_&&(_=!1,E(A),A=-1),w=!0;var D=y;try{for(I(ne),g=t(d);g!==null&&(!(g.expirationTime>ne)||K&&!ae());){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&&q(O,le.startTime-ne),ge=!1}return ge}finally{g=null,y=D,w=!1}}var Z=!1,M=null,A=-1,H=5,J=-1;function ae(){return!(n.unstable_now()-J<H)}function Ne(){if(M!==null){var K=n.unstable_now();J=K;var ne=!0;try{ne=M(!0,K)}finally{ne?Ee():(Z=!1,M=null)}}else Z=!1}var Ee;if(typeof S=="function")Ee=function(){S(Ne)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,te=we.port2;we.port1.onmessage=Ne,Ee=function(){te.postMessage(null)}}else Ee=function(){C(Ne,0)};function B(K){M=K,Z||(Z=!0,Ee())}function q(K,ne){A=C(function(){K(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(K){K.callback=null},n.unstable_continueExecution=function(){k||w||(k=!0,B(R))},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return t(d)},n.unstable_next=function(K){switch(y){case 1:case 2:case 3:var ne=3;break;default:ne=y}var D=y;y=ne;try{return K()}finally{y=D}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(K,ne){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var D=y;y=K;try{return ne()}finally{y=D}},n.unstable_scheduleCallback=function(K,ne,D){var $=n.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?$+D:$):D=$,K){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,K={id:p++,callback:ne,priorityLevel:K,startTime:D,expirationTime:ie,sortIndex:-1},D>$?(K.sortIndex=D,e(f,K),t(d)===null&&K===t(f)&&(_?(E(A),A=-1):_=!0,q(O,D-$))):(K.sortIndex=ie,e(d,K),k||w||(k=!0,B(R))),K},n.unstable_shouldYield=ae,n.unstable_wrapCallback=function(K){var ne=y;return function(){var D=y;y=ne;try{return K.apply(this,arguments)}finally{y=D}}}}(wh)),wh}var S0;function Mw(){return S0||(S0=1,yh.exports=Ew()),yh.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 E0;function Dw(){if(E0)return cn;E0=1;var n=Ud(),e=Mw();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 E=/[\-:]([a-z])/g;function S(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(E,S);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(E,S);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(E,S);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 O=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),Z=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),ae=Symbol.for("react.context"),Ne=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),we=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),K=Symbol.iterator;function ne(i){return i===null||typeof i!="object"?null:(i=K&&i[K]||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,L=b.length-1;1<=N&&0<=L&&x[N]!==b[L];)L--;for(;1<=N&&0<=L;N--,L--)if(x[N]!==b[L]){if(N!==1||L!==1)do if(N--,L--,0>L||x[N]!==b[L]){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<=L);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 De(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 M:return"Fragment";case Z:return"Portal";case H:return"Profiler";case A:return"StrictMode";case Ee:return"Suspense";case we:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ae: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:De(i.type)||"Memo";case B:o=i._payload,i=i._init;try{return De(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 De(o);case 8:return o===A?"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 gt(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Y(i){var o=gt(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=gt(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 F(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 oe(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 _e(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 Xe(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 Ct(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 zn(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 Nt,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(Nt=Nt||document.createElement("div"),Nt.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Nt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function Ce(i,o){if(o){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=o;return}}i.textContent=o}var Me={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},Je=["Webkit","ms","Moz","O"];Object.keys(Me).forEach(function(i){Je.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),Me[o]=Me[i]})});function nn(i,o,h){return o==null||typeof o=="boolean"||o===""?"":h||typeof o!="number"||o===0||Me.hasOwnProperty(i)&&Me[i]?(""+o).trim():o+"px"}function rt(i,o){i=i.style;for(var h in o)if(o.hasOwnProperty(h)){var m=h.indexOf("--")===0,x=nn(h,o[h],m);h==="float"&&(h="cssFloat"),m?i.setProperty(h,x):i[h]=x}}var jy=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 Ec(i,o){if(o){if(jy[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 Mc(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 Dc=null;function Tc(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ic=null,Yr=null,Qr=null;function Rf(i){if(i=ia(i)){if(typeof Ic!="function")throw Error(t(280));var o=i.stateNode;o&&(o=Io(o),Ic(i.stateNode,i.type,o))}}function Pf(i){Yr?Qr?Qr.push(i):Qr=[i]:Yr=i}function zf(){if(Yr){var i=Yr,o=Qr;if(Qr=Yr=null,Rf(i),o)for(i=0;i<o.length;i++)Rf(o[i])}}function Bf(i,o){return i(o)}function Vf(){}var Lc=!1;function $f(i,o,h){if(Lc)return i(o,h);Lc=!0;try{return Bf(i,o,h)}finally{Lc=!1,(Yr!==null||Qr!==null)&&(Vf(),zf())}}function zi(i,o){var h=i.stateNode;if(h===null)return null;var m=Io(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 Ac=!1;if(u)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){Ac=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{Ac=!1}function Sy(i,o,h,m,x,b,N,L,V){var re=Array.prototype.slice.call(arguments,3);try{o.apply(h,re)}catch(fe){this.onError(fe)}}var Vi=!1,co=null,uo=!1,Oc=null,Ey={onError:function(i){Vi=!0,co=i}};function My(i,o,h,m,x,b,N,L,V){Vi=!1,co=null,Sy.apply(Ey,arguments)}function Dy(i,o,h,m,x,b,N,L,V){if(My.apply(this,arguments),Vi){if(Vi){var re=co;Vi=!1,co=null}else throw Error(t(198));uo||(uo=!0,Oc=re)}}function xr(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 Ff(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 Hf(i){if(xr(i)!==i)throw Error(t(188))}function Ty(i){var o=i.alternate;if(!o){if(o=xr(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 Hf(x),i;if(b===m)return Hf(x),o;b=b.sibling}throw Error(t(188))}if(h.return!==m.return)h=x,m=b;else{for(var N=!1,L=x.child;L;){if(L===h){N=!0,h=x,m=b;break}if(L===m){N=!0,m=x,h=b;break}L=L.sibling}if(!N){for(L=b.child;L;){if(L===h){N=!0,h=b,m=x;break}if(L===m){N=!0,m=b,h=x;break}L=L.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 Uf(i){return i=Ty(i),i!==null?Wf(i):null}function Wf(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=Wf(i);if(o!==null)return o;i=i.sibling}return null}var Yf=e.unstable_scheduleCallback,Qf=e.unstable_cancelCallback,Iy=e.unstable_shouldYield,Ly=e.unstable_requestPaint,jt=e.unstable_now,Ay=e.unstable_getCurrentPriorityLevel,Rc=e.unstable_ImmediatePriority,Kf=e.unstable_UserBlockingPriority,ho=e.unstable_NormalPriority,Oy=e.unstable_LowPriority,Zf=e.unstable_IdlePriority,fo=null,es=null;function Ry(i){if(es&&typeof es.onCommitFiberRoot=="function")try{es.onCommitFiberRoot(fo,i,void 0,(i.current.flags&128)===128)}catch{}}var Bn=Math.clz32?Math.clz32:By,Py=Math.log,zy=Math.LN2;function By(i){return i>>>=0,i===0?32:31-(Py(i)/zy|0)|0}var po=64,mo=4194304;function $i(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 go(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 L=N&~x;L!==0?m=$i(L):(b&=N,b!==0&&(m=$i(b)))}else N=h&~x,N!==0?m=$i(N):b!==0&&(m=$i(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-Bn(o),x=1<<h,m|=i[h],o&=~x;return m}function Vy(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 $y(i,o){for(var h=i.suspendedLanes,m=i.pingedLanes,x=i.expirationTimes,b=i.pendingLanes;0<b;){var N=31-Bn(b),L=1<<N,V=x[N];V===-1?((L&h)===0||(L&m)!==0)&&(x[N]=Vy(L,o)):V<=o&&(i.expiredLanes|=L),b&=~L}}function Pc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Gf(){var i=po;return po<<=1,(po&4194240)===0&&(po=64),i}function zc(i){for(var o=[],h=0;31>h;h++)o.push(i);return o}function Fi(i,o,h){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Bn(o),i[o]=h}function Fy(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-Bn(h),b=1<<x;o[x]=0,m[x]=-1,i[x]=-1,h&=~b}}function Bc(i,o){var h=i.entangledLanes|=o;for(i=i.entanglements;h;){var m=31-Bn(h),x=1<<m;x&o|i[m]&o&&(i[m]|=o),h&=~x}}var tt=0;function Jf(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var qf,Vc,Xf,ep,tp,$c=!1,vo=[],Rs=null,Ps=null,zs=null,Hi=new Map,Ui=new Map,Bs=[],Hy="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 np(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":Hi.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ui.delete(o.pointerId)}}function Wi(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=ia(o),o!==null&&Vc(o)),i):(i.eventSystemFlags|=m,o=i.targetContainers,x!==null&&o.indexOf(x)===-1&&o.push(x),i)}function Uy(i,o,h,m,x){switch(o){case"focusin":return Rs=Wi(Rs,i,o,h,m,x),!0;case"dragenter":return Ps=Wi(Ps,i,o,h,m,x),!0;case"mouseover":return zs=Wi(zs,i,o,h,m,x),!0;case"pointerover":var b=x.pointerId;return Hi.set(b,Wi(Hi.get(b)||null,i,o,h,m,x)),!0;case"gotpointercapture":return b=x.pointerId,Ui.set(b,Wi(Ui.get(b)||null,i,o,h,m,x)),!0}return!1}function sp(i){var o=yr(i.target);if(o!==null){var h=xr(o);if(h!==null){if(o=h.tag,o===13){if(o=Ff(h),o!==null){i.blockedOn=o,tp(i.priority,function(){Xf(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 xo(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var h=Hc(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var m=new h.constructor(h.type,h);Dc=m,h.target.dispatchEvent(m),Dc=null}else return o=ia(h),o!==null&&Vc(o),i.blockedOn=h,!1;o.shift()}return!0}function rp(i,o,h){xo(i)&&h.delete(o)}function Wy(){$c=!1,Rs!==null&&xo(Rs)&&(Rs=null),Ps!==null&&xo(Ps)&&(Ps=null),zs!==null&&xo(zs)&&(zs=null),Hi.forEach(rp),Ui.forEach(rp)}function Yi(i,o){i.blockedOn===o&&(i.blockedOn=null,$c||($c=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Wy)))}function Qi(i){function o(x){return Yi(x,i)}if(0<vo.length){Yi(vo[0],i);for(var h=1;h<vo.length;h++){var m=vo[h];m.blockedOn===i&&(m.blockedOn=null)}}for(Rs!==null&&Yi(Rs,i),Ps!==null&&Yi(Ps,i),zs!==null&&Yi(zs,i),Hi.forEach(o),Ui.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);)sp(h),h.blockedOn===null&&Bs.shift()}var Kr=O.ReactCurrentBatchConfig,yo=!0;function Yy(i,o,h,m){var x=tt,b=Kr.transition;Kr.transition=null;try{tt=1,Fc(i,o,h,m)}finally{tt=x,Kr.transition=b}}function Qy(i,o,h,m){var x=tt,b=Kr.transition;Kr.transition=null;try{tt=4,Fc(i,o,h,m)}finally{tt=x,Kr.transition=b}}function Fc(i,o,h,m){if(yo){var x=Hc(i,o,h,m);if(x===null)au(i,o,m,wo,h),np(i,m);else if(Uy(x,i,o,h,m))m.stopPropagation();else if(np(i,m),o&4&&-1<Hy.indexOf(i)){for(;x!==null;){var b=ia(x);if(b!==null&&qf(b),b=Hc(i,o,h,m),b===null&&au(i,o,m,wo,h),b===x)break;x=b}x!==null&&m.stopPropagation()}else au(i,o,m,null,h)}}var wo=null;function Hc(i,o,h,m){if(wo=null,i=Tc(m),i=yr(i),i!==null)if(o=xr(i),o===null)i=null;else if(h=o.tag,h===13){if(i=Ff(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 wo=i,null}function ip(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(Ay()){case Rc:return 1;case Kf:return 4;case ho:case Oy:return 16;case Zf:return 536870912;default:return 16}default:return 16}}var Vs=null,Uc=null,bo=null;function ap(){if(bo)return bo;var i,o=Uc,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 bo=x.slice(i,1<m?1-m:void 0)}function ko(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 _o(){return!0}function op(){return!1}function vn(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 L in i)i.hasOwnProperty(L)&&(h=i[L],this[L]=h?h(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?_o:op,this.isPropagationStopped=op,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=_o)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),o}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=vn(Zr),Ki=D({},Zr,{view:0,detail:0}),Ky=vn(Ki),Yc,Qc,Zi,Co=D({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zc,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!==Zi&&(Zi&&i.type==="mousemove"?(Yc=i.screenX-Zi.screenX,Qc=i.screenY-Zi.screenY):Qc=Yc=0,Zi=i),Yc)},movementY:function(i){return"movementY"in i?i.movementY:Qc}}),lp=vn(Co),Zy=D({},Co,{dataTransfer:0}),Gy=vn(Zy),Jy=D({},Ki,{relatedTarget:0}),Kc=vn(Jy),qy=D({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),Xy=vn(qy),e2=D({},Zr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),t2=vn(e2),n2=D({},Zr,{data:0}),cp=vn(n2),s2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},r2={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"},i2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a2(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=i2[i])?!!o[i]:!1}function Zc(){return a2}var o2=D({},Ki,{key:function(i){if(i.key){var o=s2[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=ko(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?r2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zc,charCode:function(i){return i.type==="keypress"?ko(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ko(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),l2=vn(o2),c2=D({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),up=vn(c2),u2=D({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zc}),h2=vn(u2),d2=D({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),f2=vn(d2),p2=D({},Co,{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}),m2=vn(p2),g2=[9,13,27,32],Gc=u&&"CompositionEvent"in window,Gi=null;u&&"documentMode"in document&&(Gi=document.documentMode);var v2=u&&"TextEvent"in window&&!Gi,hp=u&&(!Gc||Gi&&8<Gi&&11>=Gi),dp=" ",fp=!1;function pp(i,o){switch(i){case"keyup":return g2.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Gr=!1;function x2(i,o){switch(i){case"compositionend":return mp(o);case"keypress":return o.which!==32?null:(fp=!0,dp);case"textInput":return i=o.data,i===dp&&fp?null:i;default:return null}}function y2(i,o){if(Gr)return i==="compositionend"||!Gc&&pp(i,o)?(i=ap(),bo=Uc=Vs=null,Gr=!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 hp&&o.locale!=="ko"?null:o.data;default:return null}}var w2={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 gp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!w2[i.type]:o==="textarea"}function vp(i,o,h,m){Pf(m),o=Mo(o,"onChange"),0<o.length&&(h=new Wc("onChange","change",null,h,m),i.push({event:h,listeners:o}))}var Ji=null,qi=null;function b2(i){Op(i,0)}function No(i){var o=ti(i);if(z(o))return i}function k2(i,o){if(i==="change")return o}var xp=!1;if(u){var Jc;if(u){var qc="oninput"in document;if(!qc){var yp=document.createElement("div");yp.setAttribute("oninput","return;"),qc=typeof yp.oninput=="function"}Jc=qc}else Jc=!1;xp=Jc&&(!document.documentMode||9<document.documentMode)}function wp(){Ji&&(Ji.detachEvent("onpropertychange",bp),qi=Ji=null)}function bp(i){if(i.propertyName==="value"&&No(qi)){var o=[];vp(o,qi,i,Tc(i)),$f(b2,o)}}function _2(i,o,h){i==="focusin"?(wp(),Ji=o,qi=h,Ji.attachEvent("onpropertychange",bp)):i==="focusout"&&wp()}function C2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return No(qi)}function N2(i,o){if(i==="click")return No(o)}function j2(i,o){if(i==="input"||i==="change")return No(o)}function S2(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Vn=typeof Object.is=="function"?Object.is:S2;function Xi(i,o){if(Vn(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)||!Vn(i[x],o[x]))return!1}return!0}function kp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function _p(i,o){var h=kp(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=kp(h)}}function Cp(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Cp(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Np(){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 Xc(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 E2(i){var o=Np(),h=i.focusedElem,m=i.selectionRange;if(o!==h&&h&&h.ownerDocument&&Cp(h.ownerDocument.documentElement,h)){if(m!==null&&Xc(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=_p(h,b);var N=_p(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 M2=u&&"documentMode"in document&&11>=document.documentMode,Jr=null,eu=null,ea=null,tu=!1;function jp(i,o,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;tu||Jr==null||Jr!==T(m)||(m=Jr,"selectionStart"in m&&Xc(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}),ea&&Xi(ea,m)||(ea=m,m=Mo(eu,"onSelect"),0<m.length&&(o=new Wc("onSelect","select",null,o,h),i.push({event:o,listeners:m}),o.target=Jr)))}function jo(i,o){var h={};return h[i.toLowerCase()]=o.toLowerCase(),h["Webkit"+i]="webkit"+o,h["Moz"+i]="moz"+o,h}var qr={animationend:jo("Animation","AnimationEnd"),animationiteration:jo("Animation","AnimationIteration"),animationstart:jo("Animation","AnimationStart"),transitionend:jo("Transition","TransitionEnd")},nu={},Sp={};u&&(Sp=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function So(i){if(nu[i])return nu[i];if(!qr[i])return i;var o=qr[i],h;for(h in o)if(o.hasOwnProperty(h)&&h in Sp)return nu[i]=o[h];return i}var Ep=So("animationend"),Mp=So("animationiteration"),Dp=So("animationstart"),Tp=So("transitionend"),Ip=new Map,Lp="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){Ip.set(i,o),a(o,[i])}for(var su=0;su<Lp.length;su++){var ru=Lp[su],D2=ru.toLowerCase(),T2=ru[0].toUpperCase()+ru.slice(1);$s(D2,"on"+T2)}$s(Ep,"onAnimationEnd"),$s(Mp,"onAnimationIteration"),$s(Dp,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(Tp,"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 ta="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(" "),I2=new Set("cancel close invalid load scroll toggle".split(" ").concat(ta));function Ap(i,o,h){var m=i.type||"unknown-event";i.currentTarget=h,Dy(m,o,void 0,i),i.currentTarget=null}function Op(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 L=m[N],V=L.instance,re=L.currentTarget;if(L=L.listener,V!==b&&x.isPropagationStopped())break e;Ap(x,L,re),b=V}else for(N=0;N<m.length;N++){if(L=m[N],V=L.instance,re=L.currentTarget,L=L.listener,V!==b&&x.isPropagationStopped())break e;Ap(x,L,re),b=V}}}if(uo)throw i=Oc,uo=!1,Oc=null,i}function ct(i,o){var h=o[du];h===void 0&&(h=o[du]=new Set);var m=i+"__bubble";h.has(m)||(Rp(o,i,2,!1),h.add(m))}function iu(i,o,h){var m=0;o&&(m|=4),Rp(h,i,m,o)}var Eo="_reactListening"+Math.random().toString(36).slice(2);function na(i){if(!i[Eo]){i[Eo]=!0,s.forEach(function(h){h!=="selectionchange"&&(I2.has(h)||iu(h,!1,i),iu(h,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Eo]||(o[Eo]=!0,iu("selectionchange",!1,o))}}function Rp(i,o,h,m){switch(ip(o)){case 1:var x=Yy;break;case 4:x=Qy;break;default:x=Fc}h=x.bind(null,o,h,i),x=void 0,!Ac||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 au(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 L=m.stateNode.containerInfo;if(L===x||L.nodeType===8&&L.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(;L!==null;){if(N=yr(L),N===null)return;if(V=N.tag,V===5||V===6){m=b=N;continue e}L=L.parentNode}}m=m.return}$f(function(){var re=b,fe=Tc(h),pe=[];e:{var de=Ip.get(i);if(de!==void 0){var Se=Wc,Ie=i;switch(i){case"keypress":if(ko(h)===0)break e;case"keydown":case"keyup":Se=l2;break;case"focusin":Ie="focus",Se=Kc;break;case"focusout":Ie="blur",Se=Kc;break;case"beforeblur":case"afterblur":Se=Kc;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=lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=Gy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=h2;break;case Ep:case Mp:case Dp:Se=Xy;break;case Tp:Se=f2;break;case"scroll":Se=Ky;break;case"wheel":Se=m2;break;case"copy":case"cut":case"paste":Se=t2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=up}var Le=(o&4)!==0,St=!Le&&i==="scroll",G=Le?de!==null?de+"Capture":null:de;Le=[];for(var W=re,ee;W!==null;){ee=W;var ve=ee.stateNode;if(ee.tag===5&&ve!==null&&(ee=ve,G!==null&&(ve=zi(W,G),ve!=null&&Le.push(sa(W,ve,ee)))),St)break;W=W.return}0<Le.length&&(de=new Se(de,Ie,null,h,fe),pe.push({event:de,listeners:Le}))}}if((o&7)===0){e:{if(de=i==="mouseover"||i==="pointerover",Se=i==="mouseout"||i==="pointerout",de&&h!==Dc&&(Ie=h.relatedTarget||h.fromElement)&&(yr(Ie)||Ie[ys]))break e;if((Se||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Se?(Ie=h.relatedTarget||h.toElement,Se=re,Ie=Ie?yr(Ie):null,Ie!==null&&(St=xr(Ie),Ie!==St||Ie.tag!==5&&Ie.tag!==6)&&(Ie=null)):(Se=null,Ie=re),Se!==Ie)){if(Le=lp,ve="onMouseLeave",G="onMouseEnter",W="mouse",(i==="pointerout"||i==="pointerover")&&(Le=up,ve="onPointerLeave",G="onPointerEnter",W="pointer"),St=Se==null?de:ti(Se),ee=Ie==null?de:ti(Ie),de=new Le(ve,W+"leave",Se,h,fe),de.target=St,de.relatedTarget=ee,ve=null,yr(fe)===re&&(Le=new Le(G,W+"enter",Ie,h,fe),Le.target=ee,Le.relatedTarget=St,ve=Le),St=ve,Se&&Ie)t:{for(Le=Se,G=Ie,W=0,ee=Le;ee;ee=Xr(ee))W++;for(ee=0,ve=G;ve;ve=Xr(ve))ee++;for(;0<W-ee;)Le=Xr(Le),W--;for(;0<ee-W;)G=Xr(G),ee--;for(;W--;){if(Le===G||G!==null&&Le===G.alternate)break t;Le=Xr(Le),G=Xr(G)}Le=null}else Le=null;Se!==null&&Pp(pe,de,Se,Le,!1),Ie!==null&&St!==null&&Pp(pe,St,Ie,Le,!0)}}e:{if(de=re?ti(re):window,Se=de.nodeName&&de.nodeName.toLowerCase(),Se==="select"||Se==="input"&&de.type==="file")var Ae=k2;else if(gp(de))if(xp)Ae=j2;else{Ae=C2;var Pe=_2}else(Se=de.nodeName)&&Se.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Ae=N2);if(Ae&&(Ae=Ae(i,re))){vp(pe,Ae,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?ti(re):window,i){case"focusin":(gp(Pe)||Pe.contentEditable==="true")&&(Jr=Pe,eu=re,ea=null);break;case"focusout":ea=eu=Jr=null;break;case"mousedown":tu=!0;break;case"contextmenu":case"mouseup":case"dragend":tu=!1,jp(pe,h,fe);break;case"selectionchange":if(M2)break;case"keydown":case"keyup":jp(pe,h,fe)}var ze;if(Gc)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 Gr?pp(i,h)&&(Ve="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ve="onCompositionStart");Ve&&(hp&&h.locale!=="ko"&&(Gr||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Gr&&(ze=ap()):(Vs=fe,Uc="value"in Vs?Vs.value:Vs.textContent,Gr=!0)),Pe=Mo(re,Ve),0<Pe.length&&(Ve=new cp(Ve,i,null,h,fe),pe.push({event:Ve,listeners:Pe}),ze?Ve.data=ze:(ze=mp(h),ze!==null&&(Ve.data=ze)))),(ze=v2?x2(i,h):y2(i,h))&&(re=Mo(re,"onBeforeInput"),0<re.length&&(fe=new cp("onBeforeInput","beforeinput",null,h,fe),pe.push({event:fe,listeners:re}),fe.data=ze))}Op(pe,o)})}function sa(i,o,h){return{instance:i,listener:o,currentTarget:h}}function Mo(i,o){for(var h=o+"Capture",m=[];i!==null;){var x=i,b=x.stateNode;x.tag===5&&b!==null&&(x=b,b=zi(i,h),b!=null&&m.unshift(sa(i,b,x)),b=zi(i,o),b!=null&&m.push(sa(i,b,x))),i=i.return}return m}function Xr(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Pp(i,o,h,m,x){for(var b=o._reactName,N=[];h!==null&&h!==m;){var L=h,V=L.alternate,re=L.stateNode;if(V!==null&&V===m)break;L.tag===5&&re!==null&&(L=re,x?(V=zi(h,b),V!=null&&N.unshift(sa(h,V,L))):x||(V=zi(h,b),V!=null&&N.push(sa(h,V,L)))),h=h.return}N.length!==0&&i.push({event:o,listeners:N})}var L2=/\r\n?/g,A2=/\u0000|\uFFFD/g;function zp(i){return(typeof i=="string"?i:""+i).replace(L2,`
38
+ `).replace(A2,"")}function Do(i,o,h){if(o=zp(o),zp(i)!==o&&h)throw Error(t(425))}function To(){}var ou=null,lu=null;function cu(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 uu=typeof setTimeout=="function"?setTimeout:void 0,O2=typeof clearTimeout=="function"?clearTimeout:void 0,Bp=typeof Promise=="function"?Promise:void 0,R2=typeof queueMicrotask=="function"?queueMicrotask:typeof Bp<"u"?function(i){return Bp.resolve(null).then(i).catch(P2)}:uu;function P2(i){setTimeout(function(){throw i})}function hu(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),Qi(o);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=x}while(h);Qi(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 Vp(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 ei=Math.random().toString(36).slice(2),ts="__reactFiber$"+ei,ra="__reactProps$"+ei,ys="__reactContainer$"+ei,du="__reactEvents$"+ei,z2="__reactListeners$"+ei,B2="__reactHandles$"+ei;function yr(i){var o=i[ts];if(o)return o;for(var h=i.parentNode;h;){if(o=h[ys]||h[ts]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(i=Vp(i);i!==null;){if(h=i[ts])return h;i=Vp(i)}return o}i=h,h=i.parentNode}return null}function ia(i){return i=i[ts]||i[ys],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ti(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(t(33))}function Io(i){return i[ra]||null}var fu=[],ni=-1;function Hs(i){return{current:i}}function ut(i){0>ni||(i.current=fu[ni],fu[ni]=null,ni--)}function lt(i,o){ni++,fu[ni]=i.current,i.current=o}var Us={},Wt=Hs(Us),sn=Hs(!1),wr=Us;function si(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 rn(i){return i=i.childContextTypes,i!=null}function Lo(){ut(sn),ut(Wt)}function $p(i,o,h){if(Wt.current!==Us)throw Error(t(168));lt(Wt,o),lt(sn,h)}function Fp(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 Ao(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Us,wr=Wt.current,lt(Wt,i),lt(sn,sn.current),!0}function Hp(i,o,h){var m=i.stateNode;if(!m)throw Error(t(169));h?(i=Fp(i,o,wr),m.__reactInternalMemoizedMergedChildContext=i,ut(sn),ut(Wt),lt(Wt,i)):ut(sn),lt(sn,h)}var ws=null,Oo=!1,pu=!1;function Up(i){ws===null?ws=[i]:ws.push(i)}function V2(i){Oo=!0,Up(i)}function Ws(){if(!pu&&ws!==null){pu=!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,Oo=!1}catch(x){throw ws!==null&&(ws=ws.slice(i+1)),Yf(Rc,Ws),x}finally{tt=o,pu=!1}}return null}var ri=[],ii=0,Ro=null,Po=0,En=[],Mn=0,br=null,bs=1,ks="";function kr(i,o){ri[ii++]=Po,ri[ii++]=Ro,Ro=i,Po=o}function Wp(i,o,h){En[Mn++]=bs,En[Mn++]=ks,En[Mn++]=br,br=i;var m=bs;i=ks;var x=32-Bn(m)-1;m&=~(1<<x),h+=1;var b=32-Bn(o)+x;if(30<b){var N=x-x%5;b=(m&(1<<N)-1).toString(32),m>>=N,x-=N,bs=1<<32-Bn(o)+x|h<<x|m,ks=b+i}else bs=1<<b|h<<x|m,ks=i}function mu(i){i.return!==null&&(kr(i,1),Wp(i,1,0))}function gu(i){for(;i===Ro;)Ro=ri[--ii],ri[ii]=null,Po=ri[--ii],ri[ii]=null;for(;i===br;)br=En[--Mn],En[Mn]=null,ks=En[--Mn],En[Mn]=null,bs=En[--Mn],En[Mn]=null}var xn=null,yn=null,ft=!1,$n=null;function Yp(i,o){var h=Ln(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 Qp(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,xn=i,yn=Fs(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,xn=i,yn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(h=br!==null?{id:bs,overflow:ks}:null,i.memoizedState={dehydrated:o,treeContext:h,retryLane:1073741824},h=Ln(18,null,null,0),h.stateNode=o,h.return=i,i.child=h,xn=i,yn=null,!0):!1;default:return!1}}function vu(i){return(i.mode&1)!==0&&(i.flags&128)===0}function xu(i){if(ft){var o=yn;if(o){var h=o;if(!Qp(i,o)){if(vu(i))throw Error(t(418));o=Fs(h.nextSibling);var m=xn;o&&Qp(i,o)?Yp(m,h):(i.flags=i.flags&-4097|2,ft=!1,xn=i)}}else{if(vu(i))throw Error(t(418));i.flags=i.flags&-4097|2,ft=!1,xn=i}}}function Kp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;xn=i}function zo(i){if(i!==xn)return!1;if(!ft)return Kp(i),ft=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!cu(i.type,i.memoizedProps)),o&&(o=yn)){if(vu(i))throw Zp(),Error(t(418));for(;o;)Yp(i,o),o=Fs(o.nextSibling)}if(Kp(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){yn=Fs(i.nextSibling);break e}o--}else h!=="$"&&h!=="$!"&&h!=="$?"||o++}i=i.nextSibling}yn=null}}else yn=xn?Fs(i.stateNode.nextSibling):null;return!0}function Zp(){for(var i=yn;i;)i=Fs(i.nextSibling)}function ai(){yn=xn=null,ft=!1}function yu(i){$n===null?$n=[i]:$n.push(i)}var $2=O.ReactCurrentBatchConfig;function Fn(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 Bo=Hs(null),Vo=null,oi=null,wu=null;function bu(){wu=oi=Vo=null}function ku(i){var o=Bo.current;ut(Bo),i._currentValue=o}function _u(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 li(i,o){Vo=i,wu=oi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(an=!0),i.firstContext=null)}function Dn(i){var o=i._currentValue;if(wu!==i)if(i={context:i,memoizedValue:o,next:null},oi===null){if(Vo===null)throw Error(t(308));oi=i,Vo.dependencies={lanes:0,firstContext:i}}else oi=oi.next=i;return o}var _r=null;function Cu(i){_r===null?_r=[i]:_r.push(i)}function Gp(i,o,h,m){var x=o.interleaved;return x===null?(h.next=h,Cu(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 Nu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jp(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 Qs(i,o,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(Ke&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,Cu(m)):(o.next=x.next,x.next=o),m.interleaved=o,_s(i,h)}function $o(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,Bc(i,h)}}function qp(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 Fo(i,o,h,m){var x=i.updateQueue;Ys=!1;var b=x.firstBaseUpdate,N=x.lastBaseUpdate,L=x.shared.pending;if(L!==null){x.shared.pending=null;var V=L,re=V.next;V.next=null,N===null?b=re:N.next=re,N=V;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,L=fe.lastBaseUpdate,L!==N&&(L===null?fe.firstBaseUpdate=re:L.next=re,fe.lastBaseUpdate=V))}if(b!==null){var pe=x.baseState;N=0,fe=re=V=null,L=b;do{var de=L.lane,Se=L.eventTime;if((m&de)===de){fe!==null&&(fe=fe.next={eventTime:Se,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ie=i,Le=L;switch(de=o,Se=h,Le.tag){case 1:if(Ie=Le.payload,typeof Ie=="function"){pe=Ie.call(Se,pe,de);break e}pe=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Le.payload,de=typeof Ie=="function"?Ie.call(Se,pe,de):Ie,de==null)break e;pe=D({},pe,de);break e;case 2:Ys=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,de=x.effects,de===null?x.effects=[L]:de.push(L))}else Se={eventTime:Se,lane:de,tag:L.tag,payload:L.payload,callback:L.callback,next:null},fe===null?(re=fe=Se,V=pe):fe=fe.next=Se,N|=de;if(L=L.next,L===null){if(L=x.shared.pending,L===null)break;de=L,L=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);jr|=N,i.lanes=N,i.memoizedState=pe}}function Xp(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 em=new n.Component().refs;function ju(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 Ho={isMounted:function(i){return(i=i._reactInternals)?xr(i)===i:!1},enqueueSetState:function(i,o,h){i=i._reactInternals;var m=Jt(),x=Js(i),b=Cs(m,x);b.payload=o,h!=null&&(b.callback=h),o=Qs(i,b,x),o!==null&&(Wn(o,i,x,m),$o(o,i,x))},enqueueReplaceState:function(i,o,h){i=i._reactInternals;var m=Jt(),x=Js(i),b=Cs(m,x);b.tag=1,b.payload=o,h!=null&&(b.callback=h),o=Qs(i,b,x),o!==null&&(Wn(o,i,x,m),$o(o,i,x))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var h=Jt(),m=Js(i),x=Cs(h,m);x.tag=2,o!=null&&(x.callback=o),o=Qs(i,x,m),o!==null&&(Wn(o,i,m,h),$o(o,i,m))}};function tm(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?!Xi(h,m)||!Xi(x,b):!0}function nm(i,o,h){var m=!1,x=Us,b=o.contextType;return typeof b=="object"&&b!==null?b=Dn(b):(x=rn(o)?wr:Wt.current,m=o.contextTypes,b=(m=m!=null)?si(i,x):Us),o=new o(h,b),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ho,i.stateNode=o,o._reactInternals=i,m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=x,i.__reactInternalMemoizedMaskedChildContext=b),o}function sm(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&&Ho.enqueueReplaceState(o,o.state,null)}function Su(i,o,h,m){var x=i.stateNode;x.props=h,x.state=i.memoizedState,x.refs=em,Nu(i);var b=o.contextType;typeof b=="object"&&b!==null?x.context=Dn(b):(b=rn(o)?wr:Wt.current,x.context=si(i,b)),x.state=i.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(ju(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&&Ho.enqueueReplaceState(x,x.state,null),Fo(i,h,x,m),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308)}function aa(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 L=x.refs;L===em&&(L=x.refs={}),N===null?delete L[b]:L[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 Uo(i,o){throw i=Object.prototype.toString.call(o),Error(t(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function rm(i){var o=i._init;return o(i._payload)}function im(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 L(G,W,ee,ve){return W===null||W.tag!==6?(W=uh(ee,G.mode,ve),W.return=G,W):(W=x(W,ee),W.return=G,W)}function V(G,W,ee,ve){var Ae=ee.type;return Ae===M?fe(G,W,ee.props.children,ve,ee.key):W!==null&&(W.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===B&&rm(Ae)===W.type)?(ve=x(W,ee.props),ve.ref=aa(G,W,ee),ve.return=G,ve):(ve=cl(ee.type,ee.key,ee.props,null,G.mode,ve),ve.ref=aa(G,W,ee),ve.return=G,ve)}function re(G,W,ee,ve){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=hh(ee,G.mode,ve),W.return=G,W):(W=x(W,ee.children||[]),W.return=G,W)}function fe(G,W,ee,ve,Ae){return W===null||W.tag!==7?(W=Dr(ee,G.mode,ve,Ae),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=uh(""+W,G.mode,ee),W.return=G,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case R:return ee=cl(W.type,W.key,W.props,null,G.mode,ee),ee.ref=aa(G,null,W),ee.return=G,ee;case Z:return W=hh(W,G.mode,ee),W.return=G,W;case B:var ve=W._init;return pe(G,ve(W._payload),ee)}if(je(W)||ne(W))return W=Dr(W,G.mode,ee,null),W.return=G,W;Uo(G,W)}return null}function de(G,W,ee,ve){var Ae=W!==null?W.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ae!==null?null:L(G,W,""+ee,ve);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:return ee.key===Ae?V(G,W,ee,ve):null;case Z:return ee.key===Ae?re(G,W,ee,ve):null;case B:return Ae=ee._init,de(G,W,Ae(ee._payload),ve)}if(je(ee)||ne(ee))return Ae!==null?null:fe(G,W,ee,ve,null);Uo(G,ee)}return null}function Se(G,W,ee,ve,Ae){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return G=G.get(ee)||null,L(W,G,""+ve,Ae);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case R:return G=G.get(ve.key===null?ee:ve.key)||null,V(W,G,ve,Ae);case Z:return G=G.get(ve.key===null?ee:ve.key)||null,re(W,G,ve,Ae);case B:var Pe=ve._init;return Se(G,W,ee,Pe(ve._payload),Ae)}if(je(ve)||ne(ve))return G=G.get(ee)||null,fe(W,G,ve,Ae,null);Uo(W,ve)}return null}function Ie(G,W,ee,ve){for(var Ae=null,Pe=null,ze=W,Ve=W=0,zt=null;ze!==null&&Ve<ee.length;Ve++){ze.index>Ve?(zt=ze,ze=null):zt=ze.sibling;var Ze=de(G,ze,ee[Ve],ve);if(Ze===null){ze===null&&(ze=zt);break}i&&ze&&Ze.alternate===null&&o(G,ze),W=b(Ze,W,Ve),Pe===null?Ae=Ze:Pe.sibling=Ze,Pe=Ze,ze=zt}if(Ve===ee.length)return h(G,ze),ft&&kr(G,Ve),Ae;if(ze===null){for(;Ve<ee.length;Ve++)ze=pe(G,ee[Ve],ve),ze!==null&&(W=b(ze,W,Ve),Pe===null?Ae=ze:Pe.sibling=ze,Pe=ze);return ft&&kr(G,Ve),Ae}for(ze=m(G,ze);Ve<ee.length;Ve++)zt=Se(ze,G,Ve,ee[Ve],ve),zt!==null&&(i&&zt.alternate!==null&&ze.delete(zt.key===null?Ve:zt.key),W=b(zt,W,Ve),Pe===null?Ae=zt:Pe.sibling=zt,Pe=zt);return i&&ze.forEach(function(er){return o(G,er)}),ft&&kr(G,Ve),Ae}function Le(G,W,ee,ve){var Ae=ne(ee);if(typeof Ae!="function")throw Error(t(150));if(ee=Ae.call(ee),ee==null)throw Error(t(151));for(var Pe=Ae=null,ze=W,Ve=W=0,zt=null,Ze=ee.next();ze!==null&&!Ze.done;Ve++,Ze=ee.next()){ze.index>Ve?(zt=ze,ze=null):zt=ze.sibling;var er=de(G,ze,Ze.value,ve);if(er===null){ze===null&&(ze=zt);break}i&&ze&&er.alternate===null&&o(G,ze),W=b(er,W,Ve),Pe===null?Ae=er:Pe.sibling=er,Pe=er,ze=zt}if(Ze.done)return h(G,ze),ft&&kr(G,Ve),Ae;if(ze===null){for(;!Ze.done;Ve++,Ze=ee.next())Ze=pe(G,Ze.value,ve),Ze!==null&&(W=b(Ze,W,Ve),Pe===null?Ae=Ze:Pe.sibling=Ze,Pe=Ze);return ft&&kr(G,Ve),Ae}for(ze=m(G,ze);!Ze.done;Ve++,Ze=ee.next())Ze=Se(ze,G,Ve,Ze.value,ve),Ze!==null&&(i&&Ze.alternate!==null&&ze.delete(Ze.key===null?Ve:Ze.key),W=b(Ze,W,Ve),Pe===null?Ae=Ze:Pe.sibling=Ze,Pe=Ze);return i&&ze.forEach(function(ww){return o(G,ww)}),ft&&kr(G,Ve),Ae}function St(G,W,ee,ve){if(typeof ee=="object"&&ee!==null&&ee.type===M&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:e:{for(var Ae=ee.key,Pe=W;Pe!==null;){if(Pe.key===Ae){if(Ae=ee.type,Ae===M){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===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===B&&rm(Ae)===Pe.type){h(G,Pe.sibling),W=x(Pe,ee.props),W.ref=aa(G,Pe,ee),W.return=G,G=W;break e}h(G,Pe);break}else o(G,Pe);Pe=Pe.sibling}ee.type===M?(W=Dr(ee.props.children,G.mode,ve,ee.key),W.return=G,G=W):(ve=cl(ee.type,ee.key,ee.props,null,G.mode,ve),ve.ref=aa(G,W,ee),ve.return=G,G=ve)}return N(G);case Z: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=hh(ee,G.mode,ve),W.return=G,G=W}return N(G);case B:return Pe=ee._init,St(G,W,Pe(ee._payload),ve)}if(je(ee))return Ie(G,W,ee,ve);if(ne(ee))return Le(G,W,ee,ve);Uo(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=uh(ee,G.mode,ve),W.return=G,G=W),N(G)):h(G,W)}return St}var ci=im(!0),am=im(!1),oa={},ns=Hs(oa),la=Hs(oa),ca=Hs(oa);function Cr(i){if(i===oa)throw Error(t(174));return i}function Eu(i,o){switch(lt(ca,o),lt(la,i),lt(ns,oa),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:zn(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=zn(o,i)}ut(ns),lt(ns,o)}function ui(){ut(ns),ut(la),ut(ca)}function om(i){Cr(ca.current);var o=Cr(ns.current),h=zn(o,i.type);o!==h&&(lt(la,i),lt(ns,h))}function Mu(i){la.current===i&&(ut(ns),ut(la))}var vt=Hs(0);function Wo(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 Du=[];function Tu(){for(var i=0;i<Du.length;i++)Du[i]._workInProgressVersionPrimary=null;Du.length=0}var Yo=O.ReactCurrentDispatcher,Iu=O.ReactCurrentBatchConfig,Nr=0,xt=null,At=null,Rt=null,Qo=!1,ua=!1,ha=0,F2=0;function Yt(){throw Error(t(321))}function Lu(i,o){if(o===null)return!1;for(var h=0;h<o.length&&h<i.length;h++)if(!Vn(i[h],o[h]))return!1;return!0}function Au(i,o,h,m,x,b){if(Nr=b,xt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Yo.current=i===null||i.memoizedState===null?Y2:Q2,i=h(m,x),ua){b=0;do{if(ua=!1,ha=0,25<=b)throw Error(t(301));b+=1,Rt=At=null,o.updateQueue=null,Yo.current=K2,i=h(m,x)}while(ua)}if(Yo.current=Go,o=At!==null&&At.next!==null,Nr=0,Rt=At=xt=null,Qo=!1,o)throw Error(t(300));return i}function Ou(){var i=ha!==0;return ha=0,i}function ss(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?xt.memoizedState=Rt=i:Rt=Rt.next=i,Rt}function Tn(){if(At===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var o=Rt===null?xt.memoizedState:Rt.next;if(o!==null)Rt=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},Rt===null?xt.memoizedState=Rt=i:Rt=Rt.next=i}return Rt}function da(i,o){return typeof o=="function"?o(i):o}function Ru(i){var o=Tn(),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 L=N=null,V=null,re=b;do{var fe=re.lane;if((Nr&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?(L=V=pe,N=m):V=V.next=pe,xt.lanes|=fe,jr|=fe}re=re.next}while(re!==null&&re!==b);V===null?N=m:V.next=L,Vn(m,o.memoizedState)||(an=!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,xt.lanes|=b,jr|=b,x=x.next;while(x!==i)}else x===null&&(h.lanes=0);return[o.memoizedState,h.dispatch]}function Pu(i){var o=Tn(),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);Vn(b,o.memoizedState)||(an=!0),o.memoizedState=b,o.baseQueue===null&&(o.baseState=b),h.lastRenderedState=b}return[b,m]}function lm(){}function cm(i,o){var h=xt,m=Tn(),x=o(),b=!Vn(m.memoizedState,x);if(b&&(m.memoizedState=x,an=!0),m=m.queue,zu(dm.bind(null,h,m,i),[i]),m.getSnapshot!==o||b||Rt!==null&&Rt.memoizedState.tag&1){if(h.flags|=2048,fa(9,hm.bind(null,h,m,x,o),void 0,null),Pt===null)throw Error(t(349));(Nr&30)!==0||um(h,o,x)}return x}function um(i,o,h){i.flags|=16384,i={getSnapshot:o,value:h},o=xt.updateQueue,o===null?(o={lastEffect:null,stores:null},xt.updateQueue=o,o.stores=[i]):(h=o.stores,h===null?o.stores=[i]:h.push(i))}function hm(i,o,h,m){o.value=h,o.getSnapshot=m,fm(o)&&pm(i)}function dm(i,o,h){return h(function(){fm(o)&&pm(i)})}function fm(i){var o=i.getSnapshot;i=i.value;try{var h=o();return!Vn(i,h)}catch{return!0}}function pm(i){var o=_s(i,1);o!==null&&Wn(o,i,1,-1)}function mm(i){var o=ss();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:i},o.queue=i,i=i.dispatch=W2.bind(null,xt,i),[o.memoizedState,i]}function fa(i,o,h,m){return i={tag:i,create:o,destroy:h,deps:m,next:null},o=xt.updateQueue,o===null?(o={lastEffect:null,stores:null},xt.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 gm(){return Tn().memoizedState}function Ko(i,o,h,m){var x=ss();xt.flags|=i,x.memoizedState=fa(1|o,h,void 0,m===void 0?null:m)}function Zo(i,o,h,m){var x=Tn();m=m===void 0?null:m;var b=void 0;if(At!==null){var N=At.memoizedState;if(b=N.destroy,m!==null&&Lu(m,N.deps)){x.memoizedState=fa(o,h,b,m);return}}xt.flags|=i,x.memoizedState=fa(1|o,h,b,m)}function vm(i,o){return Ko(8390656,8,i,o)}function zu(i,o){return Zo(2048,8,i,o)}function xm(i,o){return Zo(4,2,i,o)}function ym(i,o){return Zo(4,4,i,o)}function wm(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 bm(i,o,h){return h=h!=null?h.concat([i]):null,Zo(4,4,wm.bind(null,o,i),h)}function Bu(){}function km(i,o){var h=Tn();o=o===void 0?null:o;var m=h.memoizedState;return m!==null&&o!==null&&Lu(o,m[1])?m[0]:(h.memoizedState=[i,o],i)}function _m(i,o){var h=Tn();o=o===void 0?null:o;var m=h.memoizedState;return m!==null&&o!==null&&Lu(o,m[1])?m[0]:(i=i(),h.memoizedState=[i,o],i)}function Cm(i,o,h){return(Nr&21)===0?(i.baseState&&(i.baseState=!1,an=!0),i.memoizedState=h):(Vn(h,o)||(h=Gf(),xt.lanes|=h,jr|=h,i.baseState=!0),o)}function H2(i,o){var h=tt;tt=h!==0&&4>h?h:4,i(!0);var m=Iu.transition;Iu.transition={};try{i(!1),o()}finally{tt=h,Iu.transition=m}}function Nm(){return Tn().memoizedState}function U2(i,o,h){var m=Js(i);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},jm(i))Sm(o,h);else if(h=Gp(i,o,h,m),h!==null){var x=Jt();Wn(h,i,m,x),Em(h,o,m)}}function W2(i,o,h){var m=Js(i),x={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(jm(i))Sm(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,L=b(N,h);if(x.hasEagerState=!0,x.eagerState=L,Vn(L,N)){var V=o.interleaved;V===null?(x.next=x,Cu(o)):(x.next=V.next,V.next=x),o.interleaved=x;return}}catch{}finally{}h=Gp(i,o,x,m),h!==null&&(x=Jt(),Wn(h,i,m,x),Em(h,o,m))}}function jm(i){var o=i.alternate;return i===xt||o!==null&&o===xt}function Sm(i,o){ua=Qo=!0;var h=i.pending;h===null?o.next=o:(o.next=h.next,h.next=o),i.pending=o}function Em(i,o,h){if((h&4194240)!==0){var m=o.lanes;m&=i.pendingLanes,h|=m,o.lanes=h,Bc(i,h)}}var Go={readContext:Dn,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},Y2={readContext:Dn,useCallback:function(i,o){return ss().memoizedState=[i,o===void 0?null:o],i},useContext:Dn,useEffect:vm,useImperativeHandle:function(i,o,h){return h=h!=null?h.concat([i]):null,Ko(4194308,4,wm.bind(null,o,i),h)},useLayoutEffect:function(i,o){return Ko(4194308,4,i,o)},useInsertionEffect:function(i,o){return Ko(4,2,i,o)},useMemo:function(i,o){var h=ss();return o=o===void 0?null:o,i=i(),h.memoizedState=[i,o],i},useReducer:function(i,o,h){var m=ss();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=U2.bind(null,xt,i),[m.memoizedState,i]},useRef:function(i){var o=ss();return i={current:i},o.memoizedState=i},useState:mm,useDebugValue:Bu,useDeferredValue:function(i){return ss().memoizedState=i},useTransition:function(){var i=mm(!1),o=i[0];return i=H2.bind(null,i[1]),ss().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,h){var m=xt,x=ss();if(ft){if(h===void 0)throw Error(t(407));h=h()}else{if(h=o(),Pt===null)throw Error(t(349));(Nr&30)!==0||um(m,o,h)}x.memoizedState=h;var b={value:h,getSnapshot:o};return x.queue=b,vm(dm.bind(null,m,b,i),[i]),m.flags|=2048,fa(9,hm.bind(null,m,b,h,o),void 0,null),h},useId:function(){var i=ss(),o=Pt.identifierPrefix;if(ft){var h=ks,m=bs;h=(m&~(1<<32-Bn(m)-1)).toString(32)+h,o=":"+o+"R"+h,h=ha++,0<h&&(o+="H"+h.toString(32)),o+=":"}else h=F2++,o=":"+o+"r"+h.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},Q2={readContext:Dn,useCallback:km,useContext:Dn,useEffect:zu,useImperativeHandle:bm,useInsertionEffect:xm,useLayoutEffect:ym,useMemo:_m,useReducer:Ru,useRef:gm,useState:function(){return Ru(da)},useDebugValue:Bu,useDeferredValue:function(i){var o=Tn();return Cm(o,At.memoizedState,i)},useTransition:function(){var i=Ru(da)[0],o=Tn().memoizedState;return[i,o]},useMutableSource:lm,useSyncExternalStore:cm,useId:Nm,unstable_isNewReconciler:!1},K2={readContext:Dn,useCallback:km,useContext:Dn,useEffect:zu,useImperativeHandle:bm,useInsertionEffect:xm,useLayoutEffect:ym,useMemo:_m,useReducer:Pu,useRef:gm,useState:function(){return Pu(da)},useDebugValue:Bu,useDeferredValue:function(i){var o=Tn();return At===null?o.memoizedState=i:Cm(o,At.memoizedState,i)},useTransition:function(){var i=Pu(da)[0],o=Tn().memoizedState;return[i,o]},useMutableSource:lm,useSyncExternalStore:cm,useId:Nm,unstable_isNewReconciler:!1};function hi(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 Vu(i,o,h){return{value:i,source:null,stack:h??null,digest:o??null}}function $u(i,o){try{console.error(o.value)}catch(h){setTimeout(function(){throw h})}}var Z2=typeof WeakMap=="function"?WeakMap:Map;function Mm(i,o,h){h=Cs(-1,h),h.tag=3,h.payload={element:null};var m=o.value;return h.callback=function(){sl||(sl=!0,nh=m),$u(i,o)},h}function Dm(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(){$u(i,o)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(h.callback=function(){$u(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 Tm(i,o,h){var m=i.pingCache;if(m===null){m=i.pingCache=new Z2;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=cw.bind(null,i,o,h),o.then(i,i))}function Im(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 Lm(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,Qs(h,o,1))),h.lanes|=1),i):(i.flags|=65536,i.lanes=x,i)}var G2=O.ReactCurrentOwner,an=!1;function Gt(i,o,h,m){o.child=i===null?am(o,null,h,m):ci(o,i.child,h,m)}function Am(i,o,h,m,x){h=h.render;var b=o.ref;return li(o,x),m=Au(i,o,h,m,b,x),h=Ou(),i!==null&&!an?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Ns(i,o,x)):(ft&&h&&mu(o),o.flags|=1,Gt(i,o,m,x),o.child)}function Om(i,o,h,m,x){if(i===null){var b=h.type;return typeof b=="function"&&!ch(b)&&b.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(o.tag=15,o.type=b,Rm(i,o,b,m,x)):(i=cl(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:Xi,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 Rm(i,o,h,m,x){if(i!==null){var b=i.memoizedProps;if(Xi(b,m)&&i.ref===o.ref)if(an=!1,o.pendingProps=m=b,(i.lanes&x)!==0)(i.flags&131072)!==0&&(an=!0);else return o.lanes=i.lanes,Ns(i,o,x)}return Fu(i,o,h,m,x)}function Pm(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},lt(fi,wn),wn|=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,lt(fi,wn),wn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:h,lt(fi,wn),wn|=m}else b!==null?(m=b.baseLanes|h,o.memoizedState=null):m=h,lt(fi,wn),wn|=m;return Gt(i,o,x,h),o.child}function zm(i,o){var h=o.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(o.flags|=512,o.flags|=2097152)}function Fu(i,o,h,m,x){var b=rn(h)?wr:Wt.current;return b=si(o,b),li(o,x),h=Au(i,o,h,m,b,x),m=Ou(),i!==null&&!an?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Ns(i,o,x)):(ft&&m&&mu(o),o.flags|=1,Gt(i,o,h,x),o.child)}function Bm(i,o,h,m,x){if(rn(h)){var b=!0;Ao(o)}else b=!1;if(li(o,x),o.stateNode===null)qo(i,o),nm(o,h,m),Su(o,h,m,x),m=!0;else if(i===null){var N=o.stateNode,L=o.memoizedProps;N.props=L;var V=N.context,re=h.contextType;typeof re=="object"&&re!==null?re=Dn(re):(re=rn(h)?wr:Wt.current,re=si(o,re));var fe=h.getDerivedStateFromProps,pe=typeof fe=="function"||typeof N.getSnapshotBeforeUpdate=="function";pe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L!==m||V!==re)&&sm(o,N,m,re),Ys=!1;var de=o.memoizedState;N.state=de,Fo(o,m,N,x),V=o.memoizedState,L!==m||de!==V||sn.current||Ys?(typeof fe=="function"&&(ju(o,h,fe,m),V=o.memoizedState),(L=Ys||tm(o,h,L,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=L):(typeof N.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{N=o.stateNode,Jp(i,o),L=o.memoizedProps,re=o.type===o.elementType?L:Fn(o.type,L),N.props=re,pe=o.pendingProps,de=N.context,V=h.contextType,typeof V=="object"&&V!==null?V=Dn(V):(V=rn(h)?wr:Wt.current,V=si(o,V));var Se=h.getDerivedStateFromProps;(fe=typeof Se=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L!==pe||de!==V)&&sm(o,N,m,V),Ys=!1,de=o.memoizedState,N.state=de,Fo(o,m,N,x);var Ie=o.memoizedState;L!==pe||de!==Ie||sn.current||Ys?(typeof Se=="function"&&(ju(o,h,Se,m),Ie=o.memoizedState),(re=Ys||tm(o,h,re,m,de,Ie,V)||!1)?(fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(m,Ie,V),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,Ie,V)),typeof N.componentDidUpdate=="function"&&(o.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof N.componentDidUpdate!="function"||L===i.memoizedProps&&de===i.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&de===i.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=Ie),N.props=m,N.state=Ie,N.context=V,m=re):(typeof N.componentDidUpdate!="function"||L===i.memoizedProps&&de===i.memoizedState||(o.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&de===i.memoizedState||(o.flags|=1024),m=!1)}return Hu(i,o,h,m,b,x)}function Hu(i,o,h,m,x,b){zm(i,o);var N=(o.flags&128)!==0;if(!m&&!N)return x&&Hp(o,h,!1),Ns(i,o,b);m=o.stateNode,G2.current=o;var L=N&&typeof h.getDerivedStateFromError!="function"?null:m.render();return o.flags|=1,i!==null&&N?(o.child=ci(o,i.child,null,b),o.child=ci(o,null,L,b)):Gt(i,o,L,b),o.memoizedState=m.state,x&&Hp(o,h,!0),o.child}function Vm(i){var o=i.stateNode;o.pendingContext?$p(i,o.pendingContext,o.pendingContext!==o.context):o.context&&$p(i,o.context,!1),Eu(i,o.containerInfo)}function $m(i,o,h,m,x){return ai(),yu(x),o.flags|=256,Gt(i,o,h,m),o.child}var Uu={dehydrated:null,treeContext:null,retryLane:0};function Wu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Fm(i,o,h){var m=o.pendingProps,x=vt.current,b=!1,N=(o.flags&128)!==0,L;if((L=N)||(L=i!==null&&i.memoizedState===null?!1:(x&2)!==0),L?(b=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(x|=1),lt(vt,x&1),i===null)return xu(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=ul(N,m,0,null),i=Dr(i,m,h,null),b.return=o,i.return=o,b.sibling=i,o.child=b,o.child.memoizedState=Wu(h),o.memoizedState=Uu,i):Yu(o,N));if(x=i.memoizedState,x!==null&&(L=x.dehydrated,L!==null))return J2(i,o,N,m,L,x,h);if(b){b=m.fallback,N=o.mode,x=i.child,L=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),L!==null?b=Xs(L,b):(b=Dr(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?Wu(h):{baseLanes:N.baseLanes|h,cachePool:null,transitions:N.transitions},b.memoizedState=N,b.childLanes=i.childLanes&~h,o.memoizedState=Uu,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 Yu(i,o){return o=ul({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Jo(i,o,h,m){return m!==null&&yu(m),ci(o,i.child,null,h),i=Yu(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function J2(i,o,h,m,x,b,N){if(h)return o.flags&256?(o.flags&=-257,m=Vu(Error(t(422))),Jo(i,o,N,m)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(b=m.fallback,x=o.mode,m=ul({mode:"visible",children:m.children},x,0,null),b=Dr(b,x,N,null),b.flags|=2,m.return=o,b.return=o,m.sibling=b,o.child=m,(o.mode&1)!==0&&ci(o,i.child,null,N),o.child.memoizedState=Wu(N),o.memoizedState=Uu,b);if((o.mode&1)===0)return Jo(i,o,N,null);if(x.data==="$!"){if(m=x.nextSibling&&x.nextSibling.dataset,m)var L=m.dgst;return m=L,b=Error(t(419)),m=Vu(b,m,void 0),Jo(i,o,N,m)}if(L=(N&i.childLanes)!==0,an||L){if(m=Pt,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),Wn(m,i,x,-1))}return lh(),m=Vu(Error(t(421))),Jo(i,o,N,m)}return x.data==="$?"?(o.flags|=128,o.child=i.child,o=uw.bind(null,i),x._reactRetry=o,null):(i=b.treeContext,yn=Fs(x.nextSibling),xn=o,ft=!0,$n=null,i!==null&&(En[Mn++]=bs,En[Mn++]=ks,En[Mn++]=br,bs=i.id,ks=i.overflow,br=o),o=Yu(o,m.children),o.flags|=4096,o)}function Hm(i,o,h){i.lanes|=o;var m=i.alternate;m!==null&&(m.lanes|=o),_u(i.return,o,h)}function Qu(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 Um(i,o,h){var m=o.pendingProps,x=m.revealOrder,b=m.tail;if(Gt(i,o,m.children,h),m=vt.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&&Hm(i,h,o);else if(i.tag===19)Hm(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(lt(vt,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&&Wo(i)===null&&(x=h),h=h.sibling;h=x,h===null?(x=o.child,o.child=null):(x=h.sibling,h.sibling=null),Qu(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&&Wo(i)===null){o.child=x;break}i=x.sibling,x.sibling=h,h=x,x=i}Qu(o,!0,h,null,b);break;case"together":Qu(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function qo(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),jr|=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 q2(i,o,h){switch(o.tag){case 3:Vm(o),ai();break;case 5:om(o);break;case 1:rn(o.type)&&Ao(o);break;case 4:Eu(o,o.stateNode.containerInfo);break;case 10:var m=o.type._context,x=o.memoizedProps.value;lt(Bo,m._currentValue),m._currentValue=x;break;case 13:if(m=o.memoizedState,m!==null)return m.dehydrated!==null?(lt(vt,vt.current&1),o.flags|=128,null):(h&o.child.childLanes)!==0?Fm(i,o,h):(lt(vt,vt.current&1),i=Ns(i,o,h),i!==null?i.sibling:null);lt(vt,vt.current&1);break;case 19:if(m=(h&o.childLanes)!==0,(i.flags&128)!==0){if(m)return Um(i,o,h);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),lt(vt,vt.current),m)break;return null;case 22:case 23:return o.lanes=0,Pm(i,o,h)}return Ns(i,o,h)}var Wm,Ku,Ym,Qm;Wm=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}},Ku=function(){},Ym=function(i,o,h,m){var x=i.memoizedProps;if(x!==m){i=o.stateNode,Cr(ns.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=To)}Ec(h,m);var N;h=null;for(re in x)if(!m.hasOwnProperty(re)&&x.hasOwnProperty(re)&&x[re]!=null)if(re==="style"){var L=x[re];for(N in L)L.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(L=x!=null?x[re]:void 0,m.hasOwnProperty(re)&&V!==L&&(V!=null||L!=null))if(re==="style")if(L){for(N in L)!L.hasOwnProperty(N)||V&&V.hasOwnProperty(N)||(h||(h={}),h[N]="");for(N in V)V.hasOwnProperty(N)&&L[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,L=L?L.__html:void 0,V!=null&&L!==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||L===V||(b=[])):(b=b||[]).push(re,V))}h&&(b=b||[]).push("style",h);var re=b;(o.updateQueue=re)&&(o.flags|=4)}},Qm=function(i,o,h,m){h!==m&&(o.flags|=4)};function pa(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 Qt(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 X2(i,o,h){var m=o.pendingProps;switch(gu(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(o),null;case 1:return rn(o.type)&&Lo(),Qt(o),null;case 3:return m=o.stateNode,ui(),ut(sn),ut(Wt),Tu(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(i===null||i.child===null)&&(zo(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,$n!==null&&(ih($n),$n=null))),Ku(i,o),Qt(o),null;case 5:Mu(o);var x=Cr(ca.current);if(h=o.type,i!==null&&o.stateNode!=null)Ym(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 Qt(o),null}if(i=Cr(ns.current),zo(o)){m=o.stateNode,h=o.type;var b=o.memoizedProps;switch(m[ts]=o,m[ra]=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<ta.length;x++)ct(ta[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":F(m,b),ct("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!b.multiple},ct("invalid",m);break;case"textarea":Xe(m,b),ct("invalid",m)}Ec(h,b),x=null;for(var N in b)if(b.hasOwnProperty(N)){var L=b[N];N==="children"?typeof L=="string"?m.textContent!==L&&(b.suppressHydrationWarning!==!0&&Do(m.textContent,L,i),x=["children",L]):typeof L=="number"&&m.textContent!==""+L&&(b.suppressHydrationWarning!==!0&&Do(m.textContent,L,i),x=["children",""+L]):r.hasOwnProperty(N)&&L!=null&&N==="onScroll"&&ct("scroll",m)}switch(h){case"input":j(m),oe(m,b,!0);break;case"textarea":j(m),dt(m);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(m.onclick=To)}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[ts]=o,i[ra]=m,Wm(i,o,!1,!1),o.stateNode=i;e:{switch(N=Mc(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<ta.length;x++)ct(ta[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":F(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":Xe(i,m),x=Oe(i,m),ct("invalid",i);break;default:x=m}Ec(h,x),L=x;for(b in L)if(L.hasOwnProperty(b)){var V=L[b];b==="style"?rt(i,V):b==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&ue(i,V)):b==="children"?typeof V=="string"?(h!=="textarea"||V!=="")&&Ce(i,V):typeof V=="number"&&Ce(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),oe(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?_e(i,!!m.multiple,b,!1):m.defaultValue!=null&&_e(i,!!m.multiple,m.defaultValue,!0);break;default:typeof x.onClick=="function"&&(i.onclick=To)}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 Qt(o),null;case 6:if(i&&o.stateNode!=null)Qm(i,o,i.memoizedProps,m);else{if(typeof m!="string"&&o.stateNode===null)throw Error(t(166));if(h=Cr(ca.current),Cr(ns.current),zo(o)){if(m=o.stateNode,h=o.memoizedProps,m[ts]=o,(b=m.nodeValue!==h)&&(i=xn,i!==null))switch(i.tag){case 3:Do(m.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Do(m.nodeValue,h,(i.mode&1)!==0)}b&&(o.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[ts]=o,o.stateNode=m}return Qt(o),null;case 13:if(ut(vt),m=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ft&&yn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Zp(),ai(),o.flags|=98560,b=!1;else if(b=zo(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[ts]=o}else ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Qt(o),b=!1}else $n!==null&&(ih($n),$n=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||(vt.current&1)!==0?Ot===0&&(Ot=3):lh())),o.updateQueue!==null&&(o.flags|=4),Qt(o),null);case 4:return ui(),Ku(i,o),i===null&&na(o.stateNode.containerInfo),Qt(o),null;case 10:return ku(o.type._context),Qt(o),null;case 17:return rn(o.type)&&Lo(),Qt(o),null;case 19:if(ut(vt),b=o.memoizedState,b===null)return Qt(o),null;if(m=(o.flags&128)!==0,N=b.rendering,N===null)if(m)pa(b,!1);else{if(Ot!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(N=Wo(i),N!==null){for(o.flags|=128,pa(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 lt(vt,vt.current&1|2),o.child}i=i.sibling}b.tail!==null&&jt()>pi&&(o.flags|=128,m=!0,pa(b,!1),o.lanes=4194304)}else{if(!m)if(i=Wo(N),i!==null){if(o.flags|=128,m=!0,h=i.updateQueue,h!==null&&(o.updateQueue=h,o.flags|=4),pa(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!ft)return Qt(o),null}else 2*jt()-b.renderingStartTime>pi&&h!==1073741824&&(o.flags|=128,m=!0,pa(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=jt(),o.sibling=null,h=vt.current,lt(vt,m?h&1|2:h&1),o):(Qt(o),null);case 22:case 23:return oh(),m=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==m&&(o.flags|=8192),m&&(o.mode&1)!==0?(wn&1073741824)!==0&&(Qt(o),o.subtreeFlags&6&&(o.flags|=8192)):Qt(o),null;case 24:return null;case 25:return null}throw Error(t(156,o.tag))}function ew(i,o){switch(gu(o),o.tag){case 1:return rn(o.type)&&Lo(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ui(),ut(sn),ut(Wt),Tu(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Mu(o),null;case 13:if(ut(vt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(t(340));ai()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return ut(vt),null;case 4:return ui(),null;case 10:return ku(o.type._context),null;case 22:case 23:return oh(),null;case 24:return null;default:return null}}var Xo=!1,Kt=!1,tw=typeof WeakSet=="function"?WeakSet:Set,Te=null;function di(i,o){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){kt(i,o,m)}else h.current=null}function Zu(i,o,h){try{h()}catch(m){kt(i,o,m)}}var Km=!1;function nw(i,o){if(ou=yo,i=Np(),Xc(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,L=-1,V=-1,re=0,fe=0,pe=i,de=null;e:for(;;){for(var Se;pe!==h||x!==0&&pe.nodeType!==3||(L=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&&(L=N),de===b&&++fe===m&&(V=N),(Se=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=Se}h=L===-1||V===-1?null:{start:L,end:V}}else h=null}h=h||{start:0,end:0}}else h=null;for(lu={focusedElem:i,selectionRange:h},yo=!1,Te=o;Te!==null;)if(o=Te,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Te=i;else for(;Te!==null;){o=Te;try{var Ie=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Le=Ie.memoizedProps,St=Ie.memoizedState,G=o.stateNode,W=G.getSnapshotBeforeUpdate(o.elementType===o.type?Le:Fn(o.type,Le),St);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(ve){kt(o,o.return,ve)}if(i=o.sibling,i!==null){i.return=o.return,Te=i;break}Te=o.return}return Ie=Km,Km=!1,Ie}function ma(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&&Zu(o,h,b)}x=x.next}while(x!==m)}}function el(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 Gu(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 Zm(i){var o=i.alternate;o!==null&&(i.alternate=null,Zm(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[ts],delete o[ra],delete o[du],delete o[z2],delete o[B2])),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 Gm(i){return i.tag===5||i.tag===3||i.tag===4}function Jm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Gm(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 Ju(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=To));else if(m!==4&&(i=i.child,i!==null))for(Ju(i,o,h),i=i.sibling;i!==null;)Ju(i,o,h),i=i.sibling}function qu(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(qu(i,o,h),i=i.sibling;i!==null;)qu(i,o,h),i=i.sibling}var Bt=null,Hn=!1;function Ks(i,o,h){for(h=h.child;h!==null;)qm(i,o,h),h=h.sibling}function qm(i,o,h){if(es&&typeof es.onCommitFiberUnmount=="function")try{es.onCommitFiberUnmount(fo,h)}catch{}switch(h.tag){case 5:Kt||di(h,o);case 6:var m=Bt,x=Hn;Bt=null,Ks(i,o,h),Bt=m,Hn=x,Bt!==null&&(Hn?(i=Bt,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Bt.removeChild(h.stateNode));break;case 18:Bt!==null&&(Hn?(i=Bt,h=h.stateNode,i.nodeType===8?hu(i.parentNode,h):i.nodeType===1&&hu(i,h),Qi(i)):hu(Bt,h.stateNode));break;case 4:m=Bt,x=Hn,Bt=h.stateNode.containerInfo,Hn=!0,Ks(i,o,h),Bt=m,Hn=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)&&Zu(h,o,N),x=x.next}while(x!==m)}Ks(i,o,h);break;case 1:if(!Kt&&(di(h,o),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(L){kt(h,o,L)}Ks(i,o,h);break;case 21:Ks(i,o,h);break;case 22:h.mode&1?(Kt=(m=Kt)||h.memoizedState!==null,Ks(i,o,h),Kt=m):Ks(i,o,h);break;default:Ks(i,o,h)}}function Xm(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new tw),o.forEach(function(m){var x=hw.bind(null,i,m);h.has(m)||(h.add(m),m.then(x,x))})}}function Un(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,L=N;e:for(;L!==null;){switch(L.tag){case 5:Bt=L.stateNode,Hn=!1;break e;case 3:Bt=L.stateNode.containerInfo,Hn=!0;break e;case 4:Bt=L.stateNode.containerInfo,Hn=!0;break e}L=L.return}if(Bt===null)throw Error(t(160));qm(b,N,x),Bt=null,Hn=!1;var V=x.alternate;V!==null&&(V.return=null),x.return=null}catch(re){kt(x,o,re)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)e0(o,i),o=o.sibling}function e0(i,o){var h=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Un(o,i),rs(i),m&4){try{ma(3,i,i.return),el(3,i)}catch(Le){kt(i,i.return,Le)}try{ma(5,i,i.return)}catch(Le){kt(i,i.return,Le)}}break;case 1:Un(o,i),rs(i),m&512&&h!==null&&di(h,h.return);break;case 5:if(Un(o,i),rs(i),m&512&&h!==null&&di(h,h.return),i.flags&32){var x=i.stateNode;try{Ce(x,"")}catch(Le){kt(i,i.return,Le)}}if(m&4&&(x=i.stateNode,x!=null)){var b=i.memoizedProps,N=h!==null?h.memoizedProps:b,L=i.type,V=i.updateQueue;if(i.updateQueue=null,V!==null)try{L==="input"&&b.type==="radio"&&b.name!=null&&P(x,b),Mc(L,N);var re=Mc(L,b);for(N=0;N<V.length;N+=2){var fe=V[N],pe=V[N+1];fe==="style"?rt(x,pe):fe==="dangerouslySetInnerHTML"?ue(x,pe):fe==="children"?Ce(x,pe):I(x,fe,pe,re)}switch(L){case"input":Q(x,b);break;case"textarea":Ct(x,b);break;case"select":var de=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!b.multiple;var Se=b.value;Se!=null?_e(x,!!b.multiple,Se,!1):de!==!!b.multiple&&(b.defaultValue!=null?_e(x,!!b.multiple,b.defaultValue,!0):_e(x,!!b.multiple,b.multiple?[]:"",!1))}x[ra]=b}catch(Le){kt(i,i.return,Le)}}break;case 6:if(Un(o,i),rs(i),m&4){if(i.stateNode===null)throw Error(t(162));x=i.stateNode,b=i.memoizedProps;try{x.nodeValue=b}catch(Le){kt(i,i.return,Le)}}break;case 3:if(Un(o,i),rs(i),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Qi(o.containerInfo)}catch(Le){kt(i,i.return,Le)}break;case 4:Un(o,i),rs(i);break;case 13:Un(o,i),rs(i),x=i.child,x.flags&8192&&(b=x.memoizedState!==null,x.stateNode.isHidden=b,!b||x.alternate!==null&&x.alternate.memoizedState!==null||(th=jt())),m&4&&Xm(i);break;case 22:if(fe=h!==null&&h.memoizedState!==null,i.mode&1?(Kt=(re=Kt)||fe,Un(o,i),Kt=re):Un(o,i),rs(i),m&8192){if(re=i.memoizedState!==null,(i.stateNode.isHidden=re)&&!fe&&(i.mode&1)!==0)for(Te=i,fe=i.child;fe!==null;){for(pe=Te=fe;Te!==null;){switch(de=Te,Se=de.child,de.tag){case 0:case 11:case 14:case 15:ma(4,de,de.return);break;case 1:di(de,de.return);var Ie=de.stateNode;if(typeof Ie.componentWillUnmount=="function"){m=de,h=de.return;try{o=m,Ie.props=o.memoizedProps,Ie.state=o.memoizedState,Ie.componentWillUnmount()}catch(Le){kt(m,h,Le)}}break;case 5:di(de,de.return);break;case 22:if(de.memoizedState!==null){s0(pe);continue}}Se!==null?(Se.return=de,Te=Se):s0(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"):(L=pe.stateNode,V=pe.memoizedProps.style,N=V!=null&&V.hasOwnProperty("display")?V.display:null,L.style.display=nn("display",N))}catch(Le){kt(i,i.return,Le)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=re?"":pe.memoizedProps}catch(Le){kt(i,i.return,Le)}}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:Un(o,i),rs(i),m&4&&Xm(i);break;case 21:break;default:Un(o,i),rs(i)}}function rs(i){var o=i.flags;if(o&2){try{e:{for(var h=i.return;h!==null;){if(Gm(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&&(Ce(x,""),m.flags&=-33);var b=Jm(i);qu(i,b,x);break;case 3:case 4:var N=m.stateNode.containerInfo,L=Jm(i);Ju(i,L,N);break;default:throw Error(t(161))}}catch(V){kt(i,i.return,V)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function sw(i,o,h){Te=i,t0(i)}function t0(i,o,h){for(var m=(i.mode&1)!==0;Te!==null;){var x=Te,b=x.child;if(x.tag===22&&m){var N=x.memoizedState!==null||Xo;if(!N){var L=x.alternate,V=L!==null&&L.memoizedState!==null||Kt;L=Xo;var re=Kt;if(Xo=N,(Kt=V)&&!re)for(Te=x;Te!==null;)N=Te,V=N.child,N.tag===22&&N.memoizedState!==null?r0(x):V!==null?(V.return=N,Te=V):r0(x);for(;b!==null;)Te=b,t0(b),b=b.sibling;Te=x,Xo=L,Kt=re}n0(i)}else(x.subtreeFlags&8772)!==0&&b!==null?(b.return=x,Te=b):n0(i)}}function n0(i){for(;Te!==null;){var o=Te;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||el(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:Fn(o.type,h.memoizedProps);m.componentDidUpdate(x,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var b=o.updateQueue;b!==null&&Xp(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}Xp(o,N,h)}break;case 5:var L=o.stateNode;if(h===null&&o.flags&4){h=L;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&&Qi(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Kt||o.flags&512&&Gu(o)}catch(de){kt(o,o.return,de)}}if(o===i){Te=null;break}if(h=o.sibling,h!==null){h.return=o.return,Te=h;break}Te=o.return}}function s0(i){for(;Te!==null;){var o=Te;if(o===i){Te=null;break}var h=o.sibling;if(h!==null){h.return=o.return,Te=h;break}Te=o.return}}function r0(i){for(;Te!==null;){var o=Te;try{switch(o.tag){case 0:case 11:case 15:var h=o.return;try{el(4,o)}catch(V){kt(o,h,V)}break;case 1:var m=o.stateNode;if(typeof m.componentDidMount=="function"){var x=o.return;try{m.componentDidMount()}catch(V){kt(o,x,V)}}var b=o.return;try{Gu(o)}catch(V){kt(o,b,V)}break;case 5:var N=o.return;try{Gu(o)}catch(V){kt(o,N,V)}}}catch(V){kt(o,o.return,V)}if(o===i){Te=null;break}var L=o.sibling;if(L!==null){L.return=o.return,Te=L;break}Te=o.return}}var rw=Math.ceil,tl=O.ReactCurrentDispatcher,Xu=O.ReactCurrentOwner,In=O.ReactCurrentBatchConfig,Ke=0,Pt=null,It=null,Vt=0,wn=0,fi=Hs(0),Ot=0,ga=null,jr=0,nl=0,eh=0,va=null,on=null,th=0,pi=1/0,js=null,sl=!1,nh=null,Zs=null,rl=!1,Gs=null,il=0,xa=0,sh=null,al=-1,ol=0;function Jt(){return(Ke&6)!==0?jt():al!==-1?al:al=jt()}function Js(i){return(i.mode&1)===0?1:(Ke&2)!==0&&Vt!==0?Vt&-Vt:$2.transition!==null?(ol===0&&(ol=Gf()),ol):(i=tt,i!==0||(i=window.event,i=i===void 0?16:ip(i.type)),i)}function Wn(i,o,h,m){if(50<xa)throw xa=0,sh=null,Error(t(185));Fi(i,h,m),((Ke&2)===0||i!==Pt)&&(i===Pt&&((Ke&2)===0&&(nl|=h),Ot===4&&qs(i,Vt)),ln(i,m),h===1&&Ke===0&&(o.mode&1)===0&&(pi=jt()+500,Oo&&Ws()))}function ln(i,o){var h=i.callbackNode;$y(i,o);var m=go(i,i===Pt?Vt:0);if(m===0)h!==null&&Qf(h),i.callbackNode=null,i.callbackPriority=0;else if(o=m&-m,i.callbackPriority!==o){if(h!=null&&Qf(h),o===1)i.tag===0?V2(a0.bind(null,i)):Up(a0.bind(null,i)),R2(function(){(Ke&6)===0&&Ws()}),h=null;else{switch(Jf(m)){case 1:h=Rc;break;case 4:h=Kf;break;case 16:h=ho;break;case 536870912:h=Zf;break;default:h=ho}h=p0(h,i0.bind(null,i))}i.callbackPriority=o,i.callbackNode=h}}function i0(i,o){if(al=-1,ol=0,(Ke&6)!==0)throw Error(t(327));var h=i.callbackNode;if(mi()&&i.callbackNode!==h)return null;var m=go(i,i===Pt?Vt:0);if(m===0)return null;if((m&30)!==0||(m&i.expiredLanes)!==0||o)o=ll(i,m);else{o=m;var x=Ke;Ke|=2;var b=l0();(Pt!==i||Vt!==o)&&(js=null,pi=jt()+500,Er(i,o));do try{ow();break}catch(L){o0(i,L)}while(!0);bu(),tl.current=b,Ke=x,It!==null?o=0:(Pt=null,Vt=0,o=Ot)}if(o!==0){if(o===2&&(x=Pc(i),x!==0&&(m=x,o=rh(i,x))),o===1)throw h=ga,Er(i,0),qs(i,m),ln(i,jt()),h;if(o===6)qs(i,m);else{if(x=i.current.alternate,(m&30)===0&&!iw(x)&&(o=ll(i,m),o===2&&(b=Pc(i),b!==0&&(m=b,o=rh(i,b))),o===1))throw h=ga,Er(i,0),qs(i,m),ln(i,jt()),h;switch(i.finishedWork=x,i.finishedLanes=m,o){case 0:case 1:throw Error(t(345));case 2:Mr(i,on,js);break;case 3:if(qs(i,m),(m&130023424)===m&&(o=th+500-jt(),10<o)){if(go(i,0)!==0)break;if(x=i.suspendedLanes,(x&m)!==m){Jt(),i.pingedLanes|=i.suspendedLanes&x;break}i.timeoutHandle=uu(Mr.bind(null,i,on,js),o);break}Mr(i,on,js);break;case 4:if(qs(i,m),(m&4194240)===m)break;for(o=i.eventTimes,x=-1;0<m;){var N=31-Bn(m);b=1<<N,N=o[N],N>x&&(x=N),m&=~b}if(m=x,m=jt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*rw(m/1960))-m,10<m){i.timeoutHandle=uu(Mr.bind(null,i,on,js),m);break}Mr(i,on,js);break;case 5:Mr(i,on,js);break;default:throw Error(t(329))}}}return ln(i,jt()),i.callbackNode===h?i0.bind(null,i):null}function rh(i,o){var h=va;return i.current.memoizedState.isDehydrated&&(Er(i,o).flags|=256),i=ll(i,o),i!==2&&(o=on,on=h,o!==null&&ih(o)),i}function ih(i){on===null?on=i:on.push.apply(on,i)}function iw(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(!Vn(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&=~eh,o&=~nl,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var h=31-Bn(o),m=1<<h;i[h]=-1,o&=~m}}function a0(i){if((Ke&6)!==0)throw Error(t(327));mi();var o=go(i,0);if((o&1)===0)return ln(i,jt()),null;var h=ll(i,o);if(i.tag!==0&&h===2){var m=Pc(i);m!==0&&(o=m,h=rh(i,m))}if(h===1)throw h=ga,Er(i,0),qs(i,o),ln(i,jt()),h;if(h===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,Mr(i,on,js),ln(i,jt()),null}function ah(i,o){var h=Ke;Ke|=1;try{return i(o)}finally{Ke=h,Ke===0&&(pi=jt()+500,Oo&&Ws())}}function Sr(i){Gs!==null&&Gs.tag===0&&(Ke&6)===0&&mi();var o=Ke;Ke|=1;var h=In.transition,m=tt;try{if(In.transition=null,tt=1,i)return i()}finally{tt=m,In.transition=h,Ke=o,(Ke&6)===0&&Ws()}}function oh(){wn=fi.current,ut(fi)}function Er(i,o){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,O2(h)),It!==null)for(h=It.return;h!==null;){var m=h;switch(gu(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Lo();break;case 3:ui(),ut(sn),ut(Wt),Tu();break;case 5:Mu(m);break;case 4:ui();break;case 13:ut(vt);break;case 19:ut(vt);break;case 10:ku(m.type._context);break;case 22:case 23:oh()}h=h.return}if(Pt=i,It=i=Xs(i.current,null),Vt=wn=o,Ot=0,ga=null,eh=nl=jr=0,on=va=null,_r!==null){for(o=0;o<_r.length;o++)if(h=_r[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}_r=null}return i}function o0(i,o){do{var h=It;try{if(bu(),Yo.current=Go,Qo){for(var m=xt.memoizedState;m!==null;){var x=m.queue;x!==null&&(x.pending=null),m=m.next}Qo=!1}if(Nr=0,Rt=At=xt=null,ua=!1,ha=0,Xu.current=null,h===null||h.return===null){Ot=1,ga=o,It=null;break}e:{var b=i,N=h.return,L=h,V=o;if(o=Vt,L.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var re=V,fe=L,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=Im(N);if(Se!==null){Se.flags&=-257,Lm(Se,N,L,b,o),Se.mode&1&&Tm(b,re,o),o=Se,V=re;var Ie=o.updateQueue;if(Ie===null){var Le=new Set;Le.add(V),o.updateQueue=Le}else Ie.add(V);break e}else{if((o&1)===0){Tm(b,re,o),lh();break e}V=Error(t(426))}}else if(ft&&L.mode&1){var St=Im(N);if(St!==null){(St.flags&65536)===0&&(St.flags|=256),Lm(St,N,L,b,o),yu(hi(V,L));break e}}b=V=hi(V,L),Ot!==4&&(Ot=2),va===null?va=[b]:va.push(b),b=N;do{switch(b.tag){case 3:b.flags|=65536,o&=-o,b.lanes|=o;var G=Mm(b,V,o);qp(b,G);break e;case 1:L=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 ve=Dm(b,L,o);qp(b,ve);break e}}b=b.return}while(b!==null)}u0(h)}catch(Ae){o=Ae,It===h&&h!==null&&(It=h=h.return);continue}break}while(!0)}function l0(){var i=tl.current;return tl.current=Go,i===null?Go:i}function lh(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Pt===null||(jr&268435455)===0&&(nl&268435455)===0||qs(Pt,Vt)}function ll(i,o){var h=Ke;Ke|=2;var m=l0();(Pt!==i||Vt!==o)&&(js=null,Er(i,o));do try{aw();break}catch(x){o0(i,x)}while(!0);if(bu(),Ke=h,tl.current=m,It!==null)throw Error(t(261));return Pt=null,Vt=0,Ot}function aw(){for(;It!==null;)c0(It)}function ow(){for(;It!==null&&!Iy();)c0(It)}function c0(i){var o=f0(i.alternate,i,wn);i.memoizedProps=i.pendingProps,o===null?u0(i):It=o,Xu.current=null}function u0(i){var o=i;do{var h=o.alternate;if(i=o.return,(o.flags&32768)===0){if(h=X2(h,o,wn),h!==null){It=h;return}}else{if(h=ew(h,o),h!==null){h.flags&=32767,It=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Ot=6,It=null;return}}if(o=o.sibling,o!==null){It=o;return}It=o=i}while(o!==null);Ot===0&&(Ot=5)}function Mr(i,o,h){var m=tt,x=In.transition;try{In.transition=null,tt=1,lw(i,o,h,m)}finally{In.transition=x,tt=m}return null}function lw(i,o,h,m){do mi();while(Gs!==null);if((Ke&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(Fy(i,b),i===Pt&&(It=Pt=null,Vt=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||rl||(rl=!0,p0(ho,function(){return mi(),null})),b=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||b){b=In.transition,In.transition=null;var N=tt;tt=1;var L=Ke;Ke|=4,Xu.current=null,nw(i,h),e0(h,i),E2(lu),yo=!!ou,lu=ou=null,i.current=h,sw(h),Ly(),Ke=L,tt=N,In.transition=b}else i.current=h;if(rl&&(rl=!1,Gs=i,il=x),b=i.pendingLanes,b===0&&(Zs=null),Ry(h.stateNode),ln(i,jt()),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(sl)throw sl=!1,i=nh,nh=null,i;return(il&1)!==0&&i.tag!==0&&mi(),b=i.pendingLanes,(b&1)!==0?i===sh?xa++:(xa=0,sh=i):xa=0,Ws(),null}function mi(){if(Gs!==null){var i=Jf(il),o=In.transition,h=tt;try{if(In.transition=null,tt=16>i?16:i,Gs===null)var m=!1;else{if(i=Gs,Gs=null,il=0,(Ke&6)!==0)throw Error(t(331));var x=Ke;for(Ke|=4,Te=i.current;Te!==null;){var b=Te,N=b.child;if((Te.flags&16)!==0){var L=b.deletions;if(L!==null){for(var V=0;V<L.length;V++){var re=L[V];for(Te=re;Te!==null;){var fe=Te;switch(fe.tag){case 0:case 11:case 15:ma(8,fe,b)}var pe=fe.child;if(pe!==null)pe.return=fe,Te=pe;else for(;Te!==null;){fe=Te;var de=fe.sibling,Se=fe.return;if(Zm(fe),fe===re){Te=null;break}if(de!==null){de.return=Se,Te=de;break}Te=Se}}}var Ie=b.alternate;if(Ie!==null){var Le=Ie.child;if(Le!==null){Ie.child=null;do{var St=Le.sibling;Le.sibling=null,Le=St}while(Le!==null)}}Te=b}}if((b.subtreeFlags&2064)!==0&&N!==null)N.return=b,Te=N;else e:for(;Te!==null;){if(b=Te,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:ma(9,b,b.return)}var G=b.sibling;if(G!==null){G.return=b.return,Te=G;break e}Te=b.return}}var W=i.current;for(Te=W;Te!==null;){N=Te;var ee=N.child;if((N.subtreeFlags&2064)!==0&&ee!==null)ee.return=N,Te=ee;else e:for(N=W;Te!==null;){if(L=Te,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:el(9,L)}}catch(Ae){kt(L,L.return,Ae)}if(L===N){Te=null;break e}var ve=L.sibling;if(ve!==null){ve.return=L.return,Te=ve;break e}Te=L.return}}if(Ke=x,Ws(),es&&typeof es.onPostCommitFiberRoot=="function")try{es.onPostCommitFiberRoot(fo,i)}catch{}m=!0}return m}finally{tt=h,In.transition=o}}return!1}function h0(i,o,h){o=hi(h,o),o=Mm(i,o,1),i=Qs(i,o,1),o=Jt(),i!==null&&(Fi(i,1,o),ln(i,o))}function kt(i,o,h){if(i.tag===3)h0(i,i,h);else for(;o!==null;){if(o.tag===3){h0(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=hi(h,i),i=Dm(o,i,1),o=Qs(o,i,1),i=Jt(),o!==null&&(Fi(o,1,i),ln(o,i));break}}o=o.return}}function cw(i,o,h){var m=i.pingCache;m!==null&&m.delete(o),o=Jt(),i.pingedLanes|=i.suspendedLanes&h,Pt===i&&(Vt&h)===h&&(Ot===4||Ot===3&&(Vt&130023424)===Vt&&500>jt()-th?Er(i,0):eh|=h),ln(i,o)}function d0(i,o){o===0&&((i.mode&1)===0?o=1:(o=mo,mo<<=1,(mo&130023424)===0&&(mo=4194304)));var h=Jt();i=_s(i,o),i!==null&&(Fi(i,o,h),ln(i,h))}function uw(i){var o=i.memoizedState,h=0;o!==null&&(h=o.retryLane),d0(i,h)}function hw(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),d0(i,h)}var f0;f0=function(i,o,h){if(i!==null)if(i.memoizedProps!==o.pendingProps||sn.current)an=!0;else{if((i.lanes&h)===0&&(o.flags&128)===0)return an=!1,q2(i,o,h);an=(i.flags&131072)!==0}else an=!1,ft&&(o.flags&1048576)!==0&&Wp(o,Po,o.index);switch(o.lanes=0,o.tag){case 2:var m=o.type;qo(i,o),i=o.pendingProps;var x=si(o,Wt.current);li(o,h),x=Au(null,o,m,i,x,h);var b=Ou();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,rn(m)?(b=!0,Ao(o)):b=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Nu(o),x.updater=Ho,o.stateNode=x,x._reactInternals=o,Su(o,m,i,h),o=Hu(null,o,m,!0,b,h)):(o.tag=0,ft&&b&&mu(o),Gt(null,o,x,h),o=o.child),o;case 16:m=o.elementType;e:{switch(qo(i,o),i=o.pendingProps,x=m._init,m=x(m._payload),o.type=m,x=o.tag=fw(m),i=Fn(m,i),x){case 0:o=Fu(null,o,m,i,h);break e;case 1:o=Bm(null,o,m,i,h);break e;case 11:o=Am(null,o,m,i,h);break e;case 14:o=Om(null,o,m,Fn(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:Fn(m,x),Fu(i,o,m,x,h);case 1:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Fn(m,x),Bm(i,o,m,x,h);case 3:e:{if(Vm(o),i===null)throw Error(t(387));m=o.pendingProps,b=o.memoizedState,x=b.element,Jp(i,o),Fo(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=hi(Error(t(423)),o),o=$m(i,o,m,h,x);break e}else if(m!==x){x=hi(Error(t(424)),o),o=$m(i,o,m,h,x);break e}else for(yn=Fs(o.stateNode.containerInfo.firstChild),xn=o,ft=!0,$n=null,h=am(o,null,m,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ai(),m===x){o=Ns(i,o,h);break e}Gt(i,o,m,h)}o=o.child}return o;case 5:return om(o),i===null&&xu(o),m=o.type,x=o.pendingProps,b=i!==null?i.memoizedProps:null,N=x.children,cu(m,x)?N=null:b!==null&&cu(m,b)&&(o.flags|=32),zm(i,o),Gt(i,o,N,h),o.child;case 6:return i===null&&xu(o),null;case 13:return Fm(i,o,h);case 4:return Eu(o,o.stateNode.containerInfo),m=o.pendingProps,i===null?o.child=ci(o,null,m,h):Gt(i,o,m,h),o.child;case 11:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Fn(m,x),Am(i,o,m,x,h);case 7:return Gt(i,o,o.pendingProps,h),o.child;case 8:return Gt(i,o,o.pendingProps.children,h),o.child;case 12:return Gt(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,lt(Bo,m._currentValue),m._currentValue=N,b!==null)if(Vn(b.value,N)){if(b.children===x.children&&!sn.current){o=Ns(i,o,h);break e}}else for(b=o.child,b!==null&&(b.return=o);b!==null;){var L=b.dependencies;if(L!==null){N=b.child;for(var V=L.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),_u(b.return,h,o),L.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,L=N.alternate,L!==null&&(L.lanes|=h),_u(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}Gt(i,o,x.children,h),o=o.child}return o;case 9:return x=o.type,m=o.pendingProps.children,li(o,h),x=Dn(x),m=m(x),o.flags|=1,Gt(i,o,m,h),o.child;case 14:return m=o.type,x=Fn(m,o.pendingProps),x=Fn(m.type,x),Om(i,o,m,x,h);case 15:return Rm(i,o,o.type,o.pendingProps,h);case 17:return m=o.type,x=o.pendingProps,x=o.elementType===m?x:Fn(m,x),qo(i,o),o.tag=1,rn(m)?(i=!0,Ao(o)):i=!1,li(o,h),nm(o,m,x),Su(o,m,x,h),Hu(null,o,m,!0,i,h);case 19:return Um(i,o,h);case 22:return Pm(i,o,h)}throw Error(t(156,o.tag))};function p0(i,o){return Yf(i,o)}function dw(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 Ln(i,o,h,m){return new dw(i,o,h,m)}function ch(i){return i=i.prototype,!(!i||!i.isReactComponent)}function fw(i){if(typeof i=="function")return ch(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=Ln(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 cl(i,o,h,m,x,b){var N=2;if(m=i,typeof i=="function")ch(i)&&(N=1);else if(typeof i=="string")N=5;else e:switch(i){case M:return Dr(h.children,x,b,o);case A:N=8,x|=8;break;case H:return i=Ln(12,h,o,x|2),i.elementType=H,i.lanes=b,i;case Ee:return i=Ln(13,h,o,x),i.elementType=Ee,i.lanes=b,i;case we:return i=Ln(19,h,o,x),i.elementType=we,i.lanes=b,i;case q:return ul(h,x,b,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case J:N=10;break e;case ae: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=Ln(N,h,o,x),o.elementType=i,o.type=m,o.lanes=b,o}function Dr(i,o,h,m){return i=Ln(7,i,m,o),i.lanes=h,i}function ul(i,o,h,m){return i=Ln(22,i,m,o),i.elementType=q,i.lanes=h,i.stateNode={isHidden:!1},i}function uh(i,o,h){return i=Ln(6,i,null,o),i.lanes=h,i}function hh(i,o,h){return o=Ln(4,i.children!==null?i.children:[],i.key,o),o.lanes=h,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function pw(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=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=m,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function dh(i,o,h,m,x,b,N,L,V){return i=new pw(i,o,h,L,V),o===1?(o=1,b===!0&&(o|=8)):o=0,b=Ln(3,null,null,o),i.current=b,b.stateNode=i,b.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nu(b),i}function mw(i,o,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Z,key:m==null?null:""+m,children:i,containerInfo:o,implementation:h}}function m0(i){if(!i)return Us;i=i._reactInternals;e:{if(xr(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(rn(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(rn(h))return Fp(i,h,o)}return o}function g0(i,o,h,m,x,b,N,L,V){return i=dh(h,m,!0,i,x,b,N,L,V),i.context=m0(null),h=i.current,m=Jt(),x=Js(h),b=Cs(m,x),b.callback=o??null,Qs(h,b,x),i.current.lanes=x,Fi(i,x,m),ln(i,m),i}function hl(i,o,h,m){var x=o.current,b=Jt(),N=Js(x);return h=m0(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=Qs(x,o,N),i!==null&&(Wn(i,x,N,b),$o(i,x,N)),N}function dl(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 v0(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<o?h:o}}function fh(i,o){v0(i,o),(i=i.alternate)&&v0(i,o)}function gw(){return null}var x0=typeof reportError=="function"?reportError:function(i){console.error(i)};function ph(i){this._internalRoot=i}fl.prototype.render=ph.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(t(409));hl(i,o,null,null)},fl.prototype.unmount=ph.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Sr(function(){hl(null,i,null,null)}),o[ys]=null}};function fl(i){this._internalRoot=i}fl.prototype.unstable_scheduleHydration=function(i){if(i){var o=ep();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&&sp(i)}};function mh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function pl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function y0(){}function vw(i,o,h,m,x){if(x){if(typeof m=="function"){var b=m;m=function(){var re=dl(N);b.call(re)}}var N=g0(o,m,i,0,null,!1,!1,"",y0);return i._reactRootContainer=N,i[ys]=N.current,na(i.nodeType===8?i.parentNode:i),Sr(),N}for(;x=i.lastChild;)i.removeChild(x);if(typeof m=="function"){var L=m;m=function(){var re=dl(V);L.call(re)}}var V=dh(i,0,!1,null,null,!1,!1,"",y0);return i._reactRootContainer=V,i[ys]=V.current,na(i.nodeType===8?i.parentNode:i),Sr(function(){hl(o,V,h,m)}),V}function ml(i,o,h,m,x){var b=h._reactRootContainer;if(b){var N=b;if(typeof x=="function"){var L=x;x=function(){var V=dl(N);L.call(V)}}hl(o,N,i,x)}else N=vw(h,o,i,x,m);return dl(N)}qf=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var h=$i(o.pendingLanes);h!==0&&(Bc(o,h|1),ln(o,jt()),(Ke&6)===0&&(pi=jt()+500,Ws()))}break;case 13:Sr(function(){var m=_s(i,1);if(m!==null){var x=Jt();Wn(m,i,1,x)}}),fh(i,1)}},Vc=function(i){if(i.tag===13){var o=_s(i,134217728);if(o!==null){var h=Jt();Wn(o,i,134217728,h)}fh(i,134217728)}},Xf=function(i){if(i.tag===13){var o=Js(i),h=_s(i,o);if(h!==null){var m=Jt();Wn(h,i,o,m)}fh(i,o)}},ep=function(){return tt},tp=function(i,o){var h=tt;try{return tt=i,o()}finally{tt=h}},Ic=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=Io(m);if(!x)throw Error(t(90));z(m),Q(m,x)}}}break;case"textarea":Ct(i,h);break;case"select":o=h.value,o!=null&&_e(i,!!h.multiple,o,!1)}},Bf=ah,Vf=Sr;var xw={usingClientEntryPoint:!1,Events:[ia,ti,Io,Pf,zf,ah]},ya={findFiberByHostInstance:yr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},yw={bundleType:ya.bundleType,version:ya.version,rendererPackageName:ya.rendererPackageName,rendererConfig:ya.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Uf(i),i===null?null:i.stateNode},findFiberByHostInstance:ya.findFiberByHostInstance||gw,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 gl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gl.isDisabled&&gl.supportsFiber)try{fo=gl.inject(yw),es=gl}catch{}}return cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xw,cn.createPortal=function(i,o){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mh(o))throw Error(t(200));return mw(i,o,null,h)},cn.createRoot=function(i,o){if(!mh(i))throw Error(t(299));var h=!1,m="",x=x0;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onRecoverableError!==void 0&&(x=o.onRecoverableError)),o=dh(i,1,!1,null,null,h,!1,m,x),i[ys]=o.current,na(i.nodeType===8?i.parentNode:i),new ph(o)},cn.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=Uf(o),i=i===null?null:i.stateNode,i},cn.flushSync=function(i){return Sr(i)},cn.hydrate=function(i,o,h){if(!pl(o))throw Error(t(200));return ml(null,i,o,!0,h)},cn.hydrateRoot=function(i,o,h){if(!mh(i))throw Error(t(405));var m=h!=null&&h.hydratedSources||null,x=!1,b="",N=x0;if(h!=null&&(h.unstable_strictMode===!0&&(x=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onRecoverableError!==void 0&&(N=h.onRecoverableError)),o=g0(o,null,i,1,h??null,x,!1,b,N),i[ys]=o.current,na(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 fl(o)},cn.render=function(i,o,h){if(!pl(o))throw Error(t(200));return ml(null,i,o,!1,h)},cn.unmountComponentAtNode=function(i){if(!pl(i))throw Error(t(40));return i._reactRootContainer?(Sr(function(){ml(null,null,i,!1,function(){i._reactRootContainer=null,i[ys]=null})}),!0):!1},cn.unstable_batchedUpdates=ah,cn.unstable_renderSubtreeIntoContainer=function(i,o,h,m){if(!pl(h))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return ml(i,o,h,!1,m)},cn.version="18.2.0-next-9e3b772b8-20220608",cn}var M0;function Tw(){if(M0)return xh.exports;M0=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(),xh.exports=Dw(),xh.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 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)}var ar;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(ar||(ar={}));const D0="popstate";function Iw(n){n===void 0&&(n={});function e(r,a){let{pathname:l="/",search:u="",hash:d=""}=Fr(r.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),pd("",{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:Kl(a))}function s(r,a){Wd(r.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return Aw(e,t,s,n)}function Mt(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function Wd(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Lw(){return Math.random().toString(36).substr(2,8)}function T0(n,e){return{usr:n.state,key:n.key,idx:e}}function pd(n,e,t,s){return t===void 0&&(t=null),Ba({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Fr(e):e,{state:t,key:e&&e.key||s||Lw()})}function Kl(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 Fr(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 Aw(n,e,t,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,l=r.history,u=ar.Pop,d=null,f=p();f==null&&(f=0,l.replaceState(Ba({},l.state,{idx:f}),""));function p(){return(l.state||{idx:null}).idx}function g(){u=ar.Pop;let C=p(),E=C==null?null:C-f;f=C,d&&d({action:u,location:_.location,delta:E})}function y(C,E){u=ar.Push;let S=pd(_.location,C,E);t&&t(S,C),f=p()+1;let I=T0(S,f),O=_.createHref(S);try{l.pushState(I,"",O)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;r.location.assign(O)}a&&d&&d({action:u,location:_.location,delta:1})}function w(C,E){u=ar.Replace;let S=pd(_.location,C,E);t&&t(S,C),f=p();let I=T0(S,f),O=_.createHref(S);l.replaceState(I,"",O),a&&d&&d({action:u,location:_.location,delta:0})}function k(C){let E=r.location.origin!=="null"?r.location.origin:r.location.href,S=typeof C=="string"?C:Kl(C);return S=S.replace(/ $/,"%20"),Mt(E,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,E)}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(D0,g),d=C,()=>{r.removeEventListener(D0,g),d=null}},createHref(C){return e(r,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:w,go(C){return l.go(C)}};return _}var I0;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(I0||(I0={}));function Ow(n,e,t){return t===void 0&&(t="/"),Rw(n,e,t)}function Rw(n,e,t,s){let r=typeof e=="string"?Fr(e):e,a=Yd(r.pathname||"/",t);if(a==null)return null;let l=H1(n);Pw(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=Zw(a);u=Yw(l[d],f)}return u}function H1(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("/")&&(Mt(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=cr([s,d.relativePath]),p=t.concat(d);a.children&&a.children.length>0&&(Mt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),H1(a.children,e,p,f)),!(a.path==null&&!a.index)&&e.push({path:f,score:Uw(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 U1(a.path))r(a,l,d)}),e}function U1(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=U1(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 Pw(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Ww(e.routesMeta.map(s=>s.childrenIndex),t.routesMeta.map(s=>s.childrenIndex)))}const zw=/^:[\w-]+$/,Bw=3,Vw=2,$w=1,Fw=10,Hw=-2,L0=n=>n==="*";function Uw(n,e){let t=n.split("/"),s=t.length;return t.some(L0)&&(s+=Hw),e&&(s+=Vw),t.filter(r=>!L0(r)).reduce((r,a)=>r+(zw.test(a)?Bw:a===""?$w:Fw),s)}function Ww(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 Yw(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=Qw({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:cr([a,g.pathname]),pathnameBase:Xw(cr([a,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(a=cr([a,g.pathnameBase]))}return l}function Qw(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,s]=Kw(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 Kw(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Wd(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 Zw(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Wd(!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 Yd(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 Gw(n,e){e===void 0&&(e="/");let{pathname:t,search:s="",hash:r=""}=typeof n=="string"?Fr(n):n;return{pathname:t?t.startsWith("/")?t:Jw(t,e):e,search:eb(s),hash:tb(r)}}function Jw(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 bh(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 qw(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qd(n,e){let t=qw(n);return e?t.map((s,r)=>r===t.length-1?s.pathname:s.pathnameBase):t.map(s=>s.pathnameBase)}function Kd(n,e,t,s){s===void 0&&(s=!1);let r;typeof n=="string"?r=Fr(n):(r=Ba({},n),Mt(!r.pathname||!r.pathname.includes("?"),bh("?","pathname","search",r)),Mt(!r.pathname||!r.pathname.includes("#"),bh("#","pathname","hash",r)),Mt(!r.search||!r.search.includes("#"),bh("#","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=Gw(r,u),f=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&t.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}const cr=n=>n.join("/").replace(/\/\/+/g,"/"),Xw=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),eb=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,tb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function nb(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const W1=["post","put","patch","delete"];new Set(W1);const sb=["get",...W1];new Set(sb);/**
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 Va(){return Va=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},Va.apply(this,arguments)}const Zd=v.createContext(null),rb=v.createContext(null),fr=v.createContext(null),pc=v.createContext(null),hs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Y1=v.createContext(null);function ib(n,e){let{relative:t}=e===void 0?{}:e;Li()||Mt(!1);let{basename:s,navigator:r}=v.useContext(fr),{hash:a,pathname:l,search:u}=K1(n,{relative:t}),d=l;return s!=="/"&&(d=l==="/"?s:cr([s,l])),r.createHref({pathname:d,search:u,hash:a})}function Li(){return v.useContext(pc)!=null}function Hr(){return Li()||Mt(!1),v.useContext(pc).location}function Q1(n){v.useContext(fr).static||v.useLayoutEffect(n)}function Is(){let{isDataRoute:n}=v.useContext(hs);return n?wb():ab()}function ab(){Li()||Mt(!1);let n=v.useContext(Zd),{basename:e,future:t,navigator:s}=v.useContext(fr),{matches:r}=v.useContext(hs),{pathname:a}=Hr(),l=JSON.stringify(Qd(r,t.v7_relativeSplatPath)),u=v.useRef(!1);return Q1(()=>{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=Kd(f,JSON.parse(l),a,p.relative==="path");n==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:cr([e,g.pathname])),(p.replace?s.replace:s.push)(g,p.state,p)},[e,s,l,a,n])}const ob=v.createContext(null);function lb(n){let e=v.useContext(hs).outlet;return e&&v.createElement(ob.Provider,{value:n},e)}function fn(){let{matches:n}=v.useContext(hs),e=n[n.length-1];return e?e.params:{}}function K1(n,e){let{relative:t}=e===void 0?{}:e,{future:s}=v.useContext(fr),{matches:r}=v.useContext(hs),{pathname:a}=Hr(),l=JSON.stringify(Qd(r,s.v7_relativeSplatPath));return v.useMemo(()=>Kd(n,JSON.parse(l),a,t==="path"),[n,l,a,t])}function cb(n,e){return ub(n,e)}function ub(n,e,t,s){Li()||Mt(!1);let{navigator:r}=v.useContext(fr),{matches:a}=v.useContext(hs),l=a[a.length-1],u=l?l.params:{},d=l?l.pathnameBase:"/",f=Hr(),p;if(e){var g;let C=typeof e=="string"?Fr(e):e;d==="/"||(g=C.pathname)!=null&&g.startsWith(d)||Mt(!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=Ow(n,{pathname:w}),_=mb(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:cr([d,r.encodeLocation?r.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:cr([d,r.encodeLocation?r.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,t,s);return e&&_?v.createElement(pc.Provider,{value:{location:Va({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:ar.Pop}},_):_}function hb(){let n=yb(),e=nb(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 db=v.createElement(hb,null);class fb 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(hs.Provider,{value:this.props.routeContext},v.createElement(Y1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function pb(n){let{routeContext:e,match:t,children:s}=n,r=v.useContext(Zd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(hs.Provider,{value:e},s)}function mb(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||Mt(!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||db,d&&(f<0&&y===0?(k=!0,C=null):f===y&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=e.concat(l.slice(0,y+1)),S=()=>{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(pb,{match:g,routeContext:{outlet:p,matches:E,isDataRoute:t!=null},children:I})};return t&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?v.createElement(fb,{location:t.location,revalidation:t.revalidation,component:_,error:w,children:S(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):S()},null)}function gb(n){let e=v.useContext(Zd);return e||Mt(!1),e}function vb(n){let e=v.useContext(rb);return e||Mt(!1),e}function xb(n){let e=v.useContext(hs);return e||Mt(!1),e}function Z1(n){let e=xb(),t=e.matches[e.matches.length-1];return t.route.id||Mt(!1),t.route.id}function yb(){var n;let e=v.useContext(Y1),t=vb(),s=Z1();return e!==void 0?e:(n=t.errors)==null?void 0:n[s]}function wb(){let{router:n}=gb(),e=Z1(),t=v.useRef(!1);return Q1(()=>{t.current=!0}),v.useCallback(function(r,a){a===void 0&&(a={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,Va({fromRouteId:e},a)))},[n,e])}function bb(n){let{to:e,replace:t,state:s,relative:r}=n;Li()||Mt(!1);let{future:a}=v.useContext(fr),{matches:l}=v.useContext(hs),{pathname:u}=Hr(),d=Is(),f=Kd(e,Qd(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 kb(n){return lb(n.context)}function be(n){Mt(!1)}function _b(n){let{basename:e="/",children:t=null,location:s,navigationType:r=ar.Pop,navigator:a,static:l=!1,future:u}=n;Li()&&Mt(!1);let d=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:a,static:l,future:Va({v7_relativeSplatPath:!1},u)}),[d,u,a,l]);typeof s=="string"&&(s=Fr(s));let{pathname:p="/",search:g="",hash:y="",state:w=null,key:k="default"}=s,_=v.useMemo(()=>{let C=Yd(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(fr.Provider,{value:f},v.createElement(pc.Provider,{children:t,value:_}))}function Cb(n){let{children:e,location:t}=n;return cb(md(e),t)}new Promise(()=>{});function md(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,md(s.props.children,a));return}s.type!==be&&Mt(!1),!s.props.index||!s.props.children||Mt(!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=md(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 gd(){return gd=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},gd.apply(this,arguments)}function Nb(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 jb(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Sb(n,e){return n.button===0&&(!e||e==="_self")&&!jb(n)}const Eb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Mb="6";try{window.__reactRouterVersion=Mb}catch{}const Db="startTransition",A0=Sw[Db];function Tb(n){let{basename:e,children:t,future:s,window:r}=n,a=v.useRef();a.current==null&&(a.current=Iw({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&&A0?A0(()=>d(g)):d(g)},[d,f]);return v.useLayoutEffect(()=>l.listen(p),[l,p]),v.createElement(_b,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:l,future:s})}const Ib=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ut=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=Nb(e,Eb),{basename:w}=v.useContext(fr),k,_=!1;if(typeof f=="string"&&Lb.test(f)&&(k=f,Ib))try{let I=new URL(window.location.href),O=f.startsWith("//")?new URL(I.protocol+f):new URL(f),R=Yd(O.pathname,w);O.origin===I.origin&&R!=null?f=R+O.search+O.hash:_=!0}catch{}let C=ib(f,{relative:r}),E=Ab(f,{replace:l,state:u,target:d,preventScrollReset:p,relative:r,unstable_viewTransition:g});function S(I){s&&s(I),I.defaultPrevented||E(I)}return v.createElement("a",gd({},y,{href:k||C,onClick:_||a?s:S,ref:t,target:d}))});var O0;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(O0||(O0={}));var R0;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(R0||(R0={}));function Ab(n,e){let{target:t,replace:s,state:r,preventScrollReset:a,relative:l,unstable_viewTransition:u}=e===void 0?{}:e,d=Is(),f=Hr(),p=K1(n,{relative:l});return v.useCallback(g=>{if(Sb(g,t)){g.preventDefault();let y=s!==void 0?s:Kl(f)===Kl(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 G1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},P0=X.createContext&&X.createContext(G1),ur=function(){return ur=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},ur.apply(this,arguments)},Ob=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 J1(n){return n&&n.map(function(e,t){return X.createElement(e.tag,ur({key:t},e.attr),J1(e.child))})}function ye(n){return function(e){return X.createElement(Rb,ur({attr:ur({},n.attr)},e),J1(n.child))}}function Rb(n){var e=function(t){var s=n.attr,r=n.size,a=n.title,l=Ob(n,["attr","size","title"]),u=r||t.size||"1em",d;return t.className&&(d=t.className),n.className&&(d=(d?d+" ":"")+n.className),X.createElement("svg",ur({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,l,{className:d,style:ur(ur({color:n.color||t.color},t.style),n.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&X.createElement("title",null,a),n.children)};return P0!==void 0?X.createElement(P0.Consumer,null,function(t){return e(t)}):e(G1)}function Pb(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 zb(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 Bb(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 q1(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 Vb(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 X1(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 Gd(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 $b(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 Fb(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 ev(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 Hb(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 Ub(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 Wb(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 Yb(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 Jd(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 Qb(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 tv(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 Kb(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 Zb(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 nv(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 qd(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 sv(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 Gb(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 Jb(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 rv(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 qb(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 Xb(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 iv(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 e4(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 t4(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 av(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 n4(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 s4(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 vd(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 r4(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 i4(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 a4(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 o4(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 l4(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 c4(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 ov(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 u4(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 Zl(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 lv(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 cv(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 Qn(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 uv(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 hv(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 ke=({show:n,children:e})=>n?e:null,h4=({index:n=0,children:e,...t})=>{if(n>=X.Children.count(e))return null;const s=v.useMemo(()=>X.Children.toArray(e),[e]);return c.jsx("div",{...t,children:s[n]})},Xd=({toggle:n=!0,children:e,...t})=>c.jsx(h4,{index:n?0:1,children:e,...t});function d4(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 f4(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 $a(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 p4(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 m4(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 z0(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 dv(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 g4(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 fv="pubsub.on_change",pv="pubsub.on_refresh";class v4{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 os=new v4,x4={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`]},mc=(n,e,t=void 0)=>e.hasOwnProperty(n)?e[n]:t,y4=n=>mc("editable",n,!0),w4=n=>mc("validate",n,!0),b4=(n,e)=>{const s=w4(n)?mc("validator",n,x4[n.type]):void 0;return s?s(e):[!0,void 0]},mv=(n,e)=>{let t=n??"";return e&&(n&&(t+="."),t+=e),t},k4=v.forwardRef(({field:n,value:e,context:t,running_key:s,isViewMode:r,...a},l)=>{s=mv(s,n.key);const[u,d]=v.useState(void 0),[f,p]=v.useState(e??n.defaultValue),g=v.useCallback(()=>y4(n)&&!r,[n,r]),y=v.useCallback(k=>{g()&&(p(k),os.dispatch(fv),os.dispatch(s,k))},[g,os,s]);v.useEffect(()=>{os.dispatch(s,f)},[os,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=mc("autoGenerate",n,()=>f)(n),[E,S]=b4(n,C);return k&&d(E?void 0:S),n.key?{data:{[n.key]:C},validation:{fine:{[n.key]:[E,S,n.name]},has_errors:!E}}:{data:void 0}}}),[n,f,g]);const w=v.useMemo(()=>({...t,running_key:s,pubsub:os}),[t,s,os]);return v.useEffect(()=>()=>{},[]),c.jsx(n.comp,{field:n,value:f,error:u,setError:d,onChange:y,context:w,disabled:!g(),...n.comp_params})}),_4=({...n})=>c.jsx("div",{...n}),gv=v.forwardRef(({field:n,value:e,className:t,context:s,running_key:r,isViewMode:a=!1,...l},u)=>{r=mv(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,O)=>({...I,...O==null?void 0:O.data}),{}),E=_.reduce((I,O)=>({...I,...O==null?void 0:O.validation.fine}),{}),S=_.reduce((I,O)=>I||O.validation.has_errors,!1);return{data:n.key?{[n.key]:C}:C,validation:{fine:n.key?{[n.key]:E}:E,has_errors:S}}}}),[n]);let f=n.fields.map((k,_)=>{let C=k.key?e==null?void 0:e[k.key]:e;const E=k.fields?gv:k4;return c.jsx(E,{ref:S=>d.current[_]=S,running_key:r,field:k,value:C,isViewMode:a,context:s},`${r}_${_}`)});const p=n.comp??_4,{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})}),Rn=v.forwardRef(({field:n,value:e,className:t,context:s,isViewMode:r=!1,...a},l)=>{v.useEffect(()=>{os.dispatch(pv)},[e]);const u=v.useMemo(()=>({...s??{},query:{all:{get:(d=!1)=>l.current.get(d)}},data:e}),[s,e]);return c.jsx(gv,{ref:l,field:n,value:e,className:t,context:u,running_key:void 0,isViewMode:r,...a})});function ef(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ur=ef();function vv(n){Ur=n}const Da={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(Xt.caret,"$1"),t=t.replace(r,l),s},getRegex:()=>new RegExp(t,e)};return s}const Xt={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")},C4=/^(?:[ \t]*(?:\n|$))+/,N4=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,j4=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,S4=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tf=/(?:[*+-]|\d{1,9}[.)])/,xv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yv=et(xv).replace(/bull/g,tf).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(),E4=et(xv).replace(/bull/g,tf).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(),nf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,M4=/^[^\n]+/,sf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,D4=et(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),T4=et(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tf).getRegex(),gc="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",rf=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,I4=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",rf).replace("tag",gc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wv=et(nf).replace("hr",qa).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",gc).getRegex(),L4=et(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wv).getRegex(),af={blockquote:L4,code:N4,def:D4,fences:j4,heading:S4,hr:qa,html:I4,lheading:yv,list:T4,newline:C4,paragraph:wv,table:Da,text:M4},B0=et("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qa).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",gc).getRegex(),A4={...af,lheading:E4,table:B0,paragraph:et(nf).replace("hr",qa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",B0).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",gc).getRegex()},O4={...af,html:et(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rf).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:Da,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:et(nf).replace("hr",qa).replace("heading",` *#{1,6} *[^
69
+ ]`).replace("lheading",yv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},R4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,P4=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bv=/^( {2,}|\\)\n(?!\s*$)/,z4=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vc=/[\p{P}\p{S}]/u,of=/[\s\p{P}\p{S}]/u,kv=/[^\s\p{P}\p{S}]/u,B4=et(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,of).getRegex(),_v=/(?!~)[\p{P}\p{S}]/u,V4=/(?!~)[\s\p{P}\p{S}]/u,$4=/(?:[^\s\p{P}\p{S}]|~)/u,F4=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Cv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,H4=et(Cv,"u").replace(/punct/g,vc).getRegex(),U4=et(Cv,"u").replace(/punct/g,_v).getRegex(),Nv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",W4=et(Nv,"gu").replace(/notPunctSpace/g,kv).replace(/punctSpace/g,of).replace(/punct/g,vc).getRegex(),Y4=et(Nv,"gu").replace(/notPunctSpace/g,$4).replace(/punctSpace/g,V4).replace(/punct/g,_v).getRegex(),Q4=et("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kv).replace(/punctSpace/g,of).replace(/punct/g,vc).getRegex(),K4=et(/\\(punct)/,"gu").replace(/punct/g,vc).getRegex(),Z4=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(),G4=et(rf).replace("(?:-->|$)","-->").getRegex(),J4=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",G4).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q4=et(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Gl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jv=et(/^!?\[(label)\]\[(ref)\]/).replace("label",Gl).replace("ref",sf).getRegex(),Sv=et(/^!?\[(ref)\](?:\[\])?/).replace("ref",sf).getRegex(),X4=et("reflink|nolink(?!\\()","g").replace("reflink",jv).replace("nolink",Sv).getRegex(),lf={_backpedal:Da,anyPunctuation:K4,autolink:Z4,blockSkip:F4,br:bv,code:P4,del:Da,emStrongLDelim:H4,emStrongRDelimAst:W4,emStrongRDelimUnd:Q4,escape:R4,link:q4,nolink:Sv,punctuation:B4,reflink:jv,reflinkSearch:X4,tag:J4,text:z4,url:Da},e5={...lf,link:et(/^!?\[(label)\]\((.*?)\)/).replace("label",Gl).getRegex(),reflink:et(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gl).getRegex()},xd={...lf,emStrongRDelimAst:Y4,emStrongLDelim:U4,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.!#$%&'*+\/=?_`{\|}~-]+@)))/},t5={...xd,br:et(bv).replace("{2,}","*").getRegex(),text:et(xd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vl={normal:af,gfm:A4,pedantic:O4},ba={normal:lf,gfm:xd,breaks:t5,pedantic:e5},n5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},V0=n=>n5[n];function as(n,e){if(e){if(Xt.escapeTest.test(n))return n.replace(Xt.escapeReplace,V0)}else if(Xt.escapeTestNoEncode.test(n))return n.replace(Xt.escapeReplaceNoEncode,V0);return n}function $0(n){try{n=encodeURI(n).replace(Xt.percentDecode,"%")}catch{return null}return n}function F0(n,e){var a;const t=n.replace(Xt.findPipe,(l,u,d)=>{let f=!1,p=u;for(;--p>=0&&d[p]==="\\";)f=!f;return f?"|":" |"}),s=t.split(Xt.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(Xt.slashPipe,"|");return s}function ka(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 s5(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 H0(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 r5(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 Jl{constructor(e){xe(this,"options");xe(this,"rules");xe(this,"lexer");this.options=e||Ur}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:ka(s,`
72
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],r=r5(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=ka(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:ka(t[0],`
73
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=ka(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,S=>" ".repeat(3*S.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 S=this.rules.other.nextBulletRegex(_),I=this.rules.other.hrRegex(_),O=this.rules.other.fencesBeginRegex(_),R=this.rules.other.headingBeginRegex(_),Z=this.rules.other.htmlBeginRegex(_);for(;e;){const M=e.split(`
88
+ `,1)[0];let A;if(w=M,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),A=w):A=w.replace(this.rules.other.tabCharGlobal," "),O.test(w)||R.test(w)||Z.test(w)||S.test(w)||I.test(w))break;if(A.search(this.rules.other.nonSpaceChar)>=_||!w.trim())g+=`
89
+ `+A.slice(_);else{if(k||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||O.test(y)||R.test(y)||I.test(y))break;g+=`
90
+ `+w}!k&&!w.trim()&&(k=!0),p+=M+`
91
+ `,e=e.substring(M.length+1),y=A.slice(_)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(u=!0));let C=null,E;this.options.gfm&&(C=this.rules.other.listIsTask.exec(g),C&&(E=C[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:p,task:!!C,checked:E,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=F0(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(F0(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=ka(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{const l=s5(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)),H0(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 H0(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){xe(this,"tokens");xe(this,"options");xe(this,"state");xe(this,"tokenizer");xe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ur,this.options.tokenizer=this.options.tokenizer||new Jl,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:Xt,block:vl.normal,inline:ba.normal};this.options.pedantic?(t.block=vl.pedantic,t.inline=ba.pedantic):this.options.gfm&&(t.block=vl.gfm,this.options.breaks?t.inline=ba.breaks:t.inline=ba.gfm),this.tokenizer.rules=t}static get rules(){return{block:vl,inline:ba}}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(Xt.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(Xt.tabCharGlobal," ").replace(Xt.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 ql{constructor(e){xe(this,"options");xe(this,"parser");this.options=e||Ur}space(e){return""}code({text:e,lang:t,escaped:s}){var l;const r=(l=(t||"").match(Xt.notSpaceStart))==null?void 0:l[0],a=e.replace(Xt.endingNewline,"")+`
104
+ `;return r?'<pre><code class="language-'+as(r)+'">'+(s?a:as(a,!0))+`</code></pre>
105
+ `:"<pre><code>"+(s?a:as(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+" "+as(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>${as(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=$0(e);if(a===null)return r;e=a;let l='<a href="'+e+'"';return t&&(l+=' title="'+as(t)+'"'),l+=">"+r+"</a>",l}image({href:e,title:t,text:s}){const r=$0(e);if(r===null)return as(s);e=r;let a=`<img src="${e}" alt="${s}"`;return t&&(a+=` title="${as(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:as(e.text)}}class cf{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 Zn{constructor(e){xe(this,"options");xe(this,"renderer");xe(this,"textRenderer");this.options=e||Ur,this.options.renderer=this.options.renderer||new ql,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cf}static parse(e,t){return new Zn(t).parse(e)}static parseInline(e,t){return new Zn(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 Ta{constructor(e){xe(this,"options");xe(this,"block");this.options=e||Ur}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Kn.lex:Kn.lexInline}provideParser(){return this.block?Zn.parse:Zn.parseInline}}xe(Ta,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class i5{constructor(...e){xe(this,"defaults",ef());xe(this,"options",this.setOptions);xe(this,"parse",this.parseMarkdown(!0));xe(this,"parseInline",this.parseMarkdown(!1));xe(this,"Parser",Zn);xe(this,"Renderer",ql);xe(this,"TextRenderer",cf);xe(this,"Lexer",Kn);xe(this,"Tokenizer",Jl);xe(this,"Hooks",Ta);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 ql(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 Jl(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 Ta;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];Ta.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 Zn.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?Zn.parse:Zn.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>"+as(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}}const Pr=new i5;function ht(n,e){return Pr.parse(n,e)}ht.options=ht.setOptions=function(n){return Pr.setOptions(n),ht.defaults=Pr.defaults,vv(ht.defaults),ht};ht.getDefaults=ef;ht.defaults=Ur;ht.use=function(...n){return Pr.use(...n),ht.defaults=Pr.defaults,vv(ht.defaults),ht};ht.walkTokens=function(n,e){return Pr.walkTokens(n,e)};ht.parseInline=Pr.parseInline;ht.Parser=Zn;ht.parser=Zn.parse;ht.Renderer=ql;ht.TextRenderer=cf;ht.Lexer=Kn;ht.lexer=Kn.lex;ht.Tokenizer=Jl;ht.Hooks=Ta;ht.parse=ht;const Lt=({value:n,...e})=>c.jsx("div",{...e,children:c.jsx("p",{className:"--mdx md-view overflow-auto",dangerouslySetInnerHTML:{__html:ht.parse(n??"",{})}})}),a5="💡 changes made, don't forget to save",ds=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(()=>os.add_sub(d=>{switch(d){case fv:l(!0);return;case pv:return;default:return}}),[os]),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:a5,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`})]})})}),mt=({dashed:n=!1,...e})=>{const s="shelf-border-color"+(n?" border-dashed":"");return c.jsx("div",{...e,children:c.jsx("hr",{className:s})})},_a=({className:n,...e})=>c.jsx("p",{...e,className:`${n} text-4xl shelf-text-title-color `}),_i=({...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})}),o5=`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`,Ev=v.forwardRef(({className:n="h-10 px-3",overrideClass:e=!1,...t},s)=>{const r=e?n:`${o5} ${n}`;return c.jsx("input",{...t,ref:s,onWheel:a=>a.target.blur(),className:r})}),Ge=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(qe,{from:n,to:e,rounded:t,stroke:s,className:r,children:c.jsx(Ev,{ref:u,className:a,...l})})),qe=({className:n,rounded:e="rounded-md",children:t,stroke:s="border",from:r="from-pink-500/60 dark:from-pink-600/50",to:a="to-kf-500/60 dark:to-kf-500/50",...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(qe,{...e,children:c.jsx(n,{...t})}),Ye=({setError:n,...e})=>c.jsx("div",{...e}),pr=({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-xs 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(mt,{className:"mt-3 --mb-5"})]}),c.jsxs(ke,{show:a,children:[c.jsx(Lt,{value:a,className:`text-sm shelf-text-minor-light mt-3
141
+ tracking-wider --whitespace-pre-line`}),c.jsx(mt,{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(iv,{className:"flex-inline text-2xl flex-shrink-0 opacity-70"}),c.jsx(Lt,{value:t,className:"mx-3 overflow-auto"}),c.jsx(p4,{className:`flex-inline absolute top-1 right-1
144
+ cursor-pointer text-2xl flex-shrink-0 opacity-90`,onClick:()=>e&&e(void 0)})]})]})}),U0=({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]}),l5=({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})]}),c5=`h-fit px-2 py-1 rounded-lg border
148
+ w-fit flex flex-row items-center
149
+ transition-colors duration-300`,Xa=({Icon:n=null,show:e=!0,text:t="",keep_text_on_load:s=!1,className:r=c5,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(tv,{className:f}):n}),t&&c.jsx("span",{children:t,className:"whitespace-nowrap "})]})},us=({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(Xa,{...t,loading:s,onClick:a})},Ms=({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(qe,{stroke:r,className:t,rounded:a,from:l,to:u,children:c.jsx(Xa,{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},Cn=({from:n="from-pink-500/60 dark:from-pink-600",to:e="to-kf-500/60 dark:to-kf-500",rounded:t="rounded-lg",stroke:s="border-2",children:r,text:a="what",className:l="h-10",btnClassName:u="",...d})=>c.jsx(qe,{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 cursor-pointer
153
+ whitespace-nowrap ${u}`,children:r??a,...d})}),u5=({from:n,to:e,rounded:t="rounded-lg",stroke:s,...r})=>c.jsx(qe,{from:n,to:e,rounded:t,stroke:s,className:"w-fit h-fit",children:c.jsx(l5,{...r})}),eo=({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})]})},Mv="3.7.7",h5=Mv,Ai=typeof Buffer=="function",W0=typeof TextDecoder=="function"?new TextDecoder:void 0,Y0=typeof TextEncoder=="function"?new TextEncoder:void 0,d5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sa=Array.prototype.slice.call(d5),xl=(n=>{let e={};return n.forEach((t,s)=>e[t]=s),e})(Sa),f5=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ht=String.fromCharCode.bind(String),Q0=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):n=>new Uint8Array(Array.prototype.slice.call(n,0)),Dv=n=>n.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),Tv=n=>n.replace(/[^A-Za-z0-9\+\/]/g,""),Iv=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+=Sa[e>>18&63]+Sa[e>>12&63]+Sa[e>>6&63]+Sa[e&63]}return l?a.slice(0,l-3)+"===".substring(l):a},uf=typeof btoa=="function"?n=>btoa(n):Ai?n=>Buffer.from(n,"binary").toString("base64"):Iv,yd=Ai?n=>Buffer.from(n).toString("base64"):n=>{let t=[];for(let s=0,r=n.length;s<r;s+=4096)t.push(Ht.apply(null,n.subarray(s,s+4096)));return uf(t.join(""))},Rl=(n,e=!1)=>e?Dv(yd(n)):yd(n),p5=n=>{if(n.length<2){var e=n.charCodeAt(0);return e<128?n:e<2048?Ht(192|e>>>6)+Ht(128|e&63):Ht(224|e>>>12&15)+Ht(128|e>>>6&63)+Ht(128|e&63)}else{var e=65536+(n.charCodeAt(0)-55296)*1024+(n.charCodeAt(1)-56320);return Ht(240|e>>>18&7)+Ht(128|e>>>12&63)+Ht(128|e>>>6&63)+Ht(128|e&63)}},m5=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Lv=n=>n.replace(m5,p5),K0=Ai?n=>Buffer.from(n,"utf8").toString("base64"):Y0?n=>yd(Y0.encode(n)):n=>uf(Lv(n)),Ci=(n,e=!1)=>e?Dv(K0(n)):K0(n),Z0=n=>Ci(n,!0),g5=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v5=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 Ht((t>>>10)+55296)+Ht((t&1023)+56320);case 3:return Ht((15&n.charCodeAt(0))<<12|(63&n.charCodeAt(1))<<6|63&n.charCodeAt(2));default:return Ht((31&n.charCodeAt(0))<<6|63&n.charCodeAt(1))}},Av=n=>n.replace(g5,v5),Ov=n=>{if(n=n.replace(/\s+/g,""),!f5.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=xl[n.charAt(a++)]<<18|xl[n.charAt(a++)]<<12|(s=xl[n.charAt(a++)])<<6|(r=xl[n.charAt(a++)]),t+=s===64?Ht(e>>16&255):r===64?Ht(e>>16&255,e>>8&255):Ht(e>>16&255,e>>8&255,e&255);return t},hf=typeof atob=="function"?n=>atob(Tv(n)):Ai?n=>Buffer.from(n,"base64").toString("binary"):Ov,Rv=Ai?n=>Q0(Buffer.from(n,"base64")):n=>Q0(hf(n).split("").map(e=>e.charCodeAt(0))),Pv=n=>Rv(zv(n)),x5=Ai?n=>Buffer.from(n,"base64").toString("utf8"):W0?n=>W0.decode(Rv(n)):n=>Av(hf(n)),zv=n=>Tv(n.replace(/[-_]/g,e=>e=="-"?"+":"/")),wd=n=>x5(zv(n)),y5=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)},Bv=n=>({value:n,enumerable:!1,writable:!0,configurable:!0}),Vv=function(){const n=(e,t)=>Object.defineProperty(String.prototype,e,Bv(t));n("fromBase64",function(){return wd(this)}),n("toBase64",function(e){return Ci(this,e)}),n("toBase64URI",function(){return Ci(this,!0)}),n("toBase64URL",function(){return Ci(this,!0)}),n("toUint8Array",function(){return Pv(this)})},$v=function(){const n=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Bv(t));n("toBase64",function(e){return Rl(this,e)}),n("toBase64URI",function(){return Rl(this,!0)}),n("toBase64URL",function(){return Rl(this,!0)})},w5=()=>{Vv(),$v()},b5={version:Mv,VERSION:h5,atob:hf,atobPolyfill:Ov,btoa:uf,btoaPolyfill:Iv,fromBase64:wd,toBase64:Ci,encode:Ci,encodeURI:Z0,encodeURL:Z0,utob:Lv,btou:Av,decode:wd,isValid:y5,fromUint8Array:Rl,toUint8Array:Pv,extendString:Vv,extendUint8Array:$v,extendBuiltins:w5},G0=n=>n.toLowerCase().split(" ").join("-"),bd=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},kd=async n=>{var e;try{await((e=navigator.clipboard)==null?void 0:e.writeText(n)),console.log("Content copied to clipboard")}catch(t){console.error("Failed to copy: ",t)}},Fv=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,k5=n=>JSON.parse(b5.decode(decodeURIComponent(n)));function _5(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 C5(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 N5(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(n)}function j5(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 S5(n){return ye({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.5 2C13.5 2.44425 13.3069 2.84339 13 3.11805V5H18C19.6569 5 21 6.34315 21 8V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V8C3 6.34315 4.34315 5 6 5H11V3.11805C10.6931 2.84339 10.5 2.44425 10.5 2C10.5 1.17157 11.1716 0.5 12 0.5C12.8284 0.5 13.5 1.17157 13.5 2ZM6 7C5.44772 7 5 7.44772 5 8V18C5 18.5523 5.44772 19 6 19H18C18.5523 19 19 18.5523 19 18V8C19 7.44772 18.5523 7 18 7H13H11H6ZM2 10H0V16H2V10ZM22 10H24V16H22V10ZM9 14.5C9.82843 14.5 10.5 13.8284 10.5 13C10.5 12.1716 9.82843 11.5 9 11.5C8.17157 11.5 7.5 12.1716 7.5 13C7.5 13.8284 8.17157 14.5 9 14.5ZM15 14.5C15.8284 14.5 16.5 13.8284 16.5 13C16.5 12.1716 15.8284 11.5 15 11.5C14.1716 11.5 13.5 12.1716 13.5 13C13.5 13.8284 14.1716 14.5 15 14.5Z"}}]})(n)}function E5(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 M5(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 D5(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 T5(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 I5="1.2.5",Hv={version:I5},L5="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",to="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+",A5=({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);"})]})]}),Uv=({className:n})=>c.jsx(A5,{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)"})]})})}),Oi=()=>{const[n,e]=v.useState(0);return v.useCallback(()=>{e(s=>++s)},[])};function O5(n,e,t){const s=[];return e.op===n?s.push(...(e==null?void 0:e.args)??[e]):s.push(e),t.op===n?s.push(...(t==null?void 0:t.args)??[t]):s.push(t),s}function J0(n,e,t){return{op:n,args:O5(n,e,t)}}function R5(n,e){function t(){this.constructor=n}t.prototype=e.prototype,n.prototype=new t}function Ei(n,e,t,s){var r=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Ei.prototype),r.expected=e,r.found=t,r.location=s,r.name="SyntaxError",r}R5(Ei,Error);function kh(n,e,t){return t=t||" ",n.length>e?n:(e-=n.length,t+=t.repeat(e),n+t.slice(0,e))}Ei.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=kh("",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+" | "+kh("",r.column-1," ")+kh("",g,"^")}else e+=`
158
+ at `+l}return e};Ei.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 P5(n,e){e=e!==void 0?e:{};var t={},s=e.grammarSource,r={expression:_e},a=_e,l="|",u="-",d="(",f=")",p="'",g='"',y=/^[^"' ()|&]/,w=/^[^']/,k=/^[^"]/,_=/^[ ]/,C=P("expression"),E=P("sum term"),S=T("|",!1),I=P("product term"),O=T("&",!1),R=P("subexpression"),Z=T("-",!1),M=P("term"),A=T("(",!1),H=T(")",!1),J=P("variable"),ae=U(['"',"'"," ","(",")","|","&"],!0,!1),Ne=P("variable 1"),Ee=T("'",!1),we=U(["'"],!0,!1),te=T('"',!1),B=U(['"'],!0,!1),q=P("whitespace character(s)"),K=U([" "],!1,!1),ne=function(ue,Ce){return J0("|",ue,Ce)},D=function(ue,Ce){return J0("&",ue,Ce)},$=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,Ce){return{op:"LEAF",value:z().trim()}},se=0,De=0,He=[{line:1,column:1}],Re=0,gt=[],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(De,se)}function T(ue,Ce){return{type:"literal",text:ue,ignoreCase:Ce}}function U(ue,Ce,Me){return{type:"class",parts:ue,inverted:Ce,ignoreCase:Me}}function F(){return{type:"end"}}function P(ue){return{type:"other",description:ue}}function Q(ue){var Ce=He[ue],Me;if(Ce)return Ce;for(Me=ue-1;!He[Me];)Me--;for(Ce=He[Me],Ce={line:Ce.line,column:Ce.column};Me<ue;)n.charCodeAt(Me)===10?(Ce.line++,Ce.column=1):Ce.column++,Me++;return He[ue]=Ce,Ce}function oe(ue,Ce,Me){var Je=Q(ue),nn=Q(Ce),rt={source:s,start:{offset:ue,line:Je.line,column:Je.column},end:{offset:Ce,line:nn.line,column:nn.column}};return rt}function he(ue){se<Re||(se>Re&&(Re=se,gt=[]),gt.push(ue))}function je(ue,Ce,Me){return new Ei(Ei.buildMessage(ue,Ce),ue,Ce,Me)}function _e(){var ue;return Y++,ue=Oe(),Y--,ue===t&&Y===0&&he(C),ue}function Oe(){var ue,Ce,Me,Je;return Y++,ue=se,Ce=Xe(),Ce!==t?(n.charCodeAt(se)===124?(Me=l,se++):(Me=t,Y===0&&he(S)),Me!==t?(Je=Oe(),Je!==t?(De=ue,ue=ne(Ce,Je)):(se=ue,ue=t)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=Xe()),Y--,ue===t&&(Ce=t,Y===0&&he(E)),ue}function Xe(){var ue,Ce,Me;return Y++,ue=se,Ce=Ct(),Ce!==t?(n.charCodeAt(se)===38?se++:Y===0&&he(O),Me=Xe(),Me!==t?(De=ue,ue=D(Ce,Me)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=Ct()),Y--,ue===t&&(Ce=t,Y===0&&he(I)),ue}function Ct(){var ue,Ce,Me;return Y++,ue=se,Nt(),n.charCodeAt(se)===45?(Ce=u,se++):(Ce=t,Y===0&&he(Z)),Ce!==t?(Me=dt(),Me!==t?(Nt(),De=ue,ue=$(Me)):(se=ue,ue=t)):(se=ue,ue=t),ue===t&&(ue=dt()),Y--,ue===t&&Y===0&&he(R),ue}function dt(){var ue,Ce,Me,Je;return Y++,ue=zn(),ue===t&&(ue=xs()),ue===t&&(ue=se,Nt(),n.charCodeAt(se)===40?(Ce=d,se++):(Ce=t,Y===0&&he(A)),Ce!==t?(Me=_e(),Me!==t?(n.charCodeAt(se)===41?(Je=f,se++):(Je=t,Y===0&&he(H)),Je!==t?(Nt(),De=ue,ue=ie(Me)):(se=ue,ue=t)):(se=ue,ue=t)):(se=ue,ue=t)),Y--,ue===t&&Y===0&&he(M),ue}function xs(){var ue,Ce,Me;if(Y++,ue=se,Nt(),Ce=[],y.test(n.charAt(se))?(Me=n.charAt(se),se++):(Me=t,Y===0&&he(ae)),Me!==t)for(;Me!==t;)Ce.push(Me),y.test(n.charAt(se))?(Me=n.charAt(se),se++):(Me=t,Y===0&&he(ae));else Ce=t;return Ce!==t?(Me=Nt(),De=ue,ue=ge()):(se=ue,ue=t),Y--,ue===t&&Y===0&&he(J),ue}function zn(){var ue,Ce,Me,Je,nn,rt;for(Y++,ue=se,Nt(),Ce=[],y.test(n.charAt(se))?(Me=n.charAt(se),se++):(Me=t,Y===0&&he(ae));Me!==t;)Ce.push(Me),y.test(n.charAt(se))?(Me=n.charAt(se),se++):(Me=t,Y===0&&he(ae));if(Me=se,n.charCodeAt(se)===39?(Je=p,se++):(Je=t,Y===0&&he(Ee)),Je!==t){for(nn=[],w.test(n.charAt(se))?(rt=n.charAt(se),se++):(rt=t,Y===0&&he(we));rt!==t;)nn.push(rt),w.test(n.charAt(se))?(rt=n.charAt(se),se++):(rt=t,Y===0&&he(we));n.charCodeAt(se)===39?(rt=p,se++):(rt=t,Y===0&&he(Ee)),rt!==t?(Je=[Je,nn,rt],Me=Je):(se=Me,Me=t)}else se=Me,Me=t;if(Me===t)if(Me=se,n.charCodeAt(se)===34?(Je=g,se++):(Je=t,Y===0&&he(te)),Je!==t){for(nn=[],k.test(n.charAt(se))?(rt=n.charAt(se),se++):(rt=t,Y===0&&he(B));rt!==t;)nn.push(rt),k.test(n.charAt(se))?(rt=n.charAt(se),se++):(rt=t,Y===0&&he(B));n.charCodeAt(se)===34?(rt=g,se++):(rt=t,Y===0&&he(te)),rt!==t?(Je=[Je,nn,rt],Me=Je):(se=Me,Me=t)}else se=Me,Me=t;return Me!==t?(Je=Nt(),De=ue,ue=le()):(se=ue,ue=t),Y--,ue===t&&Y===0&&he(Ne),ue}function Nt(){var ue,Ce;for(Y++,ue=[],_.test(n.charAt(se))?(Ce=n.charAt(se),se++):(Ce=t,Y===0&&he(K));Ce!==t;)ue.push(Ce),_.test(n.charAt(se))?(Ce=n.charAt(se),se++):(Ce=t,Y===0&&he(K));return Y--,Ce=t,Y===0&&he(q),ue}if(j=a(),j!==t&&se===n.length)return j;throw j!==t&&se<n.length&&he(F()),je(gt,Re<n.length?n.charAt(Re):null,Re<n.length?oe(Re,Re+1):oe(Re,Re))}const z5=(n,e=void 0)=>P5(n,e),_h={">=":"$gte","!=":"$ne","<=":"$lte","=":"$eq",">":"$gt","<":"$lt","~":"$like"},q0={$gte:">=",$ne:"!=",$lte:"<=",$eq:"=",$gt:">",$lt:"<",$like:"~"},Es=(n,e)=>{if(!n)throw new Error(e)},B5=n=>n==null?!1:typeof n=="string"||typeof n=="number"||typeof n=="boolean";function V5(n=""){return typeof n!="string"?!1:!isNaN(n)&&!isNaN(parseFloat(n))}const $5=(n="")=>n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):V5(n)?parseFloat(n):n==="true"?!0:n==="false"?!1:n,Ch=(n="")=>$5(n),F5=n=>{Es(n&&typeof n=="string","VQL-failed, expected LEAF node with value"),n=n.trim();const e=Object.keys(_h).join("|"),t=new RegExp(`(${e})`,"g"),s=Array.from(n.matchAll(t));if(s.length===0)return{op:void 0,arg_0:void 0,arg_1:Ch(n)};const r=s[0][1];Es(r in _h,"VQL-failed, expected operation in INNER_STRING_OPS_MAP");const a=n.split(r),l=a[0].trim();if(l.length===0)return{op:void 0,arg_0:void 0,arg_1:Ch(n)};let u=Ch(a.slice(1).join(r).trim());return r==="~"&&(u=String(u)),{op:_h[r],arg_0:l,arg_1:u}},H5=n=>{Es(n.op==="LEAF","VQL-failed, expected LEAF node"),Es(n.value,"VQL-failed, expected LEAF node with value");const{op:e,arg_0:t,arg_1:s}=F5(n.value);return e===void 0?{$search:String(s)}:{[t]:{[e]:s}}},Pl=n=>{switch(n.op){case"&":return{$and:n.args.map(Pl)};case"|":return{$or:n.args.map(Pl)};case"!":return{$not:Pl(n.args[0])};case"LEAF":return H5(n);default:throw new Error("VQL-failed, unknown operator: "+n.op)}},U5=n=>{if(typeof n!="string"||n.trim().length===0)return n;let e;try{e=z5(n)}catch(t){console.error("boolql failed with ",t," for string: ",n);return}return Pl(e)},X0=n=>typeof n!="string"?n:n.match(/\S+/g).length>1?`"${n}"`:n,zl=(n,e=!0)=>{if(n===void 0)return"";if(typeof n=="string")return n;Es(typeof n=="object","VQL-Compile, you tried to compile a non-object value "+n);const t=[];for(const[s,r]of Object.entries(n)){const a=s;if(a==="$search"){const l=String(r);t.push(X0(l));continue}else if(a==="$and"){t.push("("+r.map(l=>zl(l,e)).join(e?" ":" & ")+")");continue}else if(a==="$or"){t.push("("+r.map(l=>zl(l,e)).join(" | ")+")");continue}if(a==="$not"){t.push("-"+zl(r,e));continue}else{const l=r;Es(typeof l=="object","VQL-failed, expected VQL_OPS");for(const[u,d]of Object.entries(l)){const f=u;Es(f!=="$in"&&f!=="$nin","VQL-Compile failed, `$in` and `$nin` are currently not supported for VQL compile. Will be supported soon by converting them to `|` operators."),Es(f in q0,`VQL-Compile failed, ${f} is not legal operation`),Es(B5(d),`VQL-Compile failed, ${d} is not of type string, number or boolean`);const p=s+q0[f]+X0(d);t.push(p)}}}return t.join(" ")};var Or;class W5 extends Error{constructor(t,s=400){super();An(this,Or);this.code=s,this.message=t;try{On(this,Or,JSON.stringify(this.message,null,2))}catch{On(this,Or,":(")}typeof this.message!="string"&&(this.message!==void 0||this.message!==null)&&(this.message.toString=()=>Ue(this,Or))}toString(){return Ue(this,Or)}}Or=new WeakMap;const Bl=(n,e,t=400)=>{if(!n)throw new W5([{message:e}],t)},Y5=(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},Wv=/[a-zA-Z0-9\_\:\-\+\*\s\'\"\.\=]+/g;function Q5(n=""){return typeof n!="string"?!1:!isNaN(n)&&!isNaN(parseFloat(n))}const K5=(n="")=>n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):Q5(n)?parseFloat(n):n==="true"?!0:n==="false"?!1:n,yl=(n="")=>n?n.match(Wv).map(t=>{const s=t.split(":"),r=s[0].trim(),a=s.slice(1).join(":").trim(),l=K5(a);return[r,l]}):void 0,Yv=(n="",e=[])=>{var s;return((s=n==null?void 0:n.match(Wv).map(r=>r.trim()))==null?void 0:s.filter(Boolean))??e},Xl=(n,e)=>Array.isArray(n)?"("+n.join(",")+")":e,Z5=n=>{const e=n.map(t=>typeof t[1]=="string"?`${t[0]}:'${t[1]}'`:`${t[0]}:${t[1]}`);return Xl(e)},Vl="equals",_d="startAt",Qv="startAfter",Cd="endAt",Kv="endBefore",G5=n=>{const e={};n.get(Vl)&&(n.set(_d,n.get(Vl)),n.set(Cd,n.get(Vl))),e.startAt=yl(n.get(_d)),e.startAfter=yl(n.get(Qv)),Bl(!(e.startAt&&e.startAfter),"Cannot set both startAt and startAfter",401),e.endAt=yl(n.get(Cd)),e.endBefore=yl(n.get(Kv)),Bl(!(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];Bl(u===d,`non matching keys \`${u}\`!==\`${d}\` in range cursors`,401)}return a&&(a!=null&&a.length)&&(e.sortBy=a.map(([l,u],d)=>l)),e},Zv="sortBy",Gv="order",Nd="limit",jd="limitToLast",Jv="vql",qv="expand",J5=(n,e=["*"])=>Yv(n.get(qv),e),q5=n=>Yv((n==null?void 0:n.get(Zv))??"(updated_at, id)"),X5=n=>(n==null?void 0:n.get(Gv))==="asc"?"asc":"desc",e3=n=>{n=new URLSearchParams(n);let e={};e.expand=J5(n),e.sortBy=q5(n),e.order=X5(n),e.limit=parseInt(n.get(Nd))?Math.abs(parseInt(n.get(Nd))):void 0,e.limitToLast=parseInt(n.get(jd))?Math.abs(parseInt(n.get(jd))):void 0,!e.limitToLast&&!e.limit&&(e.limit=5),e.limitToLast&&e.limit&&(console.warn("Both `limit` and `limitToLast` are set, using `limitToLast` only"),e.limit=void 0);{const t=G5(n);e={...e,...t}}try{const t=n.get(Jv);e.__vql_as_string=t,e.vql=U5(t)}catch(t){console.error("VQL parsing failed ",t,`for query:
159
+ `,e),Bl(!1,"VQL parsing failed",401)}return e},kn=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),e.set(Gv,n.order),e.set(Zv,Xl(n.sortBy)),e.set(qv,Xl(n.expand)),e.set(Jv,zl(n.vql,!0)),n.limit&&e.set(Nd,n.limit.toString()),n.limitToLast&&e.set(jd,n.limitToLast.toString()),[{cursor:n.equals,key:Vl},{cursor:n.endAt,key:Cd},{cursor:n.endBefore,key:Kv},{cursor:n.startAt,key:_d},{cursor:n.startAfter,key:Qv}].filter(t=>{var s;return!!t.cursor&&((s=t.cursor)==null?void 0:s.length)}).forEach(t=>{console.warn("Legacy query cursors `equals` / `endAt` / `endBefore` / `startAt` / `startAfter`will be deprecated, use `vql` instead"),e.set(t.key,Z5(t.cursor))}),e},t3=n=>new URLSearchParams(n),Lr=(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(Lr(n.config,e,s),{...t,headers:{...(t==null?void 0:t.headers)??{},Authorization:a}})},We=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 Ir(n,e,t){return We(n,`${e}/${t}`,{method:"get"})}async function Xv(n,e,t){return We(n,`${e}`,{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async function dr(n,e,t){const s=kn(t);return We(n,`${e}/count_query?${s.toString()}`,{method:"get"})}async function df(n,e,t){return We(n,`${e}/${t}`,{method:"delete"})}async function Wr(n,e,t={}){const s=kn(t);return We(n,`${e}?${s.toString()}`,{method:"get"})}var Ya,Qa;class jn{constructor(e,t){An(this,Ya);An(this,Qa);On(this,Ya,e),On(this,Qa,t)}async get(e){return Ir(this.sdk,this.base_name,e)}async upsert(e){return Xv(this.sdk,this.base_name,e)}async remove(e){return df(this.sdk,this.base_name,e)}async list(e){return Wr(this.sdk,this.base_name,e)}async count_query(e){return dr(this.sdk,this.base_name,e)}get base_name(){return Ue(this,Qa)}get sdk(){return Ue(this,Ya)}}Ya=new WeakMap,Qa=new WeakMap;const Mi={Auto:{id:0,name:"Automatic",name2:"automatic"},Manual:{id:1,name:"Manual",name2:"manual"}},n3=n=>ex(n)==="product",ex=n=>{var s;const e=ec(n);return(s=Object.values(Et).filter(r=>r.op===e)[0])==null?void 0:s.type},ec=n=>{var e;return n.op??((e=n==null?void 0:n.meta)==null?void 0:e.op)},Et={any:{id:void 0,name:void 0,op:void 0,type:void 0},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"}},ot={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"}},eg={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"}},Sd={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)"}},Ed={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("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")},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)}}}},s3=Be,tg=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},r3=(n,e)=>{if(!n)throw e};var ji,yt,Ss;class i3{constructor(e){An(this,ji,new Set);An(this,yt);xe(this,"notify_subscribers",()=>{for(let e of Ue(this,ji))e({auth:this.currentAuth,isAuthenticated:this.isAuthenticated})});xe(this,"add_sub",e=>(Ue(this,ji).add(e),()=>{Ue(this,ji).delete(e)}));An(this,Ss,e=>{this.currentAuth=e,this.notify_subscribers()});xe(this,"signin",async(e,t)=>{const s={email:e,password:t},r=await Ue(this,yt).fetcher(Lr(Ue(this,yt).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});xe(this,"signup",async(e,t,s,r)=>{const a={email:e,password:t,firstname:s,lastname:r},l=await Ue(this,yt).fetcher(Lr(Ue(this,yt).config,"/auth/signup"),{method:"post",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}});r3(l.ok,"auth/error");const u=await l.json();return Ue(this,Ss).call(this,u),u});xe(this,"changePassword",async e=>{const t=await Ue(this,yt).fetcher(Lr(Ue(this,yt).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});xe(this,"signout",async()=>{console.log("signout"),Ue(this,Ss).call(this,void 0)});xe(this,"create_api_key",async()=>await We(Ue(this,yt),"/auth/apikeys",{method:"post"}));xe(this,"get_auth_user",async e=>await We(Ue(this,yt),`/auth/users/${e}`,{method:"get"}));xe(this,"remove_auth_user",async e=>We(Ue(this,yt),`/auth/users/${e}`,{method:"delete"}));xe(this,"list_auth_users",async e=>{const t=kn(e);return await We(Ue(this,yt),`/auth/users?${t.toString()}`,{method:"get"})});xe(this,"count_auth_users_query",async e=>dr(Ue(this,yt),"/auth/users",e));xe(this,"list_api_keys_auth_users",async()=>await We(Ue(this,yt),"/auth/apikeys",{method:"get"}));xe(this,"identity_providers_list",async()=>await We(Ue(this,yt),"/auth/identity-providers",{method:"get"}));xe(this,"identity_provider_get_authorization_uri",async e=>await We(Ue(this,yt),"/auth/identity-providers/create-authorization-uri",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));xe(this,"identity_provider_sign",async e=>{const t=await We(Ue(this,yt),"/auth/identity-providers/sign",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});return Ue(this,Ss).call(this,t),t});On(this,yt,e)}get currentAuth(){var e,t;return(t=(e=Ue(this,yt))==null?void 0:e.config)==null?void 0:t.auth}set currentAuth(e){Ue(this,yt).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,yt).fetcher(Lr(Ue(this,yt).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}}}ji=new WeakMap,yt=new WeakMap,Ss=new WeakMap;let a3=class extends jn{constructor(t){super(t,"customers");xe(this,"query_customer_orders",async(t,s)=>Wr(this.sdk,`customers/${t}/orders`,s));xe(this,"count_customer_orders_query",async(t,s)=>dr(this.sdk,`customers/${t}/orders`,s))}},o3=class extends jn{constructor(e){super(e,"tags")}},l3=class extends jn{constructor(e){super(e,"templates")}},c3=class extends jn{constructor(t){super(t,"products");xe(this,"list_used_tags",async()=>await We(this.sdk,"products/used_tags",{method:"get"}));xe(this,"changeStockOfBy",async(t,s)=>await We(this.sdk,`products/${t}?quantityBy=${s}`,{method:"put"}));xe(this,"batchAddProductsToCollection",async(t,s)=>{for(const r of t)await this.upsert({...r,collections:[...r.collections??[],s]})});xe(this,"batchRemoveProductsFromCollection",async(t,s)=>{for(const r of t)await this.upsert({...r,collections:(r.collections??[]).filter(a=>a.id!==s.id)})})}},u3=class extends jn{constructor(e){super(e,"orders")}list_my_orders(e={}){const t=kn(e);return We(this.sdk,`${this.base_name}/me?${t.toString()}`,{method:"get"})}},h3=class extends jn{constructor(t){super(t,"discounts");xe(this,"query_discount_products",async(t,s)=>Wr(this.sdk,`discounts/${t}/products`,s));xe(this,"count_discount_products_query",async(t,s)=>dr(this.sdk,`discounts/${t}/products`,s));xe(this,"list_used_discount_products_tags",async t=>await We(this.sdk,`discounts/${t}/products/used_tags`,{method:"get"}))}},d3=class extends jn{constructor(t){super(t,"collections");xe(this,"publish",async(t,s=1e3)=>await We(this.sdk,`collections/${t}/export`,{method:"post"}));xe(this,"list_used_products_tags",async t=>await We(this.sdk,`collections/${t}/products/used_tags`,{method:"get"}));xe(this,"query_collection_products",async(t,s)=>Wr(this.sdk,`collections/${t}/products`,s));xe(this,"count_collection_products_query",async(t,s)=>dr(this.sdk,`collections/${t}/products`,s))}};class f3 extends jn{constructor(e){super(e,"shipping")}}let p3=class extends jn{constructor(t){super(t,"storefronts");xe(this,"publish",async t=>await We(this.sdk,`storefronts/${t}/export`,{method:"post"}));xe(this,"get_default_auto_generated_storefront",async()=>await We(this.sdk,"storefronts/auto-generated",{method:"get"}))}};var Ka;class m3{constructor(e){An(this,Ka);xe(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()),We(this.sdk,`statistics/orders?${s.toString()}`)});xe(this,"countOf",async(e,t)=>{const s=kn(t);return We(this.sdk,`statistics/count/${e}?${s.toString()}`)});On(this,Ka,e)}get sdk(){return Ue(this,Ka)}}Ka=new WeakMap;let g3=class extends jn{constructor(e){super(e,"images")}},v3=class extends jn{constructor(e){super(e,"posts")}};class x3{constructor(e){xe(this,"create",async(e,t)=>await We(this.sdk,`checkout/create?gateway=${t}`,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));xe(this,"complete",async e=>await We(this.sdk,`checkout/${e}/complete`,{method:"post"}));xe(this,"pricing",async e=>await We(this.sdk,"checkout/pricing",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}var Za;class y3{constructor(e){An(this,Za);On(this,Za,e)}get(e){return Ir(this.sdk,"payments/gateways",e)}list(){return Wr(this.sdk,"payments/gateways")}paymentStatusOfOrder(e){return We(this.sdk,`/payments/status/${e}`,{method:"get"})}invokeAction(e,t){return We(this.sdk,`/payments/${e}/${t}`,{method:"post"})}getBuyUI(e){return We(this.sdk,`/payments/buy_ui/${e}`,{method:"get"})}webhook(e,t={}){return We(this.sdk,`/payments/gateways/${e}/webhook`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}get sdk(){return Ue(this,Za)}}Za=new WeakMap;class w3{constructor(e){xe(this,"settings",async()=>await We(this.sdk,"settings",{method:"get"}));xe(this,"info",async()=>await We(this.sdk,"info",{method:"get"}));this.sdk=e}}let b3=class extends jn{constructor(t){super(t,"notifications");xe(this,"upsertBulk",t=>We(this.sdk,`${this.base_name}`,{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}));xe(this,"meta",()=>this.get("_meta"))}};var Si;class k3{constructor(e){An(this,Si,{features:void 0});xe(this,"features",async()=>{if(Ue(this,Si).features)return Ue(this,Si).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,Si).features=t,t}catch(e){console.log(e)}return{supports_signed_urls:!1}});xe(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"});xe(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()});xe(this,"getBlob",async e=>(await this.features()).supports_signed_urls?this.getBlobSigned(e):this.getBlobUnsigned(e));xe(this,"getText",e=>this.getBlob(e).then(t=>t.text()));xe(this,"getJson",e=>this.getBlob(e).then(t=>t.text().then(JSON.parse)));xe(this,"getImageObjectURL",e=>this.getBlob(e).then(t=>URL.createObjectURL(t)));xe(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});xe(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"});xe(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});xe(this,"putBytes",async(e,t)=>(await this.features()).supports_signed_urls?this.putBytesSigned(e,t):this.putBytesUnsigned(e,t));xe(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}}Si=new WeakMap;const _3="X-STORECRAFT-THREAD-ID";class C3{constructor(e){xe(this,"speak",async(e,t)=>(await this.sdk.fetcher(Lr(this.sdk.config,`ai/agents/${e}/run`),{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json());xe(this,"streamSpeak",async(e,t)=>{const s=await this.sdk.fetcher(Lr(this.sdk.config,`ai/agents/${e}/stream`),{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});if(!s.ok){const a=await s.json();throw new Error(`Error ${s.status}: ${a.message}`)}const r=s.headers.get(_3);if(!r)throw new Error(`X-Storecraft-Thread-Id is missing, please tell the backend admin to
160
+ change the cors' Access-Control-Expose-Headers to accept the header`);return{threadId:r,generator:()=>N3(s.body)}});this.sdk=e}}const N3=async function*(n){for await(const e of j3(n))yield JSON.parse(e.data)},j3=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 S3(e),e=[]):e.push(u);t=e.pop(),r=await s.read()}},S3=n=>Object.fromEntries(n.map(e=>{const t=e.indexOf(":");return[e.slice(0,t).trim(),e.slice(t+1).trim()]}));class E3{constructor(e){xe(this,"quick",async e=>await We(this.sdk,"search",{method:"get"},kn(e)));xe(this,"similarity",async e=>await We(this.sdk,"similarity-search",{method:"get"},t3({q:e.q,namespaces:Xl(e.namespaces),limit:e.limit??5})));this.sdk=e}}let M3=class extends jn{constructor(t){super(t,"chats");xe(this,"download",async(t,s=!1)=>await We(this.sdk,`chats/download/${t}?signed=${s}`,{method:"get"}))}};class D3{constructor(e){xe(this,"send",async e=>await We(this.sdk,"emails/send",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));xe(this,"sendWithTemplate",async e=>await We(this.sdk,"emails/send-with-template",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}var ir,Ga;class T3{constructor(e,t){An(this,ir);An(this,Ga);xe(this,"fetchApiWithAuth",(e,t,s)=>We(this,e,t,s));xe(this,"fetchOnlyApiResponseWithAuth",(e,t,s)=>rr(this,e,t,s));On(this,ir,e),On(this,Ga,t??((s,r)=>fetch(s,r))),this.ai=new C3(this),this.search=new E3(this),this.auth=new i3(this),this.storage=new k3(this),this.customers=new a3(this),this.tags=new o3(this),this.templates=new l3(this),this.products=new c3(this),this.orders=new u3(this),this.collections=new d3(this),this.discounts=new h3(this),this.shipping=new f3(this),this.storefronts=new p3(this),this.statistics=new m3(this),this.images=new g3(this),this.posts=new v3(this),this.payments=new y3(this),this.checkout=new x3(this),this.reference=new w3(this),this.notifications=new b3(this),this.emails=new D3(this),this.chats=new M3(this)}get fetcher(){return Ue(this,Ga)}updateConfig(e){On(this,ir,{...Ue(this,ir)??{},...e??{}})}get config(){return Ue(this,ir)}set config(e){On(this,ir,e)}}ir=new WeakMap,Ga=new WeakMap;const I3=()=>typeof window<"u",L3=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)}}),tc=L3(I3()?window.localStorage:void 0),tx="storecraft_latest_config",ng=()=>(cs==null?void 0:cs.config)??tc.get(tx),cs=new T3,A3=(n={})=>{tc.set(tx,n)},O3=n=>{cs.updateConfig(n),A3(n)},wt=(n=ng())=>{const[e,t]=v.useState(void 0),s=Oi(),r=cs.auth.isAuthenticated,a=v.useCallback(l=>{O3(l),s()},[s]);return v.useEffect(()=>{a(n)},[]),v.useEffect(()=>{const l=cs.auth.add_sub(({auth:u})=>{a({...cs.config,auth:u})});return cs.auth.reAuthenticateIfNeeded(),l},[]),{config:cs.config??ng(),sdk:cs,isAuthenticated:r,error:e,actions:{updateConfig:a,trigger:s}}},xc=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)}}),R3=(n,e="main")=>(t,s)=>new Promise((r,a)=>{xc(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)}),P3=(n,e="main")=>t=>new Promise((s,r)=>{xc(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)}),z3=(n,e="main")=>t=>new Promise((s,r)=>{xc(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)}),ff=n=>{const[e,t]=v.useState(),[s,r]=v.useState();v.useEffect(()=>{xc(n).then(t).catch(r)},[n]);const a=v.useCallback(async(d,f)=>{try{return await R3(n,"main")(d,f)}catch(p){r(p)}},[]),l=v.useCallback(async d=>{try{return await P3(n,"main")(d)}catch(f){r(f)}},[]),u=v.useCallback(async d=>{try{return await z3(n,"main")(d)}catch(f){r(f)}},[]);return{db:e,error:s,actions:{get:l,put:a,remove:u}}},nx=()=>{const{db:n,error:e,actions:{get:t,put:s,remove:r}}=ff("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}}},B3=()=>ff("storecraft_misc_cache"),V3=()=>{const{db:n,error:e,actions:{get:t,put:s,remove:r}}=ff("storecraft_query_cache"),a=v.useCallback((d,f)=>{const p=d+"_"+kn(f).toString();return t(p)},[t]),l=v.useCallback((d,f,p)=>{const g=d+"_"+kn(f).toString();return s(g,p)},[s]),u=v.useCallback((d,f)=>{try{const p=d+"_"+kn(f).toString();return r(p)}catch{}},[r]);return{db:n,error:e,actions:{get:a,put:l,remove:u}}},$3=n=>n==="shipping"?"shipping_methods":n,F3=(n,e,t,s)=>e&&!t&&s!==void 0&&s<=0&&n&&!n.vql&&!n.endAt&&!n.endBefore&&!n.startAt&&!n.startAfter,H3=(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 Wr(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}},Ri={sortBy:["updated_at","id"],order:"desc",limit:5},mr=(n,e={sortBy:["updated_at","id"],order:"desc",limit:5},t=!0)=>{const{actions:{get:s,put:r}}=V3(),{actions:{get:a,put:l,putWithKey:u,remove:d}}=nx(),{sdk:f}=wt(),p=v.useRef(e),g=v.useRef(!1),y=v.useRef(),[w,k]=v.useState(void 0),[_,C]=v.useState([]),[E,S]=v.useState(-1),[I,O]=v.useState(t),[R,Z]=v.useState(!1),[M,A]=v.useState(-1),H=M==-1||M>0&&_.reduce((ne,D)=>ne+D.length,0)<M,J=Oi();v.useEffect(()=>f.auth.add_sub(J),[J]);const ae=v.useCallback(async(ne=!1)=>{let D;O(!0);try{if(D=await y.current(),!Array.isArray(D))throw new Error("result is not an array");for(let $ of D)l($);ne?(S(0),C([[...D]])):(S($=>$+1),C($=>[...$,[...D]])),Z(!0)}catch($){k($==null?void 0:$.code)}finally{O(!1)}return D},[]),Ne=v.useCallback(ne=>{if(!y.current)return Promise.resolve();const D=ne?1:-1;return E+D<0?Promise.resolve():E+D<_.length?(S(E+D),Promise.resolve(_[E+D])):H?ae():Promise.resolve()},[_,E,ae,H]),Ee=v.useCallback(()=>Ne(!0),[Ne]),we=v.useCallback(()=>Ne(!1),[Ne]),te=v.useCallback(async(ne=p.current,D=!0)=>{let $={...Ri,...ne};p.current=$,y.current=H3(f,$,n);let ie;D&&(ie=await s(n,$),!!ie&&Array.isArray(ie)?(S(0),C([[...ie]]),ae(!0).then(le=>{Array.isArray(le)&&r(n,$,le)})):ie=void 0),ie||(ie=await ae(!0),Array.isArray(ie)?r(n,$,ie):ie=void 0);{const{limit:ge,limitToLast:le,startAfter:se,startAt:De,endAt:He,endBefore:Re,...gt}=$;dr(f,n,gt).then(A).catch(console.log)}return ie},[n,ae,s,r]),B=v.useCallback(async ne=>{try{return d(ne),await df(f,n,ne),await te(p.current,!1),ne}catch(D){throw k(D),O(!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 q=v.useCallback(async()=>{const ne=`storecraft_max_updated_seen_${n}`,D=await a(ne);return D?await f.statistics.countOf($3(n),{startAfter:[["updated_at",D.updated_at],["id",D.id]],order:"asc"})>0:!0},[]);v.useEffect(()=>{t&&E==-1&&!g.current&&te(p.current)},[]);const K=E>=0?_[E]:[];return{pages:_,page:K,loading:I,hasLoaded:R,resource_is_probably_empty:F3(p.current,R,I,K==null?void 0:K.length),resource_has_more_pages:H,error:w,sdk:f,queryCount:M,resource:n,actions:{prev:we,next:Ee,query:te,poll:q,removeDocument:B}}};function pf(n,e,t=!0,s=!0){const{actions:{get:r,put:a,remove:l}}=nx(),{sdk:u}=wt(),[d,f]=v.useState(!!(n&&e&&t)),[p,g]=v.useState(),[y,w]=v.useState(!1),[k,_]=v.useState(void 0),[C,E]=v.useState(void 0),S=Oi();v.useEffect(()=>u.auth.add_sub(S),[S]);const I=v.useRef([n,e]);v.useEffect(()=>{I.current=[n,e]},[n,e]);const O=v.useRef(async(A=!0)=>{const H=I.current[0],J=I.current[1];if(!(H&&J))throw"no doc id";f(!0),_(void 0),E("load");try{let ae;return A&&(ae=await r(J),ae&&Ir(u,H,J).then(Ne=>{a(Ne),g(Ne)})),ae||(ae=await Ir(u,H,J),a(ae)),g(ae),w(!0),ae}catch(ae){throw console.log(ae),_(ae),ae}finally{f(!1)}}),R=v.useCallback(async(A=!0)=>{const H=I.current[0],J=I.current[1];if(!(H&&J))throw console.log("resource",H),console.log("document",J),"no doc id";f(!0),_(void 0),E("load");try{let ae;return A&&(ae=await r(J),ae&&Ir(u,H,J).then(Ne=>{a(Ne),g(Ne)})),ae||(ae=await Ir(u,H,J),a(ae)),g(ae),w(!0),ae}catch(ae){throw console.log(ae),_(ae),ae}finally{f(!1)}},[]),Z=v.useCallback(async(A,...H)=>{f(!0),_(void 0),E("update");try{const J=await Xv(u,n,A),ae=await Ir(u,n,J);return g(ae),w(!0),ae}catch(J){throw _(J),console.log(JSON.stringify(J,null,2)),J}finally{f(!1)}},[n,e]),M=v.useCallback(async()=>{f(!0),_(void 0),E("delete");try{return await df(u,n,e),l(e),g(void 0),w(!0),e}catch(A){throw _(A),A}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&&R(s)},[t,R,n,e]),{doc:p,sdk:u,loading:d,hasLoaded:y,error:k,op:C,resource:n,document:e,actions:{reload:R,reload_hard:O,upsert:Z,remove:M,setError:_}}}const mf=()=>{const n=Oi(),{sdk:e}=wt();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}}}},U3=(n,e)=>{const t=n;let s=tc.get(t)??e;const r=new Set,a=u=>(r.add(u),()=>{r.delete(u)}),l=u=>{s=u,tc.set(t,u),r.forEach(d=>d(s))};return()=>{const u=Oi();v.useEffect(()=>a(u),[u]);const d=v.useCallback(f=>{typeof f=="function"&&f(s),l(f)},[]);return{state:s,setState:d}}},sg={sortBy:["updated_at","id"],order:"desc",limit:5},W3=()=>{const{sdk:n}=wt();v.useRef(!1);const[e,t]=v.useState(void 0),[s,r]=v.useState(),[a,l]=v.useState(!1),[u,d]=v.useState(!1);Oi();const f=v.useCallback(async(p=sg,g=!0)=>{p={...sg,...p};try{const y=await Wr(n,"search",p);r(y)}catch(y){t(y)}},[]);return v.useEffect(()=>{f()},[]),{result:s,loading:a,hasLoaded:u,error:e,sdk:n,actions:{query:f}}},Y3={darkMode:!0},Q3="storecraft_dashboard_preferences",K3=U3(Q3,Y3);function fs(){const{state:n,setState:e}=K3(),t=v.useCallback(()=>{e({...n,darkMode:!n.darkMode})},[n]);return{darkMode:n.darkMode,toggle:t}}const Z3=({...n})=>{const{darkMode:e}=fs(),t=({})=>c.jsxs("div",{className:`rounded-lg my-auto b
161
+ bg-pink-50 dark:bg-pink-50/10 w-fit text-sm
162
+ text-pink-500 -tracking-wideset
163
+ 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
164
+ items-start
165
+ border-b
166
+ shelf-logo
167
+ text-xl font-bold
168
+ --pr-3 overflow-x-clip shadow-md`,...n,children:[e&&c.jsx("img",{src:to,className:"h-full p-1 opacity-80"}),!e&&c.jsx(G3,{className:`h-full object-contain rounded-xl bg-teal-400
169
+ 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(Uv,{className:"h-[27px]"}),c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx("div",{className:"flex flex-col",children:c.jsx("span",{children:`v${Hv.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,{})})]})]})]})},G3=({className:n="w-[512px] h-[512px] bg-slate-100 p-3",...e})=>c.jsx("div",{className:n,...e,children:c.jsx(qe,{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
170
+ 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
171
+ flex flex-row items-center justify-center --opacity-80
172
+ --scale-[3.0] -rotate-`,children:c.jsx("div",{className:"w-full h-full overflow-clip rounded-xl",children:c.jsx("img",{src:L5,className:`w-full h-full object-cover scale-[1.05]
173
+ bg-teal-100 --bg-slate-300`})})})})})}),J3={xs:"480px",sm:"580px",md:"768px","md-lg":"914px",lg:"1024px",xl:"1280px","2xl":"1536px"},q3=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),rg=!q3;function X3(n){if(!n)throw new Error("Failed to create breakpoint hooks, given `screens` value is invalid.");function e(r,a=!1){const[l,u]=X.useState(a),d=X.useRef(a);return v.useEffect(()=>{if(!(rg&&"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,rg,l]),l}function t(r,a){const l=e(r);return X.useEffect(()=>a(l)),null}function s(r,a,l){const u=e(r);return X.useMemo(()=>u?a:l,[l,u,a])}return{useBreakpoint:e,useBreakpointEffect:t,useBreakpointValue:s}}const{useBreakpointValue:ek}=X3(J3),tk=({dash:{onCloseClick:n,menu:{items:e,info:t}},className:s,...r})=>{const a=ek("md",!0,!1);let l=Hr();const u=Is(),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
174
+ flex flex-col ${s}`,children:[c.jsx(Z3,{}),c.jsx(Wb,{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 --bg-red-400 flex-1 overflow-y-hidden 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(U0,{icon:c.jsx(N5,{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(T5,{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 _=`/${G0(g.name)}/${G0(w.slug??w.name)}`;return c.jsx(Ut,{to:_,draggable:"false",children:c.jsx(U0,{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))]})})]})},sx=1e3,yc=sx*60,rx=yc*60,gf=rx*24,nk=gf*30,sk=gf*365,ig=[{millis:sk,adj:"year"},{millis:nk,adj:"month"},{millis:gf,adj:"day"},{millis:rx,adj:"hour",singular:"about an hour ago"},{millis:yc,adj:"minute"},{millis:sx,adj:"second"}],rk=n=>{const e=Math.max(Date.now()-new Date(n).getTime(),0);if(e<1e3)return"now";for(let t=0;t<ig.length;t++){const s=ig[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`}},ix=(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}},ik=({notification:n})=>{const e=Is(),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(Lt,{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:rk(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`})]})]})]})})},ak=({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))})},ok=({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(ik,{notification:t},s)),(n==null?void 0:n.length)>0&&c.jsx(us,{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`})]}),lk=({})=>c.jsxs("div",{className:`w-fit flex flex-row
193
+ items-center gap-1 `,children:[c.jsx($b,{className:"text-2xl"}),c.jsx("p",{children:"Notifications",className:"text-2xl font-bold"})]}),ck=v.forwardRef(({...n},e)=>{const[t,s]=v.useState("All"),{pages:r,actions:{next:a,query:l}}=mr("notifications",Ri,!1),u=v.useRef(l),d=v.useCallback(async()=>{u.current({limit:5},!1)},[]),{start:f}=ix(d,yc*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(lk,{}),c.jsx(ak,{notis:p,selected:t,onChange:s}),c.jsx(ok,{notis:g,onLoadMore:a})]})});function ag(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 uk(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 hk(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 dk(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 fk(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 pk(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 mk=({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}`})})}),gk=({isOpen:n=!1,onClick:e,...t})=>{const[s,r]=v.useState(!1),{actions:{poll:a}}=mr("notifications",{limit:1}),l=v.useCallback(async()=>{const f=await a();r(f)},[a]),{stop:u,start:d}=ix(l,yc*10,!1);return v.useEffect(()=>{n?(u(),r(!1)):d()},[n,d,u]),c.jsxs("div",{className:"relative",onClick:e,children:[c.jsx(eo,{Icon:hk,className:"h-6 w-6 cursor-pointer",...t}),c.jsx(ke,{show:s,children:c.jsx(mk,{className:"absolute w-3 h-3 top-px right-0"})})]})},vk=({...n})=>{const{darkMode:e,toggle:t}=fs();return c.jsx("div",{className:"relative",children:c.jsx(eo,{Icon:e?l4:c4,className:"cursor-pointer "+(e?"h-6 w-6":"h-5 w-5"),onClick:t})})},xk=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 yk(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 wk(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 ax=(...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])},bk=({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),_(S=>`${S} hidden`)},e)):_("hidden"),()=>clearTimeout(C.current.timer)),[n,e]);const E=y||!t;return c.jsx(c.Fragment,{children:E&&c.jsx("div",{children:f,className:`${k} ${p}`,...g})})},Ls=X.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(bk,{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 ox(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 kk(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 _k(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 Ck(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 Nk(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 jk(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 Sk(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 Ek=ax(["Meta","K"],["Meta","k"]),Mk=ax(["ArrowUp"],["ArrowDown"],["Enter"],["Escape"]),Dk={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",chats:"/pages/chats",templates:"/apps/templates",images:"/apps/gallery/img"},Tk=({onClick:n,...e})=>{const t=Is();Ek(a=>{s.current.show()});const s=v.useRef(void 0),r=v.useCallback((a,l)=>{const u=Dk[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-harder shelf-text-minor text-sm
203
+ cursor-pointer hover:ring-pink-400 hover:ring-2`,children:[c.jsx(wk,{}),c.jsx("span",{children:"Search"}),c.jsxs("div",{className:`rounded-md border flex flex-row
204
+ items-center px-2 shelf-card-harder`,children:[c.jsx(u4,{}),c.jsx("span",{children:"K"})]})]}),c.jsx(xf.PortalChild,{children:c.jsx(Ls,{ref:s,children:c.jsx(Rk,{onCancel:()=>s.current.hide(),onSelect:r})},"tomer")})]})},Ik=()=>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(Sk,{className:"text-5xl"}),"No search Results ",c.jsx("br",{}),"were found 😔"]}),Lk=()=>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(ox,{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(ag,{className:"text-lg"}),c.jsx(ag,{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"})]})]}),Ak={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",chats:"🤖 AI Chats"},Ok=({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:Ak[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",{className:"max-w-[80%] overflow-hidden text-ellipsis",children:(d==null?void 0:d.title)??(d==null?void 0:d.handle)??(d==null?void 0:d.id)??"nooop"}),c.jsx(ox,{className:"text-xl "+(s==f?"inline":"hidden")})]},d.id))})]})},Rk=({onCancel:n,onSelect:e})=>{const{result:t,loading:s,actions:{query:r}}=W3(),a=v.useMemo(()=>Object.entries(t??{}).map(_=>({group:_[1],name:_[0]})).filter(_=>_.name!=="auth_users"&&_.name!=="notifications"),[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]);Mk(_=>{if(a.length==0)return;const C={...l},E=_[0];E=="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)),E=="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)),E==="Escape"&&n&&n(),E==="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(_=>{_.stopPropagation(),_==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,onSubmit:k,children:c.jsx(qe,{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(vd,{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(ke,{show:a.length==0&&!s,children:c.jsx(Ik,{})}),a.map((_,C)=>c.jsx(Ok,{name:_.name,group:_.group,index:C,scrollIntoView:d,selectedItemIndex:l.groupIndex==C?l.itemIndex:-1,onHover:g,onClick:y},_.name))]})})})]}),c.jsx(Lk,{})]})})},Pk=()=>{const[n,e]=v.useState([]),{sdk:t}=wt();return v.useEffect(()=>{async function s(){try{return(await t.reference.info()).core_version}catch{return}}async function r(){try{const u=await fetch("https://registry.npmjs.org/@storecraft/core/latest");if(!u.ok)throw new Error("Failed to fetch latest version");const d=await u.json();return d==null?void 0:d.version}catch{return}}async function a(){return Promise.resolve(Hv.version)}async function l(){const[u,d,f]=await Promise.all([s(),r(),a()]),p=[];console.log({dashboard:f,backend:u,latest:d}),f!==u&&p.push(`⚠️ Dashboard version ${f} might be
223
+ incompatible with your backend version ${u??""}`),d&&u!==d&&p.push(`👉 New version available: ${d}`),e(p)}l()},[]),{messages:n}},zk=({...n})=>{const[e,t]=v.useState(!0),{messages:s}=Pk();return!e||s.length===0?null:c.jsx("div",{...n,children:c.jsxs("div",{className:`w-full h-full flex items-center
224
+ justify-center text-base relative
225
+ bg-gradient-to-r from-cyan-500/0 via-cyan-500/50 to-cyan-500/100`,children:[c.jsx("span",{children:s.join(" "),className:`whitespace-nowrap text-gray-600 dark:text-white
226
+ font-mono text-sm font-bold`}),c.jsx($a,{className:"absolute right-3 text-black cursor-pointer",onClick:()=>t(!1)})]})})},Bk=({menuOpen:n,className:e="w-full",onMenuClick:t,...s})=>{var p,g;const[r,a]=v.useState(!1),{auth:l,actions:{signout:u}}=mf(),d=xk(()=>{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:"w-full h-fit flex flex-col",children:[c.jsx(zk,{className:"w-full h-8"}),c.jsxs("div",{className:`relative w-full flex flex-row
227
+ justify-between items-center px-1 sm:px-3 md:px-6 h-12`,children:[c.jsx(Kb,{className:`text-kf-500 dark:text-kf-400/70 text-4xl top-4 right-4
228
+ cursor-pointer --md:hidden hover-text-pink-600
229
+ rounded-full transition-all duration-300
230
+ hover:bg-pink-400
231
+ hover:text-white dark:hover:text-white
232
+ p-1.5 hover:p-1
233
+ ${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(Tk,{}),c.jsx(eo,{Icon:a4,onClick:u,className:"text-2xl cursor-pointer"}),c.jsx(gk,{isOpen:r,onClick:f}),c.jsx(vk,{})]}),c.jsx(ke,{show:r,children:c.jsx(ck,{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 $k(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 Fk(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 vf=()=>{const[n,e]=v.useState(0);return v.useCallback(()=>{e(s=>++s)},[])},Hk=()=>{const n=new Map;let e;const t=()=>{v.useState(void 0);const a=vf();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}}},Uk={info:{name:"Storecraft",icon:c.jsx(e4,{className:"inline"})},items:[{name:"pages",items:[{name:"Storefronts",icon:c.jsx(cv,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-cyan-400"}},{name:"Customers",icon:c.jsx(nv,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-cyan-400"}},{name:"Tags",icon:c.jsx(ev,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-pink-400"}},{name:"Products",icon:c.jsx(Qn,{className:""}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-400"}},{name:"Collections",icon:c.jsx(uv,{}),extra:{active:"bg-pink-600",hover:"hover:bg-kf-400"}},{name:"Orders",icon:c.jsx(q1,{}),extra:{active:"bg-pink-600 dark:bg-pink-600/90",hover:"hover:bg-amber-200"}},{name:"Discounts",icon:c.jsx(sv,{className:"--text-lg"}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-200"}},{name:"Shipping Methods",icon:c.jsx(hv,{className:"--text-lg"}),extra:{active:"bg-pink-600",hover:"hover:bg-teal-200"}},{name:"Blog",slug:"posts",icon:c.jsx(Pb,{}),extra:{active:"bg-orange-400 dark:bg-orange-400/70",hover:"hover:bg-teal-200"}},{name:"Payment Gateways",icon:c.jsx(o4,{}),extra:{active:"bg-pink-600",hover:"hover:bg-amber-200"}},{name:"AI Chats",slug:"chats",icon:c.jsx(S5,{}),extra:{active:"bg-pink-600",hover:"hover:bg-amber-200"}}]},{name:"apps",items:[{name:"Gallery",icon:c.jsx(t4,{className:"--scale-125"}),extra:{active:"bg-yellow-400 dark:bg-yellow-400/80",hover:"hover:bg-teal-200"}},{name:"Templates",icon:c.jsx(Fk,{className:"--scale-125"}),extra:{active:"bg-red-400 dark:bg-red-400/80",hover:"hover:bg-teal-200"}},{name:"Extensions",icon:c.jsx(Hb,{className:"--scale-125"}),extra:{active:"bg-teal-400 dark:bg-teal-400/80",hover:"hover:bg-teal-200"}}]}]},xf=Hk(),wl=({children:n=void 0,className:e,...t})=>{const{open:s,ref_scroll_element:r}=Vk(100,!0),[a,l]=v.useState(!0),{darkMode:u}=fs(),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
234
+ shelf-body-bg w-full h-full sm:h-full ${e}`,...t,ssstyle:{height:"100dvh"},children:[c.jsx(xf.Portal,{}),c.jsx("div",{className:`fixed left-0 top-0 w-full h-full bg-teal-900/10
235
+ z-50 transition-all md:hidden
236
+ ${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
237
+ w-fit h-full overflow-x-clip overflow-hidden
238
+ z-50
239
+ md:transition-max-width md:duration-500 ease-in-out
240
+ ${a?"max-w-[72rem]":"max-w-0 "}`,children:c.jsx(qe,{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(tk,{dash:{menu:Uk,onCloseClick:f},className:`bg-gradient-to-r
241
+ from-slate-100 to-white
242
+ dark:from-slate-800 dark:to-slate-800
243
+ shadow-md
244
+ shadow-gray-800 h-full rounded-tr-3xl
245
+ rounded-br-3xl`})})}),c.jsxs("div",{className:`relative flex-1 h-full flex flex-col
246
+ overflow-auto`,children:[c.jsx(Bk,{className:`w-full
247
+ shelf-action-bar
248
+ h-fit backdrop-blur-sm
249
+ absolute left-0 top-0 z-40
250
+ border-b dark:border-b-slate-700
251
+ transition-transform
252
+ duration-500 ${p}`,onMenuClick:d,menuOpen:a}),c.jsx("div",{ref:r,className:`relative w-full
253
+ px-0 sm:px-3 md:px-6
254
+ h-full pt-16 pb-5 overflow-y-auto scrollbar-none `,children:c.jsxs("div",{className:`
255
+ --bg-red-400
256
+ --bg-gradient-to-tl --from-kf-50/50 --to-slate-50/10
257
+ dark:from-transparent/0 dark:to-transparent/0
258
+ px-3 sm:px-5 lg:px-10 py-3 sm:py-5 lg:py-8
259
+ rounded-3xl text-sm font-medium
260
+ border dark:border-slate-700 w-full h-fit
261
+ min-h-full overflow-x-auto`,children:[c.jsx(kb,{}),n]})})]})]})})},Ia=({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"}),Nh=({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
262
+ shelf-border-color w-full overflow-auto
263
+ border-b pb-2 flex flex-row gap-2 text-kf-500
264
+ ${t}`,...r,children:[e&&c.jsx(e,{className:s}),c.jsxs("div",{className:"flex flex-row items-baseline text-3xl/none",children:[c.jsx(Ia,{children:n.slice(0,3),className:`bg-gradient-to-r from-kf-600 to-pink-500
265
+ dark:from-kf-600 dark:to-pink-500 --text-5xl
266
+ uppercase font-medium italic tracking-tighter
267
+ inline-flex --tracking-wide`}),c.jsx(Ia,{children:n.slice(3),className:`bg-gradient-to-r from-pink-600 to-pink-500
268
+ dark:from-pink-600 dark:to-pink-500 --text-5xl
269
+ uppercase font-extralight italic tracking-tighter --hidden --text-[34px]
270
+ -translate-x-[3px]
271
+ 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 Rr(n,e){return n.width===e.width&&n.height===e.height}var Wk=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 Yk(n){return new Wk(n)}var Qk=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;Rr(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=Rr(this.bitmapSize,s)?null:s;t===null&&r===null||t!==null&&r!==null&&Rr(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}Zk().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},n.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=og(this._canvasElement);if(t===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=Yk(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},n.prototype._invalidateBitmapSize=function(){var e,t;if(this._canvasElement!==null){var s=og(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?Gk(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 Kk(n,e){return new Qk(n,e.transform,e.options)}function og(n){return n.ownerDocument.defaultView}function Zk(){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 Gk(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 Jk=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 zr(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 Jk(r,t,s)}/*!
272
+ * @license
273
+ * TradingView Lightweight Charts™ v5.0.5
274
+ * Copyright (c) 2025 TradingView, Inc.
275
+ * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
276
+ */const qk={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 lg,cg;function Br(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 lx(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 qt(n,e){if(!n)throw new Error("Assertion failed"+(e?": "+e:""))}function dn(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 Ar(n){return me(dn(n))}(function(n){n[n.Simple=0]="Simple",n[n.WithSteps=1]="WithSteps",n[n.Curved=2]="Curved"})(lg||(lg={})),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"}(cg||(cg={}));class Dt{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 _n(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]:_n(n[s],t[s]));return n}function Di(n){return typeof n=="number"&&isFinite(n)}function Fa(n){return typeof n=="number"&&n%1==0}function no(n){return typeof n=="string"}function bl(n){return typeof n=="boolean"}function Ds(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"?Ds(r):r);return t}function Xk(n){return n!==null}function Md(n){return n===null?void 0:n}const cx="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function nc(n,e,t){return e===void 0&&(e=cx),`${t=t!==void 0?`${t} `:""}${n}px ${e}`}class e_{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=nc(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 jh(n){return n<0?0:n>255?255:Math.round(n)||0}function ug(n){return .199*n[0]+.687*n[1]+.114*n[2]}let t_=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:ug(t)>160?"black":"white"}}J(e){return ug(this.Z(e))}tt(e,t,s){const[r,a,l,u]=this.Z(e),[d,f,p,g]=this.Z(t),y=[jh(r+s*(d-r)),jh(a+s*(f-a)),jh(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 ux{constructor(){this.it=[]}st(e){this.it=e}nt(e,t,s){this.it.forEach(r=>{r.nt(e,t,s)})}}class gr{nt(e,t,s){e.useBitmapCoordinateSpace(r=>this.et(r,t,s))}}let n_=class extends gr{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 s_(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const r_={from:0,to:1};class i_{constructor(e,t,s){this.Mt=new ux,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(s_),this.bt=this.xt.map(t=>{const s=new n_;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=r_):u.lt=null})}}class a_ extends gr{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,Br(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,Br(e,this.Yt.Zt.Kt),lx(e,d,0,t.width))}}class o_{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 a_(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 wc(n,e,t,s,r,a){n.save(),n.globalCompositeOperation="copy",n.fillStyle=a,n.fillRect(e,t,s,r),n.restore()}function hg(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 dg(n,e,t,s,r,a,l=0,u=[0,0,0,0],d=""){if(n.save(),!l||!d||d===a)return hg(n,e,t,s,r,u),n.fillStyle=a,n.fill(),void n.restore();const f=l/2;var p;hg(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 hx(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 fg{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?dg(f,g.oi,g._i,g.ui,g.ci,l,g.di,[g.ft,0,0,g.ft],l):dg(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,E=t.P,S=s.Di(a,C),I=Math.ceil(s.Vi(a,C)),O=E+y+w,R=t.S+k+_+I+p,Z=Math.max(1,Math.floor(f));let M=Math.round(O*f);M%2!=Z%2&&(M+=1);const A=g>0?Math.max(1,Math.floor(g*d)):0,H=Math.round(R*d),J=Math.round(p*d),ae=this.ei.Ii??this.ei.Bi,Ne=Math.round(ae*f)-Math.floor(.5*f),Ee=Math.floor(Ne+Z/2-M/2),we=Ee+M,te=r==="right",B=te?u.width-g:g,q=te?l.width-A:A;let K,ne,D;return te?(K=q-H,ne=q-J,D=B-p-k-g):(K=q+H,ne=q+J,D=B+p+k),{li:te,ai:{_i:Ee,mi:Ne,xi:we,ui:H,ci:M,ft:2*d,di:A,oi:K,fi:q,wi:ne,gi:Z,bi:l.width},Si:{_i:Ee/f,xi:we/f,Ci:D,yi:S}}}}let bc=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||fg)(this.Ei,this.Ai),this.Oi=new(e||fg)(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 l_ extends bc{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 c_=/[1-9]/g;class dx{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,c_))));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),E=Math.round(0*k),S=Math.round(p*w),I=Math.round(g*k),O=Math.round(2*w);if(y.beginPath(),y.moveTo(C,E),y.lineTo(C,I-O),y.arcTo(C,I,C+O,I,O),y.lineTo(S-O,I),y.arcTo(S,I,S,I-O,O),y.lineTo(S,E),y.fill(),_.pi){const R=Math.round(_.Bi*w),Z=E,M=Math.round((Z+t.C)*k);y.fillStyle=_.R;const A=Math.max(1,Math.floor(w)),H=Math.floor(.5*w);y.fillRect(R-H,Z,A,M-Z)}}),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 u_=class{constructor(e,t,s){this.St=!0,this.Gt=new dx,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 fx{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 Dd;(function(n){n[n.Normal=0]="Normal",n[n.Magnet=1]="Magnet",n[n.Hidden=2]="Hidden",n[n.MagnetOHLC=3]="MagnetOHLC"})(Dd||(Dd={}));class h_ extends fx{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 u_(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 o_(this,e),this.gs.set(e,t));let s=this.Ms.get(e);return s||(s=new i_(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(Xk),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 l_(this,t,s),e.set(t,r)),r}}function kc(n){return n==="left"||n==="right"}class Ft{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 Ft(2)}static gn(){return new Ft(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 pg=".";function Ts(n,e){if(!Di(n))return"n/a";if(!Fa(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 _c{constructor(e,t){if(t||(t=1),Di(e)&&Fa(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=pg+Ts(+l.toFixed(this.Sn)*this.Mn,a)}else s=Math.round(s*t)/t,a>0&&(r=pg+Ts(0,a));return s.toFixed(0)+r}}class px extends _c{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class d_{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 f_=/[2-9]/g;class sc{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||f_,a=String(t).replace(r,"0");if(this.Dn.has(a))return dn(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 p_{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 mx{constructor(e,t,s){this.Wn=e,this.On=new sc(50),this.Fn=t,this.O=s,this.W=-1,this.Gt=new p_(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 m_ extends gr{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),Br(e,this.Yt.Kt),lx(e,a,0,t.width))}}class yf{constructor(e){this.Xn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Kt:0,Vt:!1},this.Gn=new m_,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 g_ extends yf{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 v_ extends gr{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 x_=[{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 y_{constructor(e){this.Gt=new v_,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 x_)if(s>=f.le&&s<=f.oe){r=f;break}qt(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 w_ extends yf{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 b_ extends bc{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 mg(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 hn{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 hn(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 hn(mg(Math.min,this.$e(),e.$e(),-1/0),mg(Math.max,this.qe(),e.qe(),1/0))}je(e){if(!Di(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){Di(e)&&(this.Fe+=e,this.We+=e)}Ke(){return{minValue:this.We,maxValue:this.Fe}}static Xe(e){return e===null?null:new hn(e.minValue,e.maxValue)}}class rc{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 rc(hn.Xe(e.priceRange),e.margins)}}class k_ extends yf{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 __ extends bc{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 C_{constructor(e,t){this.ge=e,this.ys=t,this.er=new k_(e,this),this.Wn=new __(e,this),this.rr=new mx(this.Wn,e,e.Qt())}hr(e){_n(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 fx{constructor(e){super(),this.ts=e}Qt(){return this.ts}}const j_={Bar:(n,e,t,s)=>{const r=e.upColor,a=e.downColor,l=me(n(t,s)),u=Ar(l.Ft[0])<=Ar(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=Ar(p.Ft[0])<=Ar(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 S_{constructor(e){this.Pr=(t,s)=>s!==void 0?s.Ft:this.ge.Ks().kr(t),this.ge=e,this.Tr=j_[e.Rr()]}Dr(e,t){return this.Tr(this.Pr,this.ge.N(),e,t)}}function gx(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 Ti=gx.bind(null,!0),vx=gx.bind(null,!1);var gg;(function(n){n[n.NearestLeft=-1]="NearestLeft",n[n.None=0]="None",n[n.NearestRight=1]="NearestRight"})(gg||(gg={}));const tr=30;class E_{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=kl(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 Ti(this.Vr,e,(t,s)=>t.Re<s)}Xr(e){return vx(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=kl(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=kl(r,k)}{const y=this.Kr(p),w=this.Xr(d);r=kl(r,this.Gr(y,w,s))}return r}}function kl(n,e){return n===null?e:e===null?n:{Jr:Math.min(n.Jr,e.Jr),Qr:Math.max(n.Qr,e.Qr)}}class M_{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 D_{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 M_(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 xx{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 D_(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 T_=class extends xx{us(){return[]}};class I_{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 vg{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 I_(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 yx(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 L_{constructor(e,t){this.Gt=new dx,this._h=e,this.uh=t}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...yx(this._h)}),this.Gt}}class A_ extends bc{constructor(e,t){super(),this._h=e,this.Yi=t}qi(e,t,s){const r=yx(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 O_ extends xx{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 L_(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 A_(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 vg(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 vg(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 Sh(n,e,t,s){n.forEach(r=>{e(r).forEach(a=>{a.rh()===t&&s.push(a)})})}function Eh(n){return n.Ws()}function R_(n){return n.wh()}function P_(n){return n.gh()}const z_=["Area","Line","Baseline"];class Cc extends N_{constructor(e,t,s,r,a){super(e),this.Yt=new E_,this.er=new w_(this),this.bh=[],this.xh=new g_(this),this.Sh=null,this.Ch=null,this.yh=null,this.Ph=[],this.ys=s,this.kh=t;const l=new b_(this);this.vs=[l],this.rr=new mx(l,this,e),z_.includes(this.kh)&&(this.Sh=new y_(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 S_(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),_n(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 C_(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=[];Sh(this.Ph,Eh,"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),Sh(this.Ph,Eh,"normal",e),e}Jh(){return this.Qh(Eh,"bottom")}ta(e){return this.Qh(R_,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 rc.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 O_(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!kc(this.Wt().wa())}na(e,t){if(!Fa(e)||!Fa(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 hn(r.Jr,r.Qr):null,l=null;if(this.Rr()==="Histogram"){const u=this.ys.base,d=new hn(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 hn(d.priceRange.minValue,d.priceRange.maxValue);a=a!==null?a.vn(f):f}d!=null&&d.margins&&(l=d.margins)}),new rc(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 d_(this.ys.priceFormat.precision);break;case"percent":this.ha=new px(this.ys.priceFormat.precision);break;default:{const e=Math.pow(10,this.ys.priceFormat.precision);this.ha=new _c(e,this.ys.priceFormat.minMove*e)}}this.es!==null&&this.es.ga()}Qh(e,t){const s=[];return Sh(this.Ph,e,t,s),s}}const B_=[3],V_=[0,1,2,3];class $_{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 Cc).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 _=Ar(g.zt()),C=this.ys.mode===3?V_:B_;return p.concat(C.map(E=>y.Nt(k.Ft[E],_.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 F_ extends gr{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,Br(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,Br(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 H_{constructor(e){this.Gt=new F_,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 U_{constructor(e){this.sh=new H_(e)}lr(){return this.sh}}const Mh={Ia:4,Ba:1e-4};function bi(n,e){const t=100*(n-e)/e;return e<0?-t:t}function W_(n,e){const t=bi(n.$e(),e),s=bi(n.qe(),e);return new hn(t,s)}function La(n,e){const t=100*(n-e)/e+100;return e<0?-t:t}function Y_(n,e){const t=La(n.$e(),e),s=La(n.qe(),e);return new hn(t,s)}function ic(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 Ca(n,e){if(n===null)return null;const t=ic(n.$e(),e),s=ic(n.qe(),e);return new hn(t,s)}function _l(n,e){if(n===null)return null;const t=Aa(n.$e(),e),s=Aa(n.qe(),e);return new hn(t,s)}function Dh(n){if(n===null)return Mh;const e=Math.abs(n.qe()-n.$e());if(e>=1||e<1e-15)return Mh;const t=Math.ceil(Math.abs(Math.log10(e))),s=Mh.Ia+t;return{Ia:s,Ba:1/Math.pow(10,s)}}function Oa(n,e,t){return Math.min(Math.max(n,e),t)}function Cl(n,e,t){return e-n<=t}class Th{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=Cl(a,r,1e-14)&&a>r+1e-14,y=Cl(a,s*u,1e-14),w=Cl(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];Cl(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 xg{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 Th(this.Aa,[2,2.5,2]),l=new Th(this.Aa,[2,2,2.5]),u=new Th(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 E=this.Wa(C,t,!0);k!==null&&Math.abs(E-k)<this.Fa()||E<u||E>d||(_<this.Oa.length?(this.Oa[_].Pa=E,this.Oa[_].$a=e.qa(C)):this.Oa.push({Pa:E,$a:e.qa(C)}),_++,k=E,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 wx(n){return n.slice().sort((e,t)=>me(e.hs())-me(t.hs()))}var yg;(function(n){n[n.Normal=0]="Normal",n[n.Logarithmic=1]="Logarithmic",n[n.Percentage=2]="Percentage",n[n.IndexedTo100=3]="IndexedTo100"})(yg||(yg={}));const wg=new px,bg=new _c(100,1);class Q_{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 Dt,this.sl=new Dt,this.nl=[],this.el=null,this.rl=null,this.hl=null,this.al=null,this.ha=bg,this.ll=Dh(null),this.ol=e,this.ys=t,this._l=s,this.ul=r,this.cl=a,this.dl=new xg(this,100,this.fl.bind(this),this.pl.bind(this))}wa(){return this.ol}N(){return this.ys}hr(e){if(_n(this.ys,e),this.ga(),e.mode!==void 0&&this.vl({ie:e.mode}),e.scaleMargins!==void 0){const t=dn(e.scaleMargins.top),s=dn(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=_l(this.Ge,this.ll),s!==null&&this.bl(s)):this.ys.autoScale=!0),e.ie===1&&e.ie!==t.ie&&(s=Ca(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=bi(e,t):this.gl()&&(e=La(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 E=C;w!==null&&(E=w(_.gt,t));const S=r+p*(E-l),I=f?S:this.ja-1-S;_.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,E=_.Yh,S=_.jh,I=_.Zh;w!==null&&(C=w(_.qh,t),E=w(_.Yh,t),S=w(_.jh,t),I=w(_.Zh,t));let O=r+p*(C-l),R=f?O:this.ja-1-O;_.Bl=R,O=r+p*(E-l),R=f?O:this.ja-1-O,_.Al=R,O=r+p*(S-l),R=f?O:this.ja-1-O,_.El=R,O=r+p*(I-l),R=f?O:this.ja-1-O,_.zl=R}}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=wx(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(bi(e,t));case 3:return this.ra().format(La(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=bi(e,t),this.Kl(e,wg)}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=bg,this.Le()?(this.ha=wg,t=100):this.gl()?(this.ha=new _c(100,1),t=100):e!==null&&(this.ha=e.ra()),this.dl=new xg(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?ic(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=Ca(g,this.ll);break;case 2:g=W_(g,f.Ft);break;case 3:g=Y_(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=_l(t,this.ll)),t=new hn(t.$e()-f,t.qe()+f),this.Ya()&&(t=Ca(t,this.ll))}if(this.Ya()){const d=_l(t,this.ll),f=Dh(d);if(l=f,u=this.ll,l.Ia!==u.Ia||l.Ba!==u.Ba){const p=this.Ka!==null?_l(this.Ka,this.ll):null;this.ll=f,t=Ca(d,f),p!==null&&(this.Ka=Ca(p,f))}}this.bl(t)}else this.Ge===null&&(this.bl(new hn(-.5,.5)),this.ll=Dh(null));var l,u;this.Xa.Ga=!0}Vl(){return this.Le()?bi:this.gl()?La:this.Ya()?e=>ic(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 kg(n){return n instanceof Cc}class _g{constructor(e,t){this.nl=[],this.so=new Map,this.ja=0,this.no=0,this.eo=1e3,this.el=null,this.ro=new Dt,this.Ph=[],this.uh=e,this.ts=t,this.ho=new U_(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)?dn(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(kg)}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);qt(t!==-1,"removeDataSource: invalid data source"),this.nl.splice(t,1);const s=me(e.Wt()).wa();if(this.so.has(s)){const a=dn(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=wx(this.nl)),this.el}It(){return this.Dt().filter(kg)}zo(){return this.ro}Lo(){return this.ho}ua(e){this.Ph.push(new T_(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),!kc(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,...Ds(t)},r=new Q_(e,s,this.ts.N().layout,this.ts.N().localization,this.ts.Ki());return r.Cl(this.$t()),r}}function Nl(n){return{Wo:n.Wo,Fo:{Zn:n.Ho.externalId},Uo:n.Ho.cursorStyle}}function K_(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 Z_(n){return n.Ws!==void 0}function bx(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 Nl(r);for(const a of s){if(r&&r.Wo===a&&r.Ho.zOrder!=="bottom"&&!r.Ho.isBackground)return Nl(r);if(Z_(a)){const l=K_(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 Nl(r)}return r!=null&&r.Ho?Nl(r):null}class G_{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(dn(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 Ra{constructor(e,t){qt(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 Cg(n,e){return n===null||e===null?n===e:n.He(e)}class J_{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(Ti(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=dn(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 E=u[f],S=E.index;if(!(S<C&&a(E))){y=S;break}f++,r.push(E),w=S,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 Ni{constructor(e){this.l_=e}o_(){return this.l_===null?null:new Ra(Math.floor(this.l_.Uh()),Math.ceil(this.l_.bi()))}__(){return this.l_}static u_(){return new Ni(null)}}function q_(n,e){return n.weight>e.weight?n:e}class X_{constructor(e,t,s,r){this.no=0,this.c_=null,this.d_=[],this.al=null,this.hl=null,this.f_=new J_,this.p_=new Map,this.v_=Ni.u_(),this.m_=!0,this.w_=new Dt,this.g_=new Dt,this.M_=new Dt,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){_n(this.ul,e),this.V_(),this.T_()}hr(e,t){_n(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=Ti(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()||!Fa(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=Oa(this.no-e,0,this.no),s=Oa(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 Ra(e,t+this.ys.rightOffset))}wu(e){const t=new Ra(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(Ni.u_());const e=this.Y_(),t=this.no/this.k_,s=this.P_+e,r=new Ra(s-t+1,s);this.bu(new Ni(r))}U_(){const e=Oa(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 G_(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,Cg(t.o_(),this.v_.o_())||this.w_.p(),Cg(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 Ng,jg,Sg,Td,Eg;(function(n){n[n.OnTouchEnd=0]="OnTouchEnd",n[n.OnNextTap=1]="OnNextTap"})(Ng||(Ng={}));class e6{constructor(e,t,s){this.ku=[],this.Tu=[],this.no=0,this.Ru=null,this.Du=new Dt,this.Vu=new Dt,this.Iu=null,this.Bu=e,this.ys=t,this.Yo=s,this.cl=new t_(this.ys.layout.colorParsers),this.Au=new e_(this),this.uh=new X_(this,t.timeScale,this.ys.localization,s),this.Ct=new h_(this,t.crosshair),this.Eu=new $_(t.crosshair),this.zu(0),this.ku[0].po(2e3),this.Lu=this.Ou(0),this.Nu=this.Ou(1)}Bh(){this.Wu(Ft.gn())}ar(){this.Wu(Ft.wn())}Xh(){this.Wu(new Ft(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){_n(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 _n(this.ys,{leftPriceScale:t}),r.uo({leftPriceScale:t}),this.Du.p(),void this.Bh();if(e==="right")return _n(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&&(qt(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;qt(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){qt(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=bx(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 _g}(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);qt(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=Ft.wn();e.rn(),this.Wu(e)}wc(e){const t=Ft.wn();t.ln(e),this.Wu(t)}cn(){const e=Ft.wn();e.cn(),this.Wu(e)}dn(e){const t=Ft.wn();t.dn(e),this.Wu(t)}fn(e){const t=Ft.wn();t.fn(e),this.Wu(t)}_n(e){const t=Ft.wn();t._n(e),this.Wu(t)}hn(){const e=Ft.wn();e.hn(),this.Wu(e)}gc(){return this.ys.rightPriceScale.visible?"right":"left"}Mc(e,t){if(qt(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(qt(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 _g(this.uh,this);this.ku.push(t);const s=Ft.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 Ft(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),kc(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 Id(n){return!Di(n)&&!no(n)}function kx(n){return Di(n)}(function(n){n[n.Disabled=0]="Disabled",n[n.Continuous=1]="Continuous",n[n.OnDataUpdate=2]="OnDataUpdate"})(jg||(jg={})),function(n){n[n.LastBar=0]="LastBar",n[n.LastVisible=1]="LastVisible"}(Sg||(Sg={})),function(n){n.Solid="solid",n.VerticalGradient="gradient"}(Td||(Td={})),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"}(Eg||(Eg={}));const Mg=n=>n.getUTCFullYear();function t6(n,e,t){return e.replace(/yyyy/g,(s=>Ts(Mg(s),4))(n)).replace(/yy/g,(s=>Ts(Mg(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=>Ts((r=>r.getUTCMonth()+1)(s),2))(n)).replace(/dd/g,(s=>Ts((r=>r.getUTCDate())(s),2))(n))}class _x{constructor(e="yyyy-MM-dd",t="default"){this.yc=e,this.Pc=t}jo(e){return t6(e,this.yc,this.Pc)}}class n6{constructor(e){this.kc=e||"%h:%m:%s"}jo(e){return this.kc.replace("%h",Ts(e.getUTCHours(),2)).replace("%m",Ts(e.getUTCMinutes(),2)).replace("%s",Ts(e.getUTCSeconds(),2))}}const s6={Tc:"yyyy-MM-dd",Rc:"%h:%m:%s",Dc:" ",Vc:"default"};class r6{constructor(e={}){const t={...s6,...e};this.Ic=new _x(t.Tc,t.Vc),this.Bc=new n6(t.Rc),this.Ac=t.Dc}jo(e){return`${this.Ic.jo(e)}${this.Ac}${this.Bc.jo(e)}`}}function jl(n){return 60*n*60*1e3}function Ih(n){return 60*n*1e3}const Sl=[{Ec:(Dg=1,1e3*Dg),zc:10},{Ec:Ih(1),zc:20},{Ec:Ih(5),zc:21},{Ec:Ih(30),zc:22},{Ec:jl(1),zc:30},{Ec:jl(3),zc:31},{Ec:jl(6),zc:32},{Ec:jl(12),zc:33}];var Dg;function Tg(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=Sl.length-1;t>=0;--t)if(Math.floor(e.getTime()/Sl[t].Ec)!==Math.floor(n.getTime()/Sl[t].Ec))return Sl[t].zc;return 0}function Lh(n){let e=n;if(no(n)&&(e=wf(n)),!Id(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 Ig(n){if(!kx(n))throw new Error("time must be of type isUTCTimestamp");return{Lc:n}}function wf(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 Lg(n){no(n.time)&&(n.time=wf(n.time))}class Ag{options(){return this.ys}setOptions(e){this.ys=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(t){t.forEach(Lg)}(e):Lg(e)}createConverterToInternalObj(e){return me(function(t){return t.length===0?null:Id(t[0].time)||no(t[0].time)?Lh:Ig}(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 kx(t=e)?Ig(t):Id(t)?Lh(t):Lh(wf(t));var t}updateFormatter(e){if(!this.ys)return;const t=e.dateFormat;this.ys.timeScale.timeVisible?this.Nc=new r6({Tc:t,Rc:this.ys.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Dc:" ",Vc:e.locale}):this.Nc=new _x(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(q_,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=Tg(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=Tg(new Date(1e3*s[0].time.Lc),f)}})(e,t)}static Wc(e){return _n({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}const Ii=typeof window<"u";function Og(){return!!Ii&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function Ah(){return!!Ii&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function Ld(n){return n+n%2}function i6(n){Ii&&window.chrome!==void 0&&n.addEventListener("mousedown",e=>{if(e.button===1)return e.preventDefault(),!1})}class Nc{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=!Ah(),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(is(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(is(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=Oh(e.changedTouches,me(this.fd));if(t===null||(this.dd=El(e),this.ad!==null)||this._d)return;this.od=!0;const s=this.xd(is(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),gi(e)}}}Ud(e){if(e.button!==0)return;const t=this.xd(is(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=Oh(e.changedTouches,me(this.fd));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.fd=null,this.dd=El(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(is(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&&gi(e));this.$c===0&&gi(e),e.touches.length===0&&this.Zc&&(this.Zc=!1,gi(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),Og()&&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(is(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=El(e);const s=this.Dd.ownerDocument.documentElement;this.Qc=!1,this.Gc=!1,this._d=!1,this.Xc=is(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=is(t))}Qd(e){if(e.button!==0)return;const t=this.Dd.ownerDocument.documentElement;Og()&&t.addEventListener("mouseleave",this.vd),this.Jc=!1,this.Kc=is(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=is(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})}Ah()&&(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}),i6(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=Rg(e.touches[0],e.touches[1])/this.ld;this.yd.rf(this.ad,t),gi(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=Rg(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=!Ah()}Gd(e){const t=Oh(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:El(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"&&gi(e)}}}}function Rg(n,e){const t=n.clientX-e.clientX,s=n.clientY-e.clientY;return Math.sqrt(t*t+s*s)}function gi(n){n.cancelable&&n.preventDefault()}function is(n){return{_t:n.pageX,ut:n.pageY}}function El(n){return n.timeStamp||performance.now()}function Oh(n,e){for(let t=0;t<n.length;++t)if(n[t].identifier===e)return n[t];return null}class a6{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 Nc(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=Oa(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 Rh(n,e){return n.jf-e.jf}function Ph(n,e,t){const s=(n.jf-e.jf)/(n.wt-e.wt);return Math.sign(s)*Math.min(Math.abs(s),t)}class o6{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=Ph(this.Zf,this.Kf,this.sp),a=Rh(this.Zf,this.Kf),l=[r],u=[a];if(s+=a,this.Xf!==null){const f=Ph(this.Kf,this.Xf,this.sp);if(Math.sign(f)===Math.sign(r)){const p=Rh(this.Kf,this.Xf);if(l.push(f),u.push(p),s+=p,this.Gf!==null){const g=Ph(this.Xf,this.Gf,this.sp);if(Math.sign(g)===Math.sign(r)){const y=Rh(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 l6{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 Vr(n,e){const t=me(n.ownerDocument).createElement("canvas");n.appendChild(t);const s=Kk(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 $r(n){var e;n.width=1,n.height=1,(e=n.getContext("2d"))==null||e.clearRect(0,0,1,1)}function Ad(n,e,t,s){n.ih&&n.ih(e,t,s)}function $l(n,e,t,s){n.nt(e,t,s)}function Od(n,e,t,s){const r=n(t,s);for(const a of r){const l=a.Tt(s);l!==null&&e(l)}}function zh(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 Pg(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 E=r;E<n.length;E++)n[E].Fi(n[E].Wi()+e*C);l-=C}}else r=u,l=e===1?y-p-g:g-(y+p)}}class zg{constructor(e,t,s,r){this.Yi=null,this.mp=null,this.wp=!1,this.gp=new sc(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=zh("normal",r),this.Tp=zh("top",r),this.Rp=zh("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=Vr(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=Vr(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 Nc(this.Vp.canvasElement,u,{Wd:()=>!this.ys.handleScroll.vertTouchDrag,Fd:()=>!0})}m(){this.wf.m(),this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),$r(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),$r(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 Ld(Math.ceil(t.S+t.C+t.I+t.B+5+d))}Np(e){this.mp!==null&&Rr(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=zr(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=zr(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?wc(e,0,0,s,r,l):hx(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)}Pg(r,1,this.mp.height,t),Pg(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 nc(this._l.fontSize,this._l.fontFamily)}}function c6(n,e){var t;return((t=n.Jh)==null?void 0:t.call(n,e))??[]}function Bg(n,e){var t;return((t=n.Ws)==null?void 0:t.call(n,e))??[]}function Vg(n,e){var t;return((t=n.us)==null?void 0:t.call(n,e))??[]}function u6(n,e){var t;return((t=n.Kh)==null?void 0:t.call(n,e))??[]}class bf{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 Dt,this.nv=new Dt,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=Vr(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=Vr(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 Nc(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),$r(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),$r(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(bf.prototype.uv.bind(this),this,!0),this.pv(),this._p.Sf().indexOf(this)===this._p.Sf().length-1?(this.Qp=this.Qp??new l6(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:bx(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){Rr(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=zr(this.Dp,t);r!==null&&(r.useBitmapCoordinateSpace(a=>{this.Up(a)}),this._v&&(this.Bv(r,c6),this.Av(r),this.Bv(r,Bg),this.Bv(r,Vg)))}this.Vp.applySuggestedBitmapSize();const s=zr(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,u6),this.Bv(s,Vg))}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?wc(e,0,0,s,r,u):hx(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,Bg,$l,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,Ad,l);for(const l of r)this.Ov(e,t,Ad,l);for(const l of a)this.Ov(e,t,$l,l);for(const l of r)this.Ov(e,t,$l,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;Od(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 zg(this,e.N(),r,"left"),this.dv.appendChild(this.Gp.Rf())),s&&this.Jp===null&&(this.Jp=new zg(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 o6(.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 $g{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=Vr(this.Pf,at({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp)}m(){this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),$r(this.Dp.canvasElement),this.Dp.dispose()}Rf(){return this.Pf}Df(){return this.mp}Np(e){Rr(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=zr(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}){wc(e,0,0,t.width,t.height,this.qv())}}function kf(n){return e=>{var t;return((t=e.ia)==null?void 0:t.call(e,n))??[]}}const h6=kf("normal"),d6=kf("top"),f6=kf("bottom");class p6{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 Dt,this.gp=new sc(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=Vr(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=Vr(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 Nc(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),$r(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),$r(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){Rr(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=zr(this.Dp,t);r!==null&&(r.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a),this.lm(r,f6)}),this.Yp(r),this.lm(r,h6)),this.Yv!==null&&this.Yv.Fp(e),this.jv!==null&&this.jv.Fp(e)}this.Vp.applySuggestedBitmapSize();const s=zr(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,d6))}lm(e,t){const s=this._p.Qt().js();for(const r of s)Od(t,a=>Ad(a,e,!1,void 0),r,void 0);for(const r of s)Od(t,a=>$l(a,e,!1,void 0),r,void 0)}Up({context:e,bitmapSize:t}){wc(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 nc(this.W(),this.ys.fontFamily)}dm(){return nc(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 sc,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 $g("left",t,s,r,a),this.Xv.appendChild(this.Yv.Rf())),t.rightPriceScale.visible&&this.jv===null&&(this.jv=new $g("right",t,s,r,a),this.Gv.appendChild(this.jv.Rf()))}}var F1;const m6=!!Ii&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(n=>n.brand.includes("Chromium"))&&!!Ii&&((F1=navigator==null?void 0:navigator.userAgentData)!=null&&F1.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class g6{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 Dt,this.nv=new Dt,this.Vu=new Dt,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),Bh(this.ys)&&this.km(!0),this.ts=new e6(this.Bu.bind(this),this.ys,s),this.Qt().ju().i(this.Tm.bind(this),this),this.Rm=new p6(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(Ft.gn(),performance.now()):this.ts.Bh()}Fp(e){e===void 0&&(e=Ft.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=Bh(this.ys);this.ts.hr(e);const s=Bh(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 dn(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=Ld(t),s=Ld(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 E=this.fm[C];E.vv(this.ts.$s()[C]);let S=0,I=0;I=C===this.fm.length-1?Math.ceil((y-k)*_)/_:Math.round(E.fo()*w*_)/_,S=Math.max(I,2),k+=S,E.Np(at({width:l,height:S})),this.Um()&&E.Vv(t,"left"),this.$m()&&E.Vv(s,"right"),E.Wf()&&this.ts.Zu(E.Wf(),S)}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 m6?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=dn(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 bf(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 a6(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 Cc?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 Bh(n){return!!(n.handleScroll.mouseWheel||n.handleScale.mouseWheel)}function v6(n){return n.open===void 0&&n.value===void 0}function x6(n){return function(e){return e.open!==void 0}(n)||function(e){return e.value!==void 0}(n)}function Fg(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 y6(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 w6(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 b6(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 k6(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 _6(n,e,t,s,r){const a=dn(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 Na(n){return n.Ft!==void 0}function Hg(n,e){return e.customValues!==void 0&&(n.uw=e.customValues),n}function Tr(n){return(e,t,s,r,a,l)=>function(u,d){return d?d(u):v6(u)}(s,l)?Hg({wt:e,Re:t,ew:r},s):Hg(n(e,t,s,r,a),s)}function Ug(n){return{Candlestick:Tr(k6),Bar:Tr(b6),Area:Tr(y6),Baseline:Tr(w6),Histogram:Tr(Fg),Line:Tr(Fg),Custom:Tr(_6)}[n]}function Wg(n){return{Re:0,cw:new Map,Hh:n}}function Yg(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 Qg(n){let e;return n.forEach(t=>{e===void 0&&(e=t.ew)}),dn(e)}class C6{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=Ug(e.Rr()),g=e.da(),y=e.pa();l=t.map((w,k)=>{const _=f(w.time),C=this.Yo.key(_);let E=this.pw.get(C);E===void 0&&(E=Wg(_),this.pw.set(C,E),r=!0);const S=p(_,E.Re,w,d[k],g,y);return E.cw.set(e,S),S})}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:Qg(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=Yg(d,p),y=Yg(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=Wg(a),this.pw.set(this.Yo.key(a),u));const f=Ug(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:Na(y),yw:s};if(!d)return this.Cw(e,-1,w);const k={timeWeight:0,time:u.Hh,pointData:u,originalTime:Qg(u.cw)},_=Ti(this.gw,this.Yo.key(k.time),(C,E)=>this.Yo.key(C.time)<E);this.gw.splice(_,0,k);for(let C=_;C<this.gw.length;++C)Vh(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)?Na(t)&&s.push(t):Na(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=Ti(r,s,(l,u)=>l.Re<u);Na(t)?r[a]=t:r.splice(a,1)}xw(e,t){t.length!==0?(this.mw.set(e,t.filter(Na)),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,Vh(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)Vh(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 Vh(n,e){n.Re=e,n.cw.forEach(t=>{t.Re=e})}function N6(n,e){return n.wt<e}function j6(n,e){return e<n.wt}function S6(n,e,t){const s=e.Uh(),r=e.bi(),a=Ti(n,s,N6),l=vx(n,r,j6);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 Cx{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=S6(this.zw,s,this.Ow),this.qw(e,t,r.Ft),this.Yw())}}class E6{constructor(e,t){this.jw=e,this.Yi=t}nt(e,t,s){this.jw.draw(e,this.Yi,t,s)}}class M6 extends Cx{constructor(e,t,s){super(e,t,!1),this.sh=s,this.Ww=new E6(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,Md(this.Lw))}Yw(){this.sh.update({bars:this.zw.map(D6),barSpacing:this.Qn.At().Q_(),visibleRange:this.Lw},this.Jn.N())}}function D6(n){return{x:n._t,time:n.wt,originalData:n.Zw,barColor:n.cr}}const T6={color:"#2196f3"},I6=(n,e,t)=>{const s=Ar(t);return new M6(n,e,s)};function _f(n){const e={value:n.Ft[3],time:n.ew};return n.uw!==void 0&&(e.customValues=n.uw),e}function Kg(n){const e=_f(n);return n.R!==void 0&&(e.color=n.R),e}function L6(n){const e=_f(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 A6(n){const e=_f(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 Nx(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 O6(n){const e=Nx(n);return n.R!==void 0&&(e.color=n.R),e}function R6(n){const e=Nx(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 Rd(n){return{Area:L6,Line:Kg,Baseline:A6,Histogram:Kg,Bar:O6,Candlestick:R6,Custom:P6}[n]}function P6(n){const e=n.ew;return{...n.se,time:e}}const z6={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},B6={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},V6={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:cx,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},$h={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},$6={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 Zg(){return{width:0,height:0,autoSize:!1,layout:V6,crosshair:z6,grid:B6,overlayPriceScales:{...$h},leftPriceScale:{...$h,visible:!1},rightPriceScale:{...$h,visible:!0},timeScale:$6,localization:{locale:Ii?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 jx{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 kc(this.Kw)?this.bf.Hm(this.Kw):0}Yi(){return me(this.bf.Qt().qu(this.Kw,this.Xw)).Wt}}class F6{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&&(qt(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 jx(this.bf,e,this.paneIndex())}}const H6={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class Gg{constructor(e){this.ir=e}applyOptions(e){this.ir.hr(e)}options(){return this.ir.N()}Qw(){return this.ir}}class U6{constructor(e,t,s,r,a,l){this.tg=new Dt,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 Ni(new Ra(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:Rd(this.seriesType())(s)}data(){const e=Rd(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 Ds(this.Jn.N())}priceScale(){return this.sg.priceScale(this.Jn.Wt().wa(),this.getPane().paneIndex())}createPriceLine(e){const t=_n(Ds(H6),e),s=this.Jn.Oh(t);return new Gg(s)}removePriceLine(e){this.Jn.Nh(e.Qw())}priceLines(){return this.Jn.Wh().map(e=>new Gg(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 W6{constructor(e,t,s){this.ag=new Dt,this.g_=new Dt,this.Kv=new Dt,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){qt(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{...Ds(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 Y6(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 Jg(n){return function(e){if(bl(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;bl(s)&&(e.handleScale.axisPressedMouseMove={time:s,price:s}),bl(r)&&(e.handleScale.axisDoubleClickReset={time:r,price:r})}const t=e.handleScroll;bl(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(n),n}class Q6{constructor(e,t,s){this.ug=new Map,this.cg=new Map,this.dg=new Dt,this.fg=new Dt,this.pg=new Dt,this.ku=new WeakMap,this.vg=new C6(t);const r=s===void 0?Ds(Zg()):_n(Ds(Zg()),Jg(s));this.mg=t,this.bf=new g6(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 W6(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:{...T6,...a.defaultOptions()},Mg:I6,bg:a}))(Ar(e));return this.xg(r,t,s)}addSeries(e,t={},s=0){return this.xg(e,t,s)}removeSeries(e){const t=dn(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 jx(this.bf,e,t)}timeScale(){return this.gg}applyOptions(e){this.bf.hr(Jg(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){qt(e.Mg!==void 0),Y6(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=_n(Ds(qk),Ds(e.defaultOptions),t),a=e.Mg,l=new Cc(this.bf.Qt(),e.type,r,a,e.bg);this.bf.Qt().dc(l,s);const u=new U6(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 dn(this.cg.get(e))}wg(e){const t=new Map;e.lw.forEach((r,a)=>{const l=a.Rr(),u=Rd(l)(r);if(l!=="Custom")qt(x6(u));else{const d=a.pa();qt(!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 F6(this.bf,s=>this.yg(s),e,this),this.ku.set(e,t)),t}}function K6(n){if(no(n)){const e=document.getElementById(n);return qt(e!==null,`Cannot find element in DOM with id=${n}`),e}return n}function Z6(n,e,t){const s=K6(n),r=new Q6(s,e,t);return e.setOptions(r.options()),r}function G6(n,e){return Z6(n,new Ag,Ag.Wc(e))}class Sx extends Cx{constructor(e,t){super(e,t,!0)}qw(e,t,s){t.j_(this.zw,Md(this.Lw)),e.Dl(this.zw,s,Md(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 Ex(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[E,S]=J6(e,_-1,_);u.bezierCurveTo(E._t*d,E.ut*f,S._t*d,S.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 qg=6;function Fh(n,e){return{_t:n._t-e._t,ut:n.ut-e.ut}}function Xg(n,e){return{_t:n._t/e,ut:n.ut/e}}function J6(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=Xg(Fh(n[t],n[s]),qg),{_t:a._t+l._t,ut:a.ut+l.ut}),Fh(n[t],Xg(Fh(n[r],n[e]),qg))]}function q6(n,e){const t=n.context;t.strokeStyle=e,t.stroke()}class X6 extends gr{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,Br(f,u),f.lineJoin="round";const p=this.Vg.bind(this);a!==void 0&&Ex(e,t,a,s,r,p,q6),d&&function(g,y,w,k,_){if(k.to-k.from<=0)return;const{horizontalPixelRatio:C,verticalPixelRatio:E,context:S}=g;let I=null;const O=Math.max(1,Math.floor(C))%2/2,R=w*E+O;for(let Z=k.to-1;Z>=k.from;--Z){const M=y[Z];if(M){const A=_(g,M);A!==I&&(S.beginPath(),I!==null&&S.fill(),S.fillStyle=A,I=A);const H=Math.round(M._t*C)+O,J=M.ut*E;S.moveTo(H,J),S.arc(H,J,R,0,2*Math.PI)}}S.fill()}(e,t,d,s,p)}}class eC extends X6{Vg(e,t){return t.vt}}function tC(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 nC=class extends gr{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,Br(f,l),f.lineWidth=1,Ex(e,t,u,s,r,this.Wg.bind(this),tC.bind(null,d))}};class sC{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 E=Oa((_-w)/(k-w),0,1);C.addColorStop(E,a),C.addColorStop(E,l)}C.addColorStop(1,u),this.Kg=C,this.Hg=t}return this.Kg}}let rC=class extends nC{constructor(){super(...arguments),this.Xg=new sC}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 iC extends Sx{constructor(e,t){super(e,t),this.Ww=new ux,this.tM=new rC,this.iM=new eC,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 aC={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 iC(n,e)};let oC=class extends gr{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 lC extends Sx{constructor(){super(...arguments),this.Ww=new oC}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 cC={type:"Histogram",isBuiltIn:!0,defaultOptions:{color:"#26a69a",base:0},Mg:(n,e)=>new lC(n,e)},uC=({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=G6(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:E}=w,S=y.addSeries(C,_,0);S.setData(k),E&&S.priceScale().applyOptions(E),u.current.push(S)}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 E=C.seriesData.get(w);if(!(E&&"value"in E))throw new Error("value not in data");const S=w.priceToCoordinate(E.value);let I=C.point.x-0;if(S===null)return;I=Math.max(0,Math.min(y.clientWidth-d.current.clientWidth,I));const O=5,R=S-d.current.clientHeight-O>0?S-d.current.clientHeight-O:Math.max(0,Math.min(y.clientHeight-d.current.clientHeight-O,S+O));p({show:!0,left:I+"px",top:R+"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})})]})})},e1=864e5,t1=n=>new Date(n).getTime(),hC=({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
277
+ 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})]})]})},dC=({data:n,...e})=>{const[t,s]=v.useState(0),{darkMode:r}=fs(),a=v.useMemo(()=>{const l=t1(n.from_day);let u=Array.from({length:n.count_days}).map((d,f)=>({day:new Date(l+f*e1).toISOString()}));return Object.entries(n.days).forEach(([d,f])=>{u[(t1(d)-l)/e1]=f}),console.log({arr:u}),{chart:{fitContent:!0,options:{crosshair:{mode:Dd.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:Td.Solid},textColor:r?"#d1d5db":"#374151"}}},tooltip:{component:hC},series:[{definition:aC,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:cC,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(uC,{className:" bg-pink-700",config:a,...e},String(r))},fC=({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
278
+ cursor-pointer ${s} ${r} `,children:n,...t})},pC=({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(fC,{label:`Last ${s} days`,selected:n==s,onClick:()=>t(s)},s))})},mC=864e5,gC=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)}},vC=({label:n,value:e,...t})=>c.jsxs("div",{className:`p-1 pl-2 px-1 rounded-full border shelf-border-color
279
+ cursor-pointer
280
+ bg-kf-400 text-white
281
+ dark:bg-kf-800/20
282
+ w-fit max-w-full h-fit
283
+ flex flex-row justify-between gap-3 text-sm shadow-lg
284
+ hover:scale-[1.04] duration-75 transition-transform`,...t,children:[c.jsx("span",{children:n,className:`whitespace-nowrap --flex-0 max-w-[80%]
285
+ overflow-x-hidden hover:overflow-x-auto`}),c.jsx("span",{children:e,className:`rounded-full bg-white --flex-shrink-0
286
+ text-pink-500 px-2 font-semibold`})]}),Ml=({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(qe,{rounded:"rounded-xl",stroke:"border-2",className:"shadow-md dark:shadow-xl",children:c.jsxs("div",{className:`w-56 h-52
287
+ shelf-plain-card-fill
288
+ rounded-xl px-3 pt-2
289
+ flex flex-col`,children:[c.jsxs("div",{className:"text-gray-500 text-base border-b shelf-border-color pb-2",children:[c.jsx(i4,{className:`inline text-2xl rounded-md
290
+ text-kf-400 bg-white/50
291
+ dark:text-kf-400 dark:bg-white/10
292
+ border border-kf-500/25 p-px`}),c.jsx("div",{children:t,className:`p-1 tracking-wider font-mono
293
+ bg-pink-50 text-pink-500
294
+ dark:bg-pink-50/10 dark:text-pink-500
295
+ font-semibold h-20 mx-1
296
+ rounded-md --border text-sm inline`})]}),c.jsx(ke,{show:n.length,children:c.jsx("div",{className:`w-full rounded-lg flex flex-row flex-wrap
297
+ gap-1 py-3 flex-1 overflow-clip hover:overflow-y-auto
298
+ overflow-x-hidden content-start`,children:n.map(([u,d],f)=>c.jsx(Ut,{to:s(u,d),draggable:"false",className:"w-full",children:c.jsx(vC,{label:a(u,d),value:String(r(u,d))})},u))})}),c.jsx(ke,{show:!n.length,children:c.jsx("p",{className:`w-full h-full flex flex-row items-center justify-center
299
+ --text-gray-300 text-3xl text-center font-semibold
300
+ whitespace-pre-wrap text-transparent bg-clip-text
301
+ bg-gradient-to-b from-gray-200 to-gray-500`,children:`Not enough
302
+ data
303
+ :-)`})})]})}),xC=({...n})=>{const{sdk:e}=wt(),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}}=B3(),w=v.useCallback(async E=>{if(p(void 0),!(E===a&&s))try{const S=`statistics_orders_latest_span_${E}`,I=await g(S);I&&(r(I),d(!1));const O=await e.statistics.orders(Date.now()-E*mC,Date.now());y(S,O),r(O)}catch(S){p(S)}finally{d(!1)}},[s,e,g,y,a]),k=v.useCallback(E=>{l(E),w(E)},[w]);v.useEffect(()=>{t.current||(t.current=!0,k(a))},[k,a]);const _=v.useMemo(()=>{if(s!==void 0)return gC(s)},[s]),C=u?"Loading ...":f?String(f):s===void 0?"Not enough data...":void 0;return c.jsxs("div",{...n,children:[c.jsx(ke,{show:C,children:c.jsx("div",{className:`w-full h-fit p-10 border-4 border-dashed
304
+ shelf-border-color rounded-lg flex
305
+ flex-row justify-center items-center
306
+ text-2xl text-gray-400 animate-pulse`,children:C})}),c.jsx(ke,{show:_&&s&&!C,children:c.jsxs("div",{className:"w-full h-fit",children:[c.jsx(pC,{onChange:k,span:a}),c.jsx(dC,{data:s,className:"w-full max-w-screen-md h-[200px] mt-5"}),c.jsx(mt,{className:"my-5"}),c.jsxs("div",{className:`w-full h-fit flex flex-row justify-center
307
+ lg:justify-start flex-wrap mt-5 gap-5`,children:[c.jsx(Ml,{data:_==null?void 0:_.products,label:"products",labelFn:(E,S)=>S.title??E,valFn:(E,S)=>S.count??0,linkFn:(E,S)=>`/pages/products/${E}`}),c.jsx(Ml,{data:_==null?void 0:_.collections,label:"collections",valFn:(E,S)=>S.count??0,linkFn:(E,S)=>`/pages/collections/${E}`}),c.jsx(Ml,{data:_==null?void 0:_.discounts,label:"discounts",valFn:(E,S)=>S.count??0,linkFn:(E,S)=>`/pages/discounts/${E}`}),c.jsx(Ml,{data:_==null?void 0:_.tags,label:"tags",valFn:(E,S)=>S.count??0,linkFn:(E,S)=>`/pages/tags/${E.split("_")[0]}`})]})]})})]})},yC=({msg:n="",link:e="/admin",Icon:t})=>c.jsx(Ut,{to:e,className:"cursor-pointer",draggable:"false",children:c.jsx(qe,{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
308
+ border
309
+ rounded-lg max-h-[5rem]
310
+ 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(Zl,{className:"text-3xl text-kf-400"})]})})}),wC=({which_table:n,msg:e,link:t,search:s="",Icon:r})=>{const{sdk:a}=wt(),[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(Ut,{to:t,className:"cursor-pointer",draggable:"false",children:c.jsx(qe,{stroke:"border-2",rounded:"rounded-lg",className:`w-fit shadow-md hover:scale-105
311
+ transition-transform`,children:c.jsxs("div",{className:`shelf-plain-card-fill shelf-border-color
312
+ border rounded-lg max-h-[5rem]
313
+ 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
314
+ items-center shelf-text-label-color`,children:[l&&c.jsx("p",{children:l,className:"text-xl "}),c.jsx(Zl,{className:"text-2xl translate-x-2"})]})]})})})},bC=[{msg:"Add new Product",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/products/create"},{msg:"Create a new Collection",Icon:c.jsx(uv,{className:"text-pink-400 text-2xl"}),link:"/pages/collections/create"},{msg:"Create a new Store Front",Icon:c.jsx(cv,{className:"text-pink-400 text-2xl"}),link:"/pages/storefronts/create"},{msg:"Create an Order",Icon:c.jsx(q1,{className:"text-pink-400 text-2xl"}),link:"/pages/orders/create"},{msg:"Make a new Discount or Coupon",Icon:c.jsx(sv,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/create"},{msg:"Add a new Shipping method",Icon:c.jsx(hv,{className:"text-pink-400 text-3xl"}),link:"/pages/shipping-methods/create"},{msg:"See latest customers",Icon:c.jsx(nv,{className:"text-pink-400 text-3xl"}),link:"/pages/customers"},{msg:"Create reusable Tags",Icon:c.jsx(ev,{className:"text-pink-400 text-3xl"}),link:"/pages/tags/create"},{msg:"Write a Blog post",Icon:c.jsx(zb,{className:"text-pink-400 text-3xl"}),link:"/pages/posts/create"}],kC=[{msg:"customers",which_table:"customers",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/customers"},{msg:"products",which_table:"products",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/products"},{msg:"collections",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),which_table:"collections",link:"/pages/collections"},{msg:"unfulfilled orders",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/orders/q/search=fulfill:draft | fulfill:processing",which_table:"orders",search:"fulfill:draft | fulfill:processing"},{msg:"all time orders",which_table:"orders",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/orders"},{msg:"automatic discounts",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/q/search=app:automatic",which_table:"discounts",search:"app:automatic"},{msg:"coupons",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/discounts/q/search=app:manual",which_table:"discounts",search:"app:manual"},{msg:"storefronts",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),which_table:"storefronts",link:"/pages/storefronts"},{msg:"tags",which_table:"tags",Icon:c.jsx(Qn,{className:"text-pink-400 text-3xl"}),link:"/pages/tags"}],_C=({})=>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(Nh,{label:"Performance",Icon:g4,iconClassName:"text-2xl text-kf-500",className:"--mt-10 items-baseline"}),c.jsx(xC,{className:"relative w-full h-fit"}),c.jsx(Nh,{label:"Statistics",Icon:Fb,className:"mt-20 items-center"}),c.jsx("div",{className:"flex flex-row flex-wrap gap-5 justify-left mt-8",children:kC.map((n,e)=>c.jsx(wC,{...n},e))}),c.jsx(Nh,{label:"Quick Actions",Icon:pk,className:"mt-20 items-center"}),c.jsx("div",{className:"flex flex-row flex-wrap gap-5 justify-left mt-8",children:bC.map((n,e)=>c.jsx(yC,{...n},e))})]})}),Gn=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
315
+ flex flex-row justify-between items-center px-0 --border-t`,children:[c.jsx(Ut,{to:s,draggable:"false",className:"m-2",children:s&&c.jsx("div",{className:a?"animate-[wave_1.5s_ease-in-out_infinite]":"",children:c.jsx(u5,{from:"from-pink-500/60 dark:from-pink-600",to:"to-kf-500/60 dark:to-kf-500",className:"h-9 w-16 text-base rounded-lg",stroke:"border-2",children:"add",icon:c.jsx(m4,{className:`inline shelf-text-label-color
316
+ text-xl text-grey-800`})})})}),c.jsx(Ge,{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(dv,{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})]})})}),pn=({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
317
+ flex-row justify-between items-center px-3
318
+ ${r}`,children:[c.jsx(us,{Icon:c.jsx(Zl,{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
319
+ bg-slate-50 dark:bg-slate-800
320
+ --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(us,{Icon:c.jsx(Zl,{className:"scale-150"}),text:"",className:"text-lg cursor-pointer",onClick:n})]})},Cf=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(Ls,{ref:l,children:c.jsxs(pr,{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(Cn,{stroke:"border-b-2",btnClassName:"rounded-none",rounded:"rounded-none",children:"No",onClick:()=>l.current.hide()}),c.jsx(Cn,{stroke:"border-b-2",btnClassName:"rounded-none",rounded:"rounded-none",children:"Yes",onClick:d=>u(d)})]})]})})});function Mx(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 so=({to:n,current_state:e,next_state:t,onClick:s,...r})=>{const{navWithState:a}=Jn(),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(Ut,{to:n,onClick:l,...r})},Jn=()=>{const n=Hr(),e=Is(),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}};function CC(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)}function NC(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:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}}]})(n)}const Fl=(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))})},jC="pr-3 py-2 max-w-[18rem] --overflow-clip --hover:overflow-x-auto inline-block whitespace-nowrap",pt=({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})})},Dx=({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:`${jC} ${t}`,children:u,...l})},qn=({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(Ev,{type:n.type,onWheel:y=>y.target.blur(),className:u,value:e??"",onChange:g,...p})},n1=({value:n,field:e,onChange:t,setError:s,...r})=>{const a=v.useCallback(async()=>{const l=await bd();console.log(l),l&&t(l)},[t,bd]);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
321
+ shelf-text-label-color
322
+ dark:bg-kf-50/10 p-1 rounded-md
323
+ text-sm font-medium tracking-wider`,onClick:a})}),c.jsx(qe,{className:"w-full h-fit mt-2",children:c.jsx(Fe,{field:e,value:n,onChange:t,className:"w-full h-10"})})]})},jc=({value:n,field:e,onChange:t,context:s,setError:r,...a})=>{const l=v.useCallback(async()=>{const u=s.query.title.get(),d=tg(n)??tg(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
324
+ shelf-text-label-color
325
+ dark:bg-kf-50/10 p-1 rounded-md
326
+ text-sm font-medium tracking-wider`,onClick:l})}),c.jsx(qe,{className:"w-full h-fit mt-2",children:c.jsx(Fe,{field:e,value:n,onChange:t,className:"w-full h-10"})})]})},ro=({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
327
+ 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})})},Nf=({value:n,config:e=1,process_before_copy:t=s=>s})=>{const[s,r]=v.useState(!1),a=v.useCallback(()=>{r(!0),kd(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(Mx,{className:`text-lg cursor-pointer text-gray-500
328
+ 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},E=v.useMemo(()=>s?c.jsx(Nf,{value:JSON.stringify(a)}):null,[s,a]);return c.jsx(pr,{id:"card",name:k,error:f,..._,border:t,desc:w,rightView:E,setError:p,children:c.jsx(n,{field:C,value:a,onChange:u,disabled:l,children:d,error:f,setError:p,context:g,...e})})},mn=({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 gap-3 items-center text-center flex-shrink-0
329
+ justify-end text-base overflow-clip w-fit --mx-auto px-3 shelf-body-bg h-14`,children:[!(n!=null&&n.editDocumentUrl)&&(n==null?void 0:n.viewDocumentUrl)&&c.jsx(Ut,{to:n.viewDocumentUrl(u),children:c.jsx(r4,{className:" text-xl text-teal-600 --stroke-[0.5px] hover:stroke-[1px]"})}),(n==null?void 0:n.linkExternalUrl)&&c.jsx("a",{href:(n==null?void 0:n.linkExternalUrl(u))??"",target:"_blank",children:c.jsx(NC,{className:" text-xl"})}),(n==null?void 0:n.editDocumentUrl)&&c.jsx(so,{to:n.editDocumentUrl(u),draggable:"false",current_state:()=>(n==null?void 0:n.getState)&&(n==null?void 0:n.getState()),children:c.jsx(Xb,{title:"edit",className:`text-2xl text-pink-500 cursor-pointer
330
+ --stroke-0 hover:stroke-1`})}),(n==null?void 0:n.deleteDocument)&&c.jsx(Xa,{title:"delete",Icon:c.jsx(Jd,{className:"text-xl scale-125 text-kf-500 --outline-8"}),loading:a,className:"px-0 py-0 border-0 cursor-pointer",onClick:d}),c.jsx(xf.PortalChild,{children:c.jsx(Cf,{ref:r,onApprove:f,title:c.jsxs("p",{className:"text-xl flex flex-row items-center gap-3 cursor-pointer",children:[c.jsx(qd,{className:"text-2xl"})," Warning"]})})})]})},or=({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
331
+ py-0 border shelf-border-color-blend px-2 rounded-full whitespace-nowrap
332
+ hover:scale-105 transition-transform inline-block
333
+ ${e} ${a}`,children:l,...r})},Tx=n=>{switch(n){case"draft":return"bg-gray-400 dark:bg-gray-400/40";case"processing":return"bg-red-500 dark:bg-red-500/40";case"shipped":return"bg-green-600 dark:bg-green-600/40";case"fulfilled":return"bg-black dark:bg-black/40";default:return"bg-pink-400 dark:bg-pink-400/40"}},SC=n=>{switch(n){case"unpaid":return"bg-gray-400 dark:bg-gray-400/40";case"authorized":return"bg-green-700/50 dark:bg-green-500/40";case"captured":return"bg-green-600 dark:bg-green-600/40";case"requires_auth":return"bg-kf-400/70 dark:bg-kf-400/40";case"voided":return"bg-malibu-500 dark:bg-malibu-500/40";case"failed":return"bg-red-400 dark:bg-red-400/40";case"partially_paid":return"bg-cyan-400 dark:bg-cyan-400/40";case"refunded":return"bg-teal-500 dark:bg-teal-500/40";case"partially_refunded":return"bg-teal-800/50 dark:bg-teal-400/40";default:return"bg-pink-400 dark:bg-pink-400/40"}},EC=({...n})=>c.jsx("div",{...n,children:c.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[c.jsx(Ut,{to:"/pages/orders",draggable:"false",children:c.jsx(or,{value:"all",className:"border shelf-border-color",bgColor:"bg-pink-400 dark:bg-pink-400/40"})}),Object.values(Sd).map(e=>c.jsx(Ut,{draggable:"false",to:`/pages/orders/q/search=fulfill:${e.name2}`,children:c.jsx(or,{value:e.name2,className:"border shelf-border-color",bgColor:Tx(e.name2)})},e.id)),Object.values(Ed).map(e=>c.jsx(Ut,{draggable:"false",to:`/pages/orders/q/search=payment:${e.name2}`,children:c.jsx(or,{value:e.name,className:"border shelf-border-color",bgColor:SC(e.name2)})},e.id))]})}),gn=(n,e=n,t=!1,s=Ri)=>{const{query_params:r}=fn(),a=v.useMemo(()=>{const A=new URLSearchParams(r);return{query_api:e3(A),search:A.get("search")??""}},[r]),l=Is(),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:E,query:S}}=mr(n,s,t);v.useEffect(()=>{var A;(A=u.current)==null||A.setSearch(a.search),S({...a.query_api,vql:a.search},d.current)},[a,S]);const I=v.useCallback(async(A=!0)=>{const{endBefore:H,endAt:J,startAfter:ae,startAt:Ne,limitToLast:Ee,...we}=a.query_api,te=u.current.getSearch();d.current=!1;const B={...we,limit:5,vql:te};return A?l(`${e}/q/${kn(B).toString()}&search=${te}`,{replace:!0}):await S(B),B},[l,S,e,a]),O=v.useCallback((A,H=!0)=>{const{limit:J,limitToLast:ae}=a.query_api,Ne={...a,limit:J?A:void 0,limitToLast:ae?A:void 0},Ee=u.current.getSearch();return H?l(`${e}/q/${kn(Ne).toString()}&search=${Ee}`):S(Ne),Ne},[l,S,e,a,p]),R=v.useCallback(async(A=!0)=>{const H=p==null?void 0:p.at(-1),{endBefore:J,endAt:ae,startAfter:Ne,startAt:Ee,limit:we,limitToLast:te,...B}=a.query_api,q=u.current.getSearch(),K={...B,startAfter:[["updated_at",H.updated_at],["id",H.id]],vql:q,limit:we||te};return await dr(k,n,K)==0||(A?l(`${e}/q/${kn(K).toString()}&search=${q}`):await S(K,!0)),K},[l,S,p,a,e,n]),Z=v.useCallback(async(A=!0)=>{const H=p==null?void 0:p.at(0),{endBefore:J,endAt:ae,startAfter:Ne,startAt:Ee,limit:we,limitToLast:te,...B}=a.query_api,q=u.current.getSearch(),K={...B,endBefore:[["updated_at",H.updated_at],["id",H.id]],vql:q,limitToLast:te||we};return await dr(k,n,K)==0||(A?l(`${e}/q/${kn(K).toString()}&search=${q}`):await S(K,!0)),K},[l,S,p,a,e]),M=v.useMemo(()=>({viewDocumentUrl:A=>`${e}/${A}/view`,editDocumentUrl:A=>`${e}/${A}`,deleteDocument:E}),[E,e]);return{resource:n,query_api:a.query_api,ref_actions:u,context:M,pages:f,page:p,loading:g,hasLoaded:y,resource_is_probably_empty:C,error:w,queryCount:_,actions:{onLimitChange:O,onReload:I,prev:Z,next:R}}},MC=(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))},DC=({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)=>{const y=g==e.length-1;let w="w-32";return y&&(w=""),c.jsx("td",{className:" font-light font-mono text-ellipsis overflow-clip hover:overflow-x-scroll "+(g==0?"px-3 text-left ":g<e.length-1?"px-3 text-center":"px-0 text-right right-0 sticky z-10 --w-0 --shelf-body-bg opacity-80 h-14 flex flex-row justify-end items-center"),children:c.jsx("div",{className:"--overflow-x-scroll "+w,children:c.jsx(p.comp,{context:{item:u,...n},field:p,value:MC(p.key,u,p.transform),...p.comp_params})})},g)})});return c.jsxs("table",{className:r+" --table-fixed table-auto",children:[c.jsx("thead",{children:c.jsx("tr",{className:`border-b border-b-gray-300
334
+ dark:border-gray-300/25 h-10 text-xs font-inter
335
+ text-gray-400`,children:e.map((u,d)=>{const f=d==e.length-1;let p="w-32";return f&&(p=""),c.jsx("th",{className:"text-ellipsis "+(d==0?"text-left --px-3":d<e.length-1?"text-center px-3":"text-right px-0 sticky right-0 "),children:c.jsx("div",{className:"px-3 text-ellipsis "+p,children:u.name})},d)})})}),c.jsx("tbody",{children:t.map((u,d)=>c.jsx(l,{item:u},d))})]})},en=({context:n,fields:e,data:t,recordClassName:s=`bg-white dark:bg-white/5
336
+ 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(DC,{context:n,fields:e,data:t,recordClassName:s,className:"w-full bg-re-400 whitespace-nowrap"})})}),TC=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"})]})]}),tn=({resource:n,should_onboard:e=!1,hasLoaded:t=!0,overallCollectionCount:s})=>c.jsxs("div",{className:"",children:[c.jsx(ke,{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(_a,{children:"Welcome"}),c.jsx(_a,{children:"👋",className:"animate-waving-hand"}),c.jsx(_a,{children:"to your empty"})]}),c.jsx(Ia,{children:n,className:`bg-gradient-to-r from-kf-500 to-pink-500
337
+ dark:from-kf-600 dark:to-pink-500
338
+ uppercase font-extrabold italic tracking-tighter
339
+ -translate-x-2
340
+ text-5xl font-inter inline-flex`}),c.jsx(_a,{children:"let's create something ",className:"animate-fadein"})]}),c.jsx(TC,{className:`w-[150px] scale-[3.0] duration-300 transition-transform
341
+ translate-x-[75px] translate-y-[55px] -rotate-[30deg] overflow-clip
342
+ opacity-30 right-0 top-0 flex-shrink-0 absolute`})]})}),c.jsx(ke,{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(Ia,{children:n.slice(0,3),className:`bg-gradient-to-r from-kf-600 to-pink-500
343
+ dark:from-kf-600 dark:to-pink-500 --text-5xl
344
+ uppercase font-medium italic tracking-tighter
345
+ inline-flex --tracking-wide`}),c.jsx(Ia,{children:n.slice(3),className:`bg-gradient-to-r from-pink-600 to-pink-500
346
+ dark:from-pink-600 dark:to-pink-500 --text-5xl
347
+ uppercase font-extralight italic tracking-tighter --hidden --text-[34px]
348
+ -translate-x-[3px]
349
+ inline-flex --tracking-wide`})]}),s!==void 0&&c.jsx(_a,{children:`${Math.max(s??0,0)} items`,className:t?"animate-fadein":"opacity-0"})]})})]}),IC=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"},LC=[{key:"contact",name:"Customer",comp:({context:n,value:e})=>c.jsx(Lt,{value:IC(n==null?void 0:n.item),className:"max-w-20 flex-shrink"})},{key:"pricing.total",name:"Price",comp:pt,comp_params:{className:"shelf-text-label-color font-semibold"}},{key:"id",name:"Order ID",comp:pt,comp_params:{className:"text-gray-500 font-semibold",extra:"max-w-[4rem]"}},{key:"status.fulfillment",name:"Status",comp:or,comp_params:{bgColor:n=>Tx(n==null?void 0:n.name2),label:n=>n==null?void 0:n.name.split(" ")[0]}},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn}],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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsx(EC,{className:"mt-5"}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
350
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,reload:g,ref:t,createLink:"/pages/orders/create",searchTitle:"Search by ID, status, date, customer info...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:LC}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},AC=n=>n,ps=({tags:n=[],name_fn:e=AC,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
351
+ text-white gap-1 ${t}`,children:n.map((l,u)=>c.jsxs("div",{className:`flex flex-row items-center border shelf-border-color-blend
352
+ rounded-2xl w-fit max-w-full px-0.5 py-0 --m-1 font-medium
353
+ ${s}`,children:[c.jsx("button",{children:e(l),onClick:()=>a(l),className:`mx-1 max-w-full overflow-x-auto py-0
354
+ hover:scrollbar-thin scrollbar-none cursor-pointer
355
+ whitespace-nowrap --underline --decoration-double
356
+ decoration-white/60
357
+ --underline-offset-[1px] --border-b --border-dashed `}),r&&c.jsx(Gd,{className:"text-lg cursor-pointer flex-shrink-0",onClick:d=>{d.stopPropagation(),r&&r(l)}})]},u))}):null,Ix=n=>(n==null?void 0:n.title)??(n==null?void 0:n.handle)??(n==null?void 0:n.id)??"unknown",Lx=n=>n??[],io=({onSelect:n,header:e,resource:t,limit:s=100,layout:r=0,add_all:a=!1,transform_fn:l=Lx,name_fn:u=Ix,className:d,clsHeader:f,clsReload:p,...g})=>{const y="---",w="ALL",[k,_]=v.useState(y),{page:C,loading:E,actions:{query:S}}=mr(t,Ri,!1),I=v.useMemo(()=>l(C).sort((M,A)=>{var H;return((H=u(M))==null?void 0:H.localeCompare(u(A)))??0}),[C,l,u]);v.useEffect(()=>{S({limit:s},!0).catch(M=>{console.log(M),S({limit:s},!1)})},[s,S]);const O=v.useCallback(()=>{S({limit:s},!1)},[S,s]),R=v.useCallback(M=>{const A=M.target.value;if(A===y)return;if(A===w){_(w),n(w);return}const H=parseInt(A);_(H),n(I[H])},[I,y,n]),Z=({className:M=""})=>c.jsxs("select",{name:"limit",onChange:R,value:k,className:`h-10 px-1 w-full
358
+ shelf-input-color
359
+ rounded-md text-sm
360
+ focus:outline-none
361
+ ${M}`,children:[c.jsx("option",{value:y,children:y}),a&&c.jsx("option",{value:w,children:w}),I.map((A,H)=>c.jsx("option",{value:H,children:u(A)},H))]});return c.jsxs("div",{className:d,children:[c.jsx(ke,{show:r==0,children:c.jsxs("div",{className:`flex flex-row justify-between
362
+ items-center gap-3`,children:[c.jsx("p",{children:e,className:f}),c.jsx(qe,{children:c.jsx(Z,{})}),c.jsx(z0,{className:`cursor-pointer ${p}
363
+ ${E?"animate-spin":""}`,onClick:O})]})}),c.jsxs(ke,{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(z0,{className:`cursor-pointer --h-6 --w-6 flex-shrink-0
364
+ ${p} ${E?"animate-spin":""}`,onClick:O})]}),c.jsx("div",{className:"flex flex-row items-center gap-3 mt-2",children:c.jsx(qe,{className:"w-full",children:c.jsx(Z,{})})})]})]})},Ea=({field:n,context:e,value:t,onChange:s,resource:r,add_all:a=!1,transform_fn:l=Lx,name_fn:u=Ix,slug:d,label:f="Select",className:p,...g})=>{const{navWithState:y}=Jn(),[w,k]=v.useState(Array.isArray(t)?t:[]),_=v.useCallback(S=>{if(console.log({t:S,tags:w}),w.find(O=>O.id===S.id||O.handle===S.handle))return;const I=[...w,S];console.log("new_tags",I),s(I),k(I)},[w,s]),C=v.useCallback(S=>{const I=w.filter(O=>O.id!==S.id);s(I),k(I)},[w,s]),E=v.useCallback(S=>{if(S==="ALL")return;const I=S.handle??S.id;y(`${d}/${I}`,e==null?void 0:e.getState())},[y,e,r,d]);return c.jsxs("div",{className:p,children:[c.jsx(io,{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(mt,{className:"my-5"}),c.jsx(ps,{tags:w,onClick:E,onRemove:C,name_fn:u,clsCapsule:"bg-kf-500 dark:bg-kf-500/60",className:"--mt-3"})]})},OC=({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(io,{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(mt,{className:"w-full mt-5"}),c.jsx("p",{children:"Method",className:"mt-2 shelf-text-minor"}),c.jsx(Ge,{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(Ge,{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"})})]})},RC=({field:n,value:e,onChange:t,...s})=>{v.useRef(void 0);const{comp_params:r}=n,[a,l]=v.useState(e??[]),u=Is(),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(io,{resource:"discounts",layout:1,className:"mt-3",transform_fn:g=>g.filter(y=>y.application.id==Mi.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"})]})},Ax=({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:_}}=mr(n),C=v.useCallback(R=>{d(Z=>[R,...Z.filter(M=>M.id!==R.id)]),l(!1)},[]),E=v.useCallback(R=>{d(Z=>Z.filter(M=>M.id!==R.id))},[]),S=v.useMemo(()=>g.reduce((R,Z)=>[...R,...Z],[]),[g]),I=v.useRef(void 0),O=v.useCallback(R=>{R==null||R.preventDefault();const Z=I.current.value;_({limit:f,vql:Z})},[f,_]);return v.useCallback(R=>{r()},[]),c.jsxs("div",{onClick:R=>R.stopPropagation(),className:`w-full m-3 md:w-[35rem] h-3/4
365
+ shelf-plain-card-soft
366
+ rounded-xl p-3 sm:p-5 border shadow-lg gap-5
367
+ 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:O,className:"w-full",onFocus:()=>l(!0),tabIndex:4344,children:c.jsx(qe,{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
368
+ shelf-border-color-soft px-3 text-base
369
+ focus:outline-none rounded-xl`}),c.jsx(vd,{className:`text-white text-4xl mx-1 sm:mx-5
370
+ cursor-pointer`,onClick:O})]})})}),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
371
+ ${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
372
+ overflow-y-auto`,children:[c.jsx(ke,{show:u.length==0,children:c.jsxs("div",{className:`text-xl sm:text-3xl font-medium text-gray-400
373
+ h-full flex flex-col justify-center
374
+ items-center gap-5`,children:["No Selected items, ",c.jsx("br",{}),"Tap the Search box",c.jsx(vd,{className:`text-inherit text-5xl opacity-50
375
+ mx-5 cursor-pointer`,onClick:O})]})}),u.map((R,Z)=>c.jsxs("div",{className:`w-full h-14 sm:h-14 p-3 border-b shelf-border-color-soft
376
+ flex flex-row justify-between items-center
377
+ gap-3`,children:[c.jsx(t,{data:R}),c.jsx($a,{onClick:()=>E(R),className:`h-6 w-9 pl-3 border-l shelf-border-color-soft
378
+ cursor-pointer`})]},R.id))]}),c.jsxs("div",{className:"self-end flex flex-row gap-5",children:[c.jsx(Cn,{stroke:"border-2",className:"opacity-60",children:"cancel",onClick:r}),c.jsx(Cn,{stroke:"border-2",children:"save",onClick:()=>s(u)})]})]}),c.jsxs("div",{className:`flex flex-col gap-5 absolute inset-0 w-full h-full
379
+ --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($a,{className:`h-6 w-9 pl-3 border-l
380
+ shelf-border-color-soft cursor-pointer`,onClick:()=>l(!1)})]}),c.jsx(qe,{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
381
+ overflow-y-auto `,children:[c.jsx(ke,{show:S.length==0&&!y,children:c.jsxs("div",{className:`text-3xl font-medium text-gray-400 h-full
382
+ flex justify-center items-center`,children:["No search Results ",c.jsx("br",{}),"were found ",c.jsx("br",{})," :()"]})}),S.map((R,Z)=>c.jsx("div",{className:`w-full h-14 sm:h-14 p-3 border-b shelf-border-color-soft
383
+ cursor-pointer`,onClick:()=>C(R),children:c.jsx(t,{data:R})},`sr_${R.id}`)),c.jsx(us,{text:"Load more",onClick:()=>k().catch(R=>{}),keep_text_on_load:!0,className:`w-fit mx-auto h-12 p-3 border-b cursor-pointer
384
+ shelf-border-color-soft
385
+ text-center text-pink-500 font-medium text-base`})]})})]})]})]})},PC=({data:n})=>c.jsxs("div",{className:`w-full h-full flex flex-row justify-between
386
+ items-center text-sm gap-3`,children:[c.jsx("span",{className:`text-base overflow-hidden hover:overflow-auto
387
+ whitespace-nowrap h-full
388
+ 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
389
+ overflow-x-auto whitespace-normal h-full
390
+ flex flex-row items-center`,children:`(${n.auth_id})`})]}),zC=({data:n})=>c.jsxs("div",{className:`w-full h-full flex flex-row justify-between
391
+ items-center gap-3 text-sm `,children:[c.jsx("span",{className:`overflow-hidden hover:overflow-auto
392
+ text-sm whitespace-nowrap h-full
393
+ flex flex-row items-center
394
+ pr-1`,children:n.title}),c.jsx("span",{className:"text-gray-500 whitespace-nowrap flex-shrink-0",children:`(${n.qty} In stock)`})]}),BC=({onSave:n,onCancel:e})=>c.jsx(Ax,{resource:"customers",Comp:PC,onSave:n,onCancel:e,title:"Browse Customers"}),ao=({onSave:n,onCancel:e})=>c.jsx(Ax,{resource:"products",Comp:zC,onSave:n,onCancel:e,title:"Browse Products"}),VC=({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 rounded-md ",children:c.jsxs("table",{className:"w-full border-collapse text-left border shelf-border-color border-dashed",children:[c.jsx("thead",{className:"w-full",children:c.jsxs("tr",{className:"w-full",children:[c.jsx("th",{children:"Product",className:"pl-1 pt-1"}),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:"w-full border-b shelf-border-color border-dashed",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
395
+ scrollbar-thin`,children:[c.jsx(so,{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
396
+ 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(qe,{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($a,{onClick:f=>s(l,a),className:`h-6 w-9 pl-3 border-l shelf-border-color
397
+ cursor-pointer`})})]},l)})})]})})},$C=({field:n,value:e,onChange:t,context:s,error:r,setError:a,...l})=>{const{sdk:u}=wt(),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);v.useCallback(()=>{const S=d.current.value,I=parseFloat(f.current.value),O=parseInt(p.current.value);S&&I&&O&&y(R=>[...R,{id:S,title:S,price:I,qty:O,source:"manual",data:void 0}])},[]);const k=v.useCallback(S=>{const I=S.map(O=>({id:O.handle,price:O.price,qty:1,title:O.title,data:O,stock_reserved:0}));y(O=>[...I.filter(R=>O.find(Z=>Z.id===R.id)===void 0),...O]),w.current.hide()},[]),_=v.useCallback((S,I)=>{if(I.stock_reserved&&I.qty>0){a(`${I.id} has reserved ${I.stock_reserved} items,
398
+ please return the stock before removing :)`);return}y(O=>O.filter((R,Z)=>S!==Z))},[]),C=v.useCallback(async(S,I,O)=>{if(I==="change-qty")g[S].qty=parseInt(O),y([...g]);else if(I==="stock-change"){const R=g[S],Z=R.stock_reserved&&g[S].stock_reserved>0,M=Z?R.stock_reserved:-R.qty;try{await u.products.changeStockOfBy(R.id,M),g[S].stock_reserved=Z?0:R.qty,y([...g])}catch(A){switch(A.code){case"doc-not-exists":a("Product does not exist in inventory");break;case"out-of-bounds":a(`Not enough items of ${R.id} in stock to reduce`);break;default:a("Unknown error, try again later");break}console.error(A)}}},[g]);v.useEffect(()=>{e!==g&&t&&t(g)},[g,t,e]);const E=v.useMemo(()=>g.reduce((S,I)=>S+I.price*I.qty,0),[g]);return c.jsxs("div",{...l,children:[c.jsx(Cn,{children:"Browse products",className:"text-sm h-10 w-40 mx-auto cursor-pointer",from:"from-pink-500/60 dark:from-pink-600",to:"to-kf-500/60 dark:to-kf-500",onClick:()=>w.current.show()}),c.jsx(Ls,{ref:w,children:c.jsx(ao,{onSave:k,onCancel:()=>w.current.hide()})}),c.jsx(VC,{items:g,context:s,onRemoveItem:_,onChangeItem:C}),c.jsxs("p",{className:"mt-5 --text-gray-400 text-lg font-semibold ",children:["Sub-Total: ",c.jsx("span",{className:"font-semibold",children:E})]})]})},Dl=({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(so,{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"})]}),FC=({field:n,context:e,setError:t,value:s,onChange:r,...a})=>{var y,w;const{sdk:l}=wt(),[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(Dl,{title:"SubTotal",value:(u==null?void 0:u.subtotal_undiscounted)??0}),c.jsx(Dl,{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(Dl,{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(Dl,{title:`${k.name} (tax)`,value:k.value,description:k.description,context:e},k.name))]}),c.jsx(mt,{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
399
+ shelf-text-label-color cursor-pointer`,onClick:g})]}),c.jsx(Ge,{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"})]})},HC=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"},Xn=({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:HC(a)}),a<n.length-1&&c.jsx("span",{children:e,className:`text-4xl text-pink-400 text-pink-400/50
400
+ break-inside-avoid`})]},a))}),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(Ms,{Icon:c.jsx(D5,{}),text:"save",keep_text_on_load:!0,show:!!n,onClick:n}),c.jsx(Ms,{Icon:c.jsx(rv,{}),text:"create",keep_text_on_load:!0,show:!!e,onClick:e}),c.jsx(Ms,{Icon:c.jsx(CC,{}),text:"duplicate",show:!!s,onClick:s}),c.jsx(Ms,{Icon:c.jsx(Jb,{}),text:"reload",show:!!r,keep_text_on_load:!0,onClick:r}),l]}),c.jsx(ke,{show:!!t,children:c.jsx(qe,{stroke:"border-2",className:"h-fit",rounded:"rounded-full",children:c.jsx(Xa,{className:`h-6 px-2
401
+ bg-slate-50 dark:bg-slate-800
402
+ text-gray-600 dark:text-gray-400
403
+ rounded-full text-base font-semibold tracking-tight`,Icon:c.jsx(Jd,{className:"--text-red-500 text-base"}),loading:f,text:"delete",keep_text_on_load:!0,show:!!t,onClick:g})})})]}),c.jsx(Cf,{ref:d,onApprove:y,title:c.jsxs("p",{className:`text-xl flex
404
+ flex-row items-center gap-3`,children:[c.jsx(qd,{className:"text-2xl"}),"Warning"]})})]})},ac=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"]},Sn=({error:n,positive:e=!1,className:t,...s})=>{const[r,a]=v.useState(!1),l=v.useMemo(()=>ac(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(qe,{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
405
+ to-slate-50 dark:to-slate-800
406
+ from-slate-50 dark:from-slate-800 w-full`,children:[c.jsx(Yb,{className:`text-xl absolute right-2 top-2
407
+ 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))})]})})})},UC=({value:n})=>{const[e,t]=v.useState(!1),s=v.useCallback(r=>{t(!0),kd(n),setTimeout(()=>t(!1),2e3)},[n,kd]);return c.jsxs(c.Fragment,{children:[c.jsx(Mx,{className:`text-base cursor-pointer text-gray-500
408
+ hover:text-gray-800 dark:hover:text-gray-400
409
+ 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}=wt(),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()+`
410
+ (last updated)`,f="exported @ ";return e==="discounts"&&(f="collection @ "),u||(f=""),c.jsx(ke,{show:n,children:c.jsxs("div",{className:`w-full flex flex-row justify-between text-sm
411
+ 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
412
+ dark:bg-kf-50/20 dark:text-kf-300
413
+ w-fit
414
+ rounded-lg px-1 font-light`}),c.jsx(ke,{show:e==="discounts",children:c.jsx(Ut,{to:`/pages/collections/discount-${n==null?void 0:n.handle}`,draggable:"false",children:c.jsx(pt,{className:"w-full max-w-[30rem] underline",children:u})})}),c.jsx(ke,{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(pt,{className:"w-full max-w-[30rem] underline",children:u})}),c.jsx(UC,{value:u})]})})]}),c.jsx("div",{className:"whitespace-pre-line text-right font-semibold",children:d})]})})};var WC=Object.create,jf=Object.defineProperty,YC=Object.getOwnPropertyDescriptor,Ox=Object.getOwnPropertyNames,QC=Object.getPrototypeOf,KC=Object.prototype.hasOwnProperty,Sf=(n,e)=>function(){return e||(0,n[Ox(n)[0]])((e={exports:{}}).exports,e),e.exports},ZC=(n,e)=>{for(var t in e)jf(n,t,{get:e[t],enumerable:!0})},GC=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ox(e))!KC.call(n,r)&&r!==t&&jf(n,r,{get:()=>e[r],enumerable:!(s=YC(e,r))||s.enumerable});return n},JC=(n,e,t)=>(t=n!=null?WC(QC(n)):{},GC(!n||!n.__esModule?jf(t,"default",{value:n,enumerable:!0}):t,n)),qC=Sf({"node_modules/is-object/index.js"(n,e){e.exports=function(s){return typeof s=="object"&&s!==null}}}),XC=Sf({"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}}}),e8=Sf({"node_modules/is-dom/index.js"(n,e){var t=qC(),s=XC();function r(a){return!t(a)||!s(window)||typeof window.Node!="function"?!1:typeof a.nodeType=="number"&&typeof a.nodeName=="string"}e.exports=r}}),oc={};ZC(oc,{chromeDark:()=>Rx,chromeLight:()=>Px});var Rx={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"},Px={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"},zx=v.createContext([{},()=>{}]),Hh={WebkitTouchCallout:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",OUserSelect:"none",userSelect:"none"},Hl=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,...Hh},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`}:{},...Hh},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,...Hh}}),Pd="chromeLight",Bx=v.createContext(Hl(oc[Pd])),Nn=n=>v.useContext(Bx)[n],Ef=n=>({theme:t=Pd,...s})=>{const r=v.useMemo(()=>{switch(Object.prototype.toString.call(t)){case"[object String]":return Hl(oc[t]);case"[object Object]":return Hl(t);default:return Hl(oc[Pd])}},[t]);return X.createElement(Bx.Provider,{value:r},X.createElement(n,{...s}))},t8=({expanded:n,styles:e})=>X.createElement("span",{style:{...e.base,...n?e.expanded:e.collapsed}},"▶"),n8=v.memo(n=>{n={expanded:!0,nodeRenderer:({name:p})=>X.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=Nn("TreeNode"),f=r;return X.createElement("li",{"aria-expanded":e,role:"treeitem",style:d.treeNodeBase,title:a},X.createElement("div",{style:d.treeNodePreviewContainer,onClick:t},l||v.Children.count(s)>0?X.createElement(t8,{expanded:e,styles:d.treeNodeArrow}):u&&X.createElement("span",{style:d.treeNodePlaceholder}," "),X.createElement(f,{...n})),X.createElement("ol",{role:"group",style:d.treeNodeChildNodesContainer},e?s:void 0))}),lc="$",r1="*";function Ul(n,e){return!e(n).next().done}var s8=n=>Array.from({length:n},(e,t)=>[lc].concat(Array.from({length:t},()=>"*")).join(".")),r8=(n,e,t,s,r)=>{const a=[].concat(s8(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)Ul(p,e)&&(w===lc||w===r1)&&f(p,lc,y+1);else if(w===r1)for(const{name:k,data:_}of e(p))Ul(_,e)&&f(_,`${g}.${k}`,y+1);else{const k=p[w];Ul(k,e)&&f(k,`${g}.${w}`,y+1)}};f(n,"",0)}),l.reduce((u,d)=>(u[d]=!0,u),{...r})},Vx=v.memo(n=>{const{data:e,dataIterator:t,path:s,depth:r,nodeRenderer:a}=n,[l,u]=v.useContext(zx),d=Ul(e,t),f=!!l[s],p=v.useCallback(()=>d&&u(g=>({...g,[s]:!f})),[d,u,s,f]);return X.createElement(n8,{expanded:f,onClick:p,shouldShowArrow:d,shouldShowPlaceholder:r>0,nodeRenderer:a,...n},f?[...t(e)].map(({name:g,data:y,...w})=>X.createElement(Vx,{name:g,data:y,depth:r+1,path:`${s}.${g}`,key:g,dataIterator:t,nodeRenderer:a,...w})):null)}),$x=v.memo(({name:n,data:e,dataIterator:t,nodeRenderer:s,expandPaths:r,expandLevel:a})=>{const l=Nn("TreeView"),u=v.useState({}),[,d]=u;return v.useLayoutEffect(()=>d(f=>r8(e,t,r,a,f)),[e,t,r,a]),X.createElement(zx.Provider,{value:u},X.createElement("ol",{role:"tree",style:l.treeViewOutline},X.createElement(Vx,{name:n,data:e,dataIterator:t,depth:0,path:lc,nodeRenderer:s})))}),Mf=({name:n,dimmed:e=!1,styles:t={}})=>{const s=Nn("ObjectName"),r={...s.base,...e?s.dimmed:{},...t};return X.createElement("span",{style:r},n)},Pa=({object:n,styles:e})=>{const t=Nn("ObjectValue"),s=r=>({...t[r],...e});switch(typeof n){case"bigint":return X.createElement("span",{style:s("objectValueNumber")},String(n),"n");case"number":return X.createElement("span",{style:s("objectValueNumber")},String(n));case"string":return X.createElement("span",{style:s("objectValueString")},'"',n,'"');case"boolean":return X.createElement("span",{style:s("objectValueBoolean")},String(n));case"undefined":return X.createElement("span",{style:s("objectValueUndefined")},"undefined");case"object":return n===null?X.createElement("span",{style:s("objectValueNull")},"null"):n instanceof Date?X.createElement("span",null,n.toString()):n instanceof RegExp?X.createElement("span",{style:s("objectValueRegExp")},n.toString()):Array.isArray(n)?X.createElement("span",null,`Array(${n.length})`):n.constructor?typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)?X.createElement("span",null,`Buffer[${n.length}]`):X.createElement("span",null,n.constructor.name):X.createElement("span",null,"Object");case"function":return X.createElement("span",null,X.createElement("span",{style:s("objectValueFunctionPrefix")},"ƒ "),X.createElement("span",{style:s("objectValueFunctionName")},n.name,"()"));case"symbol":return X.createElement("span",{style:s("objectValueSymbol")},n.toString());default:return X.createElement("span",null)}},Fx=Object.prototype.hasOwnProperty,i8=Object.prototype.propertyIsEnumerable;function zd(n,e){const t=Object.getOwnPropertyDescriptor(n,e);if(t.get)try{return t.get()}catch{return t.get}return n[e]}function i1(n,e){return n.length===0?[]:n.slice(1).reduce((t,s)=>t.concat([e,s]),[n[0]])}var Bd=({data:n})=>{const e=Nn("ObjectPreview"),t=n;if(typeof t!="object"||t===null||t instanceof Date||t instanceof RegExp)return X.createElement(Pa,{object:t});if(Array.isArray(t)){const s=e.arrayMaxProperties,r=t.slice(0,s).map((l,u)=>X.createElement(Pa,{key:u,object:l}));t.length>s&&r.push(X.createElement("span",{key:"ellipsis"},"…"));const a=t.length;return X.createElement(X.Fragment,null,X.createElement("span",{style:e.objectDescription},a===0?"":`(${a}) `),X.createElement("span",{style:e.preview},"[",i1(r,", "),"]"))}else{const s=e.objectMaxProperties,r=[];for(const l in t)if(Fx.call(t,l)){let u;r.length===s-1&&Object.keys(t).length>s&&(u=X.createElement("span",{key:"ellipsis"},"…"));const d=zd(t,l);if(r.push(X.createElement("span",{key:l},X.createElement(Mf,{name:l||'""'}),": ",X.createElement(Pa,{object:d}),u)),u)break}const a=t.constructor?t.constructor.name:"Object";return X.createElement(X.Fragment,null,X.createElement("span",{style:e.objectDescription},a==="Object"?"":`${a} `),X.createElement("span",{style:e.preview},"{",i1(r,", "),"}"))}},a8=({name:n,data:e})=>typeof n=="string"?X.createElement("span",null,X.createElement(Mf,{name:n}),X.createElement("span",null,": "),X.createElement(Bd,{data:e})):X.createElement(Bd,{data:e}),o8=({name:n,data:e,isNonenumerable:t=!1})=>{const s=e;return X.createElement("span",null,typeof n=="string"?X.createElement(Mf,{name:n,dimmed:t}):X.createElement(Bd,{data:n}),X.createElement("span",null,": "),X.createElement(Pa,{object:s}))},l8=(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(i8.call(s,u)){const d=zd(s,u);yield{name:u||'""',data:d}}else if(n){let d;try{d=zd(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})}},c8=({depth:n,name:e,data:t,isNonenumerable:s})=>n===0?X.createElement(a8,{name:e,data:t}):X.createElement(o8,{name:e,data:t,isNonenumerable:s}),u8=({showNonenumerable:n=!1,sortObjectKeys:e,nodeRenderer:t,...s})=>{const r=l8(n,e),a=t||c8;return X.createElement($x,{nodeRenderer:a,dataIterator:r,...s})},h8=Ef(u8);function d8(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 f8=({rows:n,columns:e,rowsData:t})=>{const s=Nn("TableInspectorDataContainer"),r=Nn("TableInspectorLeftBorder");return X.createElement("div",{style:s.div},X.createElement("table",{style:s.table},X.createElement("colgroup",null),X.createElement("tbody",null,n.map((a,l)=>X.createElement("tr",{key:a,style:s.tr},X.createElement("td",{style:{...s.td,...r.none}},a),e.map(u=>{const d=t[l];return typeof d=="object"&&d!==null&&Fx.call(d,u)?X.createElement("td",{key:u,style:{...s.td,...r.solid}},X.createElement(Pa,{object:d[u]})):X.createElement("td",{key:u,style:{...s.td,...r.solid}})}))))))},p8=n=>X.createElement("div",{style:{position:"absolute",top:1,right:0,bottom:1,display:"flex",alignItems:"center"}},n.children),m8=({sortAscending:n})=>{const e=Nn("TableInspectorSortIcon"),t=n?"▲":"▼";return X.createElement("div",{style:e},t)},a1=({sortAscending:n=!1,sorted:e=!1,onClick:t=void 0,borderStyle:s={},children:r,...a})=>{const l=Nn("TableInspectorTH"),[u,d]=v.useState(!1),f=v.useCallback(()=>d(!0),[]),p=v.useCallback(()=>d(!1),[]);return X.createElement("th",{...a,style:{...l.base,...s,...u?l.base[":hover"]:{}},onMouseEnter:f,onMouseLeave:p,onClick:t},X.createElement("div",{style:l.div},r),e&&X.createElement(p8,null,X.createElement(m8,{sortAscending:n})))},g8=({indexColumnText:n="(index)",columns:e=[],sorted:t,sortIndexColumn:s,sortColumn:r,sortAscending:a,onTHClick:l,onIndexTHClick:u})=>{const d=Nn("TableInspectorHeaderContainer"),f=Nn("TableInspectorLeftBorder");return X.createElement("div",{style:d.base},X.createElement("table",{style:d.table},X.createElement("tbody",null,X.createElement("tr",null,X.createElement(a1,{borderStyle:f.none,sorted:t&&s,sortAscending:a,onClick:u},n),e.map(p=>X.createElement(a1,{borderStyle:f.solid,key:p,sorted:t&&r===p,sortAscending:a,onClick:l.bind(null,p)},p))))))},v8=({data:n,columns:e})=>{const t=Nn("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 X.createElement("div",null);let{rowHeaders:p,colHeaders:g}=d8(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,E)=>(S,I)=>{const O=C(S),R=C(I),Z=typeof O,M=typeof R,A=(J,ae)=>J<ae?-1:J>ae?1:0;let H;if(Z===M)H=A(O,R);else{const J={string:0,number:1,object:2,symbol:3,boolean:4,undefined:5,function:6};H=A(J[Z],J[M])}return E||(H=-H),H},_=w.sort(k(C=>C[0],l)).map(C=>C[1]);p=_.map(C=>p[C]),y=_.map(C=>y[C])}return X.createElement("div",{style:t.base},X.createElement(g8,{columns:g,sorted:s,sortIndexColumn:r,sortColumn:a,sortAscending:l,onTHClick:f,onIndexTHClick:d}),X.createElement(f8,{rows:p,columns:g,rowsData:y}))},x8=Ef(v8),y8=80,Hx=n=>n.childNodes.length===0||n.childNodes.length===1&&n.childNodes[0].nodeType===Node.TEXT_NODE&&n.textContent.length<y8,w8=({tagName:n,attributes:e,styles:t})=>X.createElement("span",{style:t.base},"<",X.createElement("span",{style:t.tagName},n),(()=>{if(e){const s=[];for(let r=0;r<e.length;r++){const a=e[r];s.push(X.createElement("span",{key:r}," ",X.createElement("span",{style:t.htmlAttributeName},a.name),'="',X.createElement("span",{style:t.htmlAttributeValue},a.value),'"'))}return s}})(),">"),o1=({tagName:n,isChildNode:e=!1,styles:t})=>X.createElement("span",{style:Object.assign({},t.base,e&&t.offsetLeft)},"</",X.createElement("span",{style:t.tagName},n),">"),b8={1:"ELEMENT_NODE",3:"TEXT_NODE",7:"PROCESSING_INSTRUCTION_NODE",8:"COMMENT_NODE",9:"DOCUMENT_NODE",10:"DOCUMENT_TYPE_NODE",11:"DOCUMENT_FRAGMENT_NODE"},k8=({isCloseTag:n,data:e,expanded:t})=>{const s=Nn("DOMNodePreview");if(n)return X.createElement(o1,{styles:s.htmlCloseTag,isChildNode:!0,tagName:e.tagName});switch(e.nodeType){case Node.ELEMENT_NODE:return X.createElement("span",null,X.createElement(w8,{tagName:e.tagName,attributes:e.attributes,styles:s.htmlOpenTag}),Hx(e)?e.textContent:!t&&"…",!t&&X.createElement(o1,{tagName:e.tagName,styles:s.htmlCloseTag}));case Node.TEXT_NODE:return X.createElement("span",null,e.textContent);case Node.CDATA_SECTION_NODE:return X.createElement("span",null,"<![CDATA["+e.textContent+"]]>");case Node.COMMENT_NODE:return X.createElement("span",{style:s.htmlComment},"<!--",e.textContent,"-->");case Node.PROCESSING_INSTRUCTION_NODE:return X.createElement("span",null,e.nodeName);case Node.DOCUMENT_TYPE_NODE:return X.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 X.createElement("span",null,e.nodeName);case Node.DOCUMENT_FRAGMENT_NODE:return X.createElement("span",null,e.nodeName);default:return X.createElement("span",null,b8[e.nodeType])}},_8=function*(n){if(n&&n.childNodes){if(Hx(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})}},C8=n=>X.createElement($x,{nodeRenderer:k8,dataIterator:_8,...n}),N8=Ef(C8),j8=JC(e8()),S8=({table:n=!1,data:e,...t})=>n?X.createElement(x8,{data:e,...t}):(0,j8.default)(e)?X.createElement(N8,{data:e,...t}):X.createElement(h8,{data:e,...t});const Df=({value:n,...e})=>{const{darkMode:t}=fs();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?Rx:Px,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(Nf,{value:JSON.stringify(n)}),[n]);return c.jsx("div",{...t,children:c.jsx(pr,{className:"w-full h-fit",name:"JSON",desc:"View the RAW JSON data",rightView:s,children:c.jsx(Df,{value:n})})})},E8=({action:n,onClick:e})=>c.jsx(us,{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 "}),M8=({full_order:n,onCreate:e})=>{const{page:t}=mr("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
415
+ bg-slate-50 dark:bg-slate-800
416
+ 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(us,{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(D8,{})},D8=({})=>c.jsx("p",{className:"text-base",children:"To create a payment checkout, first save the order"}),T8=({field:n,value:e,onChange:t,setError:s,context:r,...a})=>{const{sdk:l}=wt(),{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((_=ac(C))==null?void 0:_.at(0))}},[e,p,t]),y=v.useCallback(async _=>{var C;try{const E=await l.payments.invokeAction(_.handle,p.id);t({...e,latest_status:E}),f(E)}catch(E){s((C=ac(E))==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(M8,{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(us,{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(mt,{className:""}),c.jsx("ul",{className:`flex md-view rounded-md
417
+ flex-col items-start mt-3 w-full h-fit
418
+ text-gray-500 text-base`,children:d.messages.map((_,C)=>c.jsx(Lt,{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(mt,{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(E8,{action:_,onClick:y},_.handle))}),c.jsx("a",{className:"underline w-fit text-base",children:"buy link",target:"_blank",href:k.toString()})]})]})},I8=({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(qe,{className:`shadow-md shadow-slate-300 dark:shadow-slate-800 ${s}`,rounded:"rounded-lg",children:c.jsxs("div",{className:`w-full relative rounded-lg
419
+ shelf-bling-fill
420
+ p-3 border
421
+ dark:border-slate-600`,children:[c.jsx("p",{children:"Key",className:""}),c.jsx(Ge,{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(Ge,{className:"mt-1",stroke:"border-b",onChange:a=>r("value",a),value:n.value,placeholder:"attribute value",type:"text"}),c.jsx(lv,{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
422
+ items-center gap-5`,children:[c.jsx(eo,{onClick:u,Icon:av,className:`cursor-pointer text-6xl hover:scale-110
423
+ transition-transform`}),a==null?void 0:a.map((p,g)=>c.jsx(I8,{attribute:p,className:"w-full",onDelete:()=>f(g),onChange:y=>d(g,y)},g))]})})},L8=n=>n==null?void 0:n.match(/\S+/g),A8=({onAdd:n,...e})=>{const t=v.useRef(null),s=v.useRef(null),r=v.useCallback(a=>{const l=L8(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(Ge,{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(Ge,{ref:s,placeholder:"values of the tag",type:"text",className:"mt-1 flex-1"}),c.jsx(Cn,{children:"add",className:"h-10 ",onClick:r})]})]})},Ux=({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(io,{transform_fn:d,name_fn:f=>f,onSelect:n,header:e,resource:"tags",limit:t,layout:s,className:r,clsHeader:a,clsReload:l,...u})},vr=({field:n,context:e,value:t=[],onChange:s,setError:r,...a})=>{const[l,u]=v.useState(t),{navWithState:d}=Jn(),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(A8,{onAdd:f}),c.jsx(mt,{className:"mt-5"}),c.jsx(Ux,{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(mt,{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 ls(){return ls=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},ls.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 Vd(n,e){return Vd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},Vd(n,e)}function st(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,Vd(n,e)}var Tl,O8=new Uint8Array(16);function R8(){if(!Tl&&(Tl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Tl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tl(O8)}const P8=/^(?:[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 z8(n){return typeof n=="string"&&P8.test(n)}var $t=[];for(var Uh=0;Uh<256;++Uh)$t.push((Uh+256).toString(16).substr(1));function B8(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=($t[n[e+0]]+$t[n[e+1]]+$t[n[e+2]]+$t[n[e+3]]+"-"+$t[n[e+4]]+$t[n[e+5]]+"-"+$t[n[e+6]]+$t[n[e+7]]+"-"+$t[n[e+8]]+$t[n[e+9]]+"-"+$t[n[e+10]]+$t[n[e+11]]+$t[n[e+12]]+$t[n[e+13]]+$t[n[e+14]]+$t[n[e+15]]).toLowerCase();if(!z8(t))throw TypeError("Stringified UUID is invalid");return t}function Ha(n,e,t){n=n||{};var s=n.random||(n.rng||R8)();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 B8(s)}function Tt(n){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+n.type})}function V8(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 $8(n){return v.createElement("div",{className:"tool-bar",style:n.style},n.children)}var Wh={exports:{}},l1;function F8(){return l1||(l1=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[_],E=arguments.length,S,I;if(C.fn){switch(C.once&&this.removeListener(f,C.fn,void 0,!0),E){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,S=new Array(E-1);I<E;I++)S[I-1]=arguments[I];C.fn.apply(C.context,S)}else{var O=C.length,R;for(I=0;I<O;I++)switch(C[I].once&&this.removeListener(f,C[I].fn,void 0,!0),E){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(!S)for(R=1,S=new Array(E-1);R<E;R++)S[R-1]=arguments[R];C[I].fn.apply(C[I].context,S)}}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=[],E=k.length;_<E;_++)(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}(Wh)),Wh.exports}var H8=F8(),Wx=function(n){st(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}(H8.EventEmitter),lr=new Wx;const U8={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"},W8={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 Y8=function(){function n(){this.langs={enUS:U8,zhCN:W8},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,lr.emit(lr.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,lr.emit(lr.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}(),nt=new Y8;function Ua(n){"@babel/helpers - typeof";return Ua=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},Ua(n)}function Q8(n,e){if(Ua(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var s=t.call(n,e);if(Ua(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function K8(n){var e=Q8(n,"string");return Ua(e)=="symbol"?e:e+""}function Z8(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,K8(s.key),s)}}function Yx(n,e,t){return e&&Z8(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}var _t=function(n){st(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},Yx(e,[{key:"editor",get:function(){return this.props.editor}},{key:"editorConfig",get:function(){return this.props.editorConfig}}]),e}(v.Component);_t.pluginName="";_t.align="left";_t.defaultConfig={};var $d=function(n){st(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}(_t);$d.pluginName="divider";var G8={start:0,end:0,text:""};function J8(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=q8(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.
424
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q8(n,e){if(n){if(typeof n=="string")return c1(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 c1(n,e)}}function c1(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 Tf(n){return n&&(n instanceof Promise||(typeof n=="object"||typeof n=="function")&&typeof n.then=="function")}function X8(n,e){for(var t="",s=e;s--;)t+=n;return t}function eN(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=J8(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 Yh(n,e){var t=n.split(`
425
+ `),s=n.substr(0,e).split(`
426
+ `),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 wi={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:[`
427
+ > `,`
428
+ `],inlinecode:["`","`"],code:["\n```\n","\n```\n"]};for(var Il=1;Il<=6;Il++)wi["h"+Il]=[`
429
+ `+X8("#",Il)+" ",`
430
+ `];function tN(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+=`
431
+ `+l.join("");return a.join("")+`
432
+ `+u.join("")+d}function u1(n,e){var t=e;if(t.substr(0,1)!==`
433
+ `&&(t=`
434
+ `+t),n==="unordered")return t.length>1?t.replace(/\n/g,`
435
+ * `).trim():"* ";var s=1;return t.length>1?t.replace(/\n/g,function(){return`
436
+ `+s+++". "}).trim():"1. "}function Qh(n,e){return{text:n,newBlock:e,selection:{start:n.length,end:n.length}}}function Fd(n,e,t){if(typeof wi[e]<"u")return{text:""+wi[e][0]+n+wi[e][1],selection:{start:wi[e][0].length,end:wi[e][0].length+n.length}};switch(e){case"tab":var s=t.tabMapValue===1?" ":" ".repeat(t.tabMapValue),r=s+n.replace(/\n/g,`
437
+ `+s),a=n.includes(`
438
+ `)?n.match(/\n/g).length:0;return{text:r,selection:{start:t.tabMapValue,end:t.tabMapValue*(a+1)+n.length}};case"unordered":return Qh(u1("unordered",n),!0);case"order":return Qh(u1("order",n),!0);case"hr":return Qh("---",!0);case"table":return{text:tN(t),newBlock:!0};case"image":return{text:"!["+(n||t.target)+"]("+(t.imageUrl||"")+")",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 Qx(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]=Qx(n[s],e[s]);return}t[s]=e[s]}),t}function nN(n){for(var e=ls({},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=Qx(e,a))}),e}function Kx(n,e){var t=Fd("","image",{target:"Uploading_"+Ha(),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(Fd("","image",{target:n.name,imageUrl:f}).text)},u=e(n,l);Tf(u)&&(a=!1,u.then(l))});return{placeholder:t,uploaded:s}}var h1={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"},sN=function(n){st(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),rN=function(n){st(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}(sN);function Kh(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=iN(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.
439
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iN(n,e){if(n){if(typeof n=="string")return d1(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 d1(n,e)}}function d1(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 bt=function(n){st(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 Wx,r.config=nN(h1,r.props.config,r.props),r.state={text:(r.props.value||r.props.defaultValue||"").replace(/↵/g,`
440
+ `),html:"",view:r.config.view||h1.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),lr.on(lr.EVENT_LANG_CHANGE,this.handleLocaleUpdate),nt.setUp()},t.componentWillUnmount=function(){lr.off(lr.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,`
441
+ `),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===$d.pluginName){a.push({comp:$d,config:{}});return}for(var w=Kh(e.plugins),k;!(k=w()).done;){var _=k.value;if(_.comp.pluginName===y){a.push(_);return}}},u=Kh(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"?Ha():g.comp.pluginName;p[g.comp.align].push(v.createElement(g.comp,{editor:r,editorConfig:r.config,config:ls({},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 Tf(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=Yh(f,p),y=function(){var S=d.value.substr(0,p-g.curLine.length)+d.value.substr(p);a.setText(S,void 0,{start:p-g.curLine.length,end:p-g.curLine.length}),r.preventDefault()},w=function(S){a.insertText(`
442
+ `+S,!1,{start:S.length+1,end:S.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 ls({},G8);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?ls({},a):{};if(r==="image"&&(u=ls({},u,{target:a.target||l.text||"",imageUrl:a.imageUrl||this.config.imageUrl})),r==="link"&&(u=ls({},u,{linkUrl:this.config.linkUrl})),r==="tab"&&l.start!==l.end){var d=this.getMdValue().slice(0,l.start).lastIndexOf(`
443
+ `)+1;this.setSelection({start:d,end:l.end})}var f=Fd(l.text,r,u),p=f.text,g=f.selection;if(f.newBlock){var y=Yh(this.getMdValue(),l.start),w=y.col,k=y.curLine;w>0&&k.length>0&&(p=`
444
+ `+p,g&&(g.start++,g.end++));var _=y.afterText;l.start!==l.end&&(_=Yh(this.getMdValue(),l.end).afterText),_.trim()!==""&&_.substr(0,2)!==`
445
+
446
+ `&&(_.substr(0,1)!==`
447
+ `&&(p+=`
448
+ `),p+=`
449
+ `)}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,`
450
+ `);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=Kh(this.keyboardListeners),l;!(l=a()).done;){var u=l.value;if(eN(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=ls({},this.state.view,r);this.setState({view:l},function(){a.emitter.emit(a.emitter.EVENT_VIEW_CHANGE,l)})},t.getView=function(){return ls({},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=Kx(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":_,E=p.autoFocus,S=p.placeholder,I=p.readOnly,O=this.config.canView&&this.config.canView.hideMenu&&!this.config.canView.menu,R=function(J){return r.state.plugins[J]||[]},Z=!!l.menu,M=g?g+"_md":void 0,A=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(V8,{visible:Z,left:R("left"),right:R("right")}),v.createElement("div",{className:"editor-container"},O&&v.createElement($8,null,v.createElement("span",{className:"button button-type-menu",title:Z?"hidden menu":"show menu",onClick:this.handleToggleMenu},v.createElement(Tt,{type:"expand-"+(Z?"less":"more")}))),v.createElement("section",{className:"section sec-md "+(l.md?"visible":"in-visible")},v.createElement("textarea",{id:M,ref:this.nodeMdText,name:C,autoFocus:E,placeholder:S,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:A,className:"section-container html-wrap",ref:this.nodeMdPreviewWrapper,onMouseOver:function(){return r.shouldSyncScroll="html"},onScroll:this.handlePreviewScroll},v.createElement(rN,{html:f,className:this.config.htmlClass,ref:this.nodeMdPreview})))))},e}(v.Component);bt.plugins=[];bt.addLocale=nt.add.bind(nt);bt.useLocale=nt.setCurrent.bind(nt);bt.getLocale=nt.getCurrent.bind(nt);var Zx=function(n){st(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:nt.get("btnCode"),onClick:function(){return r.editor.insertMarkdown("code")}},v.createElement(Tt,{type:"code-block"}))},e}(_t);Zx.pluginName="block-code-block";var Gx=function(n){st(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:nt.get("btnInlineCode"),onClick:function(){return r.editor.insertMarkdown("inlinecode")}},v.createElement(Tt,{type:"code"}))},e}(_t);Gx.pluginName="block-code-inline";var Jx=function(n){st(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:nt.get("btnQuote"),onClick:function(){return r.editor.insertMarkdown("quote")}},v.createElement(Tt,{type:"quote"}))},e}(_t);Jx.pluginName="block-quote";var qx=function(n){st(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:nt.get("btnLineBreak"),onClick:function(){return r.editor.insertMarkdown("hr")}},v.createElement(Tt,{type:"wrap"}))},e}(_t);qx.pluginName="block-wrap";var Xx=function(n){st(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(nt.get("clearTip"));r&&this.editor.setText("")}},t.render=function(){return v.createElement("span",{className:"button button-type-clear",title:nt.get("btnClear"),onClick:this.handleClick},v.createElement(Tt,{type:"delete"}))},e}(_t);Xx.pluginName="clear";var ey=function(n){st(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:nt.get("btnBold"),onClick:function(){return r.editor.insertMarkdown("bold")}},v.createElement(Tt,{type:"bold"}))},e}(_t);ey.pluginName="font-bold";var ty=function(n){st(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:nt.get("btnItalic"),onClick:function(){return r.editor.insertMarkdown("italic")}},v.createElement(Tt,{type:"italic"}))},e}(_t);ty.pluginName="font-italic";var ny=function(n){st(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:nt.get("btnStrikethrough"),onClick:function(){return r.editor.insertMarkdown("strikethrough")}},v.createElement(Tt,{type:"strikethrough"}))},e}(_t);ny.pluginName="font-strikethrough";var sy=function(n){st(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:nt.get("btnUnderline"),onClick:function(){return r.editor.insertMarkdown("underline")}},v.createElement(Tt,{type:"underline"}))},e}(_t);sy.pluginName="font-underline";var If=function(n){st(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:nt.get(r?"btnExitFullScreen":"btnFullScreen"),onClick:this.handleClick},v.createElement(Tt,{type:r?"fullscreen-exit":"fullscreen"}))}return null},e}(_t);If.pluginName="full-screen";If.align="right";var ry=function(n){st(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),aN=function(n){st(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),iy=function(n){st(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:nt.get("btnHeader"),onMouseEnter:this.show,onMouseLeave:this.hide},v.createElement(Tt,{type:"font-size"}),v.createElement(ry,{show:this.state.show,onClose:this.hide},v.createElement(aN,{onSelectHeader:function(l){return r.editor.insertMarkdown(l)}})))},e}(_t);iy.pluginName="header";var oN=function(n){st(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),ay=function(n){st(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=Kx(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);Tf(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:nt.get("btnImage"),onClick:this.handleCustomImageUpload},v.createElement(Tt,{type:"image"})):v.createElement("span",{className:"button button-type-image",title:nt.get("btnImage"),onClick:this.handleImageUpload,style:{position:"relative"}},v.createElement(Tt,{type:"image"}),v.createElement(oN,{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}(_t);ay.pluginName="image";var oy=function(n){st(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:nt.get("btnLink"),onClick:function(){return r.editor.insertMarkdown("link")}},v.createElement(Tt,{type:"link"}))},e}(_t);oy.pluginName="link";var ly=function(n){st(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:nt.get("btnOrdered"),onClick:function(){return r.editor.insertMarkdown("order")}},v.createElement(Tt,{type:"list-ordered"}))},e}(_t);ly.pluginName="list-ordered";var cy=function(n){st(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:nt.get("btnUnordered"),onClick:function(){return r.editor.insertMarkdown("unordered")}},v.createElement(Tt,{type:"list-unordered"}))},e}(_t);cy.pluginName="list-unordered";var lN=100,cN=function(){function n(t){t===void 0&&(t={}),this.record=[],this.recycle=[],this.initValue="";var s=t,r=s.maxSize,a=r===void 0?lN: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}(),uy=function(n){st(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 cN({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:nt.get("btnUndo"),onClick:this.handleUndo},v.createElement(Tt,{type:"undo"})),v.createElement("span",{className:"button button-type-redo "+(a?"":"disabled"),title:nt.get("btnRedo"),onClick:this.handleRedo},v.createElement(Tt,{type:"redo"})))},e}(_t);uy.pluginName="logger";var Zt;(function(n){n[n.SHOW_ALL=0]="SHOW_ALL",n[n.SHOW_MD=1]="SHOW_MD",n[n.SHOW_HTML=2]="SHOW_HTML"})(Zt||(Zt={}));var Lf=function(n){st(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 Zt.SHOW_ALL:this.editor.setView({html:!0,md:!0});break;case Zt.SHOW_HTML:this.editor.setView({html:!0,md:!1});break;case Zt.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 Zt.SHOW_ALL:return{icon:"view-split",title:"All"};case Zt.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:nt.get("btnMode"+r.title),onClick:this.handleClick},v.createElement(Tt,{type:r.icon}))}return null},Yx(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=[Zt.SHOW_ALL,Zt.SHOW_MD,Zt.SHOW_HTML];r&&(r.both||l.splice(l.indexOf(Zt.SHOW_ALL),1),r.md||l.splice(l.indexOf(Zt.SHOW_MD),1),r.html||l.splice(l.indexOf(Zt.SHOW_HTML),1));var u=Zt.SHOW_MD;if(a.html&&(u=Zt.SHOW_HTML),a.html&&a.md&&(u=Zt.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}(_t);Lf.pluginName="mode-toggle";Lf.align="right";var uN=function(n){st(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),Af=function(n){st(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:nt.get("btnTable"),onMouseEnter:this.show,onMouseLeave:this.hide},v.createElement(Tt,{type:"grid"}),v.createElement(ry,{show:this.state.show,onClose:this.hide},v.createElement(uN,{visibility:this.state.show,maxRow:a.maxRow,maxCol:a.maxCol,onSetTable:function(u){return r.editor.insertMarkdown("table",u)}})))},e}(_t);Af.pluginName="table";Af.defaultConfig={maxRow:6,maxCol:6};var Zh={exports:{}};/*!
451
+ Copyright (c) 2018 Jed Watson.
452
+ Licensed under the MIT License (MIT), see
453
+ http://jedwatson.github.io/classnames
454
+ */var f1;function hN(){return f1||(f1=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})()}(Zh)),Zh.exports}var dN=hN();const fN=Ja(dN);bt.use(iy);bt.use(ey);bt.use(ty);bt.use(sy);bt.use(ny);bt.use(cy);bt.use(ly);bt.use(Jx);bt.use(qx);bt.use(Gx);bt.use(Zx);bt.use(Af);bt.use(ay);bt.use(oy);bt.use(Xx);bt.use(uy);bt.use(Lf);bt.use(If);const Os=({field:n,value:e,onChange:t,...s})=>{const[r,a]=v.useState(e),{comp_params:l}=n,{darkMode:u}=fs(),d=f=>{console.log("value",f),t(f.text),a(f.text)};return c.jsx("div",{children:c.jsx(bt,{...l,className:"h-[300px] "+(u?"dark":"light"),value:r,renderHTML:f=>ht.parse(f),onChange:d})})},Pn=(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}}=pf(n,e),{nav:E,navWithState:S,state:I}=Jn(),O=v.useMemo(()=>{let B={};try{B=r?k5(r):{}}catch{}return{...B,...l,...I!=null&&I.hasChanged?I==null?void 0:I.data:{}}},[l,r,I]),R=v.useRef(void 0),Z=(I==null?void 0:I.hasChanged)??!1,M=s==="edit",A=s==="create",H=!(M||A),J=v.useMemo(()=>({getState:()=>{var K;const B=(K=a.current.get(!1))==null?void 0:K.data,q=!!R.current.get();return{data:B,hasChanged:q}}}),[]),ae=v.useCallback(async(B={})=>{const q=J.getState(),K={data:{...q==null?void 0:q.data,handle:void 0,id:void 0,updated_at:void 0,created_at:void 0,search:void 0,_published:void 0,...B},hasChanged:!0};R.current.set(!1),t&&S(`${t}/create`,q,K)},[S,J,t]),Ne=v.useCallback(async()=>{const B=a.current.get(),{data:q}=B,K={...O,...q};console.log("final ",K);const ne=await k(K);return console.log("new doc",ne),t&&E(`${t}/${ne.handle??ne.id}`,{replace:!0}),ne},[k,E,O,t]),Ee=v.useCallback(async(B=!1)=>{t&&E(`${t}/${O.handle??O.id}`,{replace:!0}),await y(B)},[y,E,O,t]),we=v.useCallback(async()=>{const B=await C();return t&&E(-2),B},[C,E,t]),te=v.useMemo(()=>JSON.stringify(O),[O]);return{actions:{reloadPromise:Ee,reload_hard:w,savePromise:Ne,deletePromise:we,duplicate:ae,navWithState:S,reload:y,setError:_},error:f,key:te,ref_head:R,ref_root:a,doc:O,sdk:g,isEditMode:M,isCreateMode:A,isViewMode:H,op:p,loading:u,hasChanged:Z,hasLoaded:d,context:J}},pN={name:"🙋🏻‍♂️ Contact Info",key:"contact",comp:ce(Ye,{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"}}]},mN={name:"✉︎ Address Info",key:"address",comp:ce(Ye,{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"}}]},gN={name:"☑ Status",key:"status",comp:ce(Ye,{className:""}),comp_params:{className:"w-full"},fields:[{key:"payment",name:"Payment Status",type:"text",validate:!1,desc:"What is the payment status",defaultValue:Ed.unpaid,comp:ce($e(Fl(Object.values(Ed))),{className:""},!1),comp_params:{className:"text-gray-500"}},{key:"fulfillment",name:"Fulfillment Status",type:"text",validate:!1,desc:"What is the fulfillment status",defaultValue:Sd.draft,comp:ce($e(Fl(Object.values(Sd))),{className:""},!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:eg.created,comp:ce($e(Fl(Object.values(eg))),{className:""},!1),comp_params:{className:"text-gray-500 mt-5"}}]},vN={name:"Right",comp:Ye,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(FC,{}),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(OC,{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(RC,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full"}},gN,{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach small attributes",comp:ce(vr)}]},xN={name:"Main",comp:Ye,comp_params:{className:`w-full gap-5 items-center
455
+ 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(T8,{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($C,{className:"w-full --bg-red-200 "}),comp_params:{className:"w-full text-xs py-auto --font-semibold"}},pN,mN,{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"}}]},yN={name:"Root",comp:Ye,comp_params:{className:`w-full gap-5 --justify-center --bg-red-100 items-center
456
+ lg:max-w-max lg:items-start lg:w-fit flex flex-col
457
+ lg:flex-row --mx-auto`},fields:[xN,vN]},Gh=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,ref_head:S,ref_root:I,sdk:O}=Pn("orders",t,"/pages/orders",n,s),R=v.useCallback(async A=>{const H=g;console.log("doc",g);try{const J=await O.checkout.create(H,A),ae=J==null?void 0:J.validation;if(console.log("valid_errors",ae),ae!=null&&ae.length){u({messages:ae});return}}catch(J){console.log("e",J),u(J);return}try{await l(!1)}catch(J){console.log("e",J)}},[r,u,O,l,g]),Z=v.useMemo(()=>({...f,create_checkout:R}),[f,R]),M=v.useCallback(()=>d({payment_gateway:void 0,pricing:void 0,line_items:g.line_items.map(A=>({...A,stock_reserved:0}))}),[d,g]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{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:M,onClickReload:y?void 0:async()=>l(!1),className:"mt-5 "}),c.jsx(ds,{changes_made:_,ref:S,time:g==null?void 0:g.created_at,className:"mt-8"},g==null?void 0:g.updated_at),c.jsx(ke,{show:C&&w||y,children:c.jsxs("div",{className:"w-full mx-auto ",children:[c.jsx(Sn,{error:E,className:"w-full"}),c.jsx(Rn,{ref:I,field:yN,value:g??{},context:Z,isViewMode:k,className:"mt-8 mx-auto"},p)]})})]})},hy=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",wN=[{key:void 0,name:"Full Name",comp:pt,transform:n=>hy(n),comp_params:{className:"font-semibold capitalize"}},{key:"email",name:"Email",comp:pt},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:"auth_id",name:"UID",comp:pt,comp_params:{extra:"max-w-[4rem]"}},{key:void 0,name:"Actions",comp:mn}],p1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
458
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/customers/create",searchTitle:"Search by name, email, uid...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:wN}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},bN=v.forwardRef(({resource:n,limit:e=5,context:t,schema:s,...r},a)=>{wt();const{page:l,actions:{prev:u,next:d,query:f}}=mr(n,Ri,!1);return vf(),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(en,{context:t,data:l,fields:s}),c.jsx(pn,{prev:u,next:d,onLimitChange:void 0})]})}),kN=({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(so,{current_state:l,children:e??t,to:a==null?void 0:a(n.item),className:"underline"})})},_N=({value:n,field:e,context:t,error:s,setError:r,...a})=>{const l=v.useRef([{key:"id",name:"ID",comp:({...u})=>c.jsx(kN,{...u,url_fn:d=>`/pages/orders/${d==null?void 0:d.id}`,get_state:()=>t.getState()})},{key:"updated_at",name:"Last Updated",comp:qn},{key:"pricing.total",name:"Price",comp:pt,comp_params:{className:"font-bold"}},{key:"status.fulfillment.name",name:"Status",comp:({value:u})=>u&&c.jsx(Lt,{value:`**\`${u.toString()}\`**`,className:"overflow-x-auto max-w-20 flex-shrink"})}]);return c.jsx("div",{...a,children:c.jsx(bN,{limit:5,resource:`customers/${n==null?void 0:n.email}/orders`,schema:l.current})})},CN={comp:Ye,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(_N,{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"}}]},NN={key:"address",name:"📬 Address",comp:ce(Ye,{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"}}]},jN={name:"right",comp:Ye,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(vr),desc:"Add tags to your users to better categorize them",comp_params:{className:"w-full "}},NN]},SN={name:"Root",comp:Ye,comp_params:{className:"w-full gap-5 lg:justify-center mx-auto lg:w-fit flex flex-col justify-start lg:flex-row "},fields:[CN,jN]},Jh=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E}=Pn("customers",t,"/pages/customers",n,s);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{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(ds,{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(ke,{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(Sn,{error:_,className:"w-full"}),c.jsx(Rn,{ref:E,field:SN,value:f??{},context:u,isViewMode:y,className:"mt-8"},d)]})})]})},EN=[{key:"id",name:"Thread",comp:pt},{key:void 0,name:"Customer",comp:pt,transform:n=>(n==null?void 0:n.customer_email)??(n==null?void 0:n.customer_id)??"anonymous",comp_params:{className:"font-semibold"}},{key:"created_at",name:"Created",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn}],m1=({})=>{let{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}}=gn("chats","/pages/chats");const{config:k}=wt(),_=v.useMemo(()=>({linkExternalUrl:C=>`${k.endpoint}/chat?thread_id=${C}`,deleteDocument:e.deleteDocument}),[e]);return c.jsx("div",{className:"h-full w-full",children:c.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[c.jsx(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
459
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,searchTitle:"search by thread / customer email / id ...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:_,data:s,fields:EN}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},MN=[{key:"handle",name:"Name",comp:pt,comp_params:{className:"font-semibold"}},{key:"values",name:"Values",comp:Dx,comp_params:{className:"--font-semibold"}},{key:void 0,name:"Actions",comp:mn,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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
460
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:!1,ref:t,reload:g,createLink:"/pages/tags/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:MN}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},DN=n=>n==null?void 0:n.match(/\S+/g),TN=({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=DN(u.current.value.toString()).map(w=>Y5(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(Ge,{placeholder:"space separated values",className:"flex-grow",rounded:"rounded-md",ref:u,type:"text"}),c.jsx(Cn,{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"})]})},IN=n=>{const e=Array.isArray(n)&&n.length;return[e,e?"":"Empty values"]},LN={name:"Root",comp:Ye,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:IN,comp:ce(TN),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"}}]},qh=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E}=Pn("tags",t,"/pages/tags",n,s);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{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(ds,{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(ke,{show:k&&g||p,children:[c.jsx(Sn,{error:_,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Rn,{ref:E,field:LN,value:f??{},context:u,isViewMode:y,className:"mx-auto"},d)]})]})},AN=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold"}},{key:"handle",name:"Handle",comp:pt,comp_params:{className:"--font-semibold"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],v1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
461
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/apps/templates/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:AN}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})};function ON(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function x1(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 y1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(t),!0).forEach(function(s){ON(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):x1(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function RN(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 PN(n,e){if(n==null)return{};var t=RN(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 zN(n,e){return BN(n)||VN(n,e)||$N(n,e)||FN()}function BN(n){if(Array.isArray(n))return n}function VN(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 $N(n,e){if(n){if(typeof n=="string")return w1(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 w1(n,e)}}function w1(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 FN(){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 HN(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function b1(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 k1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?b1(Object(t),!0).forEach(function(s){HN(n,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):b1(Object(t)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(t,s))})}return n}function UN(){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 Ma(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 cc(n){return{}.toString.call(n).includes("Object")}function WN(n){return!Object.keys(n).length}function Wa(n){return typeof n=="function"}function YN(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function QN(n,e){return cc(e)||hr("changeType"),Object.keys(e).some(function(t){return!YN(n,t)})&&hr("changeField"),e}function KN(n){Wa(n)||hr("selectorType")}function ZN(n){Wa(n)||cc(n)||hr("handlerType"),cc(n)&&Object.values(n).some(function(e){return!Wa(e)})&&hr("handlersType")}function GN(n){n||hr("initialIsRequired"),cc(n)||hr("initialType"),WN(n)&&hr("initialContent")}function JN(n,e){throw new Error(n[e]||n.default)}var qN={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"},hr=Ma(JN)(qN),Ll={changes:QN,selector:KN,handler:ZN,initial:GN};function XN(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ll.initial(n),Ll.handler(e);var t={current:n},s=Ma(nj)(t,e),r=Ma(tj)(t),a=Ma(Ll.changes)(n),l=Ma(ej)(t);function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Ll.selector(f),f(t.current)}function d(f){UN(s,r,a,l)(f)}return[u,d]}function ej(n,e){return Wa(e)?e(n.current):e}function tj(n,e){return n.current=k1(k1({},n.current),e),e}function nj(n,e,t){return Wa(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 sj={create:XN},rj={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function ij(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 aj(n){return{}.toString.call(n).includes("Object")}function oj(n){return n||_1("configIsRequired"),aj(n)||_1("configType"),n.urls?(lj(),{paths:{vs:n.urls.monacoBase}}):n}function lj(){console.warn(dy.deprecation)}function cj(n,e){throw new Error(n[e]||n.default)}var dy={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
+ `},_1=ij(cj)(dy),uj={config:oj},hj=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 fy(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],fy(n[t],e[t]))}),y1(y1({},n),e)}var dj={type:"cancelation",msg:"operation is manually canceled"};function Xh(n){var e=!1,t=new Promise(function(s,r){n.then(function(a){return e?r(dj):s(a)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var fj=sj.create({config:rj,isInitialized:!1,resolve:null,reject:null,monaco:null}),py=zN(fj,2),oo=py[0],Sc=py[1];function pj(n){var e=uj.config(n),t=e.monaco,s=PN(e,["monaco"]);Sc(function(r){return{config:fy(r.config,s),monaco:t}})}function mj(){var n=oo(function(e){var t=e.monaco,s=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:s,resolve:r}});if(!n.isInitialized){if(Sc({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),Xh(ed);if(window.monaco&&window.monaco.editor)return my(window.monaco),n.resolve(window.monaco),Xh(ed);hj(gj,xj)(yj)}return Xh(ed)}function gj(n){return document.body.appendChild(n)}function vj(n){var e=document.createElement("script");return n&&(e.src=n),e}function xj(n){var e=oo(function(s){var r=s.config,a=s.reject;return{config:r,reject:a}}),t=vj("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function yj(){var n=oo(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){my(t),n.resolve(t)},function(t){n.reject(t)})}function my(n){oo().monaco||Sc({monaco:n})}function wj(){return oo(function(n){var e=n.monaco;return e})}var ed=new Promise(function(n,e){return Sc({resolve:n,reject:e})}),uc={config:pj,init:mj,__getMonacoInstance:wj},bj={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},td=bj,kj={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},_j=kj;function Cj({children:n}){return X.createElement("div",{style:_j.container},n)}var Nj=Cj,jj=Nj;function Sj({width:n,height:e,isEditorReady:t,loading:s,_ref:r,className:a,wrapperProps:l}){return X.createElement("section",{style:{...td.wrapper,width:n,height:e},...l},!t&&X.createElement(jj,null,s),X.createElement("div",{ref:r,style:{...td.fullWidth,...!t&&td.hide},className:a}))}var Ej=Sj,gy=v.memo(Ej);function Mj(n){v.useEffect(n,[])}var Of=Mj;function Dj(n,e,t=!0){let s=v.useRef(!0);v.useEffect(s.current||!t?()=>{s.current=!1}:n,e)}var bn=Dj;function za(){}function ki(n,e,t,s){return Tj(n,s)||Ij(n,e,t,s)}function Tj(n,e){return n.editor.getModel(vy(n,e))}function Ij(n,e,t,s){return n.editor.createModel(e,t,s?vy(n,s):void 0)}function vy(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=za,onMount:E=za}){let[S,I]=v.useState(!1),[O,R]=v.useState(!0),Z=v.useRef(null),M=v.useRef(null),A=v.useRef(null),H=v.useRef(E),J=v.useRef(C),ae=v.useRef(!1);Of(()=>{let te=uc.init();return te.then(B=>(M.current=B)&&R(!1)).catch(B=>(B==null?void 0:B.type)!=="cancelation"&&console.error("Monaco initialization: error:",B)),()=>Z.current?we():te.cancel()}),bn(()=>{if(Z.current&&M.current){let te=Z.current.getOriginalEditor(),B=ki(M.current,n||"",s||t||"text",a||"");B!==te.getModel()&&te.setModel(B)}},[a],S),bn(()=>{if(Z.current&&M.current){let te=Z.current.getModifiedEditor(),B=ki(M.current,e||"",r||t||"text",l||"");B!==te.getModel()&&te.setModel(B)}},[l],S),bn(()=>{let te=Z.current.getModifiedEditor();te.getOption(M.current.editor.EditorOption.readOnly)?te.setValue(e||""):e!==te.getValue()&&(te.executeEdits("",[{range:te.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),te.pushUndoStop())},[e],S),bn(()=>{var te,B;(B=(te=Z.current)==null?void 0:te.getModel())==null||B.original.setValue(n||"")},[n],S),bn(()=>{let{original:te,modified:B}=Z.current.getModel();M.current.editor.setModelLanguage(te,s||t||"text"),M.current.editor.setModelLanguage(B,r||t||"text")},[t,s,r],S),bn(()=>{var te;(te=M.current)==null||te.editor.setTheme(f)},[f],S),bn(()=>{var te;(te=Z.current)==null||te.updateOptions(g)},[g],S);let Ne=v.useCallback(()=>{var q;if(!M.current)return;J.current(M.current);let te=ki(M.current,n||"",s||t||"text",a||""),B=ki(M.current,e||"",r||t||"text",l||"");(q=Z.current)==null||q.setModel({original:te,modified:B})},[t,e,r,n,s,a,l]),Ee=v.useCallback(()=>{var te;!ae.current&&A.current&&(Z.current=M.current.editor.createDiffEditor(A.current,{automaticLayout:!0,...g}),Ne(),(te=M.current)==null||te.editor.setTheme(f),I(!0),ae.current=!0)},[g,f,Ne]);v.useEffect(()=>{S&&H.current(Z.current,M.current)},[S]),v.useEffect(()=>{!O&&!S&&Ee()},[O,S,Ee]);function we(){var B,q,K,ne;let te=(B=Z.current)==null?void 0:B.getModel();u||((q=te==null?void 0:te.original)==null||q.dispose()),d||((K=te==null?void 0:te.modified)==null||K.dispose()),(ne=Z.current)==null||ne.dispose()}return X.createElement(gy,{width:w,height:y,isEditorReady:S,loading:p,_ref:A,className:k,wrapperProps:_})}var Aj=Lj;v.memo(Aj);function Oj(){let[n,e]=v.useState(uc.__getMonacoInstance());return Of(()=>{let t;return n||(t=uc.init(),t.then(s=>{e(s)})),()=>t==null?void 0:t.cancel()}),n}var xy=Oj;function Rj(n){let e=v.useRef();return v.useEffect(()=>{e.current=n},[n]),e.current}var Pj=Rj,Al=new Map;function zj({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:E=za,onMount:S=za,onChange:I,onValidate:O=za}){let[R,Z]=v.useState(!1),[M,A]=v.useState(!0),H=v.useRef(null),J=v.useRef(null),ae=v.useRef(null),Ne=v.useRef(S),Ee=v.useRef(E),we=v.useRef(),te=v.useRef(s),B=Pj(a),q=v.useRef(!1),K=v.useRef(!1);Of(()=>{let $=uc.init();return $.then(ie=>(H.current=ie)&&A(!1)).catch(ie=>(ie==null?void 0:ie.type)!=="cancelation"&&console.error("Monaco initialization: error:",ie)),()=>J.current?D():$.cancel()}),bn(()=>{var ie,ge,le,se;let $=ki(H.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],R),bn(()=>{var $;($=J.current)==null||$.updateOptions(f)},[f],R),bn(()=>{!J.current||s===void 0||(J.current.getOption(H.current.editor.EditorOption.readOnly)?J.current.setValue(s):s!==J.current.getValue()&&(K.current=!0,J.current.executeEdits("",[{range:J.current.getModel().getFullModelRange(),text:s,forceMoveMarkers:!0}]),J.current.pushUndoStop(),K.current=!1))},[s],R),bn(()=>{var ie,ge;let $=(ie=J.current)==null?void 0:ie.getModel();$&&r&&((ge=H.current)==null||ge.editor.setModelLanguage($,r))},[r],R),bn(()=>{var $;u!==void 0&&(($=J.current)==null||$.revealLine(u))},[u],R),bn(()=>{var $;($=H.current)==null||$.editor.setTheme(l)},[l],R);let ne=v.useCallback(()=>{var $;if(!(!ae.current||!H.current)&&!q.current){Ee.current(H.current);let ie=a||t,ge=ki(H.current,s||n||"",e||r||"",ie||"");J.current=($=H.current)==null?void 0:$.editor.create(ae.current,{model:ge,automaticLayout:!0,...f},p),g&&J.current.restoreViewState(Al.get(ie)),H.current.editor.setTheme(l),u!==void 0&&J.current.revealLine(u),Z(!0),q.current=!0}},[n,e,t,s,r,a,f,p,g,l,u]);v.useEffect(()=>{R&&Ne.current(J.current,H.current)},[R]),v.useEffect(()=>{!M&&!R&&ne()},[M,R,ne]),te.current=s,v.useEffect(()=>{var $,ie;R&&I&&(($=we.current)==null||$.dispose(),we.current=(ie=J.current)==null?void 0:ie.onDidChangeModelContent(ge=>{K.current||I(J.current.getValue(),ge)}))},[R,I]),v.useEffect(()=>{if(R){let $=H.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=H.current.editor.getModelMarkers({resource:ge});O==null||O(se)}});return()=>{$==null||$.dispose()}}return()=>{}},[R,O]);function D(){var $,ie;($=we.current)==null||$.dispose(),y?g&&Al.set(a,J.current.saveViewState()):(ie=J.current.getModel())==null||ie.dispose(),J.current.dispose()}return X.createElement(gy,{width:w,height:k,isEditorReady:R,loading:d,_ref:ae,className:_,wrapperProps:C})}var Bj=zj,Hd=v.memo(Bj);function C1(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 Vj=({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,E=l.current.offsetWidth;return r.current.style.left=_+f.x+"px",C+=f.x,E-=f.x,d.x=w,d.y=k,a.current.style.width=C+"px",l.current.style.width=E+"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})]})})},$j=({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(C1,{title:"Show Preview to the right",className:"cursor-pointer z-10 transition-transform duration-100 "+(n==0?"scale-150":""),onClick:()=>t(0)}),c.jsx(C1,{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(uk,{title:"Enter Fullscreen",className:"cursor-pointer z-10 transition-transform duration-100 "+(n==2?"scale-150":""),onClick:()=>t(2)})]})},nd=({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=xy(),[g,y]=v.useState(u),[w,k]=v.useState({}),[_,C]=v.useState(s),{darkMode:E}=fs(),S=v.useCallback(R=>{C(R),r(R)},[r]),I=v.useCallback(R=>{y(R)},[]),O=v.useMemo(()=>{try{let Z=s3.compile(_)(w??{});return a||(Z=`<pre>${Z}</pre>`),Z}catch(R){return R}},[_,w,a]);return v.useEffect(()=>e.pubsub.add_sub((R,Z)=>{R==="reference_example_input"&&k(Z)}),[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 R=Z=>{g==2&&Z.key==="Escape"&&y(0)};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[g]),c.jsx("div",{...f,children:c.jsxs("div",{className:"flex flex-col w-full gap-5",children:[d&&c.jsx($j,{onChange:I,mode:g}),g<2&&c.jsxs("div",{className:"w-full flex flex-col gap-5 relative",children:[g==1&&"The following template",c.jsx(Hd,{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:S,value:_,theme:E?"coblat":"light",defaultLanguage:"handlebars"}),g==1&&"will render",c.jsx("iframe",{srcDoc:O,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(Vj,{className:"z-[100] fixed left-0 top-0 w-full h-full",children:[c.jsx(Hd,{options:{tabSize:2},width:(l==null?void 0:l.width)??"100%",height:"100%",className:"--overflow-auto",onChange:S,value:_,theme:E?"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(Vb,{onClick:()=>y(0),className:"cursor-pointer"})]}),c.jsx("iframe",{width:"100%",srcDoc:O,className:" border shelf-border-color bg-white",height:"100%"})]})]})]})})},Fj=({field:n,context:e,setError:t,value:s={},onChange:r,...a})=>{const l=xy(),[u,d]=v.useState(s),{darkMode:f}=fs(),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(Hd,{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"})})})},Hj={name:"Root",comp:Ye,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(nd,{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(nd,{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(nd,{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(Fj),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"}}]},sd=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,ref_root:S}=Pn("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(Xn,{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(ds,{ref:E,time:p==null?void 0:p.created_at,className:"mt-8",changes_made:k},p==null?void 0:p.updated_at),c.jsxs(ke,{show:_&&y||g,children:[c.jsx(Sn,{error:C,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Rn,{ref:S,field:Hj,value:p??{},context:d,isViewMode:w,className:"mx-auto"},f)]})]})},Uj=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold max-w-[8rem] "}},{key:"price",name:"Price",comp:pt,comp_params:{className:"font-mono"}},{key:"collections",name:"Collections",comp:Dx,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:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],N1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
478
+ store-table-wrapper mt-5`,children:[c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/products/create",searchTitle:"Search by Name, Handle, Tag values, Collections...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:Uj}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},hc={x:0,y:0,width:0,height:0,unit:"px"},vi=(n,e,t)=>Math.min(Math.max(n,e),t),Wj=(...n)=>n.filter(e=>e&&typeof e=="string").join(" "),j1=(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 xi(n,e,t){return n.unit==="%"?{...hc,...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"?{...hc,...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}:{...hc,...n,unit:"px"}}function S1(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 E=Math.max(f.width/e,g);(t==="nw"||t=="ne")&&(f.y-=E-f.height),f.height=E}else if(C>e){const E=Math.max(f.height*e,p);(t==="sw"||t=="nw")&&(f.x-=E-f.width),f.width=E}}return f}function Yj(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 yi={capture:!0,passive:!1};let Qj=0;const sr=class Yn 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-${Qj++}`,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),xi(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(),j1(t,d)||r(nr(d,l.width,l.height),xi(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)?Yn.nudgeStepLarge:e.shiftKey?Yn.nudgeStepMedium:Yn.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=vi(f.x,0,d.width-f.width),f.y=vi(f.y,0,d.height-f.height);const g=nr(f,d.width,d.height),y=xi(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)?Yn.nudgeStepLarge:e.shiftKey?Yn.nudgeStepMedium:Yn.nudgeStep,k=nr(r,y.width,y.height),_=Yj(k,e.key,w,t),C=S1(_,s,t,y.width,y.height,l,u,d,f);if(!j1(r,C)){const E=xi(C,y.width,y.height);p(C,E),g&&g(C,E)}},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),xi(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),xi(t,r,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,yi),this.document.addEventListener("pointerup",this.onDocPointerDone,yi),this.document.addEventListener("pointercancel",this.onDocPointerDone,yi),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,yi),this.document.removeEventListener("pointerup",this.onDocPointerDone,yi),this.document.removeEventListener("pointercancel",this.onDocPointerDone,yi),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=vi(e.startCropX+r,0,t.width-s.width),s.y=vi(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=S1(w,t,f,a.width,a.height,l,u,s,r);return t||Yn.xyOrds.indexOf(p)>-1?d=k:Yn.xOrds.indexOf(p)>-1?(d.x=k.x,d.width=k.width):Yn.yOrds.indexOf(p)>-1&&(d.y=k.y,d.height=k.height),d.x=vi(d.x,0,a.width-d.width),d.y=vi(d.y,0,a.height-d.height),d}renderCropSelection(){const{ariaLabels:e=Yn.defaultProps.ariaLabels,disabled:t,locked:s,renderSelectionAddon:r,ruleOfThirds:a,crop:l}=this.props,u=this.getCropStyle();if(l)return X.createElement("div",{style:u,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!t&&!s&&X.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},X.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),X.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),X.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),X.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),X.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"}),X.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"}),X.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"}),X.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"}),X.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"}),X.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"}),X.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"}),X.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&&X.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:d=>d.stopPropagation()},r(this.state)),a&&X.createElement(X.Fragment,null,X.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),X.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){const t={...hc,...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 X.createElement("div",{ref:this.componentRef,className:w,style:d},X.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?X.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},X.createElement("defs",null,X.createElement("mask",{id:`hole-${this.instanceId}`},X.createElement("rect",{width:"100%",height:"100%",fill:"white"}),s?X.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"}):X.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),X.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 Kj=sr;const Zj=(n=!1)=>{const[e,t]=v.useState(n),s=v.useCallback(()=>{t(r=>!r)},[]);return[e,s]},Gj=({className:n,open:e=!0,...t})=>{const s=fN("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})},dc=v.forwardRef(({src:n,...e},t)=>{const s=v.useRef(void 0),[r,a]=v.useState(),{sdk:l}=wt();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
479
+ border border-gray-400 rounded-full cursor-pointer
480
+ w-14 h-7 sm:w-24 sm:h-12 flex flex-row
481
+ ${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
482
+ bg-gray-50 dark:bg-gray-800 border
483
+ border-gray-400`})}),c.jsx("div",{className:`flex flex-row justify-between w-full
484
+ h-full items-center z-10`,children:t})]})},rd=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
485
+ cursor-pointer
486
+ ${a==d?"bg-black/10 dark:bg-black/50":"bg-transparent"}`,onClick:f=>l(d)},u))})]})}),qj=({values:n,notify:e,onComplete:t,onEditingApproved:s,className:r,...a})=>{const[l,u]=Zj(!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
487
+ py-3 px-3 text-xl sm:text-2xl
488
+ rounded-t-3xl ${r}`,...a,children:[c.jsx($k,{onClick:u,className:`cursor-pointer rounded-full text-3xl p-1
489
+ ${l?"bg-white dark:bg-white/10":""} `}),c.jsx(E5,{onClick:()=>e({...n,scale:n.scale/2}),className:"cursor-pointer text-xl sm:text-2xl",title:"Scale Down"}),c.jsx(M5,{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(n4,{className:`cursor-pointer text-xl translate-x-1
490
+ scale-90 sm:translate-x-[14px]`,title:"Move"}),c.jsx(qb,{className:`cursor-pointer text-xl scale-90
491
+ -translate-x-1 sm:scale-105
492
+ sm:-translate-x-[13px]`,title:"Crop"})]}),c.jsx(s4,{onClick:()=>e({...n,rotate:n.rotate+90}),className:"cursor-pointer text-2xl",title:"Rotate Right"}),c.jsx(Gd,{onClick:()=>t(void 0),className:"cursor-pointer text-xl sm:text-2xl",title:"Close"}),c.jsx(X1,{onClick:g,className:"cursor-pointer text-xl sm:text-2xl",title:"Approve"})]}),c.jsx(Gj,{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(rd,{header:"Format",selectedDefault:0,ref:d,options:["jpeg","png","webp"]}),c.jsx(rd,{header:"Quality",selectedDefault:1,ref:f,options:[.5,.75,.8,.9,1]}),c.jsx(rd,{header:"Height",selectedDefault:3,ref:p,options:[128,256,384,512,640,768,896,1024]})]})})]})},Xj={scale:1,rotate:0,trans:{x:0,y:0},mode:"crop"},eS=({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(Xj),_=v.useCallback(O=>{f({unit:"%",x:0,y:0,width:100,height:100})},[]),C=v.useCallback(O=>{const R=a.current,Z=document.createElement("canvas"),{rotate:M,trans:A,scale:H}=w;console.log("completedCrop",l);const J={width:R.width*l.width/100,height:R.height*l.height/100,x:R.width*l.x/100,y:R.height*l.y/100},ae=Z.getContext("2d"),Ne=Math.PI/180;if(console.log("options",O),!ae)throw new Error("No 2d context");const Ee=R.naturalWidth,we=R.naturalHeight,te=Ee,B=O.height??we,q=Math.min(1,te/Ee,B/we),K=Ee/R.width,ne=we/R.height,D=q;Z.width=Math.floor(J.width*K*D),Z.height=Math.floor(J.height*ne*D),console.log("h ",we,D,Z.height),ae.fillStyle=O.format==="jpeg"?"white":"transparent",ae.fillRect(0,0,Z.width,Z.height),ae.scale(D,D),ae.imageSmoothingQuality="high";const $=J.x*K,ie=J.y*ne,ge=M*Ne,le=R.naturalWidth/2,se=R.naturalHeight/2;ae.save(),ae.translate(-$,-ie),ae.translate(A.x*K,A.y*ne),ae.translate(le,se),ae.scale(H,H),ae.rotate(ge),ae.translate(-le,-se),ae.drawImage(R,0,0,Ee,we,0,0,Ee,we),ae.restore(),y(!0),Z.toBlob(De=>{y(!1),t(De,O.format,e,Z.width,Z.height)},`image/${O.format}`,O.quality)},[l,w,e,t]),E=v.useRef(void 0),S=w.mode==="crop",I=v.useCallback(O=>{if(S)return;O.preventDefault(),O.stopPropagation(),p.current=O;const R=M=>{M.preventDefault(),p.current!==void 0&&k({...w,trans:{x:w.trans.x+(M.pageX-p.current.pageX),y:w.trans.y+(M.pageY-p.current.pageY)}})},Z=M=>{M.preventDefault(),M.stopPropagation(),p.current=void 0,E.current.removeEventListener("pointermove",R),E.current.removeEventListener("pointerup",Z),E.current.removeEventListener("pointerdown",I)};E.current.addEventListener("pointermove",R),E.current.addEventListener("pointerup",Z)},[w]);return c.jsxs("div",{className:s,...r,children:[c.jsx(qj,{values:w,notify:k,onComplete:t,onEditingApproved:C}),c.jsx("div",{className:"w-full touch-none",ref:E,onPointerDown:S?void 0:I,children:c.jsx(Kj,{disabled:!S,ruleOfThirds:!0,className:"m-0 w-full",crop:d,onChange:(O,R)=>f(R),onComplete:(O,R)=>u(R),aspect:void 0,children:c.jsx(dc,{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)
493
+ scale(${w.scale})
494
+ rotate(${w.rotate}deg) `},onLoad:_})})}),c.jsx("input",{value:e,readOnly:!0,className:`w-full p-3 mt-0 whitespace-pre break-words
495
+ --rounded-b-3xl --border
496
+ bg-transparent
497
+ dark:border-slate-600
498
+ `})]})},tS=()=>c.jsx("div",{className:"w-full h-full bg-slate-500/40 animate-pulse rounded-md"}),nS=({src:n,children:e=tS(),...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState("opacity-0"),[u,d]=v.useState(void 0),{sdk:f}=wt(),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"})})]})]})})},sS=({data:n,onClickImage:e=()=>{},className:t,...s})=>{const{url:r,handle:a}=n;return c.jsxs("div",{className:`inline-block w-24 h-fit
499
+ --pb-2 sm:w-40 shadow-sm group transition-colors duration-300
500
+ rounded-lg overflow-hidden ${t}`,...s,children:[c.jsx(Ut,{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(nS,{src:r,crossOrigin:"anonymous",draggable:"false",className:`object-cover w-[99%] mx-auto h-full -opacity-20
501
+ group-hover:opacity-100 transition-opacity duration-300
502
+ 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
503
+ border bg-gray-200 text-gray-600 rounded-b-md`})})]})},rS=({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
504
+ place-content-center --justify-items-center --justify-center mx-auto `,children:n.map((r,a)=>c.jsx(sS,{data:r,onClickImage:e},r.handle))})}),iS=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
505
+ 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(Ge,{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(dv,{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})]})})}),yy=({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}}=gn("images","/apps/gallery");return c.jsxs("div",{className:`flex flex-col justify-between ${s}`,...r,children:[c.jsx(qe,{rounded:"rounded-md",className:"shadow-md w-full h-fit",children:c.jsx(iS,{ref:l,count:p,reload:()=>y(t),className:"shelf-card rounded-md",searchTitle:"search by used products/collections/tags",isLoading:f})}),c.jsx(rS,{images:u,className:"mt-5 w-full --h-fit flex-1",onClickImage:e}),c.jsx(ke,{show:d==null?void 0:d.length,children:c.jsx(qe,{rounded:"rounded-md",className:"mt-5 shadow-md w-full h-fit",children:c.jsx(pn,{prev:()=>w(t),next:()=>k(t),limit:(a==null?void 0:a.limit)??5,onLimitChange:_=>g(_,t),className:"rounded-md shelf-card"})})})]})},wy=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(Ls,{ref:s,children:c.jsx("div",{className:"w-full h-full max-w-[60rem] px-5 py-10 ",children:c.jsx(yy,{useSearchParamsForQuery:!1,query_params:n,onClickImage:r,onClick:a=>a.stopPropagation(),className:`w-full h-full bg-slate-100 dark:bg-slate-700 border
506
+ shelf-border-color p-5 rounded-lg`})})})});var Wl={exports:{}},aS=Wl.exports,E1;function oS(){return E1||(E1=1,function(n,e){(function(t,s){n.exports=s()})(aS,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,E,S,I){var O={$$typeof:p,type:w,key:k,ref:_,props:I,_owner:S};return O};y.createElement=function(w,k,_){var C,E={},S=null,I=null;if(k!=null){a(k)&&(I=k.ref),l(k)&&(S=""+k.key);for(C in k)f.call(k,C)&&!g.hasOwnProperty(C)&&(E[C]=k[C])}var O=arguments.length-2;if(O===1)E.children=_;else if(O>1){for(var R=Array(O),Z=0;Z<O;Z++)R[Z]=arguments[Z+2];E.children=R}if(w&&w.defaultProps){var M=w.defaultProps;for(C in M)E[C]===void 0&&(E[C]=M[C])}return y(w,S,I,0,0,d.current,E)},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,E=u({},w.props),S=w.key,I=w.ref,O=w._owner;if(k!=null){a(k)&&(I=k.ref,O=d.current),l(k)&&(S=""+k.key);var R;w.type&&w.type.defaultProps&&(R=w.type.defaultProps);for(C in k)f.call(k,C)&&!g.hasOwnProperty(C)&&(k[C]===void 0&&R!==void 0?E[C]=R[C]:E[C]=k[C])}var Z=arguments.length-2;if(Z===1)E.children=_;else if(Z>1){for(var M=Array(Z),A=0;A<Z;A++)M[A]=arguments[A+2];E.children=M}return y(w.type,S,I,0,0,O,E)},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)}/*
507
+ object-assign
508
+ (c) Sindre Sorhus
509
+ @license MIT
510
+ */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(O){return O&&O.__esModule?O:{default:O}}function l(O){if(Array.isArray(O)){for(var R=0,Z=Array(O.length);R<O.length;R++)Z[R]=O[R];return Z}return Array.from(O)}function u(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function d(O,R){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!R||typeof R!="object"&&typeof R!="function"?O:R}function f(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(O,R):O.__proto__=R)}function p(O){return(O.buttons||O.which||O.button)===1}function g(){var O=document.createElement("div");O.style.cssText="position:fixed; top: 0; left: 0",document.body.appendChild(O);var R=O.getBoundingClientRect();return document.body.removeChild(O),[R.left,R.top]}function y(){return Math.abs(1-document.body.clientWidth/window.innerWidth)>.02}Object.defineProperty(s,"__esModule",{value:!0});var w=function(){function O(R,Z){var M=[],A=!0,H=!1,J=void 0;try{for(var ae,Ne=R[Symbol.iterator]();!(A=(ae=Ne.next()).done)&&(M.push(ae.value),!Z||M.length!==Z);A=!0);}catch(Ee){H=!0,J=Ee}finally{try{!A&&Ne.return&&Ne.return()}finally{if(H)throw J}}return M}return function(R,Z){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return O(R,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=function(){function O(R,Z){for(var M=0;M<Z.length;M++){var A=Z[M];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(R,A.key,A)}}return function(R,Z,M){return Z&&O(R.prototype,Z),M&&O(R,M),R}}(),_=r(14),C=a(_),E=r(7),S=a(E),I=function(O){function R(Z){u(this,R);var M=d(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,Z));return M.addListeners=function(A){A.addEventListener("mousedown",function(H){M.handleMouseDown(H)},!1),A.addEventListener("touchstart",function(H){M.handleTouchStart(H)},!1),A.addEventListener("touchmove",M.handleTouchMove,{passive:!1}),A.addEventListener("touchend",M.handleTouchEnd)},M.buildCustomEvent=function(A){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=void 0;return typeof window.CustomEvent!="function"?(J=document.createEvent("CustomEvent"),J.initCustomEvent(A,!0,!0,{})):J=new CustomEvent(A,{bubbles:!0,cancelable:!0}),Object.assign(J,{dragData:M.props.dragData,dragElem:M.dragElem,containerElem:M.containerElem,sourceElem:M.sourceElem},H),J},M.setCurrentTarget=function(A,H){M.dragElem.style.zIndex=-1;var J=document.elementFromPoint(A,H)||document.body;M.dragElem.style.zIndex=M.props.zIndex,M.currentTarget=M.dragElem.contains(J)?document.body:J},M.setFixedOffset=function(){if(y()){var A=g(),H=w(A,2);M.fixedOffsetLeft=H[0],M.fixedOffsetTop=H[1]}},M.doScroll=function(){window.scrollBy(M.xScroll,M.yScroll),M.setFixedOffset()},M.startScrolling=function(A,H){var J=[A,H];M.xScroll=J[0],M.yScroll=J[1],M.scrollTimer||(M.scrollTimer=setInterval(M.doScroll,50))},M.stopScrolling=function(){clearInterval(M.scrollTimer),M.scrollTimer=null},M.generateEnterLeaveEvents=function(A,H){var J=M.props.targetKey;M.setCurrentTarget(A,H),M.currentTarget!==M.prevTarget&&(M.prevTarget&&M.prevTarget.dispatchEvent(M.buildCustomEvent(J+"DragLeave")),M.currentTarget&&M.currentTarget.dispatchEvent(M.buildCustomEvent(J+"DragEnter"))),M.prevTarget=M.currentTarget},M.generateDropEvent=function(A,H){M.setCurrentTarget(A,H);var J=M.buildCustomEvent(M.props.targetKey+"Drop",{x:A,y:H});M.currentTarget.dispatchEvent(J)},M.handleMouseDown=function(A){p(A)&&!M.props.noDragging&&(document.addEventListener("mousemove",M.handleMouseMove),document.addEventListener("mouseup",M.handleMouseUp),M.startDrag(A.clientX,A.clientY))},M.handleTouchStart=function(A){M.props.noDragging||(A.stopPropagation(),M.setFixedOffset(),M.startDrag(A.targetTouches[0].clientX,A.targetTouches[0].clientY))},M.startDrag=function(A,H){document.addEventListener(M.props.targetKey+"Dropped",M.props.onDrop);var J=M.containerElem.getBoundingClientRect();M.setState({clicked:!0,leftOffset:J.left-A,topOffset:J.top-H,left:J.left,top:J.top}),M.props.onDragStart(M.props.dragData)},M.handleMouseMove=function(A){M.props.noDragging||(A.preventDefault(),M.state.clicked&&(M.drag(A.clientX,A.clientY),window.getSelection().removeAllRanges()))},M.handleTouchMove=function(A){M.props.noDragging||(A.preventDefault(),M.state.clicked&&M.drag(A.targetTouches[0].clientX,A.targetTouches[0].clientY))},M.getOffscreenCoordinates=function(A,H){var J=window.innerWidth-10,ae=window.innerHeight-10,Ne=A<10?A-10:A>J?A-J:0,Ee=H<10?H-10:H>ae?H-ae:0;return!(!Ee&&!Ne)&&[Ne,Ee]},M.drag=function(A,H){M.generateEnterLeaveEvents(A,H);var J={dragging:!0},ae=M.getOffscreenCoordinates(A,H);ae?M.startScrolling.apply(M,l(ae)):(M.stopScrolling(),M.props.yOnly||(J.left=M.state.leftOffset+A-M.fixedOffsetLeft),M.props.xOnly||(J.top=M.state.topOffset+H-M.fixedOffsetTop)),M.setState(J),M.props.onDrag(M.props.dragData,M.currentTarget,A,H)},M.handleMouseUp=function(A){M.setState({clicked:!1}),M.state.dragging&&(document.removeEventListener("mousemove",M.handleMouseMove),document.removeEventListener("mouseup",M.handleMouseUp),M.drop(A.clientX,A.clientY),window.getSelection().removeAllRanges())},M.handleTouchEnd=function(A){M.setState({clicked:!1}),M.state.dragging&&M.drop(A.changedTouches[0].clientX,A.changedTouches[0].clientY)},M.drop=function(A,H){M.stopScrolling(),M.generateDropEvent(A,H),document.removeEventListener(M.props.targetKey+"Dropped",M.props.onDrop),M._isMounted&&M.setState({dragging:!1}),M.props.onDragEnd(M.props.dragData,M.currentTarget,A,H)},M.getDisplayMode=function(){return!M.state.dragging||M.props.dragClone||M.props.customDragElement?"normal":M.props.disappearDraggedElement?"disappeared":"hidden"},M.state={leftOffset:0,topOffset:0,left:0,top:0,clicked:!1,dragging:!1},M.dragElem=null,M.containerElem=null,M.sourceElem=null,M.currentTarget=null,M.prevTarget=null,M._isMounted=!0,M.fixedOffsetLeft=0,M.fixedOffsetTop=0,M.scrollTimer=null,M.xScroll=0,M.yScroll=0,M}return f(R,O),k(R,[{key:"componentDidMount",value:function(){for(var Z=this.containerElem.getElementsByTagName("IMG"),M=0;M<Z.length;M+=1)Z[M].setAttribute("draggable","false");if(this.props.dragHandleClassName)for(var A=this.containerElem.getElementsByClassName(this.props.dragHandleClassName),H=0;H<A.length;H+=1)this.addListeners(A[H]),A[H].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 Z=this,M=this.props.render?this.props.render(this.state):this.props.children,A=this.getDisplayMode(),H=void 0;H=this.props.customDragElement?this.props.customDragElement:M;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"},ae=C.default.createElement("div",{className:"ddcontainerghost",style:J,ref:function(we){Z.dragElem=we}},H),Ne={position:A==="disappeared"?"absolute":"relative",display:"inline-block"},Ee={display:A==="disappeared"?"none":"inherit",visibility:A==="hidden"?"hidden":"inherit"};return C.default.createElement("div",{className:"ddcontainer",style:Ne,ref:function(we){Z.containerElem=we}},C.default.createElement("span",{className:"ddcontainersource",style:Ee,ref:function(we){Z.sourceElem=we}},M),ae)}}]),R}(C.default.Component);I.propTypes={children:S.default.node,targetKey:S.default.string,customDragElement:S.default.oneOfType([S.default.string,S.default.node]),disappearDraggedElement:S.default.bool,dragClone:S.default.bool,dragElemOpacity:S.default.number,dragData:S.default.object,dragHandleClassName:S.default.string,noDragging:S.default.bool,onDrop:S.default.func,onDrag:S.default.func,onDragEnd:S.default.func,onDragStart:S.default.func,render:S.default.func,xOnly:S.default.bool,yOnly:S.default.bool,zIndex:S.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,E){for(var S=0;S<E.length;S++){var I=E[S];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(C,I.key,I)}}return function(C,E,S){return E&&_(C.prototype,E),S&&_(C,S),C}}(),p=r(14),g=a(p),y=r(7),w=a(y),k=function(_){function C(E){l(this,C);var S=u(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,E));return S.handleDrop=function(I){var O=S.createEvent(S.props.targetKey+"Dropped",{dragData:I.dragData,dropElem:S.elem,dropData:S.props.dropData});I.containerElem.dispatchEvent(O),S.props.onHit(I),S.setState({highlighted:!1})},S.handleDragEnter=function(I){console.log("enter");var O=I;S.props.highlightClassName&&S.setState({highlighted:!0}),S.props.onDragEnter(O)},S.handleDragLeave=function(I){var O=I;S.props.highlightClassName&&S.setState({highlighted:!1}),S.props.onDragLeave(O)},S.elem=null,S.state={highlighted:!1},S}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(E,S){var I=void 0;return typeof window.CustomEvent!="function"?(I=document.createEvent("CustomEvent"),I.initCustomEvent(E,!0,!0,{})):I=new CustomEvent(E,{bubbles:!0,cancelable:!0}),Object.assign(I,S),I}},{key:"render",value:function(){var E=this,S="droptarget "+(this.state.highlighted?this.props.highlightClassName:"");return g.default.createElement("span",{ref:function(I){E.elem=I},className:S},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 q=A.hasOwnProperty(B)?A[B]:null;Ee.hasOwnProperty(B)&&f(q==="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(q==="DEFINE_MANY"||q==="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 q=te.prototype,K=q.__reactAutoBindPairs;B.hasOwnProperty(p)&&J.mixins(te,B.mixins);for(var ne in B)if(B.hasOwnProperty(ne)&&ne!==p){var D=B[ne],$=q.hasOwnProperty(ne);if(k($,ne),J.hasOwnProperty(ne))J[ne](te,D);else{var ie=A.hasOwnProperty(ne),ge=typeof D=="function",le=ge&&!ie&&!$&&B.autobind!==!1;if(le)K.push(ne,D),q[ne]=D;else if($){var se=A[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"?q[ne]=S(q[ne],D):se==="DEFINE_MANY"&&(q[ne]=I(q[ne],D))}else q[ne]=D}}}}function C(te,B){if(B)for(var q in B){var K=B[q];if(B.hasOwnProperty(q)){var ne=q 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.',q);var D=q in te;if(D){var $=H.hasOwnProperty(q)?H[q]: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.",q),void(te[q]=S(te[q],K))}te[q]=K}}}function E(te,B){f(te&&B&&typeof te=="object"&&typeof B=="object","mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var q in B)B.hasOwnProperty(q)&&(f(te[q]===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.",q),te[q]=B[q]);return te}function S(te,B){return function(){var q=te.apply(this,arguments),K=B.apply(this,arguments);if(q==null)return K;if(K==null)return q;var ne={};return E(ne,q),E(ne,K),ne}}function I(te,B){return function(){te.apply(this,arguments),B.apply(this,arguments)}}function O(te,B){var q=B.bind(te);return q}function R(te){for(var B=te.__reactAutoBindPairs,q=0;q<B.length;q+=2){var K=B[q],ne=B[q+1];te[K]=O(te,ne)}}function Z(te){var B=function(K,ne,D){this.__reactAutoBindPairs.length&&R(this),this.props=K,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 we,B.prototype.constructor=B,B.prototype.__reactAutoBindPairs=[],M.forEach(_.bind(null,B)),_(B,ae),_(B,te),_(B,Ne),B.getDefaultProps&&(B.defaultProps=B.getDefaultProps()),f(B.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var q in A)B.prototype[q]||(B.prototype[q]=null);return B}var M=[],A={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"},H={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},J={displayName:function(te,B){te.displayName=B},mixins:function(te,B){if(B)for(var q=0;q<B.length;q++)_(te,B[q])},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=S(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(){}},ae={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}},we=function(){};return u(we.prototype,g.prototype,Ee),Z}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 q=B&&(Ne&&B[Ne]||B[Ee]);if(typeof q=="function")return q}function y(B,q){return B===q?B!==0||1/B==1/q:B!==B&&q!==q}function w(B){this.message=B,this.stack=""}function k(B){function q(ne,D,$,ie,ge,le,se){if(ie=ie||we,le=le||$,se!==u&&p){var De=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 De.name="Invariant Violation",De}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 K=q.bind(null,!1);return K.isRequired=q.bind(null,!0),K}function _(B){function q(K,ne,D,$,ie,ge){var le=K[ne];return H(le)!==B?new w("Invalid "+$+" `"+ie+"` of type `"+J(le)+"` supplied to `"+D+"`, expected `"+B+"`."):null}return k(q)}function C(B){function q(K,ne,D,$,ie){if(typeof B!="function")return new w("Property `"+ie+"` of component `"+D+"` has invalid PropType notation inside arrayOf.");var ge=K[ne];if(!Array.isArray(ge))return new w("Invalid "+$+" `"+ie+"` of type `"+H(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(q)}function E(B){function q(K,ne,D,$,ie){if(!(K[ne]instanceof B)){var ge=B.name||we;return new w("Invalid "+$+" `"+ie+"` of type `"+ae(K[ne])+"` supplied to `"+D+"`, expected instance of `"+ge+"`.")}return null}return k(q)}function S(B){function q(K,ne,D,$,ie){for(var ge=K[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(q):a}function I(B){function q(K,ne,D,$,ie){if(typeof B!="function")return new w("Property `"+ie+"` of component `"+D+"` has invalid PropType notation inside objectOf.");var ge=K[ne],le=H(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 De=B(ge,se,D,$,ie+"."+se,u);if(De instanceof Error)return De}return null}return k(q)}function O(B){function q(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 K=0;K<B.length;K++){var ne=B[K];if(typeof ne!="function")return a}return k(q)}function R(B){function q(K,ne,D,$,ie){var ge=K[ne],le=H(ge);if(le!=="object")return new w("Invalid "+$+" `"+ie+"` of type `"+le+"` supplied to `"+D+"`, expected `object`.");for(var se in B){var De=B[se];if(De){var He=De(ge,se,D,$,ie+"."+se,u);if(He)return He}}return null}return k(q)}function Z(B){function q(K,ne,D,$,ie){var ge=K[ne],le=H(ge);if(le!=="object")return new w("Invalid "+$+" `"+ie+"` of type `"+le+"` supplied to `"+D+"`, expected `object`.");var se=l({},K[ne],B);for(var De in se){var He=B[De];if(!He)return new w("Invalid "+$+" `"+ie+"` key `"+De+"` supplied to `"+D+"`.\nBad object: "+JSON.stringify(K[ne],null," ")+`
511
+ Valid keys: `+JSON.stringify(Object.keys(B),null," "));var Re=He(ge,De,D,$,ie+"."+De,u);if(Re)return Re}return null}return k(q)}function M(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(M);if(B===null||f(B))return!0;var q=g(B);if(!q)return!1;var K,ne=q.call(B);if(q!==B.entries){for(;!(K=ne.next()).done;)if(!M(K.value))return!1}else for(;!(K=ne.next()).done;){var D=K.value;if(D&&!M(D[1]))return!1}return!0;default:return!1}}function A(B,q){return B==="symbol"||q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&q instanceof Symbol}function H(B){var q=typeof B;return Array.isArray(B)?"array":B instanceof RegExp?"object":A(q,B)?"symbol":q}function J(B){if(B==null)return""+B;var q=H(B);if(q==="object"){if(B instanceof Date)return"date";if(B instanceof RegExp)return"regexp"}return q}function ae(B){return B.constructor&&B.constructor.name?B.constructor.name:we}var Ne=typeof Symbol=="function"&&Symbol.iterator,Ee="@@iterator",we="<<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(q,K,ne,D,$){var ie=q[K];return f(ie)?null:new w("Invalid "+D+" `"+$+"` of type `"+H(ie)+"` supplied to `"+ne+"`, expected a single ReactElement.")}return k(B)}(),instanceOf:E,node:function(){function B(q,K,ne,D,$){return M(q[K])?null:new w("Invalid "+D+" `"+$+"` supplied to `"+ne+"`, expected a ReactNode.")}return k(B)}(),objectOf:I,oneOf:S,oneOfType:O,shape:R,exact:Z};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 E=C.instancePool.pop();return C.call(E,k,_),E}return new C(k,_)},d=function(k,_,C){var E=this;if(E.instancePool.length){var S=E.instancePool.pop();return E.call(S,k,_,C),S}return new E(k,_,C)},f=function(k,_,C,E){var S=this;if(S.instancePool.length){var I=S.instancePool.pop();return S.call(I,k,_,C,E),I}return new S(k,_,C,E)},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,E=a,S=function(O){return O},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:S,DOM:d,version:g,__spread:E};t.exports=I},function(t,s,r){function a(A){return(""+A).replace(Z,"$&/")}function l(A,H){this.func=A,this.context=H,this.count=0}function u(A,H,J){var ae=A.func,Ne=A.context;ae.call(Ne,H,A.count++)}function d(A,H,J){if(A==null)return A;var ae=l.getPooled(H,J);I(A,u,ae),l.release(ae)}function f(A,H,J,ae){this.result=A,this.keyPrefix=H,this.func=J,this.context=ae,this.count=0}function p(A,H,J){var ae=A.result,Ne=A.keyPrefix,Ee=A.func,we=A.context,te=Ee.call(we,H,A.count++);Array.isArray(te)?g(te,ae,J,S.thatReturnsArgument):te!=null&&(E.isValidElement(te)&&(te=E.cloneAndReplaceKey(te,Ne+(!te.key||H&&H.key===te.key?"":a(te.key)+"/")+J)),ae.push(te))}function g(A,H,J,ae,Ne){var Ee="";J!=null&&(Ee=a(J)+"/");var we=f.getPooled(H,Ee,ae,Ne);I(A,p,we),f.release(we)}function y(A,H,J){if(A==null)return A;var ae=[];return g(A,ae,null,H,J),ae}function w(A,H,J){return null}function k(A,H){return I(A,w,null)}function _(A){var H=[];return g(A,H,null,S.thatReturnsArgument),H}var C=r(24),E=r(0),S=r(5),I=r(34),O=C.twoArgumentPooler,R=C.fourArgumentPooler,Z=/\/+/g;l.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},C.addPoolingTo(l,O),f.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},C.addPoolingTo(f,R);var M={forEach:d,map:y,mapIntoWithKeyPrefixInternal:g,count:k,toArray:_};t.exports=M},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,E){var S=typeof k;if(S!=="undefined"&&S!=="boolean"||(k=null),k===null||S==="string"||S==="number"||S==="object"&&k.$$typeof===f)return C(E,k,_===""?y+a(k,0):_),1;var I,O,R=0,Z=_===""?y:_+w;if(Array.isArray(k))for(var M=0;M<k.length;M++)I=k[M],O=Z+a(I,M),R+=l(I,O,C,E);else{var A=p(k);if(A){var H,J=A.call(k);if(A!==k.entries)for(var ae=0;!(H=J.next()).done;)I=H.value,O=Z+a(I,ae++),R+=l(I,O,C,E);else for(;!(H=J.next()).done;){var Ne=H.value;Ne&&(I=Ne[1],O=Z+g.escape(Ne[0])+w+a(I,0),R+=l(I,O,C,E))}}else if(S==="object"){var Ee="",we=String(k);d("31",we==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":we,Ee)}}return R}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}])})}(Wl)),Wl.exports}var M1=oS();const lS=({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
512
+ rounded-lg border-4 border-dashed cursor-pointer
513
+ shelf-media-source ${f} ${e}`,children:[c.jsxs("div",{className:"flex flex-col justify-center items-center",children:[c.jsx(Ub,{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})]})},cS=({onFile:n,className:e,...t})=>{const[s,r]=v.useState(!1),[a,l]=v.useState(!1),[u,d]=v.useState();v.useEffect(()=>{r(Fv())},[]);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
514
+ shelf-media-source
515
+ border-4 border-dashed cursor-pointer rounded-lg
516
+ ${_} ${e}`,children:[c.jsxs("div",{className:`flex flex-col justify-center items-center
517
+ text-gray-500 dark:text-gray-400`,children:[c.jsx(_k,{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(ke,{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})]})},uS=({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
518
+ shelf-media-source rounded-lg
519
+ border-4 border-dashed cursor-pointer
520
+ border-gray-300
521
+ ${e}`,...t,children:c.jsxs("div",{className:"flex flex-col justify-center items-center",children:[c.jsx(C5,{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(wy,{ref:s,onSelect:r=>n(r.url)},"gallery")]})},hS=({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 bd();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
+ border-gray-300
524
+ rounded-lg shelf-media-source
525
+ border-4 border-dashed cursor-pointer
526
+ ${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(Cn,{children:"from url",className:"w-fit h-9",onClick:g=>f(a)}),c.jsx(kk,{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
527
+ bg-white dark:bg-slate-600`,onChange:g=>r(g.currentTarget.checked)})]})]}),c.jsx("p",{children:u??"",className:"text-red-600"}),c.jsx(Ge,{className:"mt-1 w-full",placeholder:"from URL..",type:"text",value:a,onChange:g=>l(g.currentTarget.value)})]})})},Pi=({field:n,value:e=[],onChange:t,className:s,...r})=>{const{sdk:a}=wt(),[l,u]=v.useState(!1),[d,f]=v.useState([]),[p,g]=v.useState(e??[]),[y,w]=v.useState(),[k,_]=v.useState("");v.useEffect(()=>{u(Fv())},[]);const C=v.useCallback((M,A)=>{w(H=>{try{URL.revokeObjectURL(H)}catch{}return M}),_(A)},[]),E=v.useCallback(M=>{const A=URL.createObjectURL(M[0]);C(A,M[0].name)},[C]),S=v.useCallback((M,A=!1)=>{if(A)C(M,M);else{const H=[M,...p];g(H),t&&t(H)}},[C,p,t]),I=v.useCallback(async(M,A,H,J,ae)=>{if(C(void 0),M==null)return;const Ne=URL.createObjectURL(M),Ee=Date.now();f(we=>[{status:"working",id:Ee,preview:Ne},...we]),H=decodeURIComponent(H.toString()).split("/").pop(),H.includes(".")&&(H=H.split(".").slice(0,-1).join(".")),H=`${H}_${Date.now()}_w_${J}_h_${ae}.${A}`;try{const we=`images/${H}`;if(!await a.storage.putBytes(we,M))throw"wow";const q=[`storage://${we}`,...p];g(q),t&&t(q),f(K=>K.filter(ne=>ne.id!==Ee)),URL.revokeObjectURL(Ne)}catch(we){console.log(we),f(te=>{let B=te.find(q=>q.id===Ee);return B.status="failed",B.error_code=we.code,[...te]})}},[C,p,t]),O=v.useCallback(M=>{console.log(M,p);const A=[...p];A.splice(M,1),g(A),t&&t(A)},[p,t]),R=v.useCallback(M=>{C(p[M],p[M])},[p,C]),Z=v.useCallback((M,A)=>{console.log(M,"-",A);const H=[...p],J=H[A];H[A]=H[M],H[M]=J,g(H),t&&t(H)},[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(lS,{onFile:E,className:"flex-1 min-w-fit h-32"}),c.jsx(cS,{onFile:E,className:"flex-1 min-w-fit h-32"}),c.jsx(hS,{onFinish:S,className:"flex-1 min-w-fit h-32"}),c.jsx(uS,{onFinish:S,className:"flex-1 min-w-fit h-32"})]}),c.jsx(ke,{show:y,children:c.jsx(eS,{onComplete:I,name:k,source:y,className:`w-full mt-6
528
+ shelf-border-color border
529
+ bg-slate-200 dark:bg-slate-200/10
530
+ rounded-3xl overflow-clip`})}),c.jsx(dS,{urls:p,uploads:d,onImageOrder:Z,onImageClick:R,onImageRemove:O})]})},dS=({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,E)=>{g.current=E,E.dragElem.style.display="block",d(C)},[]),w=v.useCallback((C,E)=>{u==C&&d(-1)},[u]),k=v.useCallback((C,E)=>{d(-1),r(C,parseInt(E.dragData))},[r]),_=v.useCallback((C,E,S,I)=>{var O;(O=g.current)!=null&&O.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
531
+ 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
532
+ bg-pink-50 dark:bg-pink-50/10
533
+ 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
534
+ bg-pink-50 dark:bg-pink-50/10
535
+ text-kf-500 dark:text-kf-400 `})," Drag and Drop thumbnails to change images order."]})]}),c.jsx(mt,{className:"my-4"}),c.jsxs("div",{className:`flex flex-row justify-start flex-wrap w-full
536
+ h-fit gap-3 `,children:[e==null?void 0:e.map((C,E)=>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(dc,{src:C.preview,crossOrigin:"anonymous",className:`object-cover w-20 h-20 rounded-xl shadow-lg
537
+ border border-black opacity-30 relative`}),c.jsx("div",{className:`w-full h-full --bg-red-400 absolute top-0 flex
538
+ flex-row animate-spin justify-center items-center`,children:c.jsx(tv,{className:"text-5xl text-gray-500"})})]})},E)),n==null?void 0:n.map((C,E)=>c.jsx(M1.DragDropContainer,{dragData:E,dragClone:!0,targetKey:"obi",onDragEnd:_,children:c.jsx(M1.DropTarget,{onDragEnter:S=>y(E,S),onDragLeave:S=>w(E,S),onHit:S=>k(E,S),targetKey:"obi",children:c.jsxs("div",{className:"py-3 w-24 h-24 relative",id:`urls_draggable_${E+e.length}`,children:[c.jsx(dc,{src:C,onClick:S=>t(E),crossOrigin:"anonymous",className:"object-cover cursor-pointer w-20 h-20 rounded-xl ---transition-transform shadow-lg border-2 border-black opacity-100 "+(f!=E&&u==E?"border-kf-500 scale-110 ":"")}),c.jsx(Gd,{onClick:S=>s(E),className:`text-black dark:text-gray-400 cursor-pointer
539
+ text-2xl absolute top-0 right-0`})]})})},`urls_draggable_${E+e.length}`))]})]})},fS=({context:n,product:e,onRemove:t})=>{const{navWithState:s}=Jn(),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
540
+ items-center py-3 border-b shelf-border-color`,children:[c.jsx(_i,{children:c.jsx("a",{onClick:r,className:"cursor-pointer",children:c.jsx("span",{children:e==null?void 0:e.title})})}),c.jsx($a,{className:`cursor-pointer h-6 w-9 pl-3
541
+ border-l shelf-border-color
542
+ flex-shrink-0`,onClick:t})]})},pS=({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(Cn,{children:"Browse products",stroke:"border-2",className:"w-40 h-10 mx-auto",onClick:()=>d.current.show()}),c.jsx(Ls,{ref:d,children:c.jsx(ao,{onSave:f,onCancel:()=>d.current.hide()})}),(l==null?void 0:l.length)>0&&c.jsx(mt,{className:"mt-5"}),l.map(g=>c.jsx(fS,{product:g,context:e,onRemove:()=>p(g.handle)},g.handle))]})},mS=({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:Ha(),value:y};if((C=s==null?void 0:s.values)==null?void 0:C.some(E=>E.value===w.value))return;const _={...s,values:[w,...(s==null?void 0:s.values)??[]]};l(_)},[s,Ha,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(Ge,{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(ke,{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(Ge,{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(Cn,{children:"add",className:"h-10 ",onClick:f})]})]}),c.jsx(lv,{className:"absolute right-0 top-0 cursor-pointer text-xl",onClick:g=>e(s)})]})},gS=({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:Ha(),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(mS,{option:u,onRemove:a,onChange:r},u==null?void 0:u.id)),c.jsx(eo,{onClick:l,Icon:av,className:`cursor-pointer text-6xl hover:scale-110
543
+ transition-transform`})]})},by=(n,e=[])=>{let t=[];if(n==e.length)return[];if(n==e.length-1)return e[n].map(r=>[r]);let s=by(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},vS=(n,e)=>n.every(t=>e.some(s=>s.option_id===t.option_id&&s.value_id===t.value_id)),xS=({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(_=>vS(n,_.selection)))==null?void 0:w.product)==null?void 0:k.handle)},[a,n]),{navWithState:u}=Jn(),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
544
+ shelf-border-color border-b pb-3`,children:[c.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[c.jsx(ke,{show:!!l,children:c.jsx(X1,{className:"text-lg text-green-500"})}),c.jsx("p",{children:r,className:"text-base font-medium flex-1"})]}),c.jsxs(Xd,{toggle:!!l,children:[c.jsxs("div",{className:"flex flex-row gap-3 flex-shrink-0 items-center",children:[c.jsx(_i,{children:c.jsx(us,{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(_i,{children:c.jsx("span",{children:"view",className:"cursor-pointer",onClick:d})})]}),c.jsx(_i,{children:c.jsx(us,{Icon:void 0,text:"create",show:!0,onClick:p,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit underline "})})]})]})},yS=({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 by(0,r)},[n]);return c.jsx("div",{className:"w-full flex flex-col gap-2",children:s.map(r=>c.jsx(xS,{combination:r,context:e,options:n,setError:t},r==null?void 0:r.map(a=>a.value_id).join("_")))})},wS="‼️ Create at least ONE Option with two values",bS=({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(so,{to:`/pages/products/${t==null?void 0:t.parent_handle}`,current_state:n==null?void 0:n.getState,children:c.jsx(_i,{children:t==null?void 0:t.parent_handle})})]})},kS=({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(bS,{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(gS,{options:a,onChange:u}),c.jsx(mt,{className:"w-full ",dashed:!0}),c.jsxs("div",{className:"flex flex-row w-full items-center gap-1",children:[c.jsx(d4,{className:"text-xl "}),c.jsx("p",{children:"Variants",className:"text-xl w-full font-semibold"})]}),c.jsxs(Xd,{toggle:(a==null?void 0:a.length)??!1,className:"w-full",children:[c.jsx(yS,{options:a,context:t,setError:s}),c.jsx("div",{className:"w-full shelf-text-minor-light text-base",children:wS})]})]})}):"You have to create the product before you add variants"},_S=({value:n,onClick:e})=>{var r;const t=n.info.details.type??n.info.details.meta.type,s=((r=ot==null?void 0:ot[t])==null?void 0:r.name)??t??"unknown";return c.jsxs("div",{className:`w-full flex flex-col gap-2
545
+ py-3 border-b shelf-border-color`,children:[c.jsxs("div",{className:"flex flex-row justify-between items-center",children:[c.jsx(_i,{children:c.jsx("a",{onClick:()=>e(n),className:"cursor-pointer",children:c.jsx("span",{children:n==null?void 0:n.title})})}),c.jsx(Lt,{value:`**\`${s}\`**`,className:"text-right"})]}),c.jsx(Lt,{value:(n==null?void 0:n.description)??"Discount does not have `description`"})]})},CS=({field:n,context:e,value:t=[],onChange:s,setError:r,...a})=>{const l=t.length>0,{navWithState:u}=Jn(),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(ke,{show:!l,children:c.jsx(Lt,{value:"This `product` is not **eligible** for `discounts`"})}),c.jsx(ke,{show:l,children:c.jsx("div",{className:"flex flex-col max-h-52 overflow-y-scroll",children:t.map(f=>c.jsx(_S,{value:f,onClick:d},f.id))})})]})},NS={name:"Root",comp:Ye,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(CS,{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(jc,{className:"w-full h-fit"}),desc:`Product handle uniquely identifies the product.
546
+ 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(n1),desc:"Set ISBN identifier",comp_params:{className:"w-full h-fit"}},{key:"variants_options",name:"Product Variants",validate:!1,editable:!0,comp:ce(kS,{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(Pi),comp_params:{className:"w-full"}},{key:"video",name:"🎥 Video",type:"text",validate:!1,editable:!0,comp:ce(n1),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"}}]},jS=n=>n,SS={name:"Root2",comp:Ye,comp_params:{className:"w-full lg:w-[19rem] flex flex-col gap-5"},fields:[jS({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(ro,{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(pS)},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Tags help you attach attributes to products",comp:ce(vr)},{key:"collections",name:"🗂️ Collections",type:"compund",validate:!1,editable:!0,desc:"Which collections does this product belong to ?",comp:ce(Ea,{resource:"collections",slug:"/pages/collections"})}]},ES={name:"Root",comp:Ye,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:[NS,SS]},id=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,ref_head:S,ref_root:I}=Pn("products",t,"/pages/products",n,s),O=v.useCallback(()=>l({discounts:void 0,title:(g==null?void 0:g.title)+" duplicate"}),[g,l]),R=v.useMemo(()=>({...d,getState:()=>{const M=d.getState();return console.log("state",M),M==null||delete M.variants,{data:M.data,hasChanged:M.hasChanged}},removeVariant:async M=>{await p.products.remove(M),await u()},preCreateVariant:async()=>{var A,H;const M=(H=(A=I.current.get(!1))==null?void 0:A.data)==null?void 0:H.variants_options;await p.products.upsert({...g,variants_options:M})}}),[g,u,d]);let Z=[t??"create"];return g&&"parent_handle"in g&&(Z=[g==null?void 0:g.parent_handle,"variants",...Z]),c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{major:["products",...Z],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:O,onClickReload:y?void 0:()=>u(!1),id:t,className:"mt-5"}),c.jsx(ds,{ref:S,time:g==null?void 0:g.created_at,className:"mt-8",changes_made:_},g==null?void 0:g.updated_at),c.jsx(ke,{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(Sn,{error:E,className:"w-full"}),c.jsx(Rn,{ref:I,context:R,field:ES,value:g??{},isViewMode:k,className:"mt-8"},f)]})})]})},MS=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],D1=({})=>{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}}=gn("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(ke,{show:!l,children:c.jsx(tn,{should_onboard:f,overallCollectionCount:u,hasLoaded:a,resource:d})}),c.jsx(ke,{show:l,children:l==null?void 0:l.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
547
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:!1,ref:t,reload:g,createLink:"/pages/collections/create",searchTitle:"Search by Name or Handle",isLoading:r}),c.jsxs(ke,{show:!l&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:MS}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},DS=[{key:"title",name:"Title",comp:pt},{key:"updated_at",name:"Last Updated",comp:qn},{key:void 0,name:"Actions",comp:mn}],TS=v.forwardRef(({collection_handle_or_id:n,limit:e=5,context:t,onLoaded:s,...r},a)=>{const{sdk:l}=wt(),{page:u,queryCount:d,actions:{prev:f,next:p,query:g}}=mr(`collections/${n}/products`,Ri,!1),y=vf();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(S=>S.id===k||S.handle===k);if(_==-1)return;const C=t.data,E=u[_];await l.products.batchRemoveProductsFromCollection([E],C),u.splice(_,1),y()}}),[y,u,t]);return c.jsxs(c.Fragment,{children:[c.jsx(en,{context:w,data:u,fields:DS}),c.jsx(pn,{prev:f,next:p,onLimitChange:void 0})]})}),IS=({value:n,context:e})=>{const{sdk:t}=wt(),[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(pr,{name:"🎁 Products in collection "+(a>=0?`(${a})`:""),className:"w-full --lg:w-[30rem] h-fit",border:!0,error:u,children:[c.jsxs(ke,{show:n==null?void 0:n.handle,children:[c.jsx(TS,{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(qe,{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(dk,{className:"text-4xl text-white "+(s?"animate-spin":"")})})]})}),c.jsx(Ls,{ref:f,children:c.jsx(ao,{onSave:g,onCancel:()=>f.current.hide()})})]}),c.jsx(ke,{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={name:"Root",comp:Ye,comp_params:{className:"w-full flex flex-col gap-5 max-w- lg:w-[35rem]"},fields:[{comp:IS,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(jc,{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(Pi),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"}}]},AS={name:"Main",comp:Ye,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(ro,{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(vr),comp_params:{className:"w-full "}}]},OS={name:"Root",comp:Ye,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:[LS,AS]},RS=({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(Ms,{Icon:c.jsx(ov,{}),text:"publish",keep_text_on_load:!0,show:!!s,onClick:s,className:""})}),ad=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,error:S,ref_head:I,ref_root:O}=Pn("collections",t,"/pages/collections",n,s),R=v.useCallback(()=>d({title:(y==null?void 0:y.title)+" duplicate"}),[y,d]),Z=v.useCallback(async()=>{await r(),l(void 0);try{await g.collections.publish(t,400),await u()}catch(M){l({messages:[{message:M.toString()}]})}},[t,r,u]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{major:["collections",t??"create"],className:""}),c.jsx(gs,{doc:y,className:"mt-5",collectionId:"collections"}),c.jsx(RS,{onClickSave:k?r:void 0,onClickCreate:w?r:void 0,onClickPublish:w?void 0:Z,onClickDelete:w?void 0:a,onClickDuplicate:w?void 0:R,onClickReload:w?void 0:async()=>u(!1),id:t,className:"mt-5"}),c.jsx(ds,{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(ke,{show:E&&k||w,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(Sn,{error:S,className:"w-full"}),c.jsx(Rn,{ref:O,field:OS,context:f,value:y??{},isViewMode:_,className:"mt-8"},p)]})})]})},Yl=n=>{switch(n){case ot.regular.type:return"bg-teal-600 dark:bg-teal-600/40";case ot.bulk.type:return"bg-red-400 dark:bg-red-400/40";case ot.buy_x_get_y.type:return"bg-cyan-500 dark:bg-cyan-500/40";case ot.order.type:return"bg-kf-400 dark:bg-kf-400/40";case ot.bundle.type:return"bg-sky-500 dark:bg-sky-400/40";default:return"bg-slate-400 dark:bg-slate-400/20"}},PS=({value:n,...e})=>{var a;const t=(n==null?void 0:n.type)??((a=n==null?void 0:n.meta)==null?void 0:a.type),s=v.useMemo(()=>{var l,u,d,f;return((f=(d=(u=(l=Object.values(ot).find(p=>p.type===t))==null?void 0:l.name)==null?void 0:u.split)==null?void 0:d.call(u," "))==null?void 0:f[0])??t??"unknown"},[n]),r="text-white rounded-xl py-px px-2 whitespace-nowrap border shelf-border-color-blend "+Yl(n==null?void 0:n.type);return c.jsx("span",{className:r+" bg-",children:s})},zS=({...n})=>c.jsxs("div",{...n,children:[c.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[c.jsx(Ut,{to:"/pages/discounts",draggable:"false",children:c.jsx(or,{value:"all",bgColor:"bg-pink-400 dark:bg-pink-400/60"})}),Object.values(ot).filter(e=>!!e.type).map(e=>c.jsx(Ut,{draggable:"false",to:`/pages/discounts/q/search=type:${e.type}`,children:c.jsx(or,{value:e.name,bgColor:Yl(e.type)})},e.id))]}),c.jsxs("div",{className:"flex flex-row flex-wrap gap-2 mt-1",children:[Object.values(Mi).map(e=>c.jsx(Ut,{draggable:"false",to:`/pages/discounts/q/search=app:${e.name2}`,children:c.jsx(or,{value:e.name,bgColor:Yl(void 0)})},e.id)),[{name:"enabled",v:!0},{name:"disabled",v:!1}].map((e,t)=>c.jsx(Ut,{draggable:"false",to:`/pages/discounts/q/search=active=${e.v}`,children:c.jsx(or,{value:e.name,bgColor:Yl(void 0)})},t))]})]}),BS=({value:n,context:e,...t})=>{const s=e.item.active?"bg-teal-500":"bg-red-500",r="whitespace-nowrap pr-2 font-mono text-base max-w-[150px] sm:max-w-max overflow-clip hover:overflow-x-auto",a=e.item.application.id===Mi.Manual.id;return c.jsxs("div",{className:r,children:[c.jsx("span",{children:n}),a&&c.jsx(_5,{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}`})]})},VS=[{key:"handle",name:"Code",comp:BS},{key:"info.details",name:"Type",comp:PS},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn}],T1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsx(zS,{className:"mt-5"}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
555
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,reload:g,ref:t,createLink:"/pages/discounts/create",searchTitle:"Search by Code, type...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:VS}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})};var ja={},I1;function $S(){if(I1)return ja;I1=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.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 ja.default=n,ja}var FS=$S();const HS=Ja(FS);var Ql={exports:{}},US=Ql.exports,L1;function WS(){return L1||(L1=1,function(n,e){(function(t,s){n.exports=s()})(US,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]:{},F=document.createElement(Y);return j&&F.classList.add(...j.split(" ")),T&&(F.id=T),z&&(F.innerHTML=z),U&&d(F,U),F}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 F in U)U[F]&&Y.push(F);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=S(Y,!1).getTime(),U=S(j,!1).getTime();return z?T>=U:T>U}function E(Y,j){return!C(Y,j,!0)}function S(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 O(Y,j){return!(!Y||Y===document||Y instanceof DocumentFragment)&&(Y.matches(j)?Y:O(Y.parentNode,j))}function R(Y,j,z){return Y>z?z:Y<j?j:Y}function Z(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[F,P]of Object.entries(U))if(P!==void 0&&P.toString()==="[object Object]"){let Q=Y[F]!==void 0?Y[F].toString():void 0,oe=P.toString(),he=Array.isArray(P)?[]:{};Y[F]=Y[F]?Q!==oe?he:Y[F]:he,Z(Y[F],P)}else Y[F]=P}),Y}function M(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 A(Y){let j="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+j+")("+Y+")($|<|"+j+")","g")}function H(Y,j,z){return(j=function(T){var U=function(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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:F}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};H(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),H(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),H(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),H(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),H(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),H(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()}),H(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=F,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),F=((j=this.customData)===null||j===void 0?void 0:j.attrs)||{};this.$cell=u({attrs:{"data-year":z,"data-month":T,"data-date":U,...F}}),this.$cell.adpCell=this}_getClassName(){var j;let z=new Date,{selectOtherMonths:T,selectOtherYears:U}=this.opts,{minDate:F,maxDate:P,isDateDisabled:Q}=this.dp,{day:oe}=p(this.date),he=this._isOutOfMinMaxRange(),je=Q(this.date),_e=k("air-datepicker-cell",`-${this.singleType}-`,{"-current-":_(z,this.date,this.type),"-min-date-":F&&_(F,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(oe),"-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(_e,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:F,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!F&&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:F,year:P,date:Q}=p(U),oe=T===r.days,he=T===r.years,je=!!j&&new Date(P,he?j.getMonth():F,oe?Q:j.getDate()),_e=!!z&&new Date(P,he?z.getMonth():F,oe?Q:z.getDate());return j&&z?E(je,j)||C(_e,z):j?E(je,j):z?C(_e,z):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:j,focusDate:z,rangeDateTo:T,rangeDateFrom:U}=this.dp,F=j.length;if(!F)return;let P=U,Q=T;if(F===1&&z){const Oe=C(z,j[0]);P=Oe?j[0]:z,Q=Oe?z:j[0]}let oe=k({"-in-range-":P&&Q&&(he=this.date,je=P,_e=Q,C(he,je)&&E(he,_e)),"-range-from-":P&&_(this.date,P,this.type),"-range-to-":Q&&_(this.date,Q,this.type)});var he,je,_e;this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),oe&&this.$cell.classList.add(...oe.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 ae(Y,j,z){return(j=function(T){var U=function(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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 we{constructor(j){let{dp:z,type:T,opts:U}=j;ae(this,"handleClick",F=>{let P=F.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)}),ae(this,"handleDayNameClick",F=>{let P=F.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(P),datepicker:this.dp})}),ae(this,"onChangeCurrentView",F=>{F!==this.type?this.hide():(this.show(),this.render())}),ae(this,"onMouseOverCell",F=>{let P=O(F.target,Ee);this.dp.setFocusDate(!!P&&P.adpCell.date)}),ae(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),ae(this,"onClickBody",F=>{let{onClickDayName:P}=this.opts,Q=F.target;Q.closest(Ee)&&this.handleClick(F),P&&Q.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(F)}),ae(this,"onMouseDown",F=>{this.pressed=!0;let P=O(F.target,Ee),Q=P&&P.adpCell;_(Q.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),_(Q.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),ae(this,"onMouseMove",F=>{if(!this.pressed||!this.dp.isMinViewReached)return;F.preventDefault();let P=O(F.target,Ee),Q=P&&P.adpCell,{selectedDates:oe,rangeDateTo:he,rangeDateFrom:je}=this.dp;if(!Q||Q.isDisabled)return;let{date:_e}=Q;if(oe.length===2){if(this.rangeFromFocused&&!C(_e,he)){let{hours:Oe,minutes:Xe}=p(je);_e.setHours(Oe),_e.setMinutes(Xe),this.dp.rangeDateFrom=_e,this.dp.replaceDate(je,_e)}if(this.rangeToFocused&&!E(_e,je)){let{hours:Oe,minutes:Xe}=p(he);_e.setHours(Oe),_e.setMinutes(Xe),this.dp.rangeDateTo=_e,this.dp.replaceDate(he,_e)}}}),ae(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),ae(this,"onChangeViewDate",(F,P)=>{if(!this.isVisible)return;let Q=w(F),oe=w(P);switch(this.dp.currentView){case r.days:if(_(F,P,r.months))return;break;case r.months:if(_(F,P,r.years))return;break;case r.years:if(Q[0]===oe[0]&&Q[1]===oe[1])return}this.render()}),ae(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(F=>{this.$cells.appendChild(F.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,F=j,P=0;for(;P<7;){let Q=F%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++,F++}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(){we.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:F}}=j,P=f(T),{year:Q,month:oe}=p(T),he=new Date(Q,oe,1),je=new Date(Q,oe,P),_e=he.getDay()-F,Oe=6-je.getDay()+F;_e=_e<0?_e+7:_e,Oe=Oe>6?Oe-7:Oe;let Xe=function(Ce,Me){let{year:Je,month:nn,date:rt}=p(Ce);return new Date(Je,nn,rt-Me)}(he,_e),Ct=P+_e+Oe,dt=Xe.getDate(),{year:xs,month:zn}=p(Xe),Nt=0;U&&(Ct=42);const ue=[];for(;Nt<Ct;){let Ce=new Date(xs,zn,dt+Nt);z&&z(Ce),ue.push(Ce),Nt++}return ue}static getMonthsDates(j,z){let{year:T}=j.parsedViewDate,U=0,F=[];for(;U<12;){const P=new Date(T,U);F.push(P),z&&z(P),U++}return F}static getYearsDates(j,z){let T=w(j.viewDate),U=T[0]-1,F=T[1]+1,P=U,Q=[];for(;P<=F;){const oe=new Date(P,0);Q.push(oe),z&&z(oe),P++}return Q}static getDatesFunction(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.days;return{[r.days]:we.getDaysDates,[r.months]:we.getMonthsDates,[r.years]:we.getYearsDates}[j]}}function te(Y,j,z){return(j=function(T){var U=function(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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 F=O(U.target,".air-datepicker-nav--action");if(!F)return;let P=F.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:F}=this.opts;this.$prev.innerHTML=U,this.$next.innerHTML=F,this._resetNavStatus(),this.render(),this.handleNavStatus()}),te(this,"renderDelay",()=>{setTimeout(this.render)}),te(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(U,F){for(let P in F)F[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:F}=this.dp.parsedViewDate,P=!!z&&p(z),Q=!!T&&p(T);switch(this.dp.currentView){case r.days:z&&P.month>=F&&P.year>=U&&this._disableNav("prev"),T&&Q.month<=F&&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 oe=w(this.dp.viewDate);z&&P.year>=oe[0]&&this._disableNav("prev"),T&&Q.year<=oe[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(F=>{F.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 q={today:{content:Y=>Y.locale.today,onClick:Y=>Y.setViewDate(new Date)},clear:{content:Y=>Y.locale.clear,onClick:Y=>Y.clear()}};class K{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"&&q[z]&&(T=q[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:F={}}=j;return u({tagName:U,innerHtml:`<span tabindex='-1'>${typeof z=="function"?z(this.dp):z}</span>`,className:k("air-datepicker-button",T),attrs:F})}render(){this.generateButtons()}}function ne(Y,j,z){return(j=function(T){var U=function(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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:F,updateTime:P=!1}=U;F&&(this.setMinMaxTime(F),this.setCurrentTime(!!P&&F),this.addTimeToDate(F))}),ne(this,"onChangeLastSelectedDate",U=>{U&&(this.setTime(U),this.render())}),ne(this,"onChangeInputRange",U=>{let F=U.target;this[F.getAttribute("name")]=F.value,this.updateText(),this.dp.trigger(r.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),ne(this,"onMouseEnterLeave",U=>{let F=U.target.getAttribute("name"),P=this.$minutesText;F==="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(A("h"))||T.match(A("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:F,minMinutes:P,maxHours:Q,maxMinutes:oe,dayPeriod:he,opts:{hoursStep:je,minutesStep:_e}}=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="${F}" max="${Q}" step="${je}"/> </div> <div class="air-datepicker-time--row"> <input type="range" name="minutes" value="${U}" min="${P}" max="${oe}" step="${_e}"/> </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=R(z,this.minHours,this.maxHours),this.minutes=R(T,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:j,minMinutes:z,maxHours:T,maxMinutes:U}=this.opts;this.minHours=R(j,0,23),this.minMinutes=R(z,0,59),this.maxHours=R(T,0,23),this.maxMinutes=R(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(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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,F)=>F.up()]])),$(this,"handleHotKey",U=>{let F=this.hotKeys.get(U),P=p(this.getInitialFocusDate());F(P,this.dp);let{year:Q,month:oe,date:he}=P,je=f(new Date(Q,oe));je<he&&(he=je);let _e=this.dp.getClampedDate(new Date(Q,oe,he));this.dp.setFocusDate(_e,{viewDateTransition:!0})}),$(this,"isHotKeyPressed",()=>{let U=!1,F=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(oe=>{U||F!==oe.length||(U=oe.every(P)&&Q)});else{if(F!==Q.length)continue;U=Q.every(P)&&Q}}return U}),$(this,"isArrow",U=>U>=37&&U<=40),$(this,"onKeyDown",U=>{let{key:F,which:P}=U,{dp:Q,dp:{focusDate:oe},opts:he}=this;this.registerKey(F);let je=this.isHotKeyPressed();if(je)return U.preventDefault(),void this.handleHotKey(je);if(this.isArrow(P))return U.preventDefault(),void this.focusNextCell(F);if(F==="Enter"){if(Q.currentView!==he.minView)return void Q.down();if(oe){let _e=Q._checkIfDateIsSelected(oe);return void(_e?Q._handleAlreadySelectedDates(_e,oe):Q.selectDate(oe))}}F==="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:F}}=this.dp,P=j||T[T.length-1];if(!P)switch(z){case r.days:P=new Date(U,F,new Date().getDate());break;case r.months:P=new Date(U,F,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:F,years:P}=r,Q=p(z),oe=Q.year,he=Q.month,je=Q.date;switch(j){case"ArrowLeft":T===U&&(je-=1),T===F&&(he-=1),T===P&&(oe-=1);break;case"ArrowUp":T===U&&(je-=7),T===F&&(he-=3),T===P&&(oe-=4);break;case"ArrowRight":T===U&&(je+=1),T===F&&(he+=1),T===P&&(oe+=1);break;case"ArrowDown":T===U&&(je+=7),T===F&&(he+=3),T===P&&(oe+=4)}let _e=this.dp.getClampedDate(new Date(oe,he,je));this.dp.setFocusDate(_e,{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(F,P){if(typeof F!="object"||F===null)return F;var Q=F[Symbol.toPrimitive];if(Q!==void 0){var oe=Q.call(F,"string");if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(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="",De="",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 oe,he,{isMobile:je}=T.opts,_e=T.$el.getBoundingClientRect(),Oe=T.$el.getBoundingClientRect(),Xe=T.$datepicker.offsetParent,Ct=T.$el.offsetParent,dt=T.$datepicker.getBoundingClientRect(),xs=P.split(" "),zn=window.scrollY,Nt=window.scrollX,ue=T.opts.offset,Ce=xs[0],Me=xs[1];if(je)T.$datepicker.style.cssText="left: 50%; top: 50%";else{if(Xe===Ct&&Xe!==document.body&&(Oe={top:T.$el.offsetTop,left:T.$el.offsetLeft,width:_e.width,height:T.$el.offsetHeight},zn=0,Nt=0),Xe!==Ct&&Xe!==document.body){let Je=Xe.getBoundingClientRect();Oe={top:_e.top-Je.top,left:_e.left-Je.left,width:_e.width,height:_e.height},zn=0,Nt=0}switch(Ce){case"top":oe=Oe.top-dt.height-ue;break;case"right":he=Oe.left+Oe.width+ue;break;case"bottom":oe=Oe.top+Oe.height+ue;break;case"left":he=Oe.left-dt.width-ue}switch(Me){case"top":oe=Oe.top;break;case"right":he=Oe.left+Oe.width-dt.width;break;case"bottom":oe=Oe.top+Oe.height-dt.height;break;case"left":he=Oe.left;break;case"center":/left|right/.test(Ce)?oe=Oe.top+Oe.height/2-dt.height/2:he=Oe.left+Oe.width/2-dt.width/2}T.$datepicker.style.cssText=`left: ${he+Nt}px; top: ${oe+zn}px`}}),le(this,"_setInputValue",()=>{let{opts:P,$altField:Q,locale:{dateFormat:oe}}=this,{altFieldDateFormat:he,altField:je}=P;je&&Q&&(Q.value=this._getInputValue(he)),this.$el.value=this._getInputValue(oe)}),le(this,"_getInputValue",P=>{let{selectedDates:Q,opts:oe}=this,{multipleDates:he,multipleDatesSeparator:je}=oe;if(!Q.length)return"";let _e=typeof P=="function",Oe=_e?P(he?Q:Q[0]):Q.map(Xe=>this.formatDate(Xe,P));return Oe=_e?Oe:Oe.join(je),Oe}),le(this,"_checkIfDateIsSelected",function(P){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.days,oe=!1;return T.selectedDates.some(he=>{let je=_(P,he,Q);return oe=je&&he,je}),oe}),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=M(P))instanceof Date)||_(P,this.viewDate))return;let Q=this.viewDate;this.viewDate=P;let{onChangeViewDate:oe}=this.opts;if(oe){let{month:he,year:je}=this.parsedViewDate;oe({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=M(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 oe=T.views[P]=new we({dp:T,opts:T.opts,type:P});T.shouldUpdateDOM&&T.$content.appendChild(oe.$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,oe=this.$datepicker.parentNode;oe&&oe.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]:{},oe=Z({},T.opts),{silent:he}=Q;Z(T.opts,P);let{timepicker:je,buttons:_e,range:Oe,selectedDates:Xe,isMobile:Ct}=T.opts,dt=T.visible||T.treatAsInline;T._createMinMaxDates(),T._limitViewDateByMaxMinDates(),T._handleLocale(),Xe&&(T.selectedDates=[],T.selectDate(Xe,{silent:he})),P.view&&T.setCurrentView(P.view,{silent:he}),T._setInputValue(),oe.range&&!Oe?(T.rangeDateTo=!1,T.rangeDateFrom=!1):!oe.range&&Oe&&T.selectedDates.length&&(T.rangeDateFrom=T.selectedDates[0],T.rangeDateTo=T.selectedDates[1]),oe.timepicker&&!je?(dt&&T.timepicker.destroy(),T.timepicker=!1,T.$timepicker.parentNode.removeChild(T.$timepicker)):!oe.timepicker&&je&&T._addTimepicker(),!oe.buttons&&_e?T._addButtons():oe.buttons&&!_e?(T.buttons.destroy(),T.$buttons.parentNode.removeChild(T.$buttons)):dt&&oe.buttons&&_e&&T.buttons.clearHtml().render(),!oe.isMobile&&Ct?(T.treatAsInline||De||T._createMobileOverlay(),T._addMobileAttributes(),T.visible&&T._showMobileOverlay()):oe.isMobile&&!Ct&&(T._removeMobileAttributes(),T.visible&&(De.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(oe=>{let he=M(oe);if(!he)return;let je=Q?"delete":"add";this.disabledDates[je](this.formatDate(he,"yyyy-MM-dd"));let _e=this.getCell(he,this.currentViewSingular);_e&&_e.adpCell.render()},[])}),le(this,"enableDate",P=>{this.disableDate(P,!0)}),le(this,"isDateDisabled",P=>{let Q=M(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),[oe,he]=w(this.viewDate);return Q<oe||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 oe=!1;Q&&(oe=T.isOtherMonth(P)||T.isOtherYear(P)||T.isOtherDecade(P)),oe&&T.setViewDate(P),T.opts.onFocus&&T.opts.onFocus({datepicker:T,date:P})}),le(this,"_onChangeTime",P=>{let{hours:Q,minutes:oe}=P,he=new Date,{lastSelectedDate:je,opts:{onSelect:_e}}=this,Oe=je;je||(Oe=he);let Xe=this.getCell(Oe,this.currentViewSingular),Ct=Xe&&Xe.adpCell;Ct&&Ct.isDisabled||(Oe.setHours(Q),Oe.setMinutes(oe),je?(this._setInputValue(),_e&&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 we.getDatesFunction(P)(T)}),le(this,"isWeekend",P=>this.opts.weekends.includes(P)),le(this,"getClampedDate",P=>{let{minDate:Q,maxDate:oe}=this,he=P;return oe&&C(P,oe)?he=oe:Q&&E(P,Q)&&(he=Q),he}),this.$el=l(j),!this.$el)return;this.$datepicker=u({className:"air-datepicker"}),this.opts=Z({},a,z),this.$customContainer=!!this.opts.container&&l(this.opts.container),this.$altField=l(this.opts.altField||!1);let{view:U,startDate:F}=this.opts;F||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=M(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:F,keyboardNav:P,onlyTimepicker:Q}}=this,oe=l("body");(!He||He&&se&&!oe.contains(se))&&!T&&this.elIsInput&&!this.$customContainer&&Re.buildGlobalContainer(Re.defaultGlobalContainerId),!U||De||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}))),F&&this.selectDate(F,{silent:!0}),this.opts.visible&&!z&&this.show(),U&&!z&&this.$el.setAttribute("readonly",!0),z&&this._createComponents()}_createMobileOverlay(){De=u({className:"air-datepicker-overlay"}),se.appendChild(De)}_createComponents(){let{opts:j,treatAsInline:z,opts:{inline:T,buttons:U,timepicker:F,position:P,classes:Q,onlyTimepicker:oe,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(" ")),oe&&this.$datepicker.classList.add("-only-timepicker-"),he&&!z&&this._addMobileAttributes(),this.views[this.currentView]=new we({dp:this,type:this.currentView,opts:j}),this.nav=new B({dp:this,opts:j}),F&&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(){De.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){De.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&&M(j),this.maxDate=!!z&&M(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 K({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:F,timeFormat:P,dateTimeSeparator:Q}=this.opts;var oe;this.locale=(oe=j,JSON.parse(JSON.stringify(oe))),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)}F&&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&&E(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=M(j),!(j instanceof Date))return;let T=z,U=this.locale,F=p(j),P=F.dayPeriod,Q=w(j),oe=Re.replacer,he={T:j.getTime(),m:F.minutes,mm:F.fullMinutes,h:F.hours12,hh:F.fullHours12,H:F.hours,HH:F.fullHours,aa:P,AA:P.toUpperCase(),E:U.daysShort[F.day],EEEE:U.days[F.day],d:F.date,dd:F.fullDate,M:F.month+1,MM:F.fullMonth,MMM:U.monthsShort[F.month],MMMM:U.months[F.month],yy:F.year.toString().slice(-2),yyyy:F.year,yyyy1:Q[0],yyyy2:Q[1]};for(let[je,_e]of Object.entries(he))T=oe(T,A(je),_e);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:F,selectedDates:P}=this,{updateTime:Q}=T,{moveToOtherMonthsOnSelect:oe,moveToOtherYearsOnSelect:he,multipleDates:je,range:_e,autoClose:Oe,onBeforeSelect:Xe}=this.opts,Ct=P.length;if(Array.isArray(j))return j.forEach(dt=>{this.selectDate(dt,T)}),new Promise(dt=>{setTimeout(dt)});if((j=M(j))instanceof Date){if(Xe&&!Xe({date:j,datepicker:this}))return Promise.resolve();if(U===r.days&&j.getMonth()!==F.month&&oe&&(z=new Date(j.getFullYear(),j.getMonth(),1)),U===r.years&&j.getFullYear()!==F.year&&he&&(z=new Date(j.getFullYear(),0,1)),z&&this.setViewDate(z),je&&!_e){if(Ct===je)return;this._checkIfDateIsSelected(j)||P.push(j)}else if(_e)switch(Ct){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||_e?_e&&Ct===1&&this.hide():this.hide()),new Promise(dt=>{setTimeout(dt)})}}unselectDate(j){let z=this.selectedDates,T=this;if((j=M(j))instanceof Date)return z.some((U,F)=>{if(_(U,j))return z.splice(F,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(F=>_(F,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&&De.classList.remove("-active-")}_triggerOnSelect(){let j=[],z=[],{selectedDates:T,locale:U,opts:{onSelect:F,multipleDates:P,range:Q}}=this,oe=P||Q,he=typeof U.dateFormat=="function";T.length&&(j=T.map(S),z=he?P?U.dateFormat(j):j.map(je=>U.dateFormat(je)):j.map(je=>this.formatDate(je,U.dateFormat))),F({date:oe?j:j[0],formattedDate:oe?z:z[0],datepicker:this})}_handleAlreadySelectedDates(j,z){let{selectedDates:T,rangeDateFrom:U,rangeDateTo:F}=this,{range:P,toggleSelected:Q}=this.opts,oe=T.length,he=typeof Q=="function"?Q({datepicker:this,date:z}):Q,je=!!(P&&oe===1&&j),_e=je?S(z):z;P&&!he&&(oe!==2&&this.selectDate(_e),oe===2&&_(U,F))||(he?this.unselectDate(_e):this._updateLastSelectedDate(je?_e:j))}_handleUpDownActions(j,z){if(!((j=M(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=M(j))instanceof Date))return;let{year:T,month:U,date:F}=p(j),P=`[data-year="${T}"]`,Q=`[data-month="${U}"]`,oe={[r.day]:`${P}${Q}[data-date="${F}"]`,[r.month]:`${P}${Q}`,[r.year]:`${P}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(oe[z]):void 0}_showMobileOverlay(){De.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,F,P,Q){return F+T+Q})}}var gt;return le(Re,"defaults",a),le(Re,"version","3.5.3"),le(Re,"defaultGlobalContainerId","air-datepicker-global-container"),gt=Re.prototype,Object.assign(gt,ge),s.default}()})}(Ql)),Ql.exports}var YS=WS();const QS=Ja(YS),KS=({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 QS(a,n.options);return s(!0),()=>{l.destroy(),s(!1)}},[]),c.jsx("div",{...e,children:c.jsx("input",{className:"dark",type:"text",ref:r})})},ky=({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}=Jn(),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(io,{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(mt,{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})]})},ZS=({...n})=>c.jsx(ky,{...n}),_y=({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(Ux,{onSelect:a,header:"Select Tags",clsReload:"text-3xl text-kf-400",layout:1}),(s==null?void 0:s.length)>0&&c.jsx(mt,{className:"w-full mt-5"}),c.jsx(ps,{onRemove:l,onClick:l,tags:s,className:"mt-5"})]})},Cy=({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}=Jn(),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(Cn,{className:"text-sm mx-auto h-10 w-40 ",stroke:"border-2",children:"Browse products",onClick:()=>s.current.show()}),c.jsx(Ls,{ref:s,children:c.jsx(ao,{onSave:f,onCancel:()=>s.current.hide()})}),(r==null?void 0:r.length)>0&&c.jsx(mt,{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"})]})},GS=({...n})=>c.jsx(Cy,{...n}),JS=({...n})=>c.jsx(_y,{...n}),qS=({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(Ge,{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))})},XS=()=>c.jsx("p",{children:"All products are eligible"}),e9=({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(Ge,{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))})},t9=({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(Ge,{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))})},n9=({onChange:n,value:e={from:new Date().toISOString(),to:new Date().toISOString()}})=>{const[t,s]=v.useState(e),{darkMode:r}=fs(),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(KS,{className:"border p-3 shelf-card outline-none",air_datepicker:{options:{classes:r?"dark":"light",isMobile:!0,inline:!1,autoClose:!0,timepicker:!0,locale:HS,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)))})},s9=({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}=Jn(),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(Cn,{children:"Browse Customers",className:"text-sm mx-auto h-10 w-40",stroke:"border-2",onClick:()=>s.current.show()}),c.jsx(Ls,{ref:s,children:c.jsx(BC,{onSave:f,onCancel:()=>s.current.hide()})}),(r==null?void 0:r.length)>0&&c.jsx(mt,{className:"w-full mt-5"}),c.jsx(ps,{onRemove:l,onClick:d,name_fn:hy,tags:r,className:"mt-5"})]})},r9=({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
556
+ text-sm rounded-lg`,...f,children:[c.jsxs("div",{className:`shelf-border-color border-b pb-2 flex
557
+ 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
558
+ border whitespace-nowrap
559
+ ${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(fk,{onClick:l,className:`text-base items-center
560
+ cursor-pointer hover:text-teal-600
561
+ flex-shrink-0`})]}),s&&c.jsx(s,{...r,context:d,onChange:a,value:e}),c.jsx(ke,{show:p,children:c.jsx("p",{children:p,className:"text-red-600 py-3"})})]})},fc=[{...Et.p_in_collections,Comp:ky,CompParams:{}},{...Et.p_not_in_collections,Comp:ZS,CompParams:{}},{...Et.p_in_products,Comp:Cy,CompParams:{}},{...Et.p_not_in_products,Comp:GS,CompParams:{}},{...Et.p_in_tags,Comp:_y,CompParams:{}},{...Et.p_not_in_tags,Comp:JS,CompParams:{}},{...Et.p_in_price_range,Comp:qS,CompParams:{}},{...Et.p_all,Comp:XS,CompParams:{}},{...Et.o_subtotal_in_range,Comp:e9,CompParams:{}},{...Et.o_items_count_in_range,Comp:t9,CompParams:{}},{...Et.o_date_in_range,Comp:n9,CompParams:{}},{...Et.o_has_customer,Comp:s9,CompParams:{}}],i9=n=>{const e=fc.find(t=>t.op===n);return{name:e==null?void 0:e.name,Comp:e==null?void 0:e.Comp,CompParams:e==null?void 0:e.CompParams}},a9=({type:n,onAdd:e})=>{const t=fc.filter(s=>s.type===n);return c.jsx("button",{className:`shelf-bling-fill shelf-border-color
562
+ rounded-lg w-full border pl-2 sm:px-3 --pl-3
563
+ py-2 shadow-lg flex overflow-x-hidden
564
+ flex-col justify-between h-full text-base`,children:c.jsxs("select",{value:"-1",className:"w-full h-9 bg-transparent outline-none p-0",onChange:s=>e(s.currentTarget.value),children:[c.jsx("option",{children:`Add ${n} Filter`,value:"-1",className:"p-0 appearance-none"},"-1"),t.map((s,r)=>c.jsx("option",{children:s.name,value:s.id},r))]})})},Ny=({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 w={op:fc.find(_=>_.id==g).op,value:void 0},k=[...a,w];u(k)},[a,u,fc]);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(qe,{className:"flex-1",rounded:"rounded-lg",children:c.jsx(a9,{type:g,onAdd:p})},y))}),c.jsx(ke,{show:a.length,children:c.jsx("p",{children:"",className:`mt-5 h-0.5 mb-5 bg-gradient-to-r
565
+ from-pink-500/50 to-kf-500/50`})}),c.jsx("div",{className:"w-full flex flex-col gap-5",children:a.map((g,y)=>v.createElement(r9,{...i9(ec(g)),context:s,onChange:w=>d(y,w),onRemove:()=>f(y),key:y,ix:y,value:g.value,id:ec(g),type:ex(g)}))})]})},o9=n=>n===void 0?[!1,"You have to choose a Discount"]:[!0,void 0],A1=[{...ot.regular,desc:"All Filtered products you defined will get the same discount. For Example: Every shirt will have 10% discount"},{...ot.bulk,desc:"Set an exact bulk discount on filtered products. for Example, 3 for 100$, 5 for 5% off"},{...ot.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"},{...ot.order,desc:"Offer a discount on the total order including perks such as Free Shipping"},{...ot.bundle,desc:"Offer a discount on a bundle of products. For Example, buy a Laptop + Headset at discount 💲"}],l9=({selectedMeta:n,onChange:e})=>{const t=v.useMemo(()=>{var r;return(r=A1.find(a=>a.id===(n==null?void 0:n.id)))==null?void 0:r.desc},[n,A1]),s=({meta: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(ot).filter(r=>r.type).map((r,a)=>c.jsx(s,{meta: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"})})]})},c9=(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},u9=({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
566
+ flex-wrap text-base `,children:[c.jsxs("p",{children:[c.jsx(un,{children:"Customer"})," buys a ",c.jsx(un,{children:"Quantity"})," of"]}),c.jsx(Ge,{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(un,{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(Ge,{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(Ge,{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
567
+ 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(lo,{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})]})},h9=n=>{switch(ec(n)){case Et.p_all.op:return c.jsxs(c.Fragment,{children:[c.jsx("b",{children:"any"})," product"]});case Et.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 Et.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 Et.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 Et.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 Et.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 Et.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 Et.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"}},d9=n=>{switch(n){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return`${n}th`}},O1=n=>n3(n),f9=({value:n,context:e,onChange:t})=>{const[s,r]=v.useState([]),[a,l]=v.useState(n);v.useEffect(()=>{var f;return(()=>{var g;const p=((g=e==null?void 0:e.query["info.filters"])==null?void 0:g.get())??[];r([...p].filter(O1))})(),(f=e==null?void 0:e.pubsub)==null?void 0:f.add_sub((p,g=[])=>{p==="info.filters"&&r(g.filter(O1))})},[e]);const u=v.useCallback((d,f)=>{const p={...a,[d]:f};l(p),t(p)},[a,t]);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
568
+ text-base `,children:[c.jsx(ke,{show:s==null?void 0:s.length,children:s.map((d,f)=>c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx(un,{children:d9(f+1),className:"text-lg shelf-text-label-color"})," item in bundle is ",h9(d)]}),c.jsx(mt,{})]},f))}),c.jsx(ke,{show:!(s!=null&&s.length),children:c.jsxs("p",{className:"text-base mt-3",children:["Use the ",c.jsx(un,{children:"products"})," filters ",c.jsx("b",{children:"ABOVE ⬆️"}),". ",c.jsx("br",{}),"Each ",c.jsx(un,{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(Ge,{type:"number",min:"0",max:"100",step:"1",onWheel:d=>d.target.blur(),value:a.percent,onChange:d=>u("percent",Math.min(parseFloat(d.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(Ge,{type:"number",value:a.fixed,onWheel:d=>d.target.blur(),onChange:d=>u("fixed",parseFloat(d.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:a.recursive===!0,onChange:d=>u("recursive",!a.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
569
+ 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(lo,{prefix:"Bundle Price",percent:a==null?void 0:a.percent,fixed:a==null?void 0:a.fixed})]})},lo=({prefix:n,percent:e,fixed:t})=>{const s=c9(`(${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(Gb,{}),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 "})]})},p9=({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(un,{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
570
+ gap-3 items-center `,children:[c.jsx("label",{children:"Percents off"}),c.jsx(Ge,{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(Ge,{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(lo,{prefix:"Product Price",percent:s==null?void 0:s.percent,fixed:s==null?void 0:s.fixed})]})},un=({className:n="",...e})=>c.jsx("span",{className:`font-semibold border-b-2
571
+ shelf-border-color border-dashed ${n}`,...e}),m9=({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
572
+ `,children:[c.jsxs("p",{children:[c.jsx(un,{children:"Customer"})," buys a ",c.jsx(un,{children:"Quantity"})," of"]}),c.jsx(Ge,{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(un,{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
573
+ flex-wrap text-base`,children:[c.jsxs("p",{children:[c.jsx(un,{children:"Customer"})," gets a ",c.jsx(un,{children:"Quantity"})," of"]}),c.jsx(Ge,{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(un,{children:"products"})," specified by the filters ",c.jsx("b",{children:"BELOW ⬇️"})]})]}),c.jsx(Ny,{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(Ge,{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(Ge,{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
574
+ 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(lo,{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})]})},g9=({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(un,{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
575
+ `,children:[c.jsx("label",{children:"Percents off"}),c.jsx(Ge,{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(Ge,{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
576
+ 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(lo,{prefix:"Order Total",percent:s==null?void 0:s.percent,fixed:s==null?void 0:s.fixed})]})},v9=[{type:ot.regular.type,Comp:p9,CompParams:{}},{type:ot.bulk.type,Comp:u9,CompParams:{}},{type:ot.buy_x_get_y.type,Comp:m9,CompParams:{}},{type:ot.order.type,Comp:g9,CompParams:{}},{type:ot.bundle.type,Comp:f9,CompParams:{}}],x9=({meta:n,context:e,onChange:t,value:s,...r})=>{const a=v9.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})},y9=n=>{switch(n){case ot.regular.type:return{percent:0,fixed:0};case ot.bulk.type:return{percent:0,fixed:0,qty:3,recursive:!1};case ot.order.type:return{percent:0,fixed:0,free_shipping:!1};case ot.buy_x_get_y.type:return{percent:0,fixed:0,qty_x:1,qty_y:1,filters_y:[]};case ot.bundle.type:return{percent:0,fixed:0};default:return}},w9=n=>{if(n!=null&&n.meta)return n.meta;if(n!=null&&n.type){const e=ot[n==null?void 0:n.type];if(e)return e}},b9=({field:n,value:e,context:t,onChange:s,...r})=>{const[a,l]=v.useState(w9(e)),[u,d]=v.useState(e==null?void 0:e.extra),f=v.useCallback((y,w)=>{l(y),d(w),s&&s({type:y.type,extra:w})},[s]),p=v.useCallback(y=>{f(y,y9(y.type))},[f]),g=v.useCallback(y=>{f(a,y)},[a,f]);return c.jsxs("div",{className:"w-full",children:[c.jsx(l9,{onChange:p,selectedMeta:a}),c.jsx(ke,{show:a,children:c.jsx("p",{children:"",className:`border-b-g mt-5 h-0.5 mb-5 bg-gradient-to-r
577
+ from-pink-400 to-kf-300`})}),c.jsx(x9,{meta:a,context:t,onChange:g,value:e==null?void 0:e.extra})]})},k9=({field:n,context:e,error:t,setError:s,...r})=>{const{sdk:a}=wt(),[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\`
578
+
579
+ `,f+=`> Also, This \`discount\` was applied in **${l.affected_orders_count}** \`orders\`
580
+
581
+ `),c.jsx("div",{...r,children:c.jsx(ke,{show:l.loaded,children:c.jsx(Lt,{value:f})})})},_9=n=>n===void 0?[!1,"Empty Code"]:/\s/g.test(n)?[!1,"Code cannot contain whitespace/s"]:[!0,void 0],C9={key:"info",name:"Info",comp:Ye,comp_params:{className:"w-full flex flex-col gap-5"},validate:!1,fields:[{key:"filters",name:"🔎 Filters",validate:!0,desc:"Define which products or orders (by date, amount or customers) are eligible for discount",comp:ce(Ny,{className:"w-full h-9"},!0),comp_params:{className:"w-full"}},{key:"details",name:"⚙️ Discount Details",validate:!0,validator:o9,desc:"Choose the type of discount and its behaviour",comp:ce(b9,{className:"w-full h-9"},!0),comp_params:{className:"w-full"}}]},N9={name:"Main",comp:Ye,comp_params:{className:`w-full --max-w-[35rem] gap-5 items-center
582
+ 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:_9,editable:!0,desc:"A short word identifier for the discount",comp:ce(jc,{className:"w-full h-fit",type:"text",placeholder:"code ..."}),comp_params:{className:"w-full text-xs py-auto --font-semibold"}},C9,{key:"media",name:"🎥 Media",type:"text",desc:"Manage and edit your media files",validate:!1,editable:!0,comp:ce(Pi),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"}}]},j9=`
583
+ Order determines the order in which automatic discounts are applied.
584
+ <br/><br/>
585
+ Discounts are arranged as a stack and the order of application is important.
586
+ <br/><br/>
587
+ For Example, A discount with a \`0\` order will be applied before a discount with order 10.
588
+ <br/><br/>
589
+ Free Shipping for orders above say 100$ should be applied last and therefore should
590
+ have a high order number`,S9=`
591
+ Decide whether the discount is:
592
+ - **Automatically** applied, or
593
+ - **Coupon** (applied by user)
594
+ `,E9={name:"Main",comp:Ye,comp_params:{className:`w-full items-center lg:items-start lg:w-[18rem]
595
+ flex flex-col gap-5`},fields:[{key:"active",name:"Enable",validate:!0,desc:"Enable or disable the discount",editable:!0,defaultValue:!0,comp:ce(ro,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:void 0,name:"🚀 Performance",desc:"This is how this discount performs",comp:ce(k9,{className:""},!0),comp_params:{className:"w-full"}},{key:"application",name:"Automatic or Coupon",validate:!0,desc:S9,editable:!0,defaultValue:Mi.Auto,comp:ce($e(Fl(Object.values(Mi))),{className:""},!0),comp_params:{className:"w-full text-xs py-auto --font-semibold "}},{key:"priority",name:"Order of discount",type:"number",validate:!0,desc:j9,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(vr),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"}}]},M9={name:"Root",comp:Ye,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:[N9,E9]},D9=({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(Ms,{Icon:c.jsx(rv,{}),text:`${d?"update":"create"} collection`,show:!!s,onClick:s,className:""})}),od=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,ref_head:S,ref_root:I}=Pn("discounts",t,"/pages/discounts",n,s),O=v.useCallback(async()=>{await r(),await l(),u(void 0);try{await l()}catch(R){console.log("e",R),u({error:{messages:[{message:R.toString()}]}})}},[r,l]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{major:["discounts",t??"create"],className:""}),c.jsx(gs,{doc:g,className:"mt-5",collectionId:"discounts"}),c.jsx(D9,{onClickSave:w?r:void 0,onClickCreate:y?r:void 0,onClickPublish:y?void 0:O,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(ds,{changes_made:_,ref:S,time:g==null?void 0:g.created_at,className:"mt-8"},g==null?void 0:g.updated_at),c.jsx(ke,{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(Sn,{error:E,className:"w-full"}),c.jsx(Rn,{ref:I,field:M9,value:g??{},context:f,isViewMode:k,className:"mt-8 mx-auto"},p)]})})]})},T9=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"price",name:"Price",comp:pt,comp_params:{className:"font-mono",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],R1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
596
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/shipping-methods/create",searchTitle:"Search by Name or Handle",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:T9}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},I9={name:"Root",comp:Ye,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(Pi),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"}}]},L9={name:"Root2",comp:Ye,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(ro,{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(vr)}]},A9={name:"Root",comp:Ye,comp_params:{className:`w-full --max-w-[35rem] --bg-red-100 items-center
597
+ lg:max-w-max lg:items-start lg:w-fit flex flex-col
598
+ lg:flex-row gap-5 mx-auto`},fields:[I9,L9]},O9=({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}),ld=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,ref_root:S}=Pn("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(Xn,{major:["shipping",t??"create"],className:""}),c.jsx(gs,{doc:p,className:"mt-5",collectionId:"shipping"}),c.jsx(O9,{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(ds,{changes_made:k,ref:E,time:p==null?void 0:p.created_at,className:"mt-8"},p==null?void 0:p.updated_at),c.jsx(ke,{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(Sn,{error:C,className:"w-full"}),c.jsx(Rn,{ref:S,field:A9,value:p??{},isViewMode:w,context:d,className:"mt-8"},f)]})})]})},R9=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold "}},{key:"handle",name:"Handle",comp:pt},{key:"updated_at",name:"Last Updated",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],P1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
599
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/storefronts/create",searchTitle:"Search by title or handle",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:R9}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},P9=({field:n,context:e,value:t=[],onChange:s})=>{const r=v.useRef(null),{navWithState:a}=Jn(),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(Cn,{children:"Browse products",className:"--w-fit h-10 w-40 mx-auto",onClick:()=>r.current.show()}),c.jsx(Ls,{ref:r,children:c.jsx(ao,{onSave:d,onCancel:()=>r.current.hide()})}),(t==null?void 0:t.length)>0&&c.jsx(mt,{className:"my-5"}),c.jsx(ps,{onClick:u,onRemove:l,name_fn:f=>f.title,tags:t,clsCapsule:"bg-kf-500 dark:bg-kf-500/60",className:"mt-5"})]})},z9={name:"Root",comp:Ye,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(jc,{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(P9,{}),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(Ea,{className:"w-full",add_all:!1,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(Ea,{className:"w-full",add_all:!1,resource:"discounts",transform_fn:n=>n.filter(e=>e.application.id===Mi.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(Ea,{className:"w-full",add_all:!1,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(Ea,{className:"w-full",add_all:!1,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(Pi),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"}}]},B9={name:"Root2",comp:Ye,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(ro,{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(vr)},{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"}}]},V9={name:"Root",comp:Ye,comp_params:{className:`w-full --max-w-[35rem] --bg-red-100 items-center
600
+ lg:max-w-max lg:items-start lg:w-fit flex flex-col
601
+ lg:flex-row gap-5 mx-auto`},fields:[z9,B9]},$9=({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(Ms,{Icon:c.jsx(ov,{}),text:"publish",keep_text_on_load:!0,show:!!s,onClick:s,className:""})}),cd=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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:E,hasLoaded:S,error:I,ref_head:O,ref_root:R}=Pn("storefronts",t,"/pages/storefronts",n,s),Z=v.useCallback(()=>d({title:(w==null?void 0:w.title)+" duplicate"}),[w,d]),M=v.useCallback(async()=>{await a(),f(void 0);try{await y.storefronts.publish(t),await u()}catch(A){f({messages:[{message:A.toString()}]})}},[a,u,t]);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(Xn,{major:["storefronts",t??"create"],className:""}),c.jsx(gs,{doc:w,className:"mt-5",collectionId:"storefronts"}),c.jsx($9,{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:M,onClickDuplicate:k?void 0:Z,onClickReload:k?void 0:r,onClickDelete:k?void 0:l}),c.jsx(ds,{changes_made:E,ref:O,time:w==null?void 0:w.created_at,className:"mt-8"},w==null?void 0:w.updated_at),c.jsx(ke,{show:S&&_||k,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(Sn,{error:I,className:"w-full"}),c.jsx(Rn,{ref:R,field:V9,value:w??{},isViewMode:C,context:p,className:"mt-8"},g)]})})]})},F9=[{key:"title",name:"Title",comp:pt,comp_params:{className:"font-semibold"}},{key:"updated_at",name:"Last Updated ",comp:qn,comp_params:{className:"font-mono"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],z1=({})=>{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}}=gn("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(tn,{should_onboard:f,overallCollectionCount:l,hasLoaded:u,resource:d}),c.jsx(ke,{show:a,children:a==null?void 0:a.toString()}),c.jsxs("div",{className:`w-full rounded-md overflow-hidden
602
+ store-table-wrapper mt-5`,children:[c.jsx(Gn,{isCollectionEmpty:f,ref:t,reload:g,createLink:"/pages/posts/create",searchTitle:"Search by name, values...",isLoading:r}),c.jsxs(ke,{show:!a&&(s==null?void 0:s.length),children:[c.jsx(en,{context:e,data:s,fields:F9}),c.jsx(pn,{prev:y,next:w,limit:n.limit,onLimitChange:p})]})]})]})})},H9={name:"Root",comp:Ye,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(Pi),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"}}]},U9={name:"Root2",comp:Ye,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(vr)}]},W9={name:"Root",comp:Ye,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:[H9,U9]},ud=({mode:n,...e})=>{const{id:t,base:s}=fn(),{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}=Pn("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(Xn,{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(ds,{ref:_,time:d==null?void 0:d.created_at,className:"mt-8",changes_made:y},d==null?void 0:d.updated_at),c.jsxs(ke,{show:w&&p||f,children:[c.jsx(Sn,{error:k,className:"w-full max-w-[55rem] mx-auto"}),c.jsx(Rn,{ref:C,field:W9,value:d??{},context:u,isViewMode:g,className:"mx-auto"},d==null?void 0:d.updated_at)]})]})},Y9=({value:n,children:e,className:t,context:s,extra:r="max-w-[8rem] md:max-w-[18rem]",...a})=>{var d,f;const u=`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)??to,className:" rounded-md w-6 h-6 object-cover border dark:opacity-80"}),c.jsx("span",{children:String(n)??e})]})},Q9=[{key:"info.name",name:"Name",comp:Y9,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"handle",name:"Handle",comp:pt,comp_params:{className:"--font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],K9=({})=>{const{context:n,page:e,error:t,hasLoaded:s,resource:r,resource_is_probably_empty:a}=gn("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(ke,{show:!t,children:c.jsx(tn,{should_onboard:a,overallCollectionCount:(e==null?void 0:e.length)??0,hasLoaded:s,resource:r})}),c.jsx(ke,{show:t,children:t==null?void 0:t.toString()}),c.jsx("div",{className:`w-full rounded-md overflow-hidden
603
+ store-table-wrapper mt-5`,children:c.jsx(ke,{show:!t&&(e==null?void 0:e.length),children:c.jsx(en,{context:l,data:e,fields:Q9})})})]})})},Z9={name:"Root",comp:Ye,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(Lt,{},!0,!0),comp_params:{className:"w-full"}},{key:"info",comp:Ye,comp_params:{className:"flex flex-col gap-5 w-full"},fields:[{key:"name",name:"Name",type:"text",validate:!1,editable:!0,comp:ce(Lt),comp_params:{className:"w-full"}},{key:"description",name:"Description",comp:ce(Lt),comp_params:{className:"w-full"}},{key:"url",name:"URL",type:"text",validate:!1,editable:!0,comp:ce(Lt),comp_params:{className:"w-full"}}]}]},G9={name:"Root2",comp:Ye,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(Df,{},!0,!0),comp_params:{className:"w-full"}}]},J9={name:"Root",comp:Ye,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:[Z9,G9]},q9=({className:n,...e})=>c.jsx("img",{className:"rounded-md object-cover border dark:opacity-80 "+n,...e}),X9=({})=>{var d,f;const{id:n}=fn(),{context:e,key:t,doc:s,hasLoaded:r,error:a,ref_root:l}=Pn("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(q9,{src:u??to,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(mt,{className:"mt-5"}),c.jsxs(ke,{show:r,children:[c.jsx(Sn,{error:a,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Rn,{ref:l,field:J9,value:s??{},context:e,isViewMode:!1,className:"mx-auto"},t)]})]})},eE=({value:n,children:e,className:t,context:s,extra:r="max-w-[8rem] md:max-w-[18rem]",...a})=>{var d,f;const u=` 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)??to,className:"rounded-md w-6 h-6 object-cover border dark:opacity-80"}),c.jsx("div",{children:n??e})]})},tE=[{key:"info.name",name:"Name",comp:eE,comp_params:{className:"font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:"handle",name:"Handle",comp:pt,comp_params:{className:"--font-semibold",extra:"max-w-[10rem] md:max-w-[18rem]"}},{key:void 0,name:"Actions",comp:mn,comp_params:{className:""}}],nE=({})=>{const{context:n,page:e,error:t,hasLoaded:s,resource:r,resource_is_probably_empty:a}=gn("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(tn,{should_onboard:a,overallCollectionCount:(e==null?void 0:e.length)??0,hasLoaded:s,resource:r}),c.jsx(ke,{show:t,children:t==null?void 0:t.toString()}),c.jsx(ke,{show:!t&&e,children:c.jsx("div",{className:`w-full rounded-md overflow-hidden
604
+ store-table-wrapper mt-5`,children:c.jsx(en,{context:l,data:e,fields:tE})})})]})})},sE={name:"Root",comp:Ye,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(Lt,{},!0,!0),comp_params:{className:"w-full"}},{key:"info",comp:Ye,comp_params:{className:"flex flex-col gap-5 w-full"},fields:[{key:"name",name:"Name",type:"text",validate:!1,editable:!0,comp:ce(Lt),comp_params:{className:"w-full"}},{key:"description",name:"Description",type:"text",validate:!1,editable:!0,comp:ce(Lt),comp_params:{className:"w-full"}},{key:"url",name:"URL",type:"text",validate:!1,editable:!0,comp:ce(Lt),comp_params:{className:"w-full"}}]}]},rE={name:"Root2",comp:Ye,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(Df,{},!0,!0),comp_params:{className:"w-full"}}]},iE={name:"Root",comp:Ye,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:[sE,rE]},aE=({className:n,...e})=>c.jsx("img",{className:"rounded-md object-cover border dark:opacity-80 "+n,...e}),oE=({})=>{var d,f;const{id:n}=fn(),{context:e,key:t,doc:s,hasLoaded:r,error:a,ref_root:l}=Pn("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(aE,{src:u??to,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(mt,{className:"mt-5"}),c.jsxs(ke,{show:r,children:[c.jsx(Sn,{error:a,className:"w-full max-w-[35rem] mx-auto"}),c.jsx(Rn,{ref:l,field:iE,value:s??{},context:e,isViewMode:!1,className:"mx-auto"},t)]})]})},hd=({value:n,title:e,description:t,...s})=>c.jsx(pr,{name:e,desc:t,border:!0,...s,children:c.jsx(qe,{stroke:"border-b",rounded:"rounded-lg",children:c.jsx(Lt,{className:`rounded-md p-3
605
+ w-full text-base min-h-8 align-middle
606
+ shelf-input-color flex flex-row items-center`,value:n})})}),lE=({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
607
+ shelf-input-color shelf-border-color border rounded-md`,children:[c.jsx(Lt,{className:`rounded-md overflow-x-scroll
608
+ text-base min-h-8 align-middle
609
+ flex flex-row items-center`,value:n}),c.jsx(Nf,{value:n,process_before_copy:e})]})}),cE=({user:n,removePromise:e})=>c.jsxs("div",{className:`flex flex-row justify-between items-center
610
+ 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(Ms,{text:"revoke",Icon:c.jsx(yk,{}),className:"h-6",rounded:"rounded-md",keep_text_on_load:!0,onClick:()=>e(n)})]}),uE=({...n})=>{var w,k;const{actions:{apikeys:{create:e,list:t},users:{remove:s}}}=mf(),[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(pr,{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(cE,{user:_,removePromise:g},_.email))}),c.jsxs("div",{className:"flex flex-col gap-3 mt-3 w-full",children:[c.jsx(us,{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(ke,{show:l,children:[c.jsx(mt,{className:"my-2"}),c.jsx("span",{children:"latest api key (only visible to you)"}),c.jsx(lE,{value:`\`${l}\``,process_before_copy:_=>_.slice(1,-1)})]})]})]})},hE=({...n})=>{var g,y;const{auth:e,actions:{changePassword:t}}=mf(),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(pr,{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(Ge,{stroke:"border-none",ref:s}),c.jsx("p",{children:"New Password"}),c.jsx(Ge,{stroke:"border-none",ref:r}),c.jsx("p",{children:"Confirm New Password"}),c.jsx(Ge,{stroke:"border-none",ref:a}),c.jsxs("div",{className:"w-full flex flex-row justify-between mt-3",children:[c.jsxs(Xd,{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(f4,{}),c.jsx("span",{children:"All done",className:"text-base font-normal"})]}),c.jsx("span",{})]}),c.jsx(Ms,{Icon:c.jsx(j5,{}),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 "})]})]})]})},dE=n=>{var t,s;let e=`Here is what you need to know:
611
+
612
+ `;return n!=null&&n.auth_admins_emails&&(e=`- The following are the **admin** emails:
613
+ `+(n==null?void 0:n.auth_admins_emails.map(r=>` - ${r}`).join(`
614
+ `))),n!=null&&n.auth_secret_access_token&&(e+=`
615
+ - **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+=`
616
+ - **JWT** refresh token \`secret\` is **${((s=n==null?void 0:n.auth_secret_refresh_token)==null?void 0:s.slice(0,4))+"------------"}**`),e},fE=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
617
+ website is ${t} and the support email is ${s} .
618
+
619
+
620
+ <br/>
621
+
622
+ The following is the description of your store
623
+ > ${r}
624
+ `},pE=n=>{let e=`**Checkout** info
625
+
626
+ `;switch(n==null?void 0:n.checkout_reserve_stock_on){case"checkout_create":e+="> Stock is **automatically** reserved upon `checkout creation`";break;case"checkout_complete":e+="> Stock is **automatically** reserved upon `checkout completion`";break;default:e+="> Stock is **manually** reserved"}return e+=`
627
+
628
+ **Storage** info
629
+
630
+
631
+
632
+ `,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},mE=({})=>{const{doc:n,hasLoaded:e,error:t}=pf("reference","settings",!0,!0);return c.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[c.jsx(tn,{hasLoaded:e,resource:"settings"}),c.jsx(mt,{className:"my-5"}),c.jsx(ke,{show:e,children:c.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[c.jsx(Sn,{error:t,className:"w-full"}),c.jsxs("div",{className:`w-full items-center lg:max-w-max lg:items-start \\
633
+ 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(uE,{}),c.jsx(hE,{}),c.jsx(hd,{value:fE(n),title:"🛍️ Your General Store information"}),c.jsx(hd,{value:dE(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(hd,{value:pE(n),title:"🛒 More information"})})]})]})})]})},B1=({})=>{const n=v.useRef(void 0);return c.jsxs("div",{className:"w-full h-full",children:[c.jsx(tn,{overallCollectionCount:void 0,hasLoaded:!0,resource:"Gallery"}),c.jsx(wy,{ref:n,onSelect:console.log}),c.jsx(yy,{className:"w-full mt-5 "})]})};function gE(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 dd=({label:n="",Icon:e,className:t,...s})=>c.jsxs("p",{className:`text-2xl mb-5 w-full overflow-auto --text-gray-500
634
+ border-b shelf-border-color pb-2 flex flex-row gap-2 items-center
635
+ ${t}`,...s,children:[e&&c.jsx(e,{className:"inline-block text-kf-500"}),c.jsx("span",{children:n})]}),vE=({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
636
+ p-1 px-3 rounded-full whitespace-nowrap --my-1
637
+ hover:scale-105 transition-transform inline-block
638
+ max-w-full overflow-x-auto
639
+ ${e} ${a}`,children:l,...r})},xE=({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(vE,{value:s},r))}),yE=({usage:n=[],...e})=>n.length==0?c.jsx("p",{children:"No usage recorded"}):c.jsx("div",{children:n.map((t,s)=>c.jsx(Ut,{to:`/pages/${t}`,draggable:"false",children:c.jsx("p",{children:t,className:"shelf-text-label-color underline font-semibold"})},s))}),wE=({})=>{const{handle:n}=fn(),{doc:e,hasLoaded:t,error:s,actions:{remove:r}}=pf("images",n),a=v.useRef(void 0),[l,u]=v.useState(!1),d=Is(),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(Xn,{major:["images",n],className:""}),c.jsx(ke,{show:t,children:c.jsx(pr,{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(qe,{stroke:"border-2",className:"w-fit h-fit",rounded:"rounded-full",children:c.jsx(Xa,{className:`h-6 px-2
640
+ bg-slate-50 dark:bg-slate-800
641
+ text-gray-600 dark:text-gray-400
642
+ rounded-full text-base font-semibold tracking-tight`,Icon:c.jsx(Jd,{className:"--text-red-500 text-base"}),loading:l,text:"delete",onClick:f})})}),c.jsxs(ke,{show:e&&t,children:[c.jsx(dc,{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(dd,{label:"Url",Icon:Qb,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(dd,{label:"Usage",Icon:gE,className:""}),c.jsx(yE,{usage:e==null?void 0:e.usage})]}),c.jsxs("div",{className:"w-full",children:[c.jsx(dd,{label:"Tags",Icon:Zb,className:""}),c.jsx(xE,{search:e==null?void 0:e.search})]})]})]})})}),c.jsx(Cf,{ref:a,onApprove:p,title:c.jsxs("p",{className:`text-xl flex
643
+ flex-row items-center gap-3`,children:[c.jsx(qd,{className:"text-2xl"}),"Warning"]})})]})};function bE(n){return c.jsxs(Cb,{children:[c.jsx(be,{path:"*",element:c.jsx(bb,{to:"home"})}),c.jsx(be,{path:"home",element:c.jsx(wl,{className:"",children:c.jsx(_C,{})})}),c.jsx(be,{path:"settings",element:c.jsx(wl,{className:"",children:c.jsx(mE,{})})}),c.jsxs(be,{path:"apps",element:c.jsx(wl,{className:""}),children:[c.jsxs(be,{path:"gallery",children:[c.jsx(be,{path:"",element:c.jsx(B1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(B1,{})}),c.jsx(be,{path:"img/:handle",element:c.jsx(wE,{})})]}),c.jsxs(be,{path:"templates",children:[c.jsx(be,{path:"",element:c.jsx(v1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(v1,{})}),c.jsx(be,{path:":id",element:c.jsx(sd,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(sd,{mode:"view"})}),c.jsx(be,{path:"create",element:c.jsx(sd,{mode:"create"})})]}),c.jsxs(be,{path:"extensions",children:[c.jsx(be,{path:"",element:c.jsx(nE,{})}),c.jsx(be,{path:":id/view",element:c.jsx(oE,{})})]})]}),c.jsxs(be,{path:"pages",element:c.jsx(wl,{className:""}),children:[c.jsxs(be,{path:"storefronts",children:[c.jsx(be,{path:"",element:c.jsx(P1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(P1,{})}),c.jsx(be,{path:":id",element:c.jsx(cd,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(cd,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(cd,{mode:"create"})})]}),c.jsxs(be,{path:"chats",children:[c.jsx(be,{path:"",element:c.jsx(m1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(m1,{})})]}),c.jsxs(be,{path:"customers",children:[c.jsx(be,{path:"",element:c.jsx(p1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(p1,{})}),c.jsx(be,{path:":id",element:c.jsx(Jh,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(Jh,{mode:"view"})}),c.jsx(be,{path:"create",element:c.jsx(Jh,{mode:"create"})})]}),c.jsxs(be,{path:"tags",children:[c.jsx(be,{path:"",element:c.jsx(g1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(g1,{})}),c.jsx(be,{path:":id",element:c.jsx(qh,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(qh,{mode:"view"})}),c.jsx(be,{path:"create",element:c.jsx(qh,{mode:"create"})})]}),c.jsxs(be,{path:"products",children:[c.jsx(be,{path:"",element:c.jsx(N1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(N1,{})}),c.jsx(be,{path:":id",element:c.jsx(id,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(id,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(id,{mode:"create"})})]}),c.jsxs(be,{path:"collections",children:[c.jsx(be,{path:"",element:c.jsx(D1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(D1,{})}),c.jsx(be,{path:":id",element:c.jsx(ad,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(ad,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(ad,{mode:"create"})})]}),c.jsxs(be,{path:"orders",children:[c.jsx(be,{path:"",element:c.jsx(s1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(s1,{})}),c.jsx(be,{path:":id",element:c.jsx(Gh,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(Gh,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(Gh,{mode:"create"})})]}),c.jsxs(be,{path:"discounts",children:[c.jsx(be,{path:"",element:c.jsx(T1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(T1,{})}),c.jsx(be,{path:":id",element:c.jsx(od,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(od,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(od,{mode:"create"})})]}),c.jsxs(be,{path:"shipping-methods",children:[c.jsx(be,{path:"",element:c.jsx(R1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(R1,{})}),c.jsx(be,{path:":id",element:c.jsx(ld,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(ld,{mode:"view"})}),c.jsx(be,{path:"create/:base?",element:c.jsx(ld,{mode:"create"})})]}),c.jsxs(be,{path:"posts",children:[c.jsx(be,{path:"",element:c.jsx(z1,{})}),c.jsx(be,{path:"q/:query_params",element:c.jsx(z1,{})}),c.jsx(be,{path:":id",element:c.jsx(ud,{mode:"edit"})}),c.jsx(be,{path:":id/view",element:c.jsx(ud,{mode:"view"})}),c.jsx(be,{path:"create",element:c.jsx(ud,{mode:"create"})})]}),c.jsxs(be,{path:"payment-gateways",children:[c.jsx(be,{path:"",element:c.jsx(K9,{})}),c.jsx(be,{path:":id/view",element:c.jsx(X9,{})})]})]})]})}const kE=({...n})=>c.jsx("div",{...n,children:c.jsxs("div",{className:`w-full h-10 flex flex-row justify-end items-center
644
+ 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(Ck,{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(Nk,{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(jk,{className:"text-xl"})})]})}),_E=({...n})=>c.jsxs("div",{...n,children:[c.jsxs("div",{className:`w-full h-full px-3
645
+ flex flex-row items-center
646
+ bg-gradient-to-r from-transparent to-kf-500
647
+ justify-between text-sm sm:text-base whitespace-nowrap`,children:[c.jsx("a",{href:"https://storecraft.app",children:c.jsx(Uv,{className:"h-[27px] pl-6"})}),c.jsx("a",{href:"https://storecraft.app/docs",className:"animate-pulse",title:"Read The Docs",children:c.jsx(CE,{})})]}),c.jsx("div",{className:`w-full bg-gradient-to-r
648
+ from-kf-500 to-pink-500
649
+ dark:from-pink-500 dark:to-kf-500 h-1
650
+ dark:shadow-[0px_0px_10px] dark:shadow-pink-500/80`})]}),CE=({})=>c.jsx(qe,{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
651
+ py-1 px-2 --border text-white font-semibold`,children:c.jsx("span",{children:"Read The docs"})})}),fd=({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
652
+ font-normal --text-gray-500`}),c.jsx(qe,{className:"mt-2",children:c.jsx("input",{className:`rounded-md h-10 px-3
653
+ w-full block
654
+ shelf-input-color
655
+ hover:ring-pink-400 hover:ring-2
656
+ font-normal transition-none `,value:n[t]??"",onChange:u=>r(t,u.currentTarget.value),...a})})]}),NE=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"},jE=({dash:{onChange:n,onSubmit:e,error:t,credentials:s,is_backend_endpoint_editable:r=!0},...a})=>{const{sdk:l,actions:{updateConfig:u}}=wt(),d=v.useCallback((f,p)=>{u({...l.config,endpoint:p}),n(f,p)},[n,u]);return c.jsx("div",{...a,children:c.jsx(qe,{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
657
+ tracking-wider font-medium gap-5 rounded-md`,onSubmit:e,children:[c.jsx(fd,{dash:{id:"email",label:"Email",input_params:{type:"email",autoComplete:"on",name:"email"},desc:"Email of admin user",value:s,onChange:n}}),c.jsx(fd,{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(mt,{}),c.jsx(qe,{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
658
+ w-full shelf-input-color text-sm hover:ring-pink-400 hover:ring-2
659
+ cursor-pointer`})}),t&&c.jsxs("div",{className:`flex flex-row flex-nowrap items-center text-sm w-full
660
+ text-red-600 border-red-600
661
+ dark:text-red-500
662
+ dark:bg-red-400/10
663
+ bg-red-400/20
664
+ border
665
+ rounded-md p-3 gap-3 `,children:[c.jsx(iv,{className:"flex-inline text-2xl flex-shrink-0 opacity-70"}),c.jsx("div",{children:NE(t),className:"flex-1 whitespace-pre-wrap overflow-x-auto"})]}),c.jsx(ke,{show:r,children:c.jsx(fd,{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,{})]})})})},V1=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}=wt(),[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:V1(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:V1(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:EE(a.logo_url),alt:a.description??a.name},a.provider))})},EE=(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},ME=n=>c.jsx("div",{...n,children:c.jsx("p",{className:`w-full py-4 text-sm font-semibold text-center
666
+ text-gray-400 dark:text-white`,children:`all rights reserved, storecraft (${new Date().getFullYear()})`})}),DE=({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
667
+ bg-gradient-to-r
668
+ from-pink-500/30 border-pink-500/20 px-1 --shadow-md
669
+ text-pink-500/90 font-mono tracking-wider
670
+ 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})]})},TE=({...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(Bb,{}),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(DE,{commit:s},s.sha))})]})})}):null},IE=({is_backend_endpoint_editable:n=!0})=>{var g,y,w;const{config:e,sdk:t,actions:{updateConfig:s}}=wt(),[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}=fs();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=>{var _;k.preventDefault();try{s({endpoint:r.endpoint}),await t.auth.signin(r.email,r.password)}catch(C){console.error("error ",C),u(((_=ac(C))==null?void 0:_.join(`
671
+ `))??"Unknown Error")}},[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(_E,{className:"w-full h-12 --bg-green-400"}),c.jsx(kE,{className:`absolute w-full --bg-green-300 left-0 top-12 h-fit
672
+ z-30 --bg-green-300/30 `}),c.jsxs("div",{className:`w-full h-fit md:h-[calc(100%-3rem)]
673
+ flex flex-col p-10
674
+ items-center justify-start
675
+ md:justify-start md:items-start
676
+ md:flex-row gap-10`,children:[c.jsx("div",{className:`flex-shrink-0 order-first md:order-first
677
+ --scale-[0.8] origin-top
678
+ --md:scale-[0.8] md:origin-top-left
679
+ w-full max-w-[22rem] h-fit
680
+ rounded-md`,sstyle:{transformOrigin:"top center"},children:c.jsx(jE,{dash:{is_backend_endpoint_editable:n,onSubmit:p,credentials:r,onChange:f,error:l},className:"w-full"})}),c.jsx(TE,{className:"flex-1 h-fit md:h-full "})]}),c.jsx(ME,{className:"relative md:fixed md:left-10 md:bottom-0"})]})})};var Ol={},$1;function LE(){if($1)return Ol;$1=1;var n=Tw();return Ol.createRoot=n.createRoot,Ol.hydrateRoot=n.hydrateRoot,Ol}var AE=LE();const OE=Ja(AE),RE=(n,e=!0)=>{const t=OE.createRoot(n);return t.render(c.jsx(PE,{is_backend_endpoint_editable:e})),()=>{t.unmount()}},PE=({is_backend_endpoint_editable:n=!0})=>{const{isAuthenticated:e,actions:{trigger:t}}=wt();return v.useEffect(()=>{if(!e){const s=new URL(window.location.pathname,window.location.origin);s.hash=window.location.hash,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(Tb,{children:c.jsx(bE,{})}),!e&&c.jsx(IE,{trigger:t,is_backend_endpoint_editable:n})]})})};RE(document.getElementById("root"),!0);