sqlmesh 0.217.1.dev1__py3-none-any.whl → 0.227.2.dev20__py3-none-any.whl

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 (190) hide show
  1. sqlmesh/__init__.py +12 -2
  2. sqlmesh/_version.py +2 -2
  3. sqlmesh/cli/project_init.py +10 -2
  4. sqlmesh/core/_typing.py +1 -0
  5. sqlmesh/core/audit/definition.py +8 -2
  6. sqlmesh/core/config/__init__.py +1 -1
  7. sqlmesh/core/config/connection.py +20 -5
  8. sqlmesh/core/config/dbt.py +13 -0
  9. sqlmesh/core/config/janitor.py +12 -0
  10. sqlmesh/core/config/loader.py +7 -0
  11. sqlmesh/core/config/model.py +2 -0
  12. sqlmesh/core/config/root.py +3 -0
  13. sqlmesh/core/console.py +80 -2
  14. sqlmesh/core/constants.py +1 -1
  15. sqlmesh/core/context.py +112 -35
  16. sqlmesh/core/dialect.py +3 -0
  17. sqlmesh/core/engine_adapter/_typing.py +2 -0
  18. sqlmesh/core/engine_adapter/base.py +330 -23
  19. sqlmesh/core/engine_adapter/base_postgres.py +17 -1
  20. sqlmesh/core/engine_adapter/bigquery.py +146 -7
  21. sqlmesh/core/engine_adapter/clickhouse.py +17 -13
  22. sqlmesh/core/engine_adapter/databricks.py +50 -2
  23. sqlmesh/core/engine_adapter/fabric.py +110 -29
  24. sqlmesh/core/engine_adapter/mixins.py +142 -48
  25. sqlmesh/core/engine_adapter/mssql.py +15 -4
  26. sqlmesh/core/engine_adapter/mysql.py +2 -2
  27. sqlmesh/core/engine_adapter/postgres.py +9 -3
  28. sqlmesh/core/engine_adapter/redshift.py +4 -0
  29. sqlmesh/core/engine_adapter/risingwave.py +1 -0
  30. sqlmesh/core/engine_adapter/shared.py +6 -0
  31. sqlmesh/core/engine_adapter/snowflake.py +82 -11
  32. sqlmesh/core/engine_adapter/spark.py +14 -10
  33. sqlmesh/core/engine_adapter/trino.py +5 -2
  34. sqlmesh/core/janitor.py +181 -0
  35. sqlmesh/core/lineage.py +1 -0
  36. sqlmesh/core/linter/rules/builtin.py +15 -0
  37. sqlmesh/core/loader.py +17 -30
  38. sqlmesh/core/macros.py +35 -13
  39. sqlmesh/core/model/common.py +2 -0
  40. sqlmesh/core/model/definition.py +72 -4
  41. sqlmesh/core/model/kind.py +66 -2
  42. sqlmesh/core/model/meta.py +107 -2
  43. sqlmesh/core/node.py +101 -2
  44. sqlmesh/core/plan/builder.py +15 -10
  45. sqlmesh/core/plan/common.py +196 -2
  46. sqlmesh/core/plan/definition.py +21 -6
  47. sqlmesh/core/plan/evaluator.py +72 -113
  48. sqlmesh/core/plan/explainer.py +90 -8
  49. sqlmesh/core/plan/stages.py +42 -21
  50. sqlmesh/core/renderer.py +26 -18
  51. sqlmesh/core/scheduler.py +60 -19
  52. sqlmesh/core/selector.py +137 -9
  53. sqlmesh/core/signal.py +64 -1
  54. sqlmesh/core/snapshot/__init__.py +1 -0
  55. sqlmesh/core/snapshot/definition.py +109 -25
  56. sqlmesh/core/snapshot/evaluator.py +610 -50
  57. sqlmesh/core/state_sync/__init__.py +0 -1
  58. sqlmesh/core/state_sync/base.py +31 -27
  59. sqlmesh/core/state_sync/cache.py +12 -4
  60. sqlmesh/core/state_sync/common.py +216 -111
  61. sqlmesh/core/state_sync/db/facade.py +30 -15
  62. sqlmesh/core/state_sync/db/interval.py +27 -7
  63. sqlmesh/core/state_sync/db/migrator.py +14 -8
  64. sqlmesh/core/state_sync/db/snapshot.py +119 -87
  65. sqlmesh/core/table_diff.py +2 -2
  66. sqlmesh/core/test/definition.py +14 -9
  67. sqlmesh/core/test/discovery.py +4 -0
  68. sqlmesh/dbt/adapter.py +20 -11
  69. sqlmesh/dbt/basemodel.py +52 -41
  70. sqlmesh/dbt/builtin.py +27 -11
  71. sqlmesh/dbt/column.py +17 -5
  72. sqlmesh/dbt/common.py +4 -2
  73. sqlmesh/dbt/context.py +14 -1
  74. sqlmesh/dbt/loader.py +60 -8
  75. sqlmesh/dbt/manifest.py +136 -8
  76. sqlmesh/dbt/model.py +105 -25
  77. sqlmesh/dbt/package.py +16 -1
  78. sqlmesh/dbt/profile.py +3 -3
  79. sqlmesh/dbt/project.py +12 -7
  80. sqlmesh/dbt/seed.py +1 -1
  81. sqlmesh/dbt/source.py +6 -1
  82. sqlmesh/dbt/target.py +25 -6
  83. sqlmesh/dbt/test.py +31 -1
  84. sqlmesh/integrations/github/cicd/controller.py +6 -2
  85. sqlmesh/lsp/context.py +4 -2
  86. sqlmesh/magics.py +1 -1
  87. sqlmesh/migrations/v0000_baseline.py +3 -6
  88. sqlmesh/migrations/v0061_mysql_fix_blob_text_type.py +2 -5
  89. sqlmesh/migrations/v0062_add_model_gateway.py +2 -2
  90. sqlmesh/migrations/v0063_change_signals.py +2 -4
  91. sqlmesh/migrations/v0064_join_when_matched_strings.py +2 -4
  92. sqlmesh/migrations/v0065_add_model_optimize.py +2 -2
  93. sqlmesh/migrations/v0066_add_auto_restatements.py +2 -6
  94. sqlmesh/migrations/v0067_add_tsql_date_full_precision.py +2 -2
  95. sqlmesh/migrations/v0068_include_unrendered_query_in_metadata_hash.py +2 -2
  96. sqlmesh/migrations/v0069_update_dev_table_suffix.py +2 -4
  97. sqlmesh/migrations/v0070_include_grains_in_metadata_hash.py +2 -2
  98. sqlmesh/migrations/v0071_add_dev_version_to_intervals.py +2 -6
  99. sqlmesh/migrations/v0072_add_environment_statements.py +2 -4
  100. sqlmesh/migrations/v0073_remove_symbolic_disable_restatement.py +2 -4
  101. sqlmesh/migrations/v0074_add_partition_by_time_column_property.py +2 -2
  102. sqlmesh/migrations/v0075_remove_validate_query.py +2 -4
  103. sqlmesh/migrations/v0076_add_cron_tz.py +2 -2
  104. sqlmesh/migrations/v0077_fix_column_type_hash_calculation.py +2 -2
  105. sqlmesh/migrations/v0078_warn_if_non_migratable_python_env.py +2 -4
  106. sqlmesh/migrations/v0079_add_gateway_managed_property.py +7 -9
  107. sqlmesh/migrations/v0080_add_batch_size_to_scd_type_2_models.py +2 -2
  108. sqlmesh/migrations/v0081_update_partitioned_by.py +2 -4
  109. sqlmesh/migrations/v0082_warn_if_incorrectly_duplicated_statements.py +2 -4
  110. sqlmesh/migrations/v0083_use_sql_for_scd_time_data_type_data_hash.py +2 -2
  111. sqlmesh/migrations/v0084_normalize_quote_when_matched_and_merge_filter.py +2 -2
  112. sqlmesh/migrations/v0085_deterministic_repr.py +2 -4
  113. sqlmesh/migrations/v0086_check_deterministic_bug.py +2 -4
  114. sqlmesh/migrations/v0087_normalize_blueprint_variables.py +2 -4
  115. sqlmesh/migrations/v0088_warn_about_variable_python_env_diffs.py +2 -4
  116. sqlmesh/migrations/v0089_add_virtual_environment_mode.py +2 -2
  117. sqlmesh/migrations/v0090_add_forward_only_column.py +2 -6
  118. sqlmesh/migrations/v0091_on_additive_change.py +2 -2
  119. sqlmesh/migrations/v0092_warn_about_dbt_data_type_diff.py +2 -4
  120. sqlmesh/migrations/v0093_use_raw_sql_in_fingerprint.py +2 -2
  121. sqlmesh/migrations/v0094_add_dev_version_and_fingerprint_columns.py +2 -6
  122. sqlmesh/migrations/v0095_warn_about_dbt_raw_sql_diff.py +2 -4
  123. sqlmesh/migrations/v0096_remove_plan_dags_table.py +2 -4
  124. sqlmesh/migrations/v0097_add_dbt_name_in_node.py +2 -2
  125. sqlmesh/migrations/v0098_add_dbt_node_info_in_node.py +103 -0
  126. sqlmesh/migrations/v0099_add_last_altered_to_intervals.py +25 -0
  127. sqlmesh/migrations/v0100_add_grants_and_grants_target_layer.py +9 -0
  128. sqlmesh/utils/__init__.py +8 -1
  129. sqlmesh/utils/cache.py +5 -1
  130. sqlmesh/utils/date.py +1 -1
  131. sqlmesh/utils/errors.py +4 -0
  132. sqlmesh/utils/git.py +3 -1
  133. sqlmesh/utils/jinja.py +25 -2
  134. sqlmesh/utils/pydantic.py +6 -6
  135. sqlmesh/utils/windows.py +13 -3
  136. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/METADATA +5 -5
  137. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/RECORD +188 -183
  138. sqlmesh_dbt/cli.py +70 -7
  139. sqlmesh_dbt/console.py +14 -6
  140. sqlmesh_dbt/operations.py +103 -24
  141. sqlmesh_dbt/selectors.py +39 -1
  142. web/client/dist/assets/{Audits-Ucsx1GzF.js → Audits-CBiYyyx-.js} +1 -1
  143. web/client/dist/assets/{Banner-BWDzvavM.js → Banner-DSRbUlO5.js} +1 -1
  144. web/client/dist/assets/{ChevronDownIcon-D2VL13Ah.js → ChevronDownIcon-MK_nrjD_.js} +1 -1
  145. web/client/dist/assets/{ChevronRightIcon-DWGYbf1l.js → ChevronRightIcon-CLWtT22Q.js} +1 -1
  146. web/client/dist/assets/{Content-DdHDZM3I.js → Content-BNuGZN5l.js} +1 -1
  147. web/client/dist/assets/{Content-Bikfy8fh.js → Content-CSHJyW0n.js} +1 -1
  148. web/client/dist/assets/{Data-CzAJH7rW.js → Data-C1oRDbLx.js} +1 -1
  149. web/client/dist/assets/{DataCatalog-BJF11g8f.js → DataCatalog-HXyX2-_j.js} +1 -1
  150. web/client/dist/assets/{Editor-s0SBpV2y.js → Editor-BDyfpUuw.js} +1 -1
  151. web/client/dist/assets/{Editor-DgLhgKnm.js → Editor-D0jNItwC.js} +1 -1
  152. web/client/dist/assets/{Errors-D0m0O1d3.js → Errors-BfuFLcPi.js} +1 -1
  153. web/client/dist/assets/{FileExplorer-CEv0vXkt.js → FileExplorer-BR9IE3he.js} +1 -1
  154. web/client/dist/assets/{Footer-BwzXn8Ew.js → Footer-CgBEtiAh.js} +1 -1
  155. web/client/dist/assets/{Header-6heDkEqG.js → Header-DSqR6nSO.js} +1 -1
  156. web/client/dist/assets/{Input-obuJsD6k.js → Input-B-oZ6fGO.js} +1 -1
  157. web/client/dist/assets/Lineage-DYQVwDbD.js +1 -0
  158. web/client/dist/assets/{ListboxShow-HM9_qyrt.js → ListboxShow-BE5-xevs.js} +1 -1
  159. web/client/dist/assets/{ModelLineage-zWdKo0U2.js → ModelLineage-DkIFAYo4.js} +1 -1
  160. web/client/dist/assets/{Models-Bcu66SRz.js → Models-D5dWr8RB.js} +1 -1
  161. web/client/dist/assets/{Page-BWEEQfIt.js → Page-C-XfU5BR.js} +1 -1
  162. web/client/dist/assets/{Plan-C4gXCqlf.js → Plan-ZEuTINBq.js} +1 -1
  163. web/client/dist/assets/{PlusCircleIcon-CVDO651q.js → PlusCircleIcon-DVXAHG8_.js} +1 -1
  164. web/client/dist/assets/{ReportErrors-BT6xFwAr.js → ReportErrors-B7FEPzMB.js} +1 -1
  165. web/client/dist/assets/{Root-ryJoBK4h.js → Root-8aZyhPxF.js} +1 -1
  166. web/client/dist/assets/{SearchList-DB04sPb9.js → SearchList-W_iT2G82.js} +1 -1
  167. web/client/dist/assets/{SelectEnvironment-CUYcXUu6.js → SelectEnvironment-C65jALmO.js} +1 -1
  168. web/client/dist/assets/{SourceList-Doo_9ZGp.js → SourceList-DSLO6nVJ.js} +1 -1
  169. web/client/dist/assets/{SourceListItem-D5Mj7Dly.js → SourceListItem-BHt8d9-I.js} +1 -1
  170. web/client/dist/assets/{SplitPane-qHmkD1qy.js → SplitPane-CViaZmw6.js} +1 -1
  171. web/client/dist/assets/{Tests-DH1Z74ML.js → Tests-DhaVt5t1.js} +1 -1
  172. web/client/dist/assets/{Welcome-DqUJUNMF.js → Welcome-DvpjH-_4.js} +1 -1
  173. web/client/dist/assets/context-BctCsyGb.js +71 -0
  174. web/client/dist/assets/{context-Dr54UHLi.js → context-DFNeGsFF.js} +1 -1
  175. web/client/dist/assets/{editor-DYIP1yQ4.js → editor-CcO28cqd.js} +1 -1
  176. web/client/dist/assets/{file-DarlIDVi.js → file-CvJN3aZO.js} +1 -1
  177. web/client/dist/assets/{floating-ui.react-dom-BH3TFvkM.js → floating-ui.react-dom-CjE-JNW1.js} +1 -1
  178. web/client/dist/assets/{help-Bl8wqaQc.js → help-DuPhjipa.js} +1 -1
  179. web/client/dist/assets/{index-D1sR7wpN.js → index-C-dJH7yZ.js} +1 -1
  180. web/client/dist/assets/{index-O3mjYpnE.js → index-Dj0i1-CA.js} +2 -2
  181. web/client/dist/assets/{plan-CehRrJUG.js → plan-BTRSbjKn.js} +1 -1
  182. web/client/dist/assets/{popover-CqgMRE0G.js → popover-_Sf0yvOI.js} +1 -1
  183. web/client/dist/assets/{project-6gxepOhm.js → project-BvSOI8MY.js} +1 -1
  184. web/client/dist/index.html +1 -1
  185. web/client/dist/assets/Lineage-D0Hgdz2v.js +0 -1
  186. web/client/dist/assets/context-DgX0fp2E.js +0 -68
  187. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/WHEEL +0 -0
  188. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/entry_points.txt +0 -0
  189. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/licenses/LICENSE +0 -0
  190. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev20.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as o,R as J,j as f,b as En,c as re,at as yt,au as ne,av as St,aw as Pn,l as Y,i as rt}from"./index-O3mjYpnE.js";import{r as qe,u as Rn,o as Tn,s as In,f as Nn,a as An,b as On,h as Mn,l as _n,c as Ln,R as Dn}from"./floating-ui.react-dom-BH3TFvkM.js";function jn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const kn=o.forwardRef(jn);function Bn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const Fn=o.forwardRef(Bn);function Wn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Hn=o.forwardRef(Wn);function Vn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z",clipRule:"evenodd"}))}const Un=o.forwardRef(Vn),$n=J.forwardRef(function({type:t="text",value:n,placeholder:r,className:a,disabled:i=!1,autoFocus:c=!1,onInput:s,onKeyDown:u},d){return n=n??"",f.jsx("input",{ref:d,className:re("placeholder:text-neutral-300 dark:placeholder:text-neutral-700",i&&"opacity-50 cursor-not-allowed",a),type:t,value:n,placeholder:r,disabled:i,autoFocus:c,readOnly:En(!!s),onInput:s,onKeyDown:u})});function ot(e,[t,n]){return Math.min(n,Math.max(t,e))}function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Qe(e,t=[]){let n=[];function r(i,c){const s=o.createContext(c),u=n.length;n=[...n,c];const d=m=>{var y;const{scope:g,children:S,...x}=m,l=((y=g==null?void 0:g[e])==null?void 0:y[u])||s,v=o.useMemo(()=>x,Object.values(x));return f.jsx(l.Provider,{value:v,children:S})};d.displayName=i+"Provider";function p(m,g){var l;const S=((l=g==null?void 0:g[e])==null?void 0:l[u])||s,x=o.useContext(S);if(x)return x;if(c!==void 0)return c;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,p]}const a=()=>{const i=n.map(c=>o.createContext(c));return function(s){const u=(s==null?void 0:s[e])||i;return o.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return a.scopeName=e,[r,Kn(a,...t)]}function Kn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const c=r.reduce((s,{useScope:u,scopeName:d})=>{const m=u(i)[`__scope${d}`];return{...s,...m}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function at(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xt(...e){return t=>{let n=!1;const r=e.map(a=>{const i=at(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():at(e[a],null)}}}}function L(...e){return o.useCallback(xt(...e),e)}function Ae(e){const t=Yn(e),n=o.forwardRef((r,a)=>{const{children:i,...c}=r,s=o.Children.toArray(i),u=s.find(Xn);if(u){const d=u.props.children,p=s.map(m=>m===u?o.Children.count(d)>1?o.Children.only(null):o.isValidElement(d)?d.props.children:null:m);return f.jsx(t,{...c,ref:a,children:o.isValidElement(d)?o.cloneElement(d,void 0,p):null})}return f.jsx(t,{...c,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Yn(e){const t=o.forwardRef((n,r)=>{const{children:a,...i}=n;if(o.isValidElement(a)){const c=Gn(a),s=Zn(i,a.props);return a.type!==o.Fragment&&(s.ref=r?xt(r,c):c),o.cloneElement(a,s)}return o.Children.count(a)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zn=Symbol("radix.slottable");function Xn(e){return o.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zn}function Zn(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{const u=i(...s);return a(...s),u}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Gn(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qn(e){const t=e+"CollectionProvider",[n,r]=Qe(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=l=>{const{scope:v,children:y}=l,h=J.useRef(null),w=J.useRef(new Map).current;return f.jsx(a,{scope:v,itemMap:w,collectionRef:h,children:y})};c.displayName=t;const s=e+"CollectionSlot",u=Ae(s),d=J.forwardRef((l,v)=>{const{scope:y,children:h}=l,w=i(s,y),b=L(v,w.collectionRef);return f.jsx(u,{ref:b,children:h})});d.displayName=s;const p=e+"CollectionItemSlot",m="data-radix-collection-item",g=Ae(p),S=J.forwardRef((l,v)=>{const{scope:y,children:h,...w}=l,b=J.useRef(null),P=L(v,b),I=i(p,y);return J.useEffect(()=>(I.itemMap.set(b,{ref:b,...w}),()=>void I.itemMap.delete(b))),f.jsx(g,{[m]:"",ref:P,children:h})});S.displayName=p;function x(l){const v=i(e+"CollectionConsumer",l);return J.useCallback(()=>{const h=v.collectionRef.current;if(!h)return[];const w=Array.from(h.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((I,C)=>w.indexOf(I.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:d,ItemSlot:S},x,r]}var Qn=o.createContext(void 0);function Jn(e){const t=o.useContext(Qn);return e||t||"ltr"}var er=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=er.reduce((e,t)=>{const n=Ae(`Primitive.${t}`),r=o.forwardRef((a,i)=>{const{asChild:c,...s}=a,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tr(e,t){e&&qe.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e);o.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rr="DismissableLayer",$e="dismissableLayer.update",or="dismissableLayer.pointerDownOutside",ar="dismissableLayer.focusOutside",st,bt=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ct=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...u}=e,d=o.useContext(bt),[p,m]=o.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=o.useState({}),x=L(t,C=>m(C)),l=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(v),h=p?l.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,b=h>=y,P=cr(C=>{const O=C.target,D=[...d.branches].some(H=>H.contains(O));!b||D||(a==null||a(C),c==null||c(C),C.defaultPrevented||s==null||s())},g),I=lr(C=>{const O=C.target;[...d.branches].some(H=>H.contains(O))||(i==null||i(C),c==null||c(C),C.defaultPrevented||s==null||s())},g);return nr(C=>{h===d.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},g),o.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(st=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),it(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=st)}},[p,g,n,d]),o.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),it())},[p,d]),o.useEffect(()=>{const C=()=>S({});return document.addEventListener($e,C),()=>document.removeEventListener($e,C)},[]),f.jsx(M.div,{...u,ref:x,style:{pointerEvents:w?b?"auto":"none":void 0,...e.style},onFocusCapture:_(e.onFocusCapture,I.onFocusCapture),onBlurCapture:_(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:_(e.onPointerDownCapture,P.onPointerDownCapture)})});Ct.displayName=rr;var sr="DismissableLayerBranch",ir=o.forwardRef((e,t)=>{const n=o.useContext(bt),r=o.useRef(null),a=L(t,r);return o.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(M.div,{...e,ref:a})});ir.displayName=sr;function cr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Et(or,n,d,{discrete:!0})};const d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),r=o.useRef(!1);return o.useEffect(()=>{const a=i=>{i.target&&!r.current&&Et(ar,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function it(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Et(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?tr(a,i):a.dispatchEvent(i)}var ke=0;function ur(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ct()),document.body.insertAdjacentElement("beforeend",e[1]??ct()),ke++,()=>{ke===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ke--}},[])}function ct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Be="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",lt={bubbles:!1,cancelable:!0},dr="FocusScope",Pt=o.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...c}=e,[s,u]=o.useState(null),d=ie(a),p=ie(i),m=o.useRef(null),g=L(t,l=>u(l)),S=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let l=function(w){if(S.paused||!s)return;const b=w.target;s.contains(b)?m.current=b:te(m.current,{select:!0})},v=function(w){if(S.paused||!s)return;const b=w.relatedTarget;b!==null&&(s.contains(b)||te(m.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&te(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",v);const h=new MutationObserver(y);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",v),h.disconnect()}}},[r,s,S.paused]),o.useEffect(()=>{if(s){dt.add(S);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(Be,lt);s.addEventListener(Be,d),s.dispatchEvent(y),y.defaultPrevented||(fr(gr(Rt(s)),{select:!0}),document.activeElement===l&&te(s))}return()=>{s.removeEventListener(Be,d),setTimeout(()=>{const y=new CustomEvent(Fe,lt);s.addEventListener(Fe,p),s.dispatchEvent(y),y.defaultPrevented||te(l??document.body,{select:!0}),s.removeEventListener(Fe,p),dt.remove(S)},0)}}},[s,d,p,S]);const x=o.useCallback(l=>{if(!n&&!r||S.paused)return;const v=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(v&&y){const h=l.currentTarget,[w,b]=pr(h);w&&b?!l.shiftKey&&y===b?(l.preventDefault(),n&&te(w,{select:!0})):l.shiftKey&&y===w&&(l.preventDefault(),n&&te(b,{select:!0})):y===h&&l.preventDefault()}},[n,r,S.paused]);return f.jsx(M.div,{tabIndex:-1,...c,ref:g,onKeyDown:x})});Pt.displayName=dr;function fr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(te(r,{select:t}),document.activeElement!==n)return}function pr(e){const t=Rt(e),n=ut(t,e),r=ut(t.reverse(),e);return[n,r]}function Rt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ut(e,t){for(const n of e)if(!vr(n,{upTo:t}))return n}function vr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hr(e){return e instanceof HTMLInputElement&&"select"in e}function te(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hr(e)&&t&&e.select()}}var dt=mr();function mr(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ft(e,t),e.unshift(t)},remove(t){var n;e=ft(e,t),(n=e[0])==null||n.resume()}}}function ft(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gr(e){return e.filter(t=>t.tagName!=="A")}var W=globalThis!=null&&globalThis.document?o.useLayoutEffect:()=>{},wr=yt[" useId ".trim().toString()]||(()=>{}),yr=0;function Je(e){const[t,n]=o.useState(wr());return W(()=>{n(r=>r??String(yr++))},[e]),t?`radix-${t}`:""}var Sr="Arrow",Tt=o.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return f.jsx(M.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tt.displayName=Sr;var xr=Tt;function br(e){const[t,n]=o.useState(void 0);return W(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let c,s;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,s=d.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var et="Popper",[It,Nt]=Qe(et),[Cr,At]=It(et),Ot=e=>{const{__scopePopper:t,children:n}=e,[r,a]=o.useState(null);return f.jsx(Cr,{scope:t,anchor:r,onAnchorChange:a,children:n})};Ot.displayName=et;var Mt="PopperAnchor",_t=o.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=At(Mt,n),c=o.useRef(null),s=L(t,c);return o.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||c.current)}),r?null:f.jsx(M.div,{...a,ref:s})});_t.displayName=Mt;var tt="PopperContent",[Er,Pr]=It(tt),Lt=o.forwardRef((e,t)=>{var E,A,B,N,R,T;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:c=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:S="optimized",onPlaced:x,...l}=e,v=At(tt,n),[y,h]=o.useState(null),w=L(t,U=>h(U)),[b,P]=o.useState(null),I=br(b),C=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,D=r+(i!=="center"?"-"+i:""),H=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(d)?d:[d],z=$.length>0,V={padding:H,boundary:$.filter(Tr),altBoundary:z},{refs:X,floatingStyles:K,placement:j,isPositioned:F,middlewareData:k}=Rn({strategy:"fixed",placement:D,whileElementsMounted:(...U)=>Ln(...U,{animationFrame:S==="always"}),elements:{reference:v.anchor},middleware:[Tn({mainAxis:a+O,alignmentAxis:c}),u&&In({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?_n():void 0,...V}),u&&Nn({...V}),An({...V,apply:({elements:U,rects:q,availableWidth:ye,availableHeight:Se})=>{const{width:xe,height:Cn}=q.reference,Ce=U.floating.style;Ce.setProperty("--radix-popper-available-width",`${ye}px`),Ce.setProperty("--radix-popper-available-height",`${Se}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Cn}px`)}}),b&&On({element:b,padding:s}),Ir({arrowWidth:C,arrowHeight:O}),g&&Mn({strategy:"referenceHidden",...V})]}),[Z,me]=kt(j),Q=ie(x);W(()=>{F&&(Q==null||Q())},[F,Q]);const ge=(E=k.arrow)==null?void 0:E.x,we=(A=k.arrow)==null?void 0:A.y,ee=((B=k.arrow)==null?void 0:B.centerOffset)!==0,[ue,se]=o.useState();return W(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),f.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:F?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(N=k.transformOrigin)==null?void 0:N.x,(R=k.transformOrigin)==null?void 0:R.y].join(" "),...((T=k.hide)==null?void 0:T.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(Er,{scope:n,placedSide:Z,onArrowChange:P,arrowX:ge,arrowY:we,shouldHideArrow:ee,children:f.jsx(M.div,{"data-side":Z,"data-align":me,...l,ref:w,style:{...l.style,animation:F?void 0:"none"}})})})});Lt.displayName=tt;var Dt="PopperArrow",Rr={top:"bottom",right:"left",bottom:"top",left:"right"},jt=o.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Pr(Dt,r),c=Rr[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(xr,{...a,ref:n,style:{...a.style,display:"block"}})})});jt.displayName=Dt;function Tr(e){return e!==null}var Ir=e=>({name:"transformOrigin",options:e,fn(t){var v,y,h;const{placement:n,rects:r,middlewareData:a}=t,c=((v=a.arrow)==null?void 0:v.centerOffset)!==0,s=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,p]=kt(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(((y=a.arrow)==null?void 0:y.x)??0)+s/2,S=(((h=a.arrow)==null?void 0:h.y)??0)+u/2;let x="",l="";return d==="bottom"?(x=c?m:`${g}px`,l=`${-u}px`):d==="top"?(x=c?m:`${g}px`,l=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,l=c?m:`${S}px`):d==="left"&&(x=`${r.floating.width+u}px`,l=c?m:`${S}px`),{data:{x,y:l}}}});function kt(e){const[t,n="center"]=e.split("-");return[t,n]}var Nr=Ot,Ar=_t,Or=Lt,Mr=jt,_r="Portal",Bt=o.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[a,i]=o.useState(!1);W(()=>i(!0),[]);const c=n||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Dn.createPortal(f.jsx(M.div,{...r,ref:t}),c):null});Bt.displayName=_r;var Lr=yt[" useInsertionEffect ".trim().toString()]||W;function pt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,c]=Dr({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:a;{const p=o.useRef(e!==void 0);o.useEffect(()=>{const m=p.current;m!==s&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=s},[s,r])}const d=o.useCallback(p=>{var m;if(s){const g=jr(p)?p(e):p;g!==e&&((m=c.current)==null||m.call(c,g))}else i(p)},[s,e,i,c]);return[u,d]}function Dr({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Lr(()=>{i.current=t},[t]),o.useEffect(()=>{var c;a.current!==n&&((c=i.current)==null||c.call(i,n),a.current=n)},[n,a]),[n,r,i]}function jr(e){return typeof e=="function"}function kr(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ft=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Br="VisuallyHidden",Fr=o.forwardRef((e,t)=>f.jsx(M.span,{...e,ref:t,style:{...Ft,...e.style}}));Fr.displayName=Br;var Wr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},de=new WeakMap,Ee=new WeakMap,Pe={},We=0,Wt=function(e){return e&&(e.host||Wt(e.parentNode))},Hr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wt(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Vr=function(e,t,n,r){var a=Hr(t,Array.isArray(e)?e:[e]);Pe[n]||(Pe[n]=new WeakMap);var i=Pe[n],c=[],s=new Set,u=new Set(a),d=function(m){!m||s.has(m)||(s.add(m),d(m.parentNode))};a.forEach(d);var p=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(g){if(s.has(g))p(g);else try{var S=g.getAttribute(r),x=S!==null&&S!=="false",l=(de.get(g)||0)+1,v=(i.get(g)||0)+1;de.set(g,l),i.set(g,v),c.push(g),l===1&&x&&Ee.set(g,!0),v===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return p(t),s.clear(),We++,function(){c.forEach(function(m){var g=de.get(m)-1,S=i.get(m)-1;de.set(m,g),i.set(m,S),g||(Ee.has(m)||m.removeAttribute(r),Ee.delete(m)),S||m.removeAttribute(n)}),We--,We||(de=new WeakMap,de=new WeakMap,Ee=new WeakMap,Pe={})}},Ur=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Wr(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Vr(r,a,n,"aria-hidden")):function(){return null}},Ie="right-scroll-bar-position",Ne="width-before-scroll-bar",$r="with-scroll-bars-hidden",Kr="--removed-body-scroll-bar-size";function He(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yr(e,t){var n=o.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var zr=typeof window<"u"?o.useLayoutEffect:o.useEffect,vt=new WeakMap;function Xr(e,t){var n=Yr(null,function(r){return e.forEach(function(a){return He(a,r)})});return zr(function(){var r=vt.get(n);if(r){var a=new Set(r),i=new Set(e),c=n.current;a.forEach(function(s){i.has(s)||He(s,null)}),i.forEach(function(s){a.has(s)||He(s,c)})}vt.set(n,e)},[e]),n}function Zr(e){return e}function Gr(e,t){t===void 0&&(t=Zr);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(i),c=n}var u=function(){var p=c;c=[],p.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),n}}}};return a}function qr(e){e===void 0&&(e={});var t=Gr(null);return t.options=ne({async:!0,ssr:!1},e),t}var Ht=function(e){var t=e.sideCar,n=St(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,ne({},n))};Ht.isSideCarExport=!0;function Qr(e,t){return e.useMedium(t),Ht}var Vt=qr(),Ve=function(){},Me=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Ve,onWheelCapture:Ve,onTouchMoveCapture:Ve}),a=r[0],i=r[1],c=e.forwardProps,s=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,S=e.noRelative,x=e.noIsolation,l=e.inert,v=e.allowPinchZoom,y=e.as,h=y===void 0?"div":y,w=e.gapMode,b=St(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=g,I=Xr([n,t]),C=ne(ne({},b),a);return o.createElement(o.Fragment,null,p&&o.createElement(P,{sideCar:Vt,removeScrollBar:d,shards:m,noRelative:S,noIsolation:x,inert:l,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),c?o.cloneElement(o.Children.only(s),ne(ne({},C),{ref:I})):o.createElement(h,ne({},C,{className:u,ref:I}),s))});Me.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Me.classNames={fullWidth:Ne,zeroRight:Ie};var Jr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eo(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jr();return t&&e.setAttribute("nonce",t),e}function to(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function no(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ro=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eo())&&(to(t,n),no(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oo=function(){var e=ro();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ut=function(){var e=oo(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},ao={left:0,top:0,right:0,gap:0},Ue=function(e){return parseInt(e||"",10)||0},so=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Ue(n),Ue(r),Ue(a)]},io=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ao;var t=so(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},co=Ut(),ve="data-scroll-locked",lo=function(e,t,n,r){var a=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
1
+ import{r as o,R as J,j as f,b as En,c as re,at as yt,au as ne,av as St,aw as Pn,l as Y,i as rt}from"./index-Dj0i1-CA.js";import{r as qe,u as Rn,o as Tn,s as In,f as Nn,a as An,b as On,h as Mn,l as _n,c as Ln,R as Dn}from"./floating-ui.react-dom-CjE-JNW1.js";function jn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const kn=o.forwardRef(jn);function Bn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const Fn=o.forwardRef(Bn);function Wn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Hn=o.forwardRef(Wn);function Vn({title:e,titleId:t,...n},r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z",clipRule:"evenodd"}))}const Un=o.forwardRef(Vn),$n=J.forwardRef(function({type:t="text",value:n,placeholder:r,className:a,disabled:i=!1,autoFocus:c=!1,onInput:s,onKeyDown:u},d){return n=n??"",f.jsx("input",{ref:d,className:re("placeholder:text-neutral-300 dark:placeholder:text-neutral-700",i&&"opacity-50 cursor-not-allowed",a),type:t,value:n,placeholder:r,disabled:i,autoFocus:c,readOnly:En(!!s),onInput:s,onKeyDown:u})});function ot(e,[t,n]){return Math.min(n,Math.max(t,e))}function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Qe(e,t=[]){let n=[];function r(i,c){const s=o.createContext(c),u=n.length;n=[...n,c];const d=m=>{var y;const{scope:g,children:S,...x}=m,l=((y=g==null?void 0:g[e])==null?void 0:y[u])||s,v=o.useMemo(()=>x,Object.values(x));return f.jsx(l.Provider,{value:v,children:S})};d.displayName=i+"Provider";function p(m,g){var l;const S=((l=g==null?void 0:g[e])==null?void 0:l[u])||s,x=o.useContext(S);if(x)return x;if(c!==void 0)return c;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,p]}const a=()=>{const i=n.map(c=>o.createContext(c));return function(s){const u=(s==null?void 0:s[e])||i;return o.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return a.scopeName=e,[r,Kn(a,...t)]}function Kn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const c=r.reduce((s,{useScope:u,scopeName:d})=>{const m=u(i)[`__scope${d}`];return{...s,...m}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function at(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xt(...e){return t=>{let n=!1;const r=e.map(a=>{const i=at(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():at(e[a],null)}}}}function L(...e){return o.useCallback(xt(...e),e)}function Ae(e){const t=Yn(e),n=o.forwardRef((r,a)=>{const{children:i,...c}=r,s=o.Children.toArray(i),u=s.find(Xn);if(u){const d=u.props.children,p=s.map(m=>m===u?o.Children.count(d)>1?o.Children.only(null):o.isValidElement(d)?d.props.children:null:m);return f.jsx(t,{...c,ref:a,children:o.isValidElement(d)?o.cloneElement(d,void 0,p):null})}return f.jsx(t,{...c,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Yn(e){const t=o.forwardRef((n,r)=>{const{children:a,...i}=n;if(o.isValidElement(a)){const c=Gn(a),s=Zn(i,a.props);return a.type!==o.Fragment&&(s.ref=r?xt(r,c):c),o.cloneElement(a,s)}return o.Children.count(a)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zn=Symbol("radix.slottable");function Xn(e){return o.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zn}function Zn(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{const u=i(...s);return a(...s),u}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Gn(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qn(e){const t=e+"CollectionProvider",[n,r]=Qe(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=l=>{const{scope:v,children:y}=l,h=J.useRef(null),w=J.useRef(new Map).current;return f.jsx(a,{scope:v,itemMap:w,collectionRef:h,children:y})};c.displayName=t;const s=e+"CollectionSlot",u=Ae(s),d=J.forwardRef((l,v)=>{const{scope:y,children:h}=l,w=i(s,y),b=L(v,w.collectionRef);return f.jsx(u,{ref:b,children:h})});d.displayName=s;const p=e+"CollectionItemSlot",m="data-radix-collection-item",g=Ae(p),S=J.forwardRef((l,v)=>{const{scope:y,children:h,...w}=l,b=J.useRef(null),P=L(v,b),I=i(p,y);return J.useEffect(()=>(I.itemMap.set(b,{ref:b,...w}),()=>void I.itemMap.delete(b))),f.jsx(g,{[m]:"",ref:P,children:h})});S.displayName=p;function x(l){const v=i(e+"CollectionConsumer",l);return J.useCallback(()=>{const h=v.collectionRef.current;if(!h)return[];const w=Array.from(h.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((I,C)=>w.indexOf(I.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:d,ItemSlot:S},x,r]}var Qn=o.createContext(void 0);function Jn(e){const t=o.useContext(Qn);return e||t||"ltr"}var er=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=er.reduce((e,t)=>{const n=Ae(`Primitive.${t}`),r=o.forwardRef((a,i)=>{const{asChild:c,...s}=a,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tr(e,t){e&&qe.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e);o.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rr="DismissableLayer",$e="dismissableLayer.update",or="dismissableLayer.pointerDownOutside",ar="dismissableLayer.focusOutside",st,bt=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ct=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...u}=e,d=o.useContext(bt),[p,m]=o.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=o.useState({}),x=L(t,C=>m(C)),l=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(v),h=p?l.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,b=h>=y,P=cr(C=>{const O=C.target,D=[...d.branches].some(H=>H.contains(O));!b||D||(a==null||a(C),c==null||c(C),C.defaultPrevented||s==null||s())},g),I=lr(C=>{const O=C.target;[...d.branches].some(H=>H.contains(O))||(i==null||i(C),c==null||c(C),C.defaultPrevented||s==null||s())},g);return nr(C=>{h===d.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},g),o.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(st=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),it(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=st)}},[p,g,n,d]),o.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),it())},[p,d]),o.useEffect(()=>{const C=()=>S({});return document.addEventListener($e,C),()=>document.removeEventListener($e,C)},[]),f.jsx(M.div,{...u,ref:x,style:{pointerEvents:w?b?"auto":"none":void 0,...e.style},onFocusCapture:_(e.onFocusCapture,I.onFocusCapture),onBlurCapture:_(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:_(e.onPointerDownCapture,P.onPointerDownCapture)})});Ct.displayName=rr;var sr="DismissableLayerBranch",ir=o.forwardRef((e,t)=>{const n=o.useContext(bt),r=o.useRef(null),a=L(t,r);return o.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(M.div,{...e,ref:a})});ir.displayName=sr;function cr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Et(or,n,d,{discrete:!0})};const d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lr(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),r=o.useRef(!1);return o.useEffect(()=>{const a=i=>{i.target&&!r.current&&Et(ar,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function it(){const e=new CustomEvent($e);document.dispatchEvent(e)}function Et(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?tr(a,i):a.dispatchEvent(i)}var ke=0;function ur(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ct()),document.body.insertAdjacentElement("beforeend",e[1]??ct()),ke++,()=>{ke===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ke--}},[])}function ct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Be="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",lt={bubbles:!1,cancelable:!0},dr="FocusScope",Pt=o.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...c}=e,[s,u]=o.useState(null),d=ie(a),p=ie(i),m=o.useRef(null),g=L(t,l=>u(l)),S=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let l=function(w){if(S.paused||!s)return;const b=w.target;s.contains(b)?m.current=b:te(m.current,{select:!0})},v=function(w){if(S.paused||!s)return;const b=w.relatedTarget;b!==null&&(s.contains(b)||te(m.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&te(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",v);const h=new MutationObserver(y);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",v),h.disconnect()}}},[r,s,S.paused]),o.useEffect(()=>{if(s){dt.add(S);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(Be,lt);s.addEventListener(Be,d),s.dispatchEvent(y),y.defaultPrevented||(fr(gr(Rt(s)),{select:!0}),document.activeElement===l&&te(s))}return()=>{s.removeEventListener(Be,d),setTimeout(()=>{const y=new CustomEvent(Fe,lt);s.addEventListener(Fe,p),s.dispatchEvent(y),y.defaultPrevented||te(l??document.body,{select:!0}),s.removeEventListener(Fe,p),dt.remove(S)},0)}}},[s,d,p,S]);const x=o.useCallback(l=>{if(!n&&!r||S.paused)return;const v=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(v&&y){const h=l.currentTarget,[w,b]=pr(h);w&&b?!l.shiftKey&&y===b?(l.preventDefault(),n&&te(w,{select:!0})):l.shiftKey&&y===w&&(l.preventDefault(),n&&te(b,{select:!0})):y===h&&l.preventDefault()}},[n,r,S.paused]);return f.jsx(M.div,{tabIndex:-1,...c,ref:g,onKeyDown:x})});Pt.displayName=dr;function fr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(te(r,{select:t}),document.activeElement!==n)return}function pr(e){const t=Rt(e),n=ut(t,e),r=ut(t.reverse(),e);return[n,r]}function Rt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ut(e,t){for(const n of e)if(!vr(n,{upTo:t}))return n}function vr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hr(e){return e instanceof HTMLInputElement&&"select"in e}function te(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hr(e)&&t&&e.select()}}var dt=mr();function mr(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ft(e,t),e.unshift(t)},remove(t){var n;e=ft(e,t),(n=e[0])==null||n.resume()}}}function ft(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gr(e){return e.filter(t=>t.tagName!=="A")}var W=globalThis!=null&&globalThis.document?o.useLayoutEffect:()=>{},wr=yt[" useId ".trim().toString()]||(()=>{}),yr=0;function Je(e){const[t,n]=o.useState(wr());return W(()=>{n(r=>r??String(yr++))},[e]),t?`radix-${t}`:""}var Sr="Arrow",Tt=o.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return f.jsx(M.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tt.displayName=Sr;var xr=Tt;function br(e){const[t,n]=o.useState(void 0);return W(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let c,s;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,s=d.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var et="Popper",[It,Nt]=Qe(et),[Cr,At]=It(et),Ot=e=>{const{__scopePopper:t,children:n}=e,[r,a]=o.useState(null);return f.jsx(Cr,{scope:t,anchor:r,onAnchorChange:a,children:n})};Ot.displayName=et;var Mt="PopperAnchor",_t=o.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=At(Mt,n),c=o.useRef(null),s=L(t,c);return o.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||c.current)}),r?null:f.jsx(M.div,{...a,ref:s})});_t.displayName=Mt;var tt="PopperContent",[Er,Pr]=It(tt),Lt=o.forwardRef((e,t)=>{var E,A,B,N,R,T;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:c=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:S="optimized",onPlaced:x,...l}=e,v=At(tt,n),[y,h]=o.useState(null),w=L(t,U=>h(U)),[b,P]=o.useState(null),I=br(b),C=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,D=r+(i!=="center"?"-"+i:""),H=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(d)?d:[d],z=$.length>0,V={padding:H,boundary:$.filter(Tr),altBoundary:z},{refs:X,floatingStyles:K,placement:j,isPositioned:F,middlewareData:k}=Rn({strategy:"fixed",placement:D,whileElementsMounted:(...U)=>Ln(...U,{animationFrame:S==="always"}),elements:{reference:v.anchor},middleware:[Tn({mainAxis:a+O,alignmentAxis:c}),u&&In({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?_n():void 0,...V}),u&&Nn({...V}),An({...V,apply:({elements:U,rects:q,availableWidth:ye,availableHeight:Se})=>{const{width:xe,height:Cn}=q.reference,Ce=U.floating.style;Ce.setProperty("--radix-popper-available-width",`${ye}px`),Ce.setProperty("--radix-popper-available-height",`${Se}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Cn}px`)}}),b&&On({element:b,padding:s}),Ir({arrowWidth:C,arrowHeight:O}),g&&Mn({strategy:"referenceHidden",...V})]}),[Z,me]=kt(j),Q=ie(x);W(()=>{F&&(Q==null||Q())},[F,Q]);const ge=(E=k.arrow)==null?void 0:E.x,we=(A=k.arrow)==null?void 0:A.y,ee=((B=k.arrow)==null?void 0:B.centerOffset)!==0,[ue,se]=o.useState();return W(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),f.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:F?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(N=k.transformOrigin)==null?void 0:N.x,(R=k.transformOrigin)==null?void 0:R.y].join(" "),...((T=k.hide)==null?void 0:T.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(Er,{scope:n,placedSide:Z,onArrowChange:P,arrowX:ge,arrowY:we,shouldHideArrow:ee,children:f.jsx(M.div,{"data-side":Z,"data-align":me,...l,ref:w,style:{...l.style,animation:F?void 0:"none"}})})})});Lt.displayName=tt;var Dt="PopperArrow",Rr={top:"bottom",right:"left",bottom:"top",left:"right"},jt=o.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Pr(Dt,r),c=Rr[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(xr,{...a,ref:n,style:{...a.style,display:"block"}})})});jt.displayName=Dt;function Tr(e){return e!==null}var Ir=e=>({name:"transformOrigin",options:e,fn(t){var v,y,h;const{placement:n,rects:r,middlewareData:a}=t,c=((v=a.arrow)==null?void 0:v.centerOffset)!==0,s=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,p]=kt(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(((y=a.arrow)==null?void 0:y.x)??0)+s/2,S=(((h=a.arrow)==null?void 0:h.y)??0)+u/2;let x="",l="";return d==="bottom"?(x=c?m:`${g}px`,l=`${-u}px`):d==="top"?(x=c?m:`${g}px`,l=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,l=c?m:`${S}px`):d==="left"&&(x=`${r.floating.width+u}px`,l=c?m:`${S}px`),{data:{x,y:l}}}});function kt(e){const[t,n="center"]=e.split("-");return[t,n]}var Nr=Ot,Ar=_t,Or=Lt,Mr=jt,_r="Portal",Bt=o.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[a,i]=o.useState(!1);W(()=>i(!0),[]);const c=n||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Dn.createPortal(f.jsx(M.div,{...r,ref:t}),c):null});Bt.displayName=_r;var Lr=yt[" useInsertionEffect ".trim().toString()]||W;function pt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,c]=Dr({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:a;{const p=o.useRef(e!==void 0);o.useEffect(()=>{const m=p.current;m!==s&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=s},[s,r])}const d=o.useCallback(p=>{var m;if(s){const g=jr(p)?p(e):p;g!==e&&((m=c.current)==null||m.call(c,g))}else i(p)},[s,e,i,c]);return[u,d]}function Dr({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Lr(()=>{i.current=t},[t]),o.useEffect(()=>{var c;a.current!==n&&((c=i.current)==null||c.call(i,n),a.current=n)},[n,a]),[n,r,i]}function jr(e){return typeof e=="function"}function kr(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ft=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Br="VisuallyHidden",Fr=o.forwardRef((e,t)=>f.jsx(M.span,{...e,ref:t,style:{...Ft,...e.style}}));Fr.displayName=Br;var Wr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},de=new WeakMap,Ee=new WeakMap,Pe={},We=0,Wt=function(e){return e&&(e.host||Wt(e.parentNode))},Hr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wt(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Vr=function(e,t,n,r){var a=Hr(t,Array.isArray(e)?e:[e]);Pe[n]||(Pe[n]=new WeakMap);var i=Pe[n],c=[],s=new Set,u=new Set(a),d=function(m){!m||s.has(m)||(s.add(m),d(m.parentNode))};a.forEach(d);var p=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(g){if(s.has(g))p(g);else try{var S=g.getAttribute(r),x=S!==null&&S!=="false",l=(de.get(g)||0)+1,v=(i.get(g)||0)+1;de.set(g,l),i.set(g,v),c.push(g),l===1&&x&&Ee.set(g,!0),v===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return p(t),s.clear(),We++,function(){c.forEach(function(m){var g=de.get(m)-1,S=i.get(m)-1;de.set(m,g),i.set(m,S),g||(Ee.has(m)||m.removeAttribute(r),Ee.delete(m)),S||m.removeAttribute(n)}),We--,We||(de=new WeakMap,de=new WeakMap,Ee=new WeakMap,Pe={})}},Ur=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Wr(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Vr(r,a,n,"aria-hidden")):function(){return null}},Ie="right-scroll-bar-position",Ne="width-before-scroll-bar",$r="with-scroll-bars-hidden",Kr="--removed-body-scroll-bar-size";function He(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yr(e,t){var n=o.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var zr=typeof window<"u"?o.useLayoutEffect:o.useEffect,vt=new WeakMap;function Xr(e,t){var n=Yr(null,function(r){return e.forEach(function(a){return He(a,r)})});return zr(function(){var r=vt.get(n);if(r){var a=new Set(r),i=new Set(e),c=n.current;a.forEach(function(s){i.has(s)||He(s,null)}),i.forEach(function(s){a.has(s)||He(s,c)})}vt.set(n,e)},[e]),n}function Zr(e){return e}function Gr(e,t){t===void 0&&(t=Zr);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(i),c=n}var u=function(){var p=c;c=[],p.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),n}}}};return a}function qr(e){e===void 0&&(e={});var t=Gr(null);return t.options=ne({async:!0,ssr:!1},e),t}var Ht=function(e){var t=e.sideCar,n=St(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,ne({},n))};Ht.isSideCarExport=!0;function Qr(e,t){return e.useMedium(t),Ht}var Vt=qr(),Ve=function(){},Me=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Ve,onWheelCapture:Ve,onTouchMoveCapture:Ve}),a=r[0],i=r[1],c=e.forwardProps,s=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,S=e.noRelative,x=e.noIsolation,l=e.inert,v=e.allowPinchZoom,y=e.as,h=y===void 0?"div":y,w=e.gapMode,b=St(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=g,I=Xr([n,t]),C=ne(ne({},b),a);return o.createElement(o.Fragment,null,p&&o.createElement(P,{sideCar:Vt,removeScrollBar:d,shards:m,noRelative:S,noIsolation:x,inert:l,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),c?o.cloneElement(o.Children.only(s),ne(ne({},C),{ref:I})):o.createElement(h,ne({},C,{className:u,ref:I}),s))});Me.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Me.classNames={fullWidth:Ne,zeroRight:Ie};var Jr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eo(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jr();return t&&e.setAttribute("nonce",t),e}function to(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function no(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ro=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eo())&&(to(t,n),no(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oo=function(){var e=ro();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ut=function(){var e=oo(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},ao={left:0,top:0,right:0,gap:0},Ue=function(e){return parseInt(e||"",10)||0},so=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Ue(n),Ue(r),Ue(a)]},io=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ao;var t=so(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},co=Ut(),ve="data-scroll-locked",lo=function(e,t,n,r){var a=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat($r,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -0,0 +1 @@
1
+ import{s as u,Q as c,a as n,v as a,j as s,e as f}from"./index-Dj0i1-CA.js";import{L as g}from"./context-BctCsyGb.js";import x from"./ModelLineage-DkIFAYo4.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./editor-CcO28cqd.js";import"./file-CvJN3aZO.js";import"./project-BvSOI8MY.js";import"./help-B59vE3aE.js";import"./SourceList-DSLO6nVJ.js";import"./Input-B-oZ6fGO.js";import"./index-C-dJH7yZ.js";import"./popover-_Sf0yvOI.js";import"./ListboxShow-BE5-xevs.js";import"./SearchList-W_iT2G82.js";function S(){const l=u(),{modelName:t}=c(),i=n(e=>e.models),o=n(e=>e.lastSelectedModel),r=a(t)||t===(o==null?void 0:o.name)?o:i.get(encodeURI(t));function d(e){const m=i.get(e);a(m)||l(f.LineageModels+"/"+m.name)}function p(e){console.log(e==null?void 0:e.message)}return s.jsx("div",{className:"flex overflow-hidden w-full h-full",children:s.jsx(g,{showColumns:!0,handleClickModel:d,handleError:p,children:s.jsx(x,{model:r})})})}export{S as default};
@@ -1 +1 @@
1
- import{r as i,R as S,j as F,b as rt,c as Se}from"./index-O3mjYpnE.js";import{o as R,p as Me,h as Ne,al as ot,s as Ae,K as G,y as W,n as z,L as X,am as lt,V as ye,an as it,I as at,aj as je,a0 as _e,ao as $e,ap as st,i as ut,c as Be,a1 as ct,a2 as ve,d as q,B as Ue,a3 as dt,a4 as pt,j as ft,S as A,C as vt,a5 as mt,a6 as bt,w as ae,ak as ht,a7 as gt,b as Ee,v as xt,aa as Ot,G as St,D as yt,a8 as $t,a9 as Et,a as I,af as wt,T as we,_ as Qe,ab as It,ac as Rt,N as Ct,ae as Lt,ad as Ft,Z as Ie,$ as Dt,W as Tt,X as kt,Y as Pt,R as Re,ah as Mt,ai as Nt,z as At}from"./popover-CqgMRE0G.js";import{r as K}from"./floating-ui.react-dom-BH3TFvkM.js";import{t as jt,v as _t}from"./Input-obuJsD6k.js";function Bt({title:e,titleId:n,...t},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?i.createElement("title",{id:n},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const Ut=i.forwardRef(Bt);let Qt=i.createContext(void 0);function ge(){return i.useContext(Qt)}function Vt(e,n,t){let[r,l]=i.useState(t),o=e!==void 0,a=i.useRef(o),s=i.useRef(!1),c=i.useRef(!1);return o&&!a.current&&!s.current?(s.current=!0,a.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&a.current&&!c.current&&(c.current=!0,a.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,R(d=>(o||l(d),n==null?void 0:n(d)))]}function Ht(e){let[n]=i.useState(e);return n}function Ve(e={},n=null,t=[]){for(let[r,l]of Object.entries(e))Ke(t,He(n,r),l);return t}function He(e,n){return e?e+"["+n+"]":n}function Ke(e,n,t){if(Array.isArray(t))for(let[r,l]of t.entries())Ke(e,He(n,r.toString()),l);else t instanceof Date?e.push([n,t.toISOString()]):typeof t=="boolean"?e.push([n,t?"1":"0"]):typeof t=="string"?e.push([n,t]):typeof t=="number"?e.push([n,`${t}`]):t==null?e.push([n,""]):Ve(t,n,e)}function Kt(e){var n,t;let r=(n=e==null?void 0:e.form)!=null?n:e.closest("form");if(r){for(let l of r.elements)if(l!==e&&(l.tagName==="INPUT"&&l.type==="submit"||l.tagName==="BUTTON"&&l.type==="submit"||l.nodeName==="INPUT"&&l.type==="image")){l.click();return}(t=r.requestSubmit)==null||t.call(r)}}let zt=i.createContext(null);function Gt({children:e}){let n=i.useContext(zt);if(!n)return S.createElement(S.Fragment,null,e);let{target:t}=n;return t?K.createPortal(S.createElement(S.Fragment,null,e),t):null}function Wt({data:e,form:n,disabled:t,onReset:r,overrides:l}){let[o,a]=i.useState(null),s=Me();return i.useEffect(()=>{if(r&&o)return s.addEventListener(o,"reset",r)},[o,n,r]),S.createElement(Gt,null,S.createElement(Xt,{setForm:a,formId:n}),Ve(e).map(([c,d])=>S.createElement(Ne,{features:Ae.Hidden,...ot({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:n,disabled:t,name:c,value:d,...l})})))}function Xt({setForm:e,formId:n}){return i.useEffect(()=>{if(n){let t=document.getElementById(n);t&&e(t)}},[e,n]),n?null:S.createElement(Ne,{features:Ae.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let r=t.closest("form");r&&e(r)}})}let Zt=i.createContext(void 0);function ze(){return i.useContext(Zt)}let se=i.createContext(null);se.displayName="DescriptionContext";function Ge(){let e=i.useContext(se);if(e===null){let n=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ge),n}return e}function qt(){var e,n;return(n=(e=i.useContext(se))==null?void 0:e.value)!=null?n:void 0}function Hn(){let[e,n]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(t){let r=R(o=>(n(a=>[...a,o]),()=>n(a=>{let s=a.slice(),c=s.indexOf(o);return c!==-1&&s.splice(c,1),s}))),l=i.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props,value:t.value}),[r,t.slot,t.name,t.props,t.value]);return S.createElement(se.Provider,{value:l},t.children)},[n])]}let Yt="p";function Jt(e,n){let t=i.useId(),r=ge(),{id:l=`headlessui-description-${t}`,...o}=e,a=Ge(),s=W(n);z(()=>a.register(l),[l,a.register]);let c=r||!1,d=i.useMemo(()=>({...a.slot,disabled:c}),[a.slot,c]),p={ref:s,...a.props,id:l};return X()({ourProps:p,theirProps:o,slot:d,defaultTag:Yt,name:a.name||"Description"})}let en=G(Jt),Kn=Object.assign(en,{}),ue=i.createContext(null);ue.displayName="LabelContext";function We(){let e=i.useContext(ue);if(e===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,We),n}return e}function Xe(e){var n,t,r;let l=(t=(n=i.useContext(ue))==null?void 0:n.value)!=null?t:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[l,...e].filter(Boolean).join(" "):l}function tn({inherit:e=!1}={}){let n=Xe(),[t,r]=i.useState([]),l=e?[n,...t].filter(Boolean):t;return[l.length>0?l.join(" "):void 0,i.useMemo(()=>function(o){let a=R(c=>(r(d=>[...d,c]),()=>r(d=>{let p=d.slice(),b=p.indexOf(c);return b!==-1&&p.splice(b,1),p}))),s=i.useMemo(()=>({register:a,slot:o.slot,name:o.name,props:o.props,value:o.value}),[a,o.slot,o.name,o.props,o.value]);return S.createElement(ue.Provider,{value:s},o.children)},[r])]}let nn="label";function rn(e,n){var t;let r=i.useId(),l=We(),o=ze(),a=ge(),{id:s=`headlessui-label-${r}`,htmlFor:c=o??((t=l.props)==null?void 0:t.htmlFor),passive:d=!1,...p}=e,b=W(n);z(()=>l.register(s),[s,l.register]);let f=R(y=>{let P=y.currentTarget;if(!(y.target!==y.currentTarget&&lt(y.target))&&(ye(P)&&y.preventDefault(),l.props&&"onClick"in l.props&&typeof l.props.onClick=="function"&&l.props.onClick(y),ye(P))){let x=document.getElementById(P.htmlFor);if(x){let $=x.getAttribute("disabled");if($==="true"||$==="")return;let C=x.getAttribute("aria-disabled");if(C==="true"||C==="")return;(it(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),u=a||!1,O=i.useMemo(()=>({...l.slot,disabled:u}),[l.slot,u]),w={ref:b,...l.props,id:s,htmlFor:c,onClick:f};return d&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in p&&delete p.onClick),X()({ourProps:w,theirProps:p,slot:O,defaultTag:c?nn:"div",name:l.name||"Label"})}let on=G(rn),ln=Object.assign(on,{});function an(e,n){return e!==null&&n!==null&&typeof e=="object"&&typeof n=="object"&&"id"in e&&"id"in n?e.id===n.id:e===n}function sn(e=an){return i.useCallback((n,t)=>{if(typeof e=="string"){let r=e;return(n==null?void 0:n[r])===(t==null?void 0:t[r])}return e(n,t)},[e])}let me=new Map,te=new Map;function Ce(e){var n;let t=(n=te.get(e))!=null?n:0;return te.set(e,t+1),t!==0?()=>Le(e):(me.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Le(e))}function Le(e){var n;let t=(n=te.get(e))!=null?n:1;if(t===1?te.delete(e):te.set(e,t-1),t!==1)return;let r=me.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,me.delete(e))}function un(e,{allowed:n,disallowed:t}={}){let r=at(e,"inert-others");z(()=>{var l,o;if(!r)return;let a=je();for(let c of(l=t==null?void 0:t())!=null?l:[])c&&a.add(Ce(c));let s=(o=n==null?void 0:n())!=null?o:[];for(let c of s){if(!c)continue;let d=_e(c);if(!d)continue;let p=c.parentElement;for(;p&&p!==d.body;){for(let b of p.children)s.some(f=>b.contains(f))||a.add(Ce(b));p=p.parentElement}}return a.dispose},[r,n,t])}var cn=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(cn||{});const oe={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},dn=200;function pn(e,{trigger:n,action:t,close:r,select:l}){let o=i.useRef(null);$e(e&&n!==null,"pointerdown",a=>{st(a==null?void 0:a.target)&&n!=null&&n.contains(a.target)&&(o.current=new Date)}),$e(e&&n!==null,"pointerup",a=>{if(o.current===null||!ut(a.target))return;let s=t(a),c=new Date().getTime()-o.current.getTime();switch(o.current=null,s.kind){case 0:return;case 1:{c>dn&&(l(s.target),r());break}case 2:{r();break}}},{capture:!0})}function Fe(e){return[e.screenX,e.screenY]}function fn(){let e=i.useRef([-1,-1]);return{wasMoved(n){let t=Fe(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=Fe(n)}}}function vn(e,n){let[t,r]=i.useState(n);return!e&&t!==n&&r(n),e?t:n}function mn(e){throw new Error("Unexpected object: "+e)}var g=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(g||{});function le(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),l=r??-1;switch(e.focus){case 0:{for(let o=0;o<t.length;++o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 1:{l===-1&&(l=t.length);for(let o=l-1;o>=0;--o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 2:{for(let o=l+1;o<t.length;++o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 3:{for(let o=t.length-1;o>=0;--o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 4:{for(let o=0;o<t.length;++o)if(n.resolveId(t[o],o,t)===e.id)return o;return r}case 5:return null;default:mn(e)}}var be=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(be||{});function bn(e,n){let t=i.useRef({left:0,top:0});if(z(()=>{if(!n)return;let l=n.getBoundingClientRect();l&&(t.current=l)},[e,n]),n==null||!e||n===document.activeElement)return!1;let r=n.getBoundingClientRect();return r.top!==t.current.top||r.left!==t.current.left}let De=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Te(e){var n,t;let r=(n=e.innerText)!=null?n:"",l=e.cloneNode(!0);if(!Be(l))return r;let o=!1;for(let s of l.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),o=!0;let a=o?(t=l.innerText)!=null?t:"":r;return De.test(a)&&(a=a.replace(De,"")),a}function hn(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(l=>{let o=document.getElementById(l);if(o){let a=o.getAttribute("aria-label");return typeof a=="string"?a.trim():Te(o).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Te(e).trim()}function gn(e){let n=i.useRef(""),t=i.useRef("");return R(()=>{let r=e.current;if(!r)return"";let l=r.innerText;if(n.current===l)return t.current;let o=hn(r).trim().toLowerCase();return n.current=l,t.current=o,o})}var xn=Object.defineProperty,On=(e,n,t)=>n in e?xn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(On(e,typeof n!="symbol"?n+"":n,t),t),E=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(E||{}),_=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(_||{}),he=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(he||{}),Ze=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Ze||{});function Pe(e,n=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=pt(n(e.options.slice()),o=>o.dataRef.current.domRef.current),l=t?r.indexOf(t):null;return l===-1&&(l=null),{options:r,activeOptionIndex:l}}let Sn={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:g.Nothing},listboxState:1,__demoMode:!1}},0(e,n){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,l=e.options.findIndex(o=>r(o.dataRef.current.value));return l!==-1&&(t=l),{...e,pendingFocus:n.focus,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,n){var t,r,l,o,a;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s={...e,searchQuery:"",activationTrigger:(t=n.trigger)!=null?t:1,__demoMode:!1};if(n.focus===g.Nothing)return{...s,activeOptionIndex:null};if(n.focus===g.Specific)return{...s,activeOptionIndex:e.options.findIndex(p=>p.id===n.id)};if(n.focus===g.Previous){let p=e.activeOptionIndex;if(p!==null){let b=e.options[p].dataRef.current.domRef,f=le(n,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});if(f!==null){let u=e.options[f].dataRef.current.domRef;if(((r=b.current)==null?void 0:r.previousElementSibling)===u.current||((l=u.current)==null?void 0:l.previousElementSibling)===null)return{...s,activeOptionIndex:f}}}}else if(n.focus===g.Next){let p=e.activeOptionIndex;if(p!==null){let b=e.options[p].dataRef.current.domRef,f=le(n,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});if(f!==null){let u=e.options[f].dataRef.current.domRef;if(((o=b.current)==null?void 0:o.nextElementSibling)===u.current||((a=u.current)==null?void 0:a.nextElementSibling)===null)return{...s,activeOptionIndex:f}}}}let c=Pe(e),d=le(n,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});return{...s,...c,activeOptionIndex:d}},3:(e,n)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.searchQuery!==""?0:1,r=e.searchQuery+n.value.toLowerCase(),l=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+t).concat(e.options.slice(0,e.activeOptionIndex+t)):e.options).find(a=>{var s;return!a.dataRef.current.disabled&&((s=a.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),o=l?e.options.indexOf(l):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,n)=>{let t=e.options.concat(n.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==g.Nothing&&(r=le(e.pendingFocus,{resolveItems:()=>t,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:l}=e.dataRef.current;if(l){let o=t.findIndex(a=>l==null?void 0:l(a.dataRef.current.value));o!==-1&&(r=o)}}return{...e,options:t,activeOptionIndex:r,pendingFocus:{focus:g.Nothing},pendingShouldSort:!0}},6:(e,n)=>{let t=e.options,r=[],l=new Set(n.options);for(let[o,a]of t.entries())if(l.has(a.id)&&(r.push(o),l.delete(a.id),l.size===0))break;if(r.length>0){t=t.slice();for(let o of r.reverse())t.splice(o,1)}return{...e,options:t,activationTrigger:1}},7:(e,n)=>e.buttonElement===n.element?e:{...e,buttonElement:n.element},8:(e,n)=>e.optionsElement===n.element?e:{...e,optionsElement:n.element},9:e=>e.pendingShouldSort?{...e,...Pe(e),pendingShouldSort:!1}:e};class xe extends ct{constructor(n){super(n),ke(this,"actions",{onChange:t=>{let{onChange:r,compare:l,mode:o,value:a}=this.state.dataRef.current;return q(o,{0:()=>r==null?void 0:r(t),1:()=>{let s=a.slice(),c=s.findIndex(d=>l(d,t));return c===-1?s.push(t):s.splice(c,1),r==null?void 0:r(s)}})},registerOption:ve(()=>{let t=[],r=new Set;return[(l,o)=>{r.has(o)||(r.add(o),t.push({id:l,dataRef:o}))},()=>(r.clear(),this.send({type:5,options:t.splice(0)}))]}),unregisterOption:ve(()=>{let t=[];return[r=>t.push(r),()=>{this.send({type:6,options:t.splice(0)})}]}),goToOption:ve(()=>{let t=null;return[(r,l)=>{t={type:2,...r,trigger:l}},()=>t&&this.send(t)]}),closeListbox:()=>{this.send({type:1})},openListbox:t=>{this.send({type:0,focus:t})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:t,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(t.current.value),this.send({type:2,focus:g.Specific,id:r})}},selectOption:t=>{let r=this.state.options.find(l=>l.id===t);r&&this.actions.onChange(r.dataRef.current.value)},search:t=>{this.send({type:3,value:t})},clearSearch:()=>{this.send({type:4})},setButtonElement:t=>{this.send({type:7,element:t})},setOptionsElement:t=>{this.send({type:8,element:t})}}),ke(this,"selectors",{activeDescendantId(t){var r;let l=t.activeOptionIndex,o=t.options;return l===null||(r=o[l])==null?void 0:r.id},isActive(t,r){var l;let o=t.activeOptionIndex,a=t.options;return o!==null?((l=a[o])==null?void 0:l.id)===r:!1},shouldScrollIntoView(t,r){return t.__demoMode||t.listboxState!==0||t.activationTrigger===0?!1:this.isActive(t,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let t=this.state.id,r=Ue.get(null);this.disposables.add(r.on(dt.Push,l=>{!r.selectors.isTop(l,t)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(t)),this.on(1,()=>r.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new xe({id:n,dataRef:{current:{}},listboxState:t?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:g.Nothing},__demoMode:t})}reduce(n,t){return q(t.type,Sn,n,t)}}const qe=i.createContext(null);function Oe(e){let n=i.useContext(qe);if(n===null){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ye),t}return n}function Ye({id:e,__demoMode:n=!1}){let t=i.useMemo(()=>xe.new({id:e,__demoMode:n}),[]);return ft(()=>t.dispose()),t}let ce=i.createContext(null);ce.displayName="ListboxDataContext";function ne(e){let n=i.useContext(ce);if(n===null){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ne),t}return n}let yn=i.Fragment;function $n(e,n){let t=i.useId(),r=ge(),{value:l,defaultValue:o,form:a,name:s,onChange:c,by:d,invalid:p=!1,disabled:b=r||!1,horizontal:f=!1,multiple:u=!1,__demoMode:O=!1,...w}=e;const y=f?"horizontal":"vertical";let P=W(n),x=Ht(o),[$=u?[]:void 0,C]=Vt(l,c,x),L=Ye({id:t,__demoMode:O}),B=i.useRef({static:!1,hold:!1}),U=i.useRef(new Map),N=sn(d),Q=i.useCallback(k=>q(h.mode,{[_.Multi]:()=>$.some(ee=>N(ee,k)),[_.Single]:()=>N($,k)}),[$]),h=i.useMemo(()=>({value:$,disabled:b,invalid:p,mode:u?_.Multi:_.Single,orientation:y,onChange:C,compare:N,isSelected:Q,optionsPropsRef:B,listRef:U}),[$,b,p,u,y,C,N,Q,B,U]);z(()=>{L.state.dataRef.current=h},[h]);let D=A(L,k=>k.listboxState),V=Ue.get(null),H=A(V,i.useCallback(k=>V.selectors.isTop(k,t),[V,t])),[j,Y]=A(L,k=>[k.buttonElement,k.optionsElement]);vt(H,[j,Y],(k,ee)=>{L.send({type:Ze.CloseListbox}),Mt(ee,Nt.Loose)||(k.preventDefault(),j==null||j.focus())});let J=i.useMemo(()=>({open:D===E.Open,disabled:b,invalid:p,value:$}),[D,b,p,$]),[m,M]=tn({inherit:!0}),de={ref:P},re=i.useCallback(()=>{if(x!==void 0)return C==null?void 0:C(x)},[C,x]),pe=X();return S.createElement(M,{value:m,props:{htmlFor:j==null?void 0:j.id},slot:{open:D===E.Open,disabled:b}},S.createElement(mt,null,S.createElement(qe.Provider,{value:L},S.createElement(ce.Provider,{value:h},S.createElement(bt,{value:q(D,{[E.Open]:ae.Open,[E.Closed]:ae.Closed})},s!=null&&$!=null&&S.createElement(Wt,{disabled:b,data:{[s]:$},form:a,onReset:re}),pe({ourProps:de,theirProps:w,slot:J,defaultTag:yn,name:"Listbox"}))))))}let En="button";function wn(e,n){let t=i.useId(),r=ze(),l=ne("Listbox.Button"),o=Oe("Listbox.Button"),{id:a=r||`headlessui-listbox-button-${t}`,disabled:s=l.disabled||!1,autoFocus:c=!1,...d}=e,p=W(n,Lt(),o.actions.setButtonElement),b=Ft(),[f,u,O]=A(o,m=>[m.listboxState,m.buttonElement,m.optionsElement]),w=f===E.Open;pn(w,{trigger:u,action:i.useCallback(m=>{if(u!=null&&u.contains(m.target))return oe.Ignore;let M=m.target.closest('[role="option"]:not([data-disabled])');return Be(M)?oe.Select(M):O!=null&&O.contains(m.target)?oe.Ignore:oe.Close},[u,O]),close:o.actions.closeListbox,select:o.actions.selectActiveOption});let y=R(m=>{switch(m.key){case I.Enter:Kt(m.currentTarget);break;case I.Space:case I.ArrowDown:m.preventDefault(),o.actions.openListbox({focus:l.value?g.Nothing:g.First});break;case I.ArrowUp:m.preventDefault(),o.actions.openListbox({focus:l.value?g.Nothing:g.Last});break}}),P=R(m=>{switch(m.key){case I.Space:m.preventDefault();break}}),x=i.useRef(null),$=R(m=>{var M;if(x.current=m.pointerType,m.pointerType==="mouse"&&m.button===be.Left){if(Ie(m.currentTarget))return m.preventDefault();o.state.listboxState===E.Open?(K.flushSync(()=>o.actions.closeListbox()),(M=o.state.buttonElement)==null||M.focus({preventScroll:!0})):(m.preventDefault(),o.actions.openListbox({focus:g.Nothing}))}}),C=R(m=>{var M;if(x.current!=="mouse"&&m.button===be.Left){if(Ie(m.currentTarget))return m.preventDefault();o.state.listboxState===E.Open?(K.flushSync(()=>o.actions.closeListbox()),(M=o.state.buttonElement)==null||M.focus({preventScroll:!0})):(m.preventDefault(),o.actions.openListbox({focus:g.Nothing}))}}),L=R(m=>m.preventDefault()),B=Xe([a]),U=qt(),{isFocusVisible:N,focusProps:Q}=Dt({autoFocus:c}),{isHovered:h,hoverProps:D}=Tt({isDisabled:s}),{pressed:V,pressProps:H}=kt({disabled:s}),j=i.useMemo(()=>({open:f===E.Open,active:V||f===E.Open,disabled:s,invalid:l.invalid,value:l.value,hover:h,focus:N,autofocus:c}),[f,l.value,s,h,N,V,l.invalid,c]),Y=A(o,m=>m.listboxState===E.Open),J=Qe(b(),{ref:p,id:a,type:Pt(e,u),"aria-haspopup":"listbox","aria-controls":O==null?void 0:O.id,"aria-expanded":Y,"aria-labelledby":B,"aria-describedby":U,disabled:s||void 0,autoFocus:c,onKeyDown:y,onKeyUp:P,onKeyPress:L,onPointerDown:$,onClick:C},Q,D,H);return X()({ourProps:J,theirProps:d,slot:j,defaultTag:En,name:"Listbox.Button"})}let Je=i.createContext(!1),In="div",Rn=Re.RenderStrategy|Re.Static;function Cn(e,n){let t=i.useId(),{id:r=`headlessui-listbox-options-${t}`,anchor:l,portal:o=!1,modal:a=!0,transition:s=!1,...c}=e,d=gt(l),[p,b]=i.useState(null);d&&(o=!0);let f=ne("Listbox.Options"),u=Oe("Listbox.Options"),[O,w,y,P]=A(u,v=>[v.listboxState,v.buttonElement,v.optionsElement,v.__demoMode]),x=Ee(w),$=Ee(y),C=xt(),[L,B]=Ot(s,p,C!==null?(C&ae.Open)===ae.Open:O===E.Open);St(L,w,u.actions.closeListbox);let U=P?!1:a&&O===E.Open;yt(U,$);let N=P?!1:a&&O===E.Open;un(N,{allowed:i.useCallback(()=>[w,y],[w,y])});let Q=O!==E.Open,h=bn(Q,w)?!1:L,D=L&&O===E.Closed,V=vn(D,f.value),H=R(v=>f.compare(V,v)),j=A(u,v=>{var T;if(d==null||!((T=d==null?void 0:d.to)!=null&&T.includes("selection")))return null;let Z=v.options.findIndex(fe=>H(fe.dataRef.current.value));return Z===-1&&(Z=0),Z}),Y=(()=>{if(d==null)return;if(j===null)return{...d,inner:void 0};let v=Array.from(f.listRef.current.values());return{...d,inner:{listRef:{current:v},index:j}}})(),[J,m]=$t(Y),M=Et(),de=W(n,d?J:null,u.actions.setOptionsElement,b),re=Me();i.useEffect(()=>{var v;let T=y;T&&O===E.Open&&T!==((v=_e(T))==null?void 0:v.activeElement)&&(T==null||T.focus({preventScroll:!0}))},[O,y]);let pe=R(v=>{var T,Z;switch(re.dispose(),v.key){case I.Space:if(u.state.searchQuery!=="")return v.preventDefault(),v.stopPropagation(),u.actions.search(v.key);case I.Enter:if(v.preventDefault(),v.stopPropagation(),u.state.activeOptionIndex!==null){let{dataRef:fe}=u.state.options[u.state.activeOptionIndex];u.actions.onChange(fe.current.value)}f.mode===_.Single&&(K.flushSync(()=>u.actions.closeListbox()),(T=u.state.buttonElement)==null||T.focus({preventScroll:!0}));break;case q(f.orientation,{vertical:I.ArrowDown,horizontal:I.ArrowRight}):return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Next});case q(f.orientation,{vertical:I.ArrowUp,horizontal:I.ArrowLeft}):return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Previous});case I.Home:case I.PageUp:return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.First});case I.End:case I.PageDown:return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Last});case I.Escape:v.preventDefault(),v.stopPropagation(),K.flushSync(()=>u.actions.closeListbox()),(Z=u.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case I.Tab:v.preventDefault(),v.stopPropagation(),K.flushSync(()=>u.actions.closeListbox()),wt(u.state.buttonElement,v.shiftKey?we.Previous:we.Next);break;default:v.key.length===1&&(u.actions.search(v.key),re.setTimeout(()=>u.actions.clearSearch(),350));break}}),k=A(u,v=>{var T;return(T=v.buttonElement)==null?void 0:T.id}),ee=i.useMemo(()=>({open:O===E.Open}),[O]),et=Qe(d?M():{},{id:r,ref:de,"aria-activedescendant":A(u,u.selectors.activeDescendantId),"aria-multiselectable":f.mode===_.Multi?!0:void 0,"aria-labelledby":k,"aria-orientation":f.orientation,onKeyDown:pe,role:"listbox",tabIndex:O===E.Open?0:void 0,style:{...c.style,...m,"--button-width":Rt(w,!0).width},...It(B)}),tt=X(),nt=i.useMemo(()=>f.mode===_.Multi?f:{...f,isSelected:H},[f,H]);return S.createElement(Ct,{enabled:o?e.static||L:!1,ownerDocument:x},S.createElement(ce.Provider,{value:nt},tt({ourProps:et,theirProps:c,slot:ee,defaultTag:In,features:Rn,visible:h,name:"Listbox.Options"})))}let Ln="div";function Fn(e,n){let t=i.useId(),{id:r=`headlessui-listbox-option-${t}`,disabled:l=!1,value:o,...a}=e,s=i.useContext(Je)===!0,c=ne("Listbox.Option"),d=Oe("Listbox.Option"),p=A(d,h=>d.selectors.isActive(h,r)),b=c.isSelected(o),f=i.useRef(null),u=gn(f),O=ht({disabled:l,value:o,domRef:f,get textValue(){return u()}}),w=W(n,f,h=>{h?c.listRef.current.set(r,h):c.listRef.current.delete(r)}),y=A(d,h=>d.selectors.shouldScrollIntoView(h,r));z(()=>{if(y)return je().requestAnimationFrame(()=>{var h,D;(D=(h=f.current)==null?void 0:h.scrollIntoView)==null||D.call(h,{block:"nearest"})})},[y,f]),z(()=>{if(!s)return d.actions.registerOption(r,O),()=>d.actions.unregisterOption(r)},[O,r,s]);let P=R(h=>{var D;if(l)return h.preventDefault();d.actions.onChange(o),c.mode===_.Single&&(K.flushSync(()=>d.actions.closeListbox()),(D=d.state.buttonElement)==null||D.focus({preventScroll:!0}))}),x=R(()=>{if(l)return d.actions.goToOption({focus:g.Nothing});d.actions.goToOption({focus:g.Specific,id:r})}),$=fn(),C=R(h=>{$.update(h),!l&&(p||d.actions.goToOption({focus:g.Specific,id:r},he.Pointer))}),L=R(h=>{$.wasMoved(h)&&(l||p||d.actions.goToOption({focus:g.Specific,id:r},he.Pointer))}),B=R(h=>{$.wasMoved(h)&&(l||p&&d.actions.goToOption({focus:g.Nothing}))}),U=i.useMemo(()=>({active:p,focus:p,selected:b,disabled:l,selectedOption:b&&s}),[p,b,l,s]),N=s?{}:{id:r,ref:w,role:"option",tabIndex:l===!0?void 0:-1,"aria-disabled":l===!0?!0:void 0,"aria-selected":b,disabled:void 0,onClick:P,onFocus:x,onPointerEnter:C,onMouseEnter:C,onPointerMove:L,onMouseMove:L,onPointerLeave:B,onMouseLeave:B},Q=X();return!b&&s?null:Q({ourProps:N,theirProps:a,slot:U,defaultTag:Ln,name:"Listbox.Option"})}let Dn=i.Fragment;function Tn(e,n){let{options:t,placeholder:r,...l}=e,o={ref:W(n)},a=ne("ListboxSelectedOption"),s=i.useMemo(()=>({}),[]),c=a.value===void 0||a.value===null||a.mode===_.Multi&&Array.isArray(a.value)&&a.value.length===0,d=X();return S.createElement(Je.Provider,{value:!0},d({ourProps:o,theirProps:{...l,children:S.createElement(S.Fragment,null,r&&c?r:t)},slot:s,defaultTag:Dn,name:"ListboxSelectedOption"}))}let kn=G($n),Pn=G(wn),Mn=ln,Nn=G(Cn),An=G(Fn),jn=G(Tn),ie=Object.assign(kn,{Button:Pn,Label:Mn,Options:Nn,Option:An,SelectedOption:jn});function _n({title:e,titleId:n,...t},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?i.createElement("title",{id:n},e):null,i.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const zn=i.forwardRef(_n);function Gn({options:e,value:n=[]}){const[t,r]=i.useState([]);return i.useEffect(()=>{r(n)},[n]),F.jsx(ie,{value:t,onChange:l=>{var o;r(l);for(const a in e)(o=e[a])==null||o.call(e,l.includes(a))},multiple:!0,children:F.jsxs("div",{className:"relative flex",children:[F.jsxs(ie.Button,{className:"flex items-center relative w-full bg-primary-10 text-xs rounded-full text-primary-500 py-1 px-2 text-center focus:outline-none focus-visible:border-accent-500 focus-visible:ring-2 focus-visible:ring-light focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-brand-300 cursor-pointer",children:[F.jsxs("span",{className:"flex truncate items-center",children:[F.jsx(Ut,{className:"h-3 w-3 mr-0 sm:mr-1"})," ",F.jsx("span",{className:"sr-only sm:not-sr-only",children:"Show"})]}),F.jsx(jt,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]}),F.jsx(At,{as:i.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:F.jsx(ie.Options,{className:"absolute top-8 right-0 z-50 max-h-60 min-w-16 overflow-auto rounded-md bg-theme py-2 shadow-lg ring-2 ring-primary-10 ring-opacity-5 focus:outline-none sm:text-sm",children:Object.keys(e).filter(l=>e[l]).map(l=>F.jsx(ie.Option,{className:({active:o,disabled:a})=>Se("relative cursor-default select-none py-1 pl-10 pr-4",a?"opacity-50 cursor-not-allowed":"",o?"bg-primary-10 text-primary-500":"text-neutral-700 dark:text-neutral-300"),value:l,disabled:rt(!!e[l]),children:({selected:o})=>F.jsxs(F.Fragment,{children:[F.jsx("span",{children:l}),F.jsx("span",{className:Se("absolute inset-y-0 left-0 flex items-center pl-3 text-primary-500",o?"block":"hidden"),children:F.jsx(_t,{className:"h-4 w-4","aria-hidden":"true"})})]})},l))})})]})})}export{We as C,zn as F,Kn as H,Gn as L,Xe as N,tn as Q,Vt as T,qt as U,ln as V,ge as a,fn as b,g as c,bn as d,sn as e,le as f,oe as g,Wt as j,pn as k,Ht as l,Kt as p,gn as s,ze as u,Hn as w,un as y};
1
+ import{r as i,R as S,j as F,b as rt,c as Se}from"./index-Dj0i1-CA.js";import{o as R,p as Me,h as Ne,al as ot,s as Ae,K as G,y as W,n as z,L as X,am as lt,V as ye,an as it,I as at,aj as je,a0 as _e,ao as $e,ap as st,i as ut,c as Be,a1 as ct,a2 as ve,d as q,B as Ue,a3 as dt,a4 as pt,j as ft,S as A,C as vt,a5 as mt,a6 as bt,w as ae,ak as ht,a7 as gt,b as Ee,v as xt,aa as Ot,G as St,D as yt,a8 as $t,a9 as Et,a as I,af as wt,T as we,_ as Qe,ab as It,ac as Rt,N as Ct,ae as Lt,ad as Ft,Z as Ie,$ as Dt,W as Tt,X as kt,Y as Pt,R as Re,ah as Mt,ai as Nt,z as At}from"./popover-_Sf0yvOI.js";import{r as K}from"./floating-ui.react-dom-CjE-JNW1.js";import{t as jt,v as _t}from"./Input-B-oZ6fGO.js";function Bt({title:e,titleId:n,...t},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?i.createElement("title",{id:n},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const Ut=i.forwardRef(Bt);let Qt=i.createContext(void 0);function ge(){return i.useContext(Qt)}function Vt(e,n,t){let[r,l]=i.useState(t),o=e!==void 0,a=i.useRef(o),s=i.useRef(!1),c=i.useRef(!1);return o&&!a.current&&!s.current?(s.current=!0,a.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&a.current&&!c.current&&(c.current=!0,a.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,R(d=>(o||l(d),n==null?void 0:n(d)))]}function Ht(e){let[n]=i.useState(e);return n}function Ve(e={},n=null,t=[]){for(let[r,l]of Object.entries(e))Ke(t,He(n,r),l);return t}function He(e,n){return e?e+"["+n+"]":n}function Ke(e,n,t){if(Array.isArray(t))for(let[r,l]of t.entries())Ke(e,He(n,r.toString()),l);else t instanceof Date?e.push([n,t.toISOString()]):typeof t=="boolean"?e.push([n,t?"1":"0"]):typeof t=="string"?e.push([n,t]):typeof t=="number"?e.push([n,`${t}`]):t==null?e.push([n,""]):Ve(t,n,e)}function Kt(e){var n,t;let r=(n=e==null?void 0:e.form)!=null?n:e.closest("form");if(r){for(let l of r.elements)if(l!==e&&(l.tagName==="INPUT"&&l.type==="submit"||l.tagName==="BUTTON"&&l.type==="submit"||l.nodeName==="INPUT"&&l.type==="image")){l.click();return}(t=r.requestSubmit)==null||t.call(r)}}let zt=i.createContext(null);function Gt({children:e}){let n=i.useContext(zt);if(!n)return S.createElement(S.Fragment,null,e);let{target:t}=n;return t?K.createPortal(S.createElement(S.Fragment,null,e),t):null}function Wt({data:e,form:n,disabled:t,onReset:r,overrides:l}){let[o,a]=i.useState(null),s=Me();return i.useEffect(()=>{if(r&&o)return s.addEventListener(o,"reset",r)},[o,n,r]),S.createElement(Gt,null,S.createElement(Xt,{setForm:a,formId:n}),Ve(e).map(([c,d])=>S.createElement(Ne,{features:Ae.Hidden,...ot({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:n,disabled:t,name:c,value:d,...l})})))}function Xt({setForm:e,formId:n}){return i.useEffect(()=>{if(n){let t=document.getElementById(n);t&&e(t)}},[e,n]),n?null:S.createElement(Ne,{features:Ae.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let r=t.closest("form");r&&e(r)}})}let Zt=i.createContext(void 0);function ze(){return i.useContext(Zt)}let se=i.createContext(null);se.displayName="DescriptionContext";function Ge(){let e=i.useContext(se);if(e===null){let n=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ge),n}return e}function qt(){var e,n;return(n=(e=i.useContext(se))==null?void 0:e.value)!=null?n:void 0}function Hn(){let[e,n]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(t){let r=R(o=>(n(a=>[...a,o]),()=>n(a=>{let s=a.slice(),c=s.indexOf(o);return c!==-1&&s.splice(c,1),s}))),l=i.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props,value:t.value}),[r,t.slot,t.name,t.props,t.value]);return S.createElement(se.Provider,{value:l},t.children)},[n])]}let Yt="p";function Jt(e,n){let t=i.useId(),r=ge(),{id:l=`headlessui-description-${t}`,...o}=e,a=Ge(),s=W(n);z(()=>a.register(l),[l,a.register]);let c=r||!1,d=i.useMemo(()=>({...a.slot,disabled:c}),[a.slot,c]),p={ref:s,...a.props,id:l};return X()({ourProps:p,theirProps:o,slot:d,defaultTag:Yt,name:a.name||"Description"})}let en=G(Jt),Kn=Object.assign(en,{}),ue=i.createContext(null);ue.displayName="LabelContext";function We(){let e=i.useContext(ue);if(e===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,We),n}return e}function Xe(e){var n,t,r;let l=(t=(n=i.useContext(ue))==null?void 0:n.value)!=null?t:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[l,...e].filter(Boolean).join(" "):l}function tn({inherit:e=!1}={}){let n=Xe(),[t,r]=i.useState([]),l=e?[n,...t].filter(Boolean):t;return[l.length>0?l.join(" "):void 0,i.useMemo(()=>function(o){let a=R(c=>(r(d=>[...d,c]),()=>r(d=>{let p=d.slice(),b=p.indexOf(c);return b!==-1&&p.splice(b,1),p}))),s=i.useMemo(()=>({register:a,slot:o.slot,name:o.name,props:o.props,value:o.value}),[a,o.slot,o.name,o.props,o.value]);return S.createElement(ue.Provider,{value:s},o.children)},[r])]}let nn="label";function rn(e,n){var t;let r=i.useId(),l=We(),o=ze(),a=ge(),{id:s=`headlessui-label-${r}`,htmlFor:c=o??((t=l.props)==null?void 0:t.htmlFor),passive:d=!1,...p}=e,b=W(n);z(()=>l.register(s),[s,l.register]);let f=R(y=>{let P=y.currentTarget;if(!(y.target!==y.currentTarget&&lt(y.target))&&(ye(P)&&y.preventDefault(),l.props&&"onClick"in l.props&&typeof l.props.onClick=="function"&&l.props.onClick(y),ye(P))){let x=document.getElementById(P.htmlFor);if(x){let $=x.getAttribute("disabled");if($==="true"||$==="")return;let C=x.getAttribute("aria-disabled");if(C==="true"||C==="")return;(it(x)&&(x.type==="file"||x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),u=a||!1,O=i.useMemo(()=>({...l.slot,disabled:u}),[l.slot,u]),w={ref:b,...l.props,id:s,htmlFor:c,onClick:f};return d&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in p&&delete p.onClick),X()({ourProps:w,theirProps:p,slot:O,defaultTag:c?nn:"div",name:l.name||"Label"})}let on=G(rn),ln=Object.assign(on,{});function an(e,n){return e!==null&&n!==null&&typeof e=="object"&&typeof n=="object"&&"id"in e&&"id"in n?e.id===n.id:e===n}function sn(e=an){return i.useCallback((n,t)=>{if(typeof e=="string"){let r=e;return(n==null?void 0:n[r])===(t==null?void 0:t[r])}return e(n,t)},[e])}let me=new Map,te=new Map;function Ce(e){var n;let t=(n=te.get(e))!=null?n:0;return te.set(e,t+1),t!==0?()=>Le(e):(me.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Le(e))}function Le(e){var n;let t=(n=te.get(e))!=null?n:1;if(t===1?te.delete(e):te.set(e,t-1),t!==1)return;let r=me.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,me.delete(e))}function un(e,{allowed:n,disallowed:t}={}){let r=at(e,"inert-others");z(()=>{var l,o;if(!r)return;let a=je();for(let c of(l=t==null?void 0:t())!=null?l:[])c&&a.add(Ce(c));let s=(o=n==null?void 0:n())!=null?o:[];for(let c of s){if(!c)continue;let d=_e(c);if(!d)continue;let p=c.parentElement;for(;p&&p!==d.body;){for(let b of p.children)s.some(f=>b.contains(f))||a.add(Ce(b));p=p.parentElement}}return a.dispose},[r,n,t])}var cn=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(cn||{});const oe={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},dn=200;function pn(e,{trigger:n,action:t,close:r,select:l}){let o=i.useRef(null);$e(e&&n!==null,"pointerdown",a=>{st(a==null?void 0:a.target)&&n!=null&&n.contains(a.target)&&(o.current=new Date)}),$e(e&&n!==null,"pointerup",a=>{if(o.current===null||!ut(a.target))return;let s=t(a),c=new Date().getTime()-o.current.getTime();switch(o.current=null,s.kind){case 0:return;case 1:{c>dn&&(l(s.target),r());break}case 2:{r();break}}},{capture:!0})}function Fe(e){return[e.screenX,e.screenY]}function fn(){let e=i.useRef([-1,-1]);return{wasMoved(n){let t=Fe(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=Fe(n)}}}function vn(e,n){let[t,r]=i.useState(n);return!e&&t!==n&&r(n),e?t:n}function mn(e){throw new Error("Unexpected object: "+e)}var g=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(g||{});function le(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),l=r??-1;switch(e.focus){case 0:{for(let o=0;o<t.length;++o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 1:{l===-1&&(l=t.length);for(let o=l-1;o>=0;--o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 2:{for(let o=l+1;o<t.length;++o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 3:{for(let o=t.length-1;o>=0;--o)if(!n.resolveDisabled(t[o],o,t))return o;return r}case 4:{for(let o=0;o<t.length;++o)if(n.resolveId(t[o],o,t)===e.id)return o;return r}case 5:return null;default:mn(e)}}var be=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(be||{});function bn(e,n){let t=i.useRef({left:0,top:0});if(z(()=>{if(!n)return;let l=n.getBoundingClientRect();l&&(t.current=l)},[e,n]),n==null||!e||n===document.activeElement)return!1;let r=n.getBoundingClientRect();return r.top!==t.current.top||r.left!==t.current.left}let De=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Te(e){var n,t;let r=(n=e.innerText)!=null?n:"",l=e.cloneNode(!0);if(!Be(l))return r;let o=!1;for(let s of l.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),o=!0;let a=o?(t=l.innerText)!=null?t:"":r;return De.test(a)&&(a=a.replace(De,"")),a}function hn(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(l=>{let o=document.getElementById(l);if(o){let a=o.getAttribute("aria-label");return typeof a=="string"?a.trim():Te(o).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Te(e).trim()}function gn(e){let n=i.useRef(""),t=i.useRef("");return R(()=>{let r=e.current;if(!r)return"";let l=r.innerText;if(n.current===l)return t.current;let o=hn(r).trim().toLowerCase();return n.current=l,t.current=o,o})}var xn=Object.defineProperty,On=(e,n,t)=>n in e?xn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(On(e,typeof n!="symbol"?n+"":n,t),t),E=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(E||{}),_=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(_||{}),he=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(he||{}),Ze=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(Ze||{});function Pe(e,n=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=pt(n(e.options.slice()),o=>o.dataRef.current.domRef.current),l=t?r.indexOf(t):null;return l===-1&&(l=null),{options:r,activeOptionIndex:l}}let Sn={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:g.Nothing},listboxState:1,__demoMode:!1}},0(e,n){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,l=e.options.findIndex(o=>r(o.dataRef.current.value));return l!==-1&&(t=l),{...e,pendingFocus:n.focus,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,n){var t,r,l,o,a;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s={...e,searchQuery:"",activationTrigger:(t=n.trigger)!=null?t:1,__demoMode:!1};if(n.focus===g.Nothing)return{...s,activeOptionIndex:null};if(n.focus===g.Specific)return{...s,activeOptionIndex:e.options.findIndex(p=>p.id===n.id)};if(n.focus===g.Previous){let p=e.activeOptionIndex;if(p!==null){let b=e.options[p].dataRef.current.domRef,f=le(n,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});if(f!==null){let u=e.options[f].dataRef.current.domRef;if(((r=b.current)==null?void 0:r.previousElementSibling)===u.current||((l=u.current)==null?void 0:l.previousElementSibling)===null)return{...s,activeOptionIndex:f}}}}else if(n.focus===g.Next){let p=e.activeOptionIndex;if(p!==null){let b=e.options[p].dataRef.current.domRef,f=le(n,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});if(f!==null){let u=e.options[f].dataRef.current.domRef;if(((o=b.current)==null?void 0:o.nextElementSibling)===u.current||((a=u.current)==null?void 0:a.nextElementSibling)===null)return{...s,activeOptionIndex:f}}}}let c=Pe(e),d=le(n,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});return{...s,...c,activeOptionIndex:d}},3:(e,n)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.searchQuery!==""?0:1,r=e.searchQuery+n.value.toLowerCase(),l=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+t).concat(e.options.slice(0,e.activeOptionIndex+t)):e.options).find(a=>{var s;return!a.dataRef.current.disabled&&((s=a.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),o=l?e.options.indexOf(l):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,n)=>{let t=e.options.concat(n.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==g.Nothing&&(r=le(e.pendingFocus,{resolveItems:()=>t,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:l}=e.dataRef.current;if(l){let o=t.findIndex(a=>l==null?void 0:l(a.dataRef.current.value));o!==-1&&(r=o)}}return{...e,options:t,activeOptionIndex:r,pendingFocus:{focus:g.Nothing},pendingShouldSort:!0}},6:(e,n)=>{let t=e.options,r=[],l=new Set(n.options);for(let[o,a]of t.entries())if(l.has(a.id)&&(r.push(o),l.delete(a.id),l.size===0))break;if(r.length>0){t=t.slice();for(let o of r.reverse())t.splice(o,1)}return{...e,options:t,activationTrigger:1}},7:(e,n)=>e.buttonElement===n.element?e:{...e,buttonElement:n.element},8:(e,n)=>e.optionsElement===n.element?e:{...e,optionsElement:n.element},9:e=>e.pendingShouldSort?{...e,...Pe(e),pendingShouldSort:!1}:e};class xe extends ct{constructor(n){super(n),ke(this,"actions",{onChange:t=>{let{onChange:r,compare:l,mode:o,value:a}=this.state.dataRef.current;return q(o,{0:()=>r==null?void 0:r(t),1:()=>{let s=a.slice(),c=s.findIndex(d=>l(d,t));return c===-1?s.push(t):s.splice(c,1),r==null?void 0:r(s)}})},registerOption:ve(()=>{let t=[],r=new Set;return[(l,o)=>{r.has(o)||(r.add(o),t.push({id:l,dataRef:o}))},()=>(r.clear(),this.send({type:5,options:t.splice(0)}))]}),unregisterOption:ve(()=>{let t=[];return[r=>t.push(r),()=>{this.send({type:6,options:t.splice(0)})}]}),goToOption:ve(()=>{let t=null;return[(r,l)=>{t={type:2,...r,trigger:l}},()=>t&&this.send(t)]}),closeListbox:()=>{this.send({type:1})},openListbox:t=>{this.send({type:0,focus:t})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:t,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(t.current.value),this.send({type:2,focus:g.Specific,id:r})}},selectOption:t=>{let r=this.state.options.find(l=>l.id===t);r&&this.actions.onChange(r.dataRef.current.value)},search:t=>{this.send({type:3,value:t})},clearSearch:()=>{this.send({type:4})},setButtonElement:t=>{this.send({type:7,element:t})},setOptionsElement:t=>{this.send({type:8,element:t})}}),ke(this,"selectors",{activeDescendantId(t){var r;let l=t.activeOptionIndex,o=t.options;return l===null||(r=o[l])==null?void 0:r.id},isActive(t,r){var l;let o=t.activeOptionIndex,a=t.options;return o!==null?((l=a[o])==null?void 0:l.id)===r:!1},shouldScrollIntoView(t,r){return t.__demoMode||t.listboxState!==0||t.activationTrigger===0?!1:this.isActive(t,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let t=this.state.id,r=Ue.get(null);this.disposables.add(r.on(dt.Push,l=>{!r.selectors.isTop(l,t)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(t)),this.on(1,()=>r.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new xe({id:n,dataRef:{current:{}},listboxState:t?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:g.Nothing},__demoMode:t})}reduce(n,t){return q(t.type,Sn,n,t)}}const qe=i.createContext(null);function Oe(e){let n=i.useContext(qe);if(n===null){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ye),t}return n}function Ye({id:e,__demoMode:n=!1}){let t=i.useMemo(()=>xe.new({id:e,__demoMode:n}),[]);return ft(()=>t.dispose()),t}let ce=i.createContext(null);ce.displayName="ListboxDataContext";function ne(e){let n=i.useContext(ce);if(n===null){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ne),t}return n}let yn=i.Fragment;function $n(e,n){let t=i.useId(),r=ge(),{value:l,defaultValue:o,form:a,name:s,onChange:c,by:d,invalid:p=!1,disabled:b=r||!1,horizontal:f=!1,multiple:u=!1,__demoMode:O=!1,...w}=e;const y=f?"horizontal":"vertical";let P=W(n),x=Ht(o),[$=u?[]:void 0,C]=Vt(l,c,x),L=Ye({id:t,__demoMode:O}),B=i.useRef({static:!1,hold:!1}),U=i.useRef(new Map),N=sn(d),Q=i.useCallback(k=>q(h.mode,{[_.Multi]:()=>$.some(ee=>N(ee,k)),[_.Single]:()=>N($,k)}),[$]),h=i.useMemo(()=>({value:$,disabled:b,invalid:p,mode:u?_.Multi:_.Single,orientation:y,onChange:C,compare:N,isSelected:Q,optionsPropsRef:B,listRef:U}),[$,b,p,u,y,C,N,Q,B,U]);z(()=>{L.state.dataRef.current=h},[h]);let D=A(L,k=>k.listboxState),V=Ue.get(null),H=A(V,i.useCallback(k=>V.selectors.isTop(k,t),[V,t])),[j,Y]=A(L,k=>[k.buttonElement,k.optionsElement]);vt(H,[j,Y],(k,ee)=>{L.send({type:Ze.CloseListbox}),Mt(ee,Nt.Loose)||(k.preventDefault(),j==null||j.focus())});let J=i.useMemo(()=>({open:D===E.Open,disabled:b,invalid:p,value:$}),[D,b,p,$]),[m,M]=tn({inherit:!0}),de={ref:P},re=i.useCallback(()=>{if(x!==void 0)return C==null?void 0:C(x)},[C,x]),pe=X();return S.createElement(M,{value:m,props:{htmlFor:j==null?void 0:j.id},slot:{open:D===E.Open,disabled:b}},S.createElement(mt,null,S.createElement(qe.Provider,{value:L},S.createElement(ce.Provider,{value:h},S.createElement(bt,{value:q(D,{[E.Open]:ae.Open,[E.Closed]:ae.Closed})},s!=null&&$!=null&&S.createElement(Wt,{disabled:b,data:{[s]:$},form:a,onReset:re}),pe({ourProps:de,theirProps:w,slot:J,defaultTag:yn,name:"Listbox"}))))))}let En="button";function wn(e,n){let t=i.useId(),r=ze(),l=ne("Listbox.Button"),o=Oe("Listbox.Button"),{id:a=r||`headlessui-listbox-button-${t}`,disabled:s=l.disabled||!1,autoFocus:c=!1,...d}=e,p=W(n,Lt(),o.actions.setButtonElement),b=Ft(),[f,u,O]=A(o,m=>[m.listboxState,m.buttonElement,m.optionsElement]),w=f===E.Open;pn(w,{trigger:u,action:i.useCallback(m=>{if(u!=null&&u.contains(m.target))return oe.Ignore;let M=m.target.closest('[role="option"]:not([data-disabled])');return Be(M)?oe.Select(M):O!=null&&O.contains(m.target)?oe.Ignore:oe.Close},[u,O]),close:o.actions.closeListbox,select:o.actions.selectActiveOption});let y=R(m=>{switch(m.key){case I.Enter:Kt(m.currentTarget);break;case I.Space:case I.ArrowDown:m.preventDefault(),o.actions.openListbox({focus:l.value?g.Nothing:g.First});break;case I.ArrowUp:m.preventDefault(),o.actions.openListbox({focus:l.value?g.Nothing:g.Last});break}}),P=R(m=>{switch(m.key){case I.Space:m.preventDefault();break}}),x=i.useRef(null),$=R(m=>{var M;if(x.current=m.pointerType,m.pointerType==="mouse"&&m.button===be.Left){if(Ie(m.currentTarget))return m.preventDefault();o.state.listboxState===E.Open?(K.flushSync(()=>o.actions.closeListbox()),(M=o.state.buttonElement)==null||M.focus({preventScroll:!0})):(m.preventDefault(),o.actions.openListbox({focus:g.Nothing}))}}),C=R(m=>{var M;if(x.current!=="mouse"&&m.button===be.Left){if(Ie(m.currentTarget))return m.preventDefault();o.state.listboxState===E.Open?(K.flushSync(()=>o.actions.closeListbox()),(M=o.state.buttonElement)==null||M.focus({preventScroll:!0})):(m.preventDefault(),o.actions.openListbox({focus:g.Nothing}))}}),L=R(m=>m.preventDefault()),B=Xe([a]),U=qt(),{isFocusVisible:N,focusProps:Q}=Dt({autoFocus:c}),{isHovered:h,hoverProps:D}=Tt({isDisabled:s}),{pressed:V,pressProps:H}=kt({disabled:s}),j=i.useMemo(()=>({open:f===E.Open,active:V||f===E.Open,disabled:s,invalid:l.invalid,value:l.value,hover:h,focus:N,autofocus:c}),[f,l.value,s,h,N,V,l.invalid,c]),Y=A(o,m=>m.listboxState===E.Open),J=Qe(b(),{ref:p,id:a,type:Pt(e,u),"aria-haspopup":"listbox","aria-controls":O==null?void 0:O.id,"aria-expanded":Y,"aria-labelledby":B,"aria-describedby":U,disabled:s||void 0,autoFocus:c,onKeyDown:y,onKeyUp:P,onKeyPress:L,onPointerDown:$,onClick:C},Q,D,H);return X()({ourProps:J,theirProps:d,slot:j,defaultTag:En,name:"Listbox.Button"})}let Je=i.createContext(!1),In="div",Rn=Re.RenderStrategy|Re.Static;function Cn(e,n){let t=i.useId(),{id:r=`headlessui-listbox-options-${t}`,anchor:l,portal:o=!1,modal:a=!0,transition:s=!1,...c}=e,d=gt(l),[p,b]=i.useState(null);d&&(o=!0);let f=ne("Listbox.Options"),u=Oe("Listbox.Options"),[O,w,y,P]=A(u,v=>[v.listboxState,v.buttonElement,v.optionsElement,v.__demoMode]),x=Ee(w),$=Ee(y),C=xt(),[L,B]=Ot(s,p,C!==null?(C&ae.Open)===ae.Open:O===E.Open);St(L,w,u.actions.closeListbox);let U=P?!1:a&&O===E.Open;yt(U,$);let N=P?!1:a&&O===E.Open;un(N,{allowed:i.useCallback(()=>[w,y],[w,y])});let Q=O!==E.Open,h=bn(Q,w)?!1:L,D=L&&O===E.Closed,V=vn(D,f.value),H=R(v=>f.compare(V,v)),j=A(u,v=>{var T;if(d==null||!((T=d==null?void 0:d.to)!=null&&T.includes("selection")))return null;let Z=v.options.findIndex(fe=>H(fe.dataRef.current.value));return Z===-1&&(Z=0),Z}),Y=(()=>{if(d==null)return;if(j===null)return{...d,inner:void 0};let v=Array.from(f.listRef.current.values());return{...d,inner:{listRef:{current:v},index:j}}})(),[J,m]=$t(Y),M=Et(),de=W(n,d?J:null,u.actions.setOptionsElement,b),re=Me();i.useEffect(()=>{var v;let T=y;T&&O===E.Open&&T!==((v=_e(T))==null?void 0:v.activeElement)&&(T==null||T.focus({preventScroll:!0}))},[O,y]);let pe=R(v=>{var T,Z;switch(re.dispose(),v.key){case I.Space:if(u.state.searchQuery!=="")return v.preventDefault(),v.stopPropagation(),u.actions.search(v.key);case I.Enter:if(v.preventDefault(),v.stopPropagation(),u.state.activeOptionIndex!==null){let{dataRef:fe}=u.state.options[u.state.activeOptionIndex];u.actions.onChange(fe.current.value)}f.mode===_.Single&&(K.flushSync(()=>u.actions.closeListbox()),(T=u.state.buttonElement)==null||T.focus({preventScroll:!0}));break;case q(f.orientation,{vertical:I.ArrowDown,horizontal:I.ArrowRight}):return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Next});case q(f.orientation,{vertical:I.ArrowUp,horizontal:I.ArrowLeft}):return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Previous});case I.Home:case I.PageUp:return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.First});case I.End:case I.PageDown:return v.preventDefault(),v.stopPropagation(),u.actions.goToOption({focus:g.Last});case I.Escape:v.preventDefault(),v.stopPropagation(),K.flushSync(()=>u.actions.closeListbox()),(Z=u.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case I.Tab:v.preventDefault(),v.stopPropagation(),K.flushSync(()=>u.actions.closeListbox()),wt(u.state.buttonElement,v.shiftKey?we.Previous:we.Next);break;default:v.key.length===1&&(u.actions.search(v.key),re.setTimeout(()=>u.actions.clearSearch(),350));break}}),k=A(u,v=>{var T;return(T=v.buttonElement)==null?void 0:T.id}),ee=i.useMemo(()=>({open:O===E.Open}),[O]),et=Qe(d?M():{},{id:r,ref:de,"aria-activedescendant":A(u,u.selectors.activeDescendantId),"aria-multiselectable":f.mode===_.Multi?!0:void 0,"aria-labelledby":k,"aria-orientation":f.orientation,onKeyDown:pe,role:"listbox",tabIndex:O===E.Open?0:void 0,style:{...c.style,...m,"--button-width":Rt(w,!0).width},...It(B)}),tt=X(),nt=i.useMemo(()=>f.mode===_.Multi?f:{...f,isSelected:H},[f,H]);return S.createElement(Ct,{enabled:o?e.static||L:!1,ownerDocument:x},S.createElement(ce.Provider,{value:nt},tt({ourProps:et,theirProps:c,slot:ee,defaultTag:In,features:Rn,visible:h,name:"Listbox.Options"})))}let Ln="div";function Fn(e,n){let t=i.useId(),{id:r=`headlessui-listbox-option-${t}`,disabled:l=!1,value:o,...a}=e,s=i.useContext(Je)===!0,c=ne("Listbox.Option"),d=Oe("Listbox.Option"),p=A(d,h=>d.selectors.isActive(h,r)),b=c.isSelected(o),f=i.useRef(null),u=gn(f),O=ht({disabled:l,value:o,domRef:f,get textValue(){return u()}}),w=W(n,f,h=>{h?c.listRef.current.set(r,h):c.listRef.current.delete(r)}),y=A(d,h=>d.selectors.shouldScrollIntoView(h,r));z(()=>{if(y)return je().requestAnimationFrame(()=>{var h,D;(D=(h=f.current)==null?void 0:h.scrollIntoView)==null||D.call(h,{block:"nearest"})})},[y,f]),z(()=>{if(!s)return d.actions.registerOption(r,O),()=>d.actions.unregisterOption(r)},[O,r,s]);let P=R(h=>{var D;if(l)return h.preventDefault();d.actions.onChange(o),c.mode===_.Single&&(K.flushSync(()=>d.actions.closeListbox()),(D=d.state.buttonElement)==null||D.focus({preventScroll:!0}))}),x=R(()=>{if(l)return d.actions.goToOption({focus:g.Nothing});d.actions.goToOption({focus:g.Specific,id:r})}),$=fn(),C=R(h=>{$.update(h),!l&&(p||d.actions.goToOption({focus:g.Specific,id:r},he.Pointer))}),L=R(h=>{$.wasMoved(h)&&(l||p||d.actions.goToOption({focus:g.Specific,id:r},he.Pointer))}),B=R(h=>{$.wasMoved(h)&&(l||p&&d.actions.goToOption({focus:g.Nothing}))}),U=i.useMemo(()=>({active:p,focus:p,selected:b,disabled:l,selectedOption:b&&s}),[p,b,l,s]),N=s?{}:{id:r,ref:w,role:"option",tabIndex:l===!0?void 0:-1,"aria-disabled":l===!0?!0:void 0,"aria-selected":b,disabled:void 0,onClick:P,onFocus:x,onPointerEnter:C,onMouseEnter:C,onPointerMove:L,onMouseMove:L,onPointerLeave:B,onMouseLeave:B},Q=X();return!b&&s?null:Q({ourProps:N,theirProps:a,slot:U,defaultTag:Ln,name:"Listbox.Option"})}let Dn=i.Fragment;function Tn(e,n){let{options:t,placeholder:r,...l}=e,o={ref:W(n)},a=ne("ListboxSelectedOption"),s=i.useMemo(()=>({}),[]),c=a.value===void 0||a.value===null||a.mode===_.Multi&&Array.isArray(a.value)&&a.value.length===0,d=X();return S.createElement(Je.Provider,{value:!0},d({ourProps:o,theirProps:{...l,children:S.createElement(S.Fragment,null,r&&c?r:t)},slot:s,defaultTag:Dn,name:"ListboxSelectedOption"}))}let kn=G($n),Pn=G(wn),Mn=ln,Nn=G(Cn),An=G(Fn),jn=G(Tn),ie=Object.assign(kn,{Button:Pn,Label:Mn,Options:Nn,Option:An,SelectedOption:jn});function _n({title:e,titleId:n,...t},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?i.createElement("title",{id:n},e):null,i.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const zn=i.forwardRef(_n);function Gn({options:e,value:n=[]}){const[t,r]=i.useState([]);return i.useEffect(()=>{r(n)},[n]),F.jsx(ie,{value:t,onChange:l=>{var o;r(l);for(const a in e)(o=e[a])==null||o.call(e,l.includes(a))},multiple:!0,children:F.jsxs("div",{className:"relative flex",children:[F.jsxs(ie.Button,{className:"flex items-center relative w-full bg-primary-10 text-xs rounded-full text-primary-500 py-1 px-2 text-center focus:outline-none focus-visible:border-accent-500 focus-visible:ring-2 focus-visible:ring-light focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-brand-300 cursor-pointer",children:[F.jsxs("span",{className:"flex truncate items-center",children:[F.jsx(Ut,{className:"h-3 w-3 mr-0 sm:mr-1"})," ",F.jsx("span",{className:"sr-only sm:not-sr-only",children:"Show"})]}),F.jsx(jt,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]}),F.jsx(At,{as:i.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:F.jsx(ie.Options,{className:"absolute top-8 right-0 z-50 max-h-60 min-w-16 overflow-auto rounded-md bg-theme py-2 shadow-lg ring-2 ring-primary-10 ring-opacity-5 focus:outline-none sm:text-sm",children:Object.keys(e).filter(l=>e[l]).map(l=>F.jsx(ie.Option,{className:({active:o,disabled:a})=>Se("relative cursor-default select-none py-1 pl-10 pr-4",a?"opacity-50 cursor-not-allowed":"",o?"bg-primary-10 text-primary-500":"text-neutral-700 dark:text-neutral-300"),value:l,disabled:rt(!!e[l]),children:({selected:o})=>F.jsxs(F.Fragment,{children:[F.jsx("span",{children:l}),F.jsx("span",{className:Se("absolute inset-y-0 left-0 flex items-center pl-3 text-primary-500",o?"block":"hidden"),children:F.jsx(_t,{className:"h-4 w-4","aria-hidden":"true"})})]})},l))})})]})})}export{We as C,zn as F,Kn as H,Gn as L,Xe as N,tn as Q,Vt as T,qt as U,ln as V,ge as a,fn as b,g as c,bn as d,sn as e,le as f,oe as g,Wt as j,pn as k,Ht as l,Kt as p,gn as s,ze as u,Hn as w,un as y};
@@ -1 +1 @@
1
- import{r as o,R as a,j as e,c as R,B as Q,l as O,m as ee,aA as ie,g as ce,v as B,b as _,i as $,V as de,Y as me,aB as ue,t as he,L as te,S as se,D as q,H as pe}from"./index-O3mjYpnE.js";import{d as fe,e as ne,s as ae,f as G,P as oe,h as P,b as F,i as ge,E as W,R as we,j as xe,k as ve,l as be,m as Y,n as X,o as J,p as Ne,q as ye,r as je,t as Ee}from"./context-DgX0fp2E.js";import{W as Ce}from"./editor-DYIP1yQ4.js";import{F as Me,L as Se}from"./ListboxShow-HM9_qyrt.js";import{S as ke}from"./SearchList-DB04sPb9.js";import{t as ze}from"./Input-obuJsD6k.js";import{U as T}from"./popover-CqgMRE0G.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./floating-ui.react-dom-BH3TFvkM.js";import"./file-DarlIDVi.js";import"./project-6gxepOhm.js";import"./help-B59vE3aE.js";import"./SourceList-Doo_9ZGp.js";import"./index-D1sR7wpN.js";function Le({title:t,titleId:s,...n},c){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:c,"aria-labelledby":s},n),t?o.createElement("title",{id:s},t):null,o.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const Ae=o.forwardRef(Le);function Be(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},a.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Ie(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},a.createElement("path",{d:"M0 0h32v4.2H0z"}))}function He(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},a.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Re(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function De(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const D=({children:t,className:s,...n})=>a.createElement("button",{type:"button",className:P(["react-flow__controls-button",s]),...n},t);D.displayName="ControlButton";const _e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),le=({style:t,showZoom:s=!0,showFitView:n=!0,showInteractive:c=!0,fitViewOptions:u,onZoomIn:l,onZoomOut:r,onFitView:h,onInteractiveChange:p,className:f,children:i,position:N="bottom-left"})=>{const g=fe(),[M,E]=o.useState(!1),{isInteractive:w,minZoomReached:x,maxZoomReached:d}=ne(_e,ae),{zoomIn:v,zoomOut:j,fitView:m}=G();if(o.useEffect(()=>{E(!0)},[]),!M)return null;const z=()=>{v(),l==null||l()},C=()=>{j(),r==null||r()},k=()=>{m(u),h==null||h()},b=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),p==null||p(!w)};return a.createElement(oe,{className:P(["react-flow__controls",f]),position:N,style:t,"data-testid":"rf__controls"},s&&a.createElement(a.Fragment,null,a.createElement(D,{onClick:z,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:d},a.createElement(Be,null)),a.createElement(D,{onClick:C,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:x},a.createElement(Ie,null))),n&&a.createElement(D,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view"},a.createElement(He,null)),c&&a.createElement(D,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity"},w?a.createElement(De,null):a.createElement(Re,null)),i)};le.displayName="Controls";var Fe=o.memo(le),S;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(S||(S={}));function $e({color:t,dimensions:s,lineWidth:n}){return a.createElement("path",{stroke:t,strokeWidth:n,d:`M${s[0]/2} 0 V${s[1]} M0 ${s[1]/2} H${s[0]}`})}function Ue({color:t,radius:s}){return a.createElement("circle",{cx:s,cy:s,r:s,fill:t})}const Ve={[S.Dots]:"#91919a",[S.Lines]:"#eee",[S.Cross]:"#e2e2e2"},We={[S.Dots]:1,[S.Lines]:1,[S.Cross]:6},Te=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function re({id:t,variant:s=S.Dots,gap:n=20,size:c,lineWidth:u=1,offset:l=2,color:r,style:h,className:p}){const f=o.useRef(null),{transform:i,patternId:N}=ne(Te,ae),g=r||Ve[s],M=c||We[s],E=s===S.Dots,w=s===S.Cross,x=Array.isArray(n)?n:[n,n],d=[x[0]*i[2]||1,x[1]*i[2]||1],v=M*i[2],j=w?[v,v]:d,m=E?[v/l,v/l]:[j[0]/l,j[1]/l];return a.createElement("svg",{className:P(["react-flow__background",p]),style:{...h,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background"},a.createElement("pattern",{id:N+t,x:i[0]%d[0],y:i[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${m[0]},-${m[1]})`},E?a.createElement(Ue,{color:g,radius:v/l}):a.createElement($e,{dimensions:j,color:g,lineWidth:u})),a.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N+t})`}))}re.displayName="Background";var Oe=o.memo(re);function Ge({handleSelect:t}){const{models:s,lineage:n,mainNode:c,connectedNodes:u}=F(),[l,r]=o.useState(!1),[h,p]=o.useState([]),[f,i]=o.useState(!1);o.useEffect(()=>{p([])},[c,s,n]);function N(){r(!0)}function g(){r(!1)}function M(E){E.length<1||ce(h)||B(c)||B(n)||(i(!0),setTimeout(()=>{const w=Array.from(ge(n,c));p(Object.keys(n).map(x=>{var d;return{name:x,displayName:((d=s.get(x))==null?void 0:d.displayName)??decodeURI(x),description:`${w.includes(x)?"Upstream":"Downstream"} | ${u.has(x)?"Directly":"Indirectly"} Connected`}})),i(!1)},300))}return e.jsxs("div",{className:R("w-full",l?"block absolute top-0 left-0 right-0 z-10 pr-10 bg-light dark:bg-dark @[40rem]:items-end @[40rem]:justify-end @[40rem]:flex @[40rem]:static @[40rem]:pr-0":"items-end justify-end flex"),children:[e.jsx(Q,{shape:ie.Circle,className:R("flex @[40rem]:hidden !py-1 border-transparent",l?"hidden":"flex"),variant:ee.Alternative,size:O.sm,"aria-label":"Show search",onClick:N,children:e.jsx(Ae,{className:"w-3 h-3 text-primary-500"})}),e.jsx(ke,{list:h,placeholder:"Find",searchBy:"displayName",displayBy:"displayName",direction:"top",descriptionBy:"description",showIndex:!1,size:O.sm,onSelect:t,isLoading:f,className:R("w-full @sm:min-w-[12rem] @[40rem]:flex",l?"flex max-w-none":"hidden max-w-[20rem]"),isFullWidth:!0,onInput:M}),e.jsx("button",{className:R("flex @[40rem]:hidden bg-none border-none px-2 py-1 absolute right-0 top-0",l?"flex":"hidden"),"aria-label":"Hide search",onClick:g,children:e.jsx(Me,{className:"w-6 h-6 text-primary-500"})})]})}function K({nodes:t=[]}){const{setCenter:s}=G(),{activeNodes:n,models:c,mainNode:u,nodesMap:l,selectedNodes:r,setSelectedNodes:h,withImpacted:p,connectedNodes:f,lineageCache:i,setActiveEdges:N,setConnections:g,setLineage:M,setLineageCache:E}=F(),w=B(u)?void 0:c.get(u),x=n.size>0?n.size:f.size,d=r.size,v=f.size-1,j=t.filter(b=>b.hidden).length,m=t.filter(b=>_(b.hidden)&&(b.data.type===W.external||b.data.type===W.seed)).length,z=t.filter(b=>_(b.hidden)&&b.data.type===W.cte).length,C=x>0&&x!==v+1;function k(){if(B(u))return;const b=l[u];B(b)||setTimeout(()=>{s(b.position.x,b.position.y,{zoom:.5,duration:0})},200)}return e.jsxs(e.Fragment,{children:[$(w)&&e.jsx("a",{className:"mr-2 w-full whitespace-nowrap text-ellipsis overflow-hidden @lg:block font-bold text-neutral-600 dark:text-neutral-400 cursor-pointer hover:underline",onClick:k,children:de(w.displayName,50,25)}),e.jsxs("span",{className:"bg-neutral-5 px-2 py-0.5 flex rounded-full mr-2",children:[e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"All:"})," ",t.length]}),j>0&&e.jsxs("span",{className:"whitespace-nowrap block mr-2",children:[e.jsx("b",{children:"Hidden:"})," ",j]}),d>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Selected:"})," ",d]}),C&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Active:"})," ",x]}),(C||d>0||$(i))&&e.jsx(Q,{size:O.xs,variant:ee.Neutral,format:me.Ghost,className:"!m-0 px-1",onClick:()=>{N(new Map),g(new Map),h(new Set),$(i)&&(M(i),E(void 0))},children:"Reset"})]}),m>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Sources"}),": ",m]}),_(C)&&p&&d===0&&v>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Upstream/Downstream:"})," ",v]}),z>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"CTEs:"})," ",z]})]})}const Pe=30;function ct({model:t,highlightedNodes:s}){const{setActiveNodes:n,setActiveEdges:c,setConnections:u,setLineage:l,handleError:r,setSelectedNodes:h,setMainNode:p,setWithColumns:f,setHighlightedNodes:i,setNodeConnections:N,setLineageCache:g,setUnknownModels:M,models:E,unknownModels:w}=F(),{refetch:x,isFetching:d,cancel:v}=ue(t.name),{isFetching:j}=he(),[m,z]=o.useState(!1),[C,k]=o.useState(void 0);o.useEffect(()=>{const y=Ce();return y.addEventListener("message",b),x().then(({data:L})=>{k(L),!B(L)&&(z(!0),y.postMessage({topic:"lineage",payload:{currentLineage:{},newLineage:L,mainNode:t.fqn}}))}).catch(L=>{r==null||r(L)}).finally(()=>{n(new Set),c(new Map),u(new Map),h(new Set),g(void 0),p(t.fqn)}),()=>{v==null||v(),y.removeEventListener("message",b),y.terminate(),l({}),N({}),p(void 0),i({})}},[t.name,t.hash]),o.useEffect(()=>{Object.keys(C??{}).forEach(y=>{y=encodeURI(y),_(E.has(y))&&_(w.has(y))&&w.add(y)}),M(new Set(w))},[C,E]),o.useEffect(()=>{i(s??{})},[s]);function b(y){var L;y.data.topic==="lineage"&&(z(!1),N(y.data.payload.nodesConnections),l(y.data.payload.lineage),Object.values(((L=y.data.payload)==null?void 0:L.lineage)??{}).length>Pe&&f(!1)),y.data.topic==="error"&&(r==null||r(y.data.error),z(!1))}const I=d||j||m;return e.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[I&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:I?"Loading Model's Lineage...":"Merging Model's..."})]})]}),e.jsx(we,{children:e.jsx(Ze,{})})]})}function Ze(){const{withColumns:t,lineage:s,mainNode:n,selectedEdges:c,selectedNodes:u,withConnected:l,withImpacted:r,withSecondary:h,hasBackground:p,activeEdges:f,connectedNodes:i,connections:N,nodesMap:g,showControls:M,handleError:E,setActiveNodes:w}=F(),{setCenter:x}=G(),[d,v]=o.useState(!1),j=o.useMemo(()=>({model:xe}),[]),m=o.useMemo(()=>ve(s),[s]),z=o.useMemo(()=>be(s),[s]),[C,k]=o.useState([]),[b,I]=o.useState([]);o.useEffect(()=>{if(q(m)||B(n))return;v(!0);const A=Y(m,f,c,g),U=X(Object.values(g),A,n,i,u,N,l,r,h),V=J(m,N,f,A,c,u,i,l,r,h),Z=Ne({nodesMap:g,nodes:U,edges:V});return Z.create().then(H=>{I(H.edges),k(H.nodes)}).catch(H=>{E==null||E(H),I([]),k([])}).finally(()=>{const H=B(n)?void 0:g[n];$(H)&&x(H.position.x,H.position.y,{zoom:.5,duration:0}),setTimeout(()=>{v(!1)},100)}),()=>{Z.terminate(),I([]),k([])}},[f,g,z]),o.useEffect(()=>{if(B(n)||q(C))return;const A=Y(m,f,c,g),U=X(C,A,n,i,u,N,l,r,h),V=J(m,N,f,A,c,u,i,l,r,h);I(V),k(U),w(A)},[N,g,m,f,u,c,i,l,r,h,t,n]);function y(A){k(Ee(A,C))}function L(A){I(je(A,b))}return e.jsxs(e.Fragment,{children:[d&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:"Building Lineage..."})]})]}),e.jsxs(ye,{nodes:C,edges:b,nodeTypes:j,onNodesChange:y,onEdgesChange:L,nodeOrigin:[.5,.5],minZoom:.05,maxZoom:1.5,snapGrid:[16,16],snapToGrid:!0,children:[M&&e.jsxs(oe,{position:"top-right",className:"bg-theme !m-0 w-full !z-10",children:[e.jsx(qe,{nodes:C}),e.jsx(pe,{})]}),e.jsx(Fe,{className:"bg-light p-1 rounded-md !border-none !shadow-lg"}),e.jsx(Oe,{variant:S.Cross,gap:32,size:4,className:R(p?"opacity-100 stroke-neutral-200 dark:stroke-neutral-800":"opacity-0")})]})]})}function qe({nodes:t=[]}){const{withColumns:s,mainNode:n,selectedNodes:c,withConnected:u,withImpacted:l,withSecondary:r,hasBackground:h,activeNodes:p,highlightedNodes:f,setSelectedNodes:i,setWithColumns:N,setWithConnected:g,setWithImpacted:M,setWithSecondary:E,setHasBackground:w}=F(),x=o.useRef(null),d=o.useMemo(()=>Object.values(f??{}).flat(),[f]);function v(j){d.includes(j.name)||n===j.name||i(m=>(m.has(j.name)?m.delete(j.name):m.add(j.name),new Set(m)))}return e.jsxs("div",{className:"px-2 flex items-center text-xs text-neutral-400 @container",children:[e.jsxs("div",{className:"contents",children:[e.jsxs(T,{as:"div",className:"flex @lg:hidden bg-none border-none","aria-label":"Show lineage node details",children:[e.jsxs(T.Button,{ref:x,className:"flex items-center relative w-full cursor-pointer bg-primary-10 text-xs rounded-full text-primary-500 py-1 px-3 text-center focus:outline-none focus-visible:border-accent-500 focus-visible:ring-2 focus-visible:ring-light focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-brand-300 border-1 border-transparent",children:["Details",e.jsx(ze,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]}),e.jsx(T.Panel,{className:"absolute left-2 right-2 flex-col z-50 mt-8 transform flex px-4 py-3 bg-theme-lighter shadow-xl focus:ring-2 ring-opacity-5 rounded-lg",children:e.jsx(K,{nodes:t})})]}),e.jsx("div",{className:"hidden @lg:contents w-full",children:e.jsx(K,{nodes:t})})]}),e.jsxs("div",{className:"flex w-full justify-end items-center",children:[e.jsx(Ge,{handleSelect:v}),e.jsx(Se,{options:{Background:w,Columns:p.size>0&&c.size===0?void 0:N,Connected:p.size>0?void 0:g,"Upstream/Downstream":p.size>0?void 0:M,All:p.size>0?void 0:E},value:[s&&"Columns",h&&"Background",u&&"Connected",l&&"Upstream/Downstream",r&&"All"].filter(Boolean)})]})]})}export{ct as default};
1
+ import{r as o,R as a,j as e,c as R,B as Q,l as O,m as ee,aA as ie,g as ce,v as B,b as _,i as $,V as de,Y as me,aB as ue,t as he,L as te,S as se,D as q,H as pe}from"./index-Dj0i1-CA.js";import{d as fe,e as ne,s as ae,f as G,P as oe,h as P,b as F,i as ge,E as W,R as we,j as xe,k as ve,l as be,m as Y,n as X,o as J,p as Ne,q as ye,r as je,t as Ee}from"./context-BctCsyGb.js";import{W as Ce}from"./editor-CcO28cqd.js";import{F as Me,L as Se}from"./ListboxShow-BE5-xevs.js";import{S as ke}from"./SearchList-W_iT2G82.js";import{t as ze}from"./Input-B-oZ6fGO.js";import{U as T}from"./popover-_Sf0yvOI.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./file-CvJN3aZO.js";import"./project-BvSOI8MY.js";import"./help-B59vE3aE.js";import"./SourceList-DSLO6nVJ.js";import"./index-C-dJH7yZ.js";function Le({title:t,titleId:s,...n},c){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:c,"aria-labelledby":s},n),t?o.createElement("title",{id:s},t):null,o.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const Ae=o.forwardRef(Le);function Be(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},a.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Ie(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},a.createElement("path",{d:"M0 0h32v4.2H0z"}))}function He(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},a.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Re(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function De(){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const D=({children:t,className:s,...n})=>a.createElement("button",{type:"button",className:P(["react-flow__controls-button",s]),...n},t);D.displayName="ControlButton";const _e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),le=({style:t,showZoom:s=!0,showFitView:n=!0,showInteractive:c=!0,fitViewOptions:u,onZoomIn:l,onZoomOut:r,onFitView:h,onInteractiveChange:p,className:f,children:i,position:N="bottom-left"})=>{const g=fe(),[M,E]=o.useState(!1),{isInteractive:w,minZoomReached:x,maxZoomReached:d}=ne(_e,ae),{zoomIn:v,zoomOut:j,fitView:m}=G();if(o.useEffect(()=>{E(!0)},[]),!M)return null;const z=()=>{v(),l==null||l()},C=()=>{j(),r==null||r()},k=()=>{m(u),h==null||h()},b=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),p==null||p(!w)};return a.createElement(oe,{className:P(["react-flow__controls",f]),position:N,style:t,"data-testid":"rf__controls"},s&&a.createElement(a.Fragment,null,a.createElement(D,{onClick:z,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:d},a.createElement(Be,null)),a.createElement(D,{onClick:C,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:x},a.createElement(Ie,null))),n&&a.createElement(D,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view"},a.createElement(He,null)),c&&a.createElement(D,{className:"react-flow__controls-interactive",onClick:b,title:"toggle interactivity","aria-label":"toggle interactivity"},w?a.createElement(De,null):a.createElement(Re,null)),i)};le.displayName="Controls";var Fe=o.memo(le),S;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(S||(S={}));function $e({color:t,dimensions:s,lineWidth:n}){return a.createElement("path",{stroke:t,strokeWidth:n,d:`M${s[0]/2} 0 V${s[1]} M0 ${s[1]/2} H${s[0]}`})}function Ue({color:t,radius:s}){return a.createElement("circle",{cx:s,cy:s,r:s,fill:t})}const Ve={[S.Dots]:"#91919a",[S.Lines]:"#eee",[S.Cross]:"#e2e2e2"},We={[S.Dots]:1,[S.Lines]:1,[S.Cross]:6},Te=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function re({id:t,variant:s=S.Dots,gap:n=20,size:c,lineWidth:u=1,offset:l=2,color:r,style:h,className:p}){const f=o.useRef(null),{transform:i,patternId:N}=ne(Te,ae),g=r||Ve[s],M=c||We[s],E=s===S.Dots,w=s===S.Cross,x=Array.isArray(n)?n:[n,n],d=[x[0]*i[2]||1,x[1]*i[2]||1],v=M*i[2],j=w?[v,v]:d,m=E?[v/l,v/l]:[j[0]/l,j[1]/l];return a.createElement("svg",{className:P(["react-flow__background",p]),style:{...h,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background"},a.createElement("pattern",{id:N+t,x:i[0]%d[0],y:i[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${m[0]},-${m[1]})`},E?a.createElement(Ue,{color:g,radius:v/l}):a.createElement($e,{dimensions:j,color:g,lineWidth:u})),a.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N+t})`}))}re.displayName="Background";var Oe=o.memo(re);function Ge({handleSelect:t}){const{models:s,lineage:n,mainNode:c,connectedNodes:u}=F(),[l,r]=o.useState(!1),[h,p]=o.useState([]),[f,i]=o.useState(!1);o.useEffect(()=>{p([])},[c,s,n]);function N(){r(!0)}function g(){r(!1)}function M(E){E.length<1||ce(h)||B(c)||B(n)||(i(!0),setTimeout(()=>{const w=Array.from(ge(n,c));p(Object.keys(n).map(x=>{var d;return{name:x,displayName:((d=s.get(x))==null?void 0:d.displayName)??decodeURI(x),description:`${w.includes(x)?"Upstream":"Downstream"} | ${u.has(x)?"Directly":"Indirectly"} Connected`}})),i(!1)},300))}return e.jsxs("div",{className:R("w-full",l?"block absolute top-0 left-0 right-0 z-10 pr-10 bg-light dark:bg-dark @[40rem]:items-end @[40rem]:justify-end @[40rem]:flex @[40rem]:static @[40rem]:pr-0":"items-end justify-end flex"),children:[e.jsx(Q,{shape:ie.Circle,className:R("flex @[40rem]:hidden !py-1 border-transparent",l?"hidden":"flex"),variant:ee.Alternative,size:O.sm,"aria-label":"Show search",onClick:N,children:e.jsx(Ae,{className:"w-3 h-3 text-primary-500"})}),e.jsx(ke,{list:h,placeholder:"Find",searchBy:"displayName",displayBy:"displayName",direction:"top",descriptionBy:"description",showIndex:!1,size:O.sm,onSelect:t,isLoading:f,className:R("w-full @sm:min-w-[12rem] @[40rem]:flex",l?"flex max-w-none":"hidden max-w-[20rem]"),isFullWidth:!0,onInput:M}),e.jsx("button",{className:R("flex @[40rem]:hidden bg-none border-none px-2 py-1 absolute right-0 top-0",l?"flex":"hidden"),"aria-label":"Hide search",onClick:g,children:e.jsx(Me,{className:"w-6 h-6 text-primary-500"})})]})}function K({nodes:t=[]}){const{setCenter:s}=G(),{activeNodes:n,models:c,mainNode:u,nodesMap:l,selectedNodes:r,setSelectedNodes:h,withImpacted:p,connectedNodes:f,lineageCache:i,setActiveEdges:N,setConnections:g,setLineage:M,setLineageCache:E}=F(),w=B(u)?void 0:c.get(u),x=n.size>0?n.size:f.size,d=r.size,v=f.size-1,j=t.filter(b=>b.hidden).length,m=t.filter(b=>_(b.hidden)&&(b.data.type===W.external||b.data.type===W.seed)).length,z=t.filter(b=>_(b.hidden)&&b.data.type===W.cte).length,C=x>0&&x!==v+1;function k(){if(B(u))return;const b=l[u];B(b)||setTimeout(()=>{s(b.position.x,b.position.y,{zoom:.5,duration:0})},200)}return e.jsxs(e.Fragment,{children:[$(w)&&e.jsx("a",{className:"mr-2 w-full whitespace-nowrap text-ellipsis overflow-hidden @lg:block font-bold text-neutral-600 dark:text-neutral-400 cursor-pointer hover:underline",onClick:k,children:de(w.displayName,50,25)}),e.jsxs("span",{className:"bg-neutral-5 px-2 py-0.5 flex rounded-full mr-2",children:[e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"All:"})," ",t.length]}),j>0&&e.jsxs("span",{className:"whitespace-nowrap block mr-2",children:[e.jsx("b",{children:"Hidden:"})," ",j]}),d>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Selected:"})," ",d]}),C&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Active:"})," ",x]}),(C||d>0||$(i))&&e.jsx(Q,{size:O.xs,variant:ee.Neutral,format:me.Ghost,className:"!m-0 px-1",onClick:()=>{N(new Map),g(new Map),h(new Set),$(i)&&(M(i),E(void 0))},children:"Reset"})]}),m>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Sources"}),": ",m]}),_(C)&&p&&d===0&&v>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"Upstream/Downstream:"})," ",v]}),z>0&&e.jsxs("span",{className:"mr-2 whitespace-nowrap block",children:[e.jsx("b",{children:"CTEs:"})," ",z]})]})}const Pe=30;function ct({model:t,highlightedNodes:s}){const{setActiveNodes:n,setActiveEdges:c,setConnections:u,setLineage:l,handleError:r,setSelectedNodes:h,setMainNode:p,setWithColumns:f,setHighlightedNodes:i,setNodeConnections:N,setLineageCache:g,setUnknownModels:M,models:E,unknownModels:w}=F(),{refetch:x,isFetching:d,cancel:v}=ue(t.name),{isFetching:j}=he(),[m,z]=o.useState(!1),[C,k]=o.useState(void 0);o.useEffect(()=>{const y=Ce();return y.addEventListener("message",b),x().then(({data:L})=>{k(L),!B(L)&&(z(!0),y.postMessage({topic:"lineage",payload:{currentLineage:{},newLineage:L,mainNode:t.fqn}}))}).catch(L=>{r==null||r(L)}).finally(()=>{n(new Set),c(new Map),u(new Map),h(new Set),g(void 0),p(t.fqn)}),()=>{v==null||v(),y.removeEventListener("message",b),y.terminate(),l({}),N({}),p(void 0),i({})}},[t.name,t.hash]),o.useEffect(()=>{Object.keys(C??{}).forEach(y=>{y=encodeURI(y),_(E.has(y))&&_(w.has(y))&&w.add(y)}),M(new Set(w))},[C,E]),o.useEffect(()=>{i(s??{})},[s]);function b(y){var L;y.data.topic==="lineage"&&(z(!1),N(y.data.payload.nodesConnections),l(y.data.payload.lineage),Object.values(((L=y.data.payload)==null?void 0:L.lineage)??{}).length>Pe&&f(!1)),y.data.topic==="error"&&(r==null||r(y.data.error),z(!1))}const I=d||j||m;return e.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[I&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:I?"Loading Model's Lineage...":"Merging Model's..."})]})]}),e.jsx(we,{children:e.jsx(Ze,{})})]})}function Ze(){const{withColumns:t,lineage:s,mainNode:n,selectedEdges:c,selectedNodes:u,withConnected:l,withImpacted:r,withSecondary:h,hasBackground:p,activeEdges:f,connectedNodes:i,connections:N,nodesMap:g,showControls:M,handleError:E,setActiveNodes:w}=F(),{setCenter:x}=G(),[d,v]=o.useState(!1),j=o.useMemo(()=>({model:xe}),[]),m=o.useMemo(()=>ve(s),[s]),z=o.useMemo(()=>be(s),[s]),[C,k]=o.useState([]),[b,I]=o.useState([]);o.useEffect(()=>{if(q(m)||B(n))return;v(!0);const A=Y(m,f,c,g),U=X(Object.values(g),A,n,i,u,N,l,r,h),V=J(m,N,f,A,c,u,i,l,r,h),Z=Ne({nodesMap:g,nodes:U,edges:V});return Z.create().then(H=>{I(H.edges),k(H.nodes)}).catch(H=>{E==null||E(H),I([]),k([])}).finally(()=>{const H=B(n)?void 0:g[n];$(H)&&x(H.position.x,H.position.y,{zoom:.5,duration:0}),setTimeout(()=>{v(!1)},100)}),()=>{Z.terminate(),I([]),k([])}},[f,g,z]),o.useEffect(()=>{if(B(n)||q(C))return;const A=Y(m,f,c,g),U=X(C,A,n,i,u,N,l,r,h),V=J(m,N,f,A,c,u,i,l,r,h);I(V),k(U),w(A)},[N,g,m,f,u,c,i,l,r,h,t,n]);function y(A){k(Ee(A,C))}function L(A){I(je(A,b))}return e.jsxs(e.Fragment,{children:[d&&e.jsxs("div",{className:"absolute top-0 left-0 z-10 flex justify-center items-center w-full h-full",children:[e.jsx("span",{className:"absolute w-full h-full z-10 bg-transparent-20 backdrop-blur-lg"}),e.jsxs(te,{className:"inline-block z-10",children:[e.jsx(se,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md whitespace-nowrap",children:"Building Lineage..."})]})]}),e.jsxs(ye,{nodes:C,edges:b,nodeTypes:j,onNodesChange:y,onEdgesChange:L,nodeOrigin:[.5,.5],minZoom:.05,maxZoom:1.5,snapGrid:[16,16],snapToGrid:!0,children:[M&&e.jsxs(oe,{position:"top-right",className:"bg-theme !m-0 w-full !z-10",children:[e.jsx(qe,{nodes:C}),e.jsx(pe,{})]}),e.jsx(Fe,{className:"bg-light p-1 rounded-md !border-none !shadow-lg"}),e.jsx(Oe,{variant:S.Cross,gap:32,size:4,className:R(p?"opacity-100 stroke-neutral-200 dark:stroke-neutral-800":"opacity-0")})]})]})}function qe({nodes:t=[]}){const{withColumns:s,mainNode:n,selectedNodes:c,withConnected:u,withImpacted:l,withSecondary:r,hasBackground:h,activeNodes:p,highlightedNodes:f,setSelectedNodes:i,setWithColumns:N,setWithConnected:g,setWithImpacted:M,setWithSecondary:E,setHasBackground:w}=F(),x=o.useRef(null),d=o.useMemo(()=>Object.values(f??{}).flat(),[f]);function v(j){d.includes(j.name)||n===j.name||i(m=>(m.has(j.name)?m.delete(j.name):m.add(j.name),new Set(m)))}return e.jsxs("div",{className:"px-2 flex items-center text-xs text-neutral-400 @container",children:[e.jsxs("div",{className:"contents",children:[e.jsxs(T,{as:"div",className:"flex @lg:hidden bg-none border-none","aria-label":"Show lineage node details",children:[e.jsxs(T.Button,{ref:x,className:"flex items-center relative w-full cursor-pointer bg-primary-10 text-xs rounded-full text-primary-500 py-1 px-3 text-center focus:outline-none focus-visible:border-accent-500 focus-visible:ring-2 focus-visible:ring-light focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-brand-300 border-1 border-transparent",children:["Details",e.jsx(ze,{className:"ml-2 h-4 w-4","aria-hidden":"true"})]}),e.jsx(T.Panel,{className:"absolute left-2 right-2 flex-col z-50 mt-8 transform flex px-4 py-3 bg-theme-lighter shadow-xl focus:ring-2 ring-opacity-5 rounded-lg",children:e.jsx(K,{nodes:t})})]}),e.jsx("div",{className:"hidden @lg:contents w-full",children:e.jsx(K,{nodes:t})})]}),e.jsxs("div",{className:"flex w-full justify-end items-center",children:[e.jsx(Ge,{handleSelect:v}),e.jsx(Se,{options:{Background:w,Columns:p.size>0&&c.size===0?void 0:N,Connected:p.size>0?void 0:g,"Upstream/Downstream":p.size>0?void 0:M,All:p.size>0?void 0:E},value:[s&&"Columns",h&&"Background",u&&"Connected",l&&"Upstream/Downstream",r&&"All"].filter(Boolean)})]})]})}export{ct as default};
@@ -1 +1 @@
1
- import{x as B,Q as M,s as $,a as d,r as x,t as L,v as m,i as h,e as b,j as s,G as F,g as T,l as E,H as z,U as K,a7 as P,O as A,D as O,b as R}from"./index-O3mjYpnE.js";import{S as k,b as w,m as C,n as D,o as G,p as H,f as I,g as U}from"./SearchList-DB04sPb9.js";import{P as Q}from"./Page-BWEEQfIt.js";import{g as W}from"./context-DgX0fp2E.js";import{u as f}from"./project-6gxepOhm.js";import"./Input-obuJsD6k.js";import"./floating-ui.react-dom-BH3TFvkM.js";import"./help-B59vE3aE.js";import"./popover-CqgMRE0G.js";import"./SplitPane-qHmkD1qy.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./editor-DYIP1yQ4.js";import"./file-DarlIDVi.js";import"./SourceList-Doo_9ZGp.js";import"./index-D1sR7wpN.js";function ne({route:g=b.Home}){const{pathname:j}=B(),{modelName:i}=M(),u=$(),n=d(e=>e.models),r=d(e=>e.lastSelectedModel),N=d(e=>e.setLastSelectedModel),p=f(e=>e.files),S=f(e=>e.setSelectedFile),l=x.useMemo(()=>Array.from(new Set(n.values())),[n]),{isFetching:c}=L(),t=`${g}/models`,a=m(i)||i===(r==null?void 0:r.name)?r:n.get(encodeURI(i));x.useEffect(()=>{if(m(a))return;const e=p.get(a.path);h(e)&&S(e),N(a),u(`${t}/${a.name}`,{replace:!0})},[p,a,t]);const v=m(a)&&h(i)&&R(c);return s.jsx(Q,{sidebar:O(l)?void 0:s.jsx(w,{"update-selector":"tbk-model-name",children:s.jsx(C,{selectable:!0,onChange:e=>u(e.detail.value),className:"pt-3 px-2",children:Object.entries(D.categorize(l)).map(([e,y])=>s.jsx(G,{headline:e,open:!0,children:y.map(o=>s.jsx(H,{size:"xs","hide-icon":!0,active:j===`${t}/${o.name}`,value:`${t}/${o.name}`,"search-value":o.displayName,compact:!0,children:s.jsx(I,{"hide-schema":!0,"hide-catalog":!0,"hide-tooltip":!0,text:o.displayName,children:s.jsx(U,{size:"2xs",slot:"after",children:W(o.type)})})},o.name))},e))})}),content:s.jsx(F.Page,{children:s.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[T(l)&&s.jsx(k,{list:l,size:E.lg,searchBy:"index",displayBy:"displayName",to:e=>`${t}/${e.name}`,direction:"top",className:"p-2",isFullWidth:!0,disabled:c}),s.jsx(z,{}),v?s.jsx(K,{link:t,message:"Go Back",description:`Model "${i}" not found.`}):c?s.jsx(P,{children:"Loading Model page..."}):s.jsx(A,{})]})})})}export{ne as default};
1
+ import{x as B,Q as M,s as $,a as d,r as x,t as L,v as m,i as h,e as b,j as s,G as F,g as T,l as E,H as z,U as K,a7 as P,O as A,D as O,b as R}from"./index-Dj0i1-CA.js";import{S as k,b as w,m as C,n as D,o as G,p as H,f as I,g as U}from"./SearchList-W_iT2G82.js";import{P as Q}from"./Page-C-XfU5BR.js";import{g as W}from"./context-BctCsyGb.js";import{u as f}from"./project-BvSOI8MY.js";import"./Input-B-oZ6fGO.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./help-B59vE3aE.js";import"./popover-_Sf0yvOI.js";import"./SplitPane-CViaZmw6.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./editor-CcO28cqd.js";import"./file-CvJN3aZO.js";import"./SourceList-DSLO6nVJ.js";import"./index-C-dJH7yZ.js";function ne({route:g=b.Home}){const{pathname:j}=B(),{modelName:i}=M(),u=$(),n=d(e=>e.models),r=d(e=>e.lastSelectedModel),N=d(e=>e.setLastSelectedModel),p=f(e=>e.files),S=f(e=>e.setSelectedFile),l=x.useMemo(()=>Array.from(new Set(n.values())),[n]),{isFetching:c}=L(),t=`${g}/models`,a=m(i)||i===(r==null?void 0:r.name)?r:n.get(encodeURI(i));x.useEffect(()=>{if(m(a))return;const e=p.get(a.path);h(e)&&S(e),N(a),u(`${t}/${a.name}`,{replace:!0})},[p,a,t]);const v=m(a)&&h(i)&&R(c);return s.jsx(Q,{sidebar:O(l)?void 0:s.jsx(w,{"update-selector":"tbk-model-name",children:s.jsx(C,{selectable:!0,onChange:e=>u(e.detail.value),className:"pt-3 px-2",children:Object.entries(D.categorize(l)).map(([e,y])=>s.jsx(G,{headline:e,open:!0,children:y.map(o=>s.jsx(H,{size:"xs","hide-icon":!0,active:j===`${t}/${o.name}`,value:`${t}/${o.name}`,"search-value":o.displayName,compact:!0,children:s.jsx(I,{"hide-schema":!0,"hide-catalog":!0,"hide-tooltip":!0,text:o.displayName,children:s.jsx(U,{size:"2xs",slot:"after",children:W(o.type)})})},o.name))},e))})}),content:s.jsx(F.Page,{children:s.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[T(l)&&s.jsx(k,{list:l,size:E.lg,searchBy:"index",displayBy:"displayName",to:e=>`${t}/${e.name}`,direction:"top",className:"p-2",isFullWidth:!0,disabled:c}),s.jsx(z,{}),v?s.jsx(K,{link:t,message:"Go Back",description:`Model "${i}" not found.`}):c?s.jsx(P,{children:"Loading Model page..."}):s.jsx(A,{})]})})})}export{ne as default};
@@ -1 +1 @@
1
- import{a as n,j as e,v as f}from"./index-O3mjYpnE.js";import{S as r}from"./SplitPane-qHmkD1qy.js";function h({sidebar:s,content:i}){const a=n(l=>l.splitPaneSizes),t=n(l=>l.setSplitPaneSizes);return e.jsx(e.Fragment,{children:f(s)?e.jsx("div",{className:"flex w-full h-full overflow-hidden justify-center",children:i}):e.jsxs(r,{sizes:a,minSize:[0,0],snapOffset:0,className:"flex w-full h-full overflow-hidden",onDragEnd:t,children:[e.jsx("div",{className:"w-full h-full overflow-hidden",children:s}),e.jsx("div",{className:"w-full h-full overflow-hidden",children:i})]})})}export{h as P};
1
+ import{a as n,j as e,v as f}from"./index-Dj0i1-CA.js";import{S as r}from"./SplitPane-CViaZmw6.js";function h({sidebar:s,content:i}){const a=n(l=>l.splitPaneSizes),t=n(l=>l.setSplitPaneSizes);return e.jsx(e.Fragment,{children:f(s)?e.jsx("div",{className:"flex w-full h-full overflow-hidden justify-center",children:i}):e.jsxs(r,{sizes:a,minSize:[0,0],snapOffset:0,className:"flex w-full h-full overflow-hidden",onDragEnd:t,children:[e.jsx("div",{className:"w-full h-full overflow-hidden",children:s}),e.jsx("div",{className:"w-full h-full overflow-hidden",children:i})]})})}export{h as P};
@@ -1 +1 @@
1
- import{s as m,x as p,a as l,r,i as u,e,j as i,O as c}from"./index-O3mjYpnE.js";import{P as f}from"./Page-BWEEQfIt.js";import{u as v}from"./plan-CehRrJUG.js";import"./SplitPane-qHmkD1qy.js";function E(){const s=m(),t=p(),o=l(n=>n.environment),a=v(n=>n.planApply);return r.useEffect(()=>{if(a.isRunning&&u(a.environment)){const n=`${e.Plan}/environments/${a.environment}`;t.pathname!==n&&s(n,{replace:!0})}else(t.pathname===e.Plan||t.pathname===`${e.Plan}/environments`)&&s(`${e.Plan}/environments/${o.name}`,{replace:!0})},[t,a.isRunning]),r.useEffect(()=>{s(`${e.Plan}/environments/${o.name}`,{replace:!0})},[o]),i.jsx(f,{content:i.jsx(c,{})})}export{E as default};
1
+ import{s as m,x as p,a as l,r,i as u,e,j as i,O as c}from"./index-Dj0i1-CA.js";import{P as f}from"./Page-C-XfU5BR.js";import{u as v}from"./plan-BTRSbjKn.js";import"./SplitPane-CViaZmw6.js";function E(){const s=m(),t=p(),o=l(n=>n.environment),a=v(n=>n.planApply);return r.useEffect(()=>{if(a.isRunning&&u(a.environment)){const n=`${e.Plan}/environments/${a.environment}`;t.pathname!==n&&s(n,{replace:!0})}else(t.pathname===e.Plan||t.pathname===`${e.Plan}/environments`)&&s(`${e.Plan}/environments/${o.name}`,{replace:!0})},[t,a.isRunning]),r.useEffect(()=>{s(`${e.Plan}/environments/${o.name}`,{replace:!0})},[o]),i.jsx(f,{content:i.jsx(c,{})})}export{E as default};
@@ -1 +1 @@
1
- import{K as D,y as k,aq as A,o as S,L as z,Q as _,a6 as J,d as T,w as I,v as X,aa as G,ab as Q,J as Y,$ as ee,W as te,X as ae,Y as re,_ as M,a0 as se,i as U,R as H,Z as ne,a as C}from"./popover-CqgMRE0G.js";import{R as x,r as s,a1 as oe}from"./index-O3mjYpnE.js";import{c as ie}from"./_commonjs-dynamic-modules-TDtrdbi3.js";var V;let le=(V=x.startTransition)!=null?V:function(e){e()};var ue=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ue||{}),ce=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(ce||{});let de={0:e=>({...e,disclosureState:T(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,r){return e.buttonId===r.buttonId?e:{...e,buttonId:r.buttonId}},3(e,r){return e.panelId===r.panelId?e:{...e,panelId:r.panelId}},4(e,r){return e.buttonElement===r.element?e:{...e,buttonElement:r.element}},5(e,r){return e.panelElement===r.element?e:{...e,panelElement:r.element}}},O=s.createContext(null);O.displayName="DisclosureContext";function j(e){let r=s.useContext(O);if(r===null){let i=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,j),i}return r}let F=s.createContext(null);F.displayName="DisclosureAPIContext";function K(e){let r=s.useContext(F);if(r===null){let i=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,K),i}return r}let q=s.createContext(null);q.displayName="DisclosurePanelContext";function pe(){return s.useContext(q)}function me(e,r){return T(r.type,de,e,r)}let fe=s.Fragment;function he(e,r){let{defaultOpen:i=!1,...l}=e,f=s.useRef(null),h=k(r,A(t=>{f.current=t},e.as===void 0||e.as===s.Fragment)),$=s.useReducer(me,{disclosureState:i?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:o,buttonId:u},y]=$,p=S(t=>{y({type:1});let a=se(f);if(!a||!u)return;let c=t?U(t)?t:"current"in t&&U(t.current)?t.current:a.getElementById(u):a.getElementById(u);c==null||c.focus()}),E=s.useMemo(()=>({close:p}),[p]),v=s.useMemo(()=>({open:o===0,close:p}),[o,p]),b={ref:h},n=z();return x.createElement(O.Provider,{value:$},x.createElement(F.Provider,{value:E},x.createElement(_,{value:p},x.createElement(J,{value:T(o,{0:I.Open,1:I.Closed})},n({ourProps:b,theirProps:l,slot:v,defaultTag:fe,name:"Disclosure"})))))}let $e="button";function ge(e,r){let i=s.useId(),{id:l=`headlessui-disclosure-button-${i}`,disabled:f=!1,autoFocus:h=!1,...$}=e,[o,u]=j("Disclosure.Button"),y=pe(),p=y===null?!1:y===o.panelId,E=s.useRef(null),v=k(E,r,S(g=>{if(!p)return u({type:4,element:g})}));s.useEffect(()=>{if(!p)return u({type:2,buttonId:l}),()=>{u({type:2,buttonId:null})}},[l,u,p]);let b=S(g=>{var P;if(p){if(o.disclosureState===1)return;switch(g.key){case C.Space:case C.Enter:g.preventDefault(),g.stopPropagation(),u({type:0}),(P=o.buttonElement)==null||P.focus();break}}else switch(g.key){case C.Space:case C.Enter:g.preventDefault(),g.stopPropagation(),u({type:0});break}}),n=S(g=>{switch(g.key){case C.Space:g.preventDefault();break}}),t=S(g=>{var P;ne(g.currentTarget)||f||(p?(u({type:0}),(P=o.buttonElement)==null||P.focus()):u({type:0}))}),{isFocusVisible:a,focusProps:c}=ee({autoFocus:h}),{isHovered:d,hoverProps:m}=te({isDisabled:f}),{pressed:w,pressProps:B}=ae({disabled:f}),N=s.useMemo(()=>({open:o.disclosureState===0,hover:d,active:w,disabled:f,focus:a,autofocus:h}),[o,d,w,a,f,h]),L=re(e,o.buttonElement),W=p?M({ref:v,type:L,disabled:f||void 0,autoFocus:h,onKeyDown:b,onClick:t},c,m,B):M({ref:v,id:l,type:L,"aria-expanded":o.disclosureState===0,"aria-controls":o.panelElement?o.panelId:void 0,disabled:f||void 0,autoFocus:h,onKeyDown:b,onKeyUp:n,onClick:t},c,m,B);return z()({ourProps:W,theirProps:$,slot:N,defaultTag:$e,name:"Disclosure.Button"})}let ve="div",be=H.RenderStrategy|H.Static;function ye(e,r){let i=s.useId(),{id:l=`headlessui-disclosure-panel-${i}`,transition:f=!1,...h}=e,[$,o]=j("Disclosure.Panel"),{close:u}=K("Disclosure.Panel"),[y,p]=s.useState(null),E=k(r,S(d=>{le(()=>o({type:5,element:d}))}),p);s.useEffect(()=>(o({type:3,panelId:l}),()=>{o({type:3,panelId:null})}),[l,o]);let v=X(),[b,n]=G(f,y,v!==null?(v&I.Open)===I.Open:$.disclosureState===0),t=s.useMemo(()=>({open:$.disclosureState===0,close:u}),[$.disclosureState,u]),a={ref:E,id:l,...Q(n)},c=z();return x.createElement(Y,null,x.createElement(q.Provider,{value:$.panelId},c({ourProps:a,theirProps:h,slot:t,defaultTag:ve,features:be,visible:b,name:"Disclosure.Panel"})))}let Ee=D(he),we=D(ge),xe=D(ye),Te=Object.assign(Ee,{Button:we,Panel:xe});var R={exports:{}},Se=R.exports,Z;function Pe(){return Z||(Z=1,function(e,r){(function(i,l){typeof ie=="function"?e.exports=l():i.pluralize=l()})(Se,function(){var i=[],l=[],f={},h={},$={};function o(t){return typeof t=="string"?new RegExp("^"+t+"$","i"):t}function u(t,a){return t===a?a:t===t.toLowerCase()?a.toLowerCase():t===t.toUpperCase()?a.toUpperCase():t[0]===t[0].toUpperCase()?a.charAt(0).toUpperCase()+a.substr(1).toLowerCase():a.toLowerCase()}function y(t,a){return t.replace(/\$(\d{1,2})/g,function(c,d){return a[d]||""})}function p(t,a){return t.replace(a[0],function(c,d){var m=y(a[1],arguments);return u(c===""?t[d-1]:c,m)})}function E(t,a,c){if(!t.length||f.hasOwnProperty(t))return a;for(var d=c.length;d--;){var m=c[d];if(m[0].test(a))return p(a,m)}return a}function v(t,a,c){return function(d){var m=d.toLowerCase();return a.hasOwnProperty(m)?u(d,m):t.hasOwnProperty(m)?u(d,t[m]):E(m,d,c)}}function b(t,a,c,d){return function(m){var w=m.toLowerCase();return a.hasOwnProperty(w)?!0:t.hasOwnProperty(w)?!1:E(w,w,c)===w}}function n(t,a,c){var d=a===1?n.singular(t):n.plural(t);return(c?a+" ":"")+d}return n.plural=v($,h,i),n.isPlural=b($,h,i),n.singular=v(h,$,l),n.isSingular=b(h,$,l),n.addPluralRule=function(t,a){i.push([o(t),a])},n.addSingularRule=function(t,a){l.push([o(t),a])},n.addUncountableRule=function(t){if(typeof t=="string"){f[t.toLowerCase()]=!0;return}n.addPluralRule(t,"$0"),n.addSingularRule(t,"$0")},n.addIrregularRule=function(t,a){a=a.toLowerCase(),t=t.toLowerCase(),$[t]=a,h[a]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return n.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return n.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return n.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(n.addUncountableRule),n})}(R)),R.exports}var Ce=Pe();const Oe=oe(Ce);function Re({title:e,titleId:r,...i},l){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":r},i),e?s.createElement("title",{id:r},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const je=s.forwardRef(Re);function Ie({title:e,titleId:r,...i},l){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":r},i),e?s.createElement("title",{id:r},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const Fe=s.forwardRef(Ie);export{je as F,Te as V,Fe as a,Oe as p};
1
+ import{K as D,y as k,aq as A,o as S,L as z,Q as _,a6 as J,d as T,w as I,v as X,aa as G,ab as Q,J as Y,$ as ee,W as te,X as ae,Y as re,_ as M,a0 as se,i as U,R as H,Z as ne,a as C}from"./popover-_Sf0yvOI.js";import{R as x,r as s,a1 as oe}from"./index-Dj0i1-CA.js";import{c as ie}from"./_commonjs-dynamic-modules-TDtrdbi3.js";var V;let le=(V=x.startTransition)!=null?V:function(e){e()};var ue=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ue||{}),ce=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(ce||{});let de={0:e=>({...e,disclosureState:T(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,r){return e.buttonId===r.buttonId?e:{...e,buttonId:r.buttonId}},3(e,r){return e.panelId===r.panelId?e:{...e,panelId:r.panelId}},4(e,r){return e.buttonElement===r.element?e:{...e,buttonElement:r.element}},5(e,r){return e.panelElement===r.element?e:{...e,panelElement:r.element}}},O=s.createContext(null);O.displayName="DisclosureContext";function j(e){let r=s.useContext(O);if(r===null){let i=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,j),i}return r}let F=s.createContext(null);F.displayName="DisclosureAPIContext";function K(e){let r=s.useContext(F);if(r===null){let i=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,K),i}return r}let q=s.createContext(null);q.displayName="DisclosurePanelContext";function pe(){return s.useContext(q)}function me(e,r){return T(r.type,de,e,r)}let fe=s.Fragment;function he(e,r){let{defaultOpen:i=!1,...l}=e,f=s.useRef(null),h=k(r,A(t=>{f.current=t},e.as===void 0||e.as===s.Fragment)),$=s.useReducer(me,{disclosureState:i?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:o,buttonId:u},y]=$,p=S(t=>{y({type:1});let a=se(f);if(!a||!u)return;let c=t?U(t)?t:"current"in t&&U(t.current)?t.current:a.getElementById(u):a.getElementById(u);c==null||c.focus()}),E=s.useMemo(()=>({close:p}),[p]),v=s.useMemo(()=>({open:o===0,close:p}),[o,p]),b={ref:h},n=z();return x.createElement(O.Provider,{value:$},x.createElement(F.Provider,{value:E},x.createElement(_,{value:p},x.createElement(J,{value:T(o,{0:I.Open,1:I.Closed})},n({ourProps:b,theirProps:l,slot:v,defaultTag:fe,name:"Disclosure"})))))}let $e="button";function ge(e,r){let i=s.useId(),{id:l=`headlessui-disclosure-button-${i}`,disabled:f=!1,autoFocus:h=!1,...$}=e,[o,u]=j("Disclosure.Button"),y=pe(),p=y===null?!1:y===o.panelId,E=s.useRef(null),v=k(E,r,S(g=>{if(!p)return u({type:4,element:g})}));s.useEffect(()=>{if(!p)return u({type:2,buttonId:l}),()=>{u({type:2,buttonId:null})}},[l,u,p]);let b=S(g=>{var P;if(p){if(o.disclosureState===1)return;switch(g.key){case C.Space:case C.Enter:g.preventDefault(),g.stopPropagation(),u({type:0}),(P=o.buttonElement)==null||P.focus();break}}else switch(g.key){case C.Space:case C.Enter:g.preventDefault(),g.stopPropagation(),u({type:0});break}}),n=S(g=>{switch(g.key){case C.Space:g.preventDefault();break}}),t=S(g=>{var P;ne(g.currentTarget)||f||(p?(u({type:0}),(P=o.buttonElement)==null||P.focus()):u({type:0}))}),{isFocusVisible:a,focusProps:c}=ee({autoFocus:h}),{isHovered:d,hoverProps:m}=te({isDisabled:f}),{pressed:w,pressProps:B}=ae({disabled:f}),N=s.useMemo(()=>({open:o.disclosureState===0,hover:d,active:w,disabled:f,focus:a,autofocus:h}),[o,d,w,a,f,h]),L=re(e,o.buttonElement),W=p?M({ref:v,type:L,disabled:f||void 0,autoFocus:h,onKeyDown:b,onClick:t},c,m,B):M({ref:v,id:l,type:L,"aria-expanded":o.disclosureState===0,"aria-controls":o.panelElement?o.panelId:void 0,disabled:f||void 0,autoFocus:h,onKeyDown:b,onKeyUp:n,onClick:t},c,m,B);return z()({ourProps:W,theirProps:$,slot:N,defaultTag:$e,name:"Disclosure.Button"})}let ve="div",be=H.RenderStrategy|H.Static;function ye(e,r){let i=s.useId(),{id:l=`headlessui-disclosure-panel-${i}`,transition:f=!1,...h}=e,[$,o]=j("Disclosure.Panel"),{close:u}=K("Disclosure.Panel"),[y,p]=s.useState(null),E=k(r,S(d=>{le(()=>o({type:5,element:d}))}),p);s.useEffect(()=>(o({type:3,panelId:l}),()=>{o({type:3,panelId:null})}),[l,o]);let v=X(),[b,n]=G(f,y,v!==null?(v&I.Open)===I.Open:$.disclosureState===0),t=s.useMemo(()=>({open:$.disclosureState===0,close:u}),[$.disclosureState,u]),a={ref:E,id:l,...Q(n)},c=z();return x.createElement(Y,null,x.createElement(q.Provider,{value:$.panelId},c({ourProps:a,theirProps:h,slot:t,defaultTag:ve,features:be,visible:b,name:"Disclosure.Panel"})))}let Ee=D(he),we=D(ge),xe=D(ye),Te=Object.assign(Ee,{Button:we,Panel:xe});var R={exports:{}},Se=R.exports,Z;function Pe(){return Z||(Z=1,function(e,r){(function(i,l){typeof ie=="function"?e.exports=l():i.pluralize=l()})(Se,function(){var i=[],l=[],f={},h={},$={};function o(t){return typeof t=="string"?new RegExp("^"+t+"$","i"):t}function u(t,a){return t===a?a:t===t.toLowerCase()?a.toLowerCase():t===t.toUpperCase()?a.toUpperCase():t[0]===t[0].toUpperCase()?a.charAt(0).toUpperCase()+a.substr(1).toLowerCase():a.toLowerCase()}function y(t,a){return t.replace(/\$(\d{1,2})/g,function(c,d){return a[d]||""})}function p(t,a){return t.replace(a[0],function(c,d){var m=y(a[1],arguments);return u(c===""?t[d-1]:c,m)})}function E(t,a,c){if(!t.length||f.hasOwnProperty(t))return a;for(var d=c.length;d--;){var m=c[d];if(m[0].test(a))return p(a,m)}return a}function v(t,a,c){return function(d){var m=d.toLowerCase();return a.hasOwnProperty(m)?u(d,m):t.hasOwnProperty(m)?u(d,t[m]):E(m,d,c)}}function b(t,a,c,d){return function(m){var w=m.toLowerCase();return a.hasOwnProperty(w)?!0:t.hasOwnProperty(w)?!1:E(w,w,c)===w}}function n(t,a,c){var d=a===1?n.singular(t):n.plural(t);return(c?a+" ":"")+d}return n.plural=v($,h,i),n.isPlural=b($,h,i),n.singular=v(h,$,l),n.isSingular=b(h,$,l),n.addPluralRule=function(t,a){i.push([o(t),a])},n.addSingularRule=function(t,a){l.push([o(t),a])},n.addUncountableRule=function(t){if(typeof t=="string"){f[t.toLowerCase()]=!0;return}n.addPluralRule(t,"$0"),n.addSingularRule(t,"$0")},n.addIrregularRule=function(t,a){a=a.toLowerCase(),t=t.toLowerCase(),$[t]=a,h[a]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return n.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return n.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return n.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(n.addUncountableRule),n})}(R)),R.exports}var Ce=Pe();const Oe=oe(Ce);function Re({title:e,titleId:r,...i},l){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":r},i),e?s.createElement("title",{id:r},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const je=s.forwardRef(Re);function Ie({title:e,titleId:r,...i},l){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":r},i),e?s.createElement("title",{id:r},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const Fe=s.forwardRef(Ie);export{je as F,Te as V,Fe as a,Oe as p};
@@ -1 +1 @@
1
- import{d as f,r as c,j as e,c as u,B as j,m as p,l as b,a as g,v,i as d,P as w,a4 as N,H as y}from"./index-O3mjYpnE.js";import{p as k,V as n,F as x,a as m}from"./PlusCircleIcon-CVDO651q.js";import{S as z}from"./SplitPane-qHmkD1qy.js";import{U as h,z as E}from"./popover-CqgMRE0G.js";function C(){const{errors:l,clearErrors:a}=f(),[t,i]=c.useState(!1);c.useEffect(()=>{l.size<1&&i(!1)},[l]);const r=l.size>0;return e.jsx(h,{onMouseEnter:()=>{i(r)},onMouseLeave:()=>{i(!1)},className:"flex",children:()=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:u("block ml-1 px-3 py-1 first-child:ml-0 rounded-full whitespace-nowrap font-bold text-xs text-center",r?"text-danger-500 bg-danger-10 dark:bg-danger-20 cursor-pointer":"bg-neutral-5 dark:bg-neutral-20 cursor-default text-neutral-500 dark:text-neutral-300"),children:r?e.jsxs("span",{children:[l.size," ",k("Error",l.size)]}):e.jsx("span",{children:"No Errors"})}),e.jsx(E,{show:t,as:c.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:e.jsxs(h.Panel,{className:"absolute top-10 right-2 z-[1000] flex flex-col rounded-md bg-light transform text-danger-700 shadow-2xl w-[90vw] max-h-[80vh]",children:[e.jsx("div",{className:"flex justify-end mx-1 mt-2",children:e.jsx(j,{size:b.sm,variant:p.Neutral,onClick:()=>a(),children:"Clear"})}),e.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(s=>e.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:e.jsx(F,{scope:s.key,error:s})},s.id))})]})})]})})}function F({error:l,scope:a,withSplitPane:t=!1}){const{removeError:i}=f(),r=g(s=>s.version);return e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[v(l.traceback)?e.jsx(o,{version:r,scope:a,error:l}):t?e.jsxs(z,{direction:"vertical",sizes:[50,50],minSize:100,snapOffset:0,className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsx(j,{variant:p.Neutral,size:b.sm,onClick:s=>{s.stopPropagation(),i(l)},children:"Dismiss"})})]})}function o({error:l,scope:a,version:t}){return e.jsxs("div",{className:"flex w-full overflow-hidden mb-2",children:[e.jsxs("div",{className:"w-[20rem] h-full",children:[e.jsxs("div",{className:"flex aline-center mb-2",children:[e.jsx("small",{className:"block mr-3",children:e.jsx("small",{className:"py-0.5 px-2 bg-danger-500 text-danger-100 rounded-md text-xs",children:l.status??"UI"})}),e.jsx("small",{className:"block",children:a})]}),e.jsxs("div",{className:u("text-sm px-2"),children:[e.jsx("small",{className:"block text-xs font-mono",children:w(N(l.timestamp),"yyyy-mm-dd hh-mm-ss",!1)}),e.jsx("p",{children:l.message})]})]}),e.jsxs("div",{className:"flex flex-col w-full px-4",children:[d(t)&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Version"}),": ",t]}),l.type!=null&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Type"}),": ",l.type]}),l.origin!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Origin"}),": ",l.origin]}),l.trigger!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Trigger"}),": ",l.trigger]}),e.jsx(y,{}),e.jsx("div",{className:"pt-4 h-full overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.jsx("p",{className:"flex text-sm ",children:l.description})})]})]})}export{F as D,C as R};
1
+ import{d as f,r as c,j as e,c as u,B as j,m as p,l as b,a as g,v,i as d,P as w,a4 as N,H as y}from"./index-Dj0i1-CA.js";import{p as k,V as n,F as x,a as m}from"./PlusCircleIcon-DVXAHG8_.js";import{S as z}from"./SplitPane-CViaZmw6.js";import{U as h,z as E}from"./popover-_Sf0yvOI.js";function C(){const{errors:l,clearErrors:a}=f(),[t,i]=c.useState(!1);c.useEffect(()=>{l.size<1&&i(!1)},[l]);const r=l.size>0;return e.jsx(h,{onMouseEnter:()=>{i(r)},onMouseLeave:()=>{i(!1)},className:"flex",children:()=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:u("block ml-1 px-3 py-1 first-child:ml-0 rounded-full whitespace-nowrap font-bold text-xs text-center",r?"text-danger-500 bg-danger-10 dark:bg-danger-20 cursor-pointer":"bg-neutral-5 dark:bg-neutral-20 cursor-default text-neutral-500 dark:text-neutral-300"),children:r?e.jsxs("span",{children:[l.size," ",k("Error",l.size)]}):e.jsx("span",{children:"No Errors"})}),e.jsx(E,{show:t,as:c.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:e.jsxs(h.Panel,{className:"absolute top-10 right-2 z-[1000] flex flex-col rounded-md bg-light transform text-danger-700 shadow-2xl w-[90vw] max-h-[80vh]",children:[e.jsx("div",{className:"flex justify-end mx-1 mt-2",children:e.jsx(j,{size:b.sm,variant:p.Neutral,onClick:()=>a(),children:"Clear"})}),e.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(s=>e.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:e.jsx(F,{scope:s.key,error:s})},s.id))})]})})]})})}function F({error:l,scope:a,withSplitPane:t=!1}){const{removeError:i}=f(),r=g(s=>s.version);return e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[v(l.traceback)?e.jsx(o,{version:r,scope:a,error:l}):t?e.jsxs(z,{direction:"vertical",sizes:[50,50],minSize:100,snapOffset:0,className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{version:r,scope:a,error:l}),d(l.traceback)&&e.jsx(n,{defaultOpen:!0,children:({open:s})=>e.jsxs("div",{className:"w-full h-full overflow-hidden",children:[e.jsxs(n.Button,{className:"flex items-center justify-between rounded-lg text-left w-full bg-neutral-10 px-3 my-2",children:[e.jsx("div",{className:"text-lg font-bold whitespace-nowrap w-full",children:e.jsx("h3",{className:"py-2",children:"Traceback"})}),e.jsx("div",{children:s?e.jsx(x,{className:"h-6 w-6 text-danger-500"}):e.jsx(m,{className:"h-6 w-6 text-danger-500"})})]}),e.jsx(n.Panel,{className:"flex w-full h-full px-2 mb-2 overflow-hidden",children:e.jsx("pre",{className:"font-mono w-full h-full bg-dark-lighter text-danger-500 rounded-lg p-4 overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal text-sm",children:e.jsx("code",{children:l.traceback??l.message})})})]})})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsx(j,{variant:p.Neutral,size:b.sm,onClick:s=>{s.stopPropagation(),i(l)},children:"Dismiss"})})]})}function o({error:l,scope:a,version:t}){return e.jsxs("div",{className:"flex w-full overflow-hidden mb-2",children:[e.jsxs("div",{className:"w-[20rem] h-full",children:[e.jsxs("div",{className:"flex aline-center mb-2",children:[e.jsx("small",{className:"block mr-3",children:e.jsx("small",{className:"py-0.5 px-2 bg-danger-500 text-danger-100 rounded-md text-xs",children:l.status??"UI"})}),e.jsx("small",{className:"block",children:a})]}),e.jsxs("div",{className:u("text-sm px-2"),children:[e.jsx("small",{className:"block text-xs font-mono",children:w(N(l.timestamp),"yyyy-mm-dd hh-mm-ss",!1)}),e.jsx("p",{children:l.message})]})]}),e.jsxs("div",{className:"flex flex-col w-full px-4",children:[d(t)&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Version"}),": ",t]}),l.type!=null&&e.jsxs("small",{className:"block",children:[e.jsx("b",{children:"Type"}),": ",l.type]}),l.origin!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Origin"}),": ",l.origin]}),l.trigger!=null&&e.jsxs("small",{className:"block mb-2",children:[e.jsx("b",{children:"Trigger"}),": ",l.trigger]}),e.jsx(y,{}),e.jsx("div",{className:"pt-4 h-full overflow-scroll hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:e.jsx("p",{className:"flex text-sm ",children:l.description})})]})]})}export{F as D,C as R};