@chaibuilder/sdk 1.2.12 → 1.2.13

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 (61) hide show
  1. package/dist/{AddBlocks-nMUkm4og.cjs → AddBlocks-tomDo_Is.cjs} +1 -1
  2. package/dist/{AddBlocks-ByeMUUzE.js → AddBlocks-zN5--UP6.js} +1 -1
  3. package/dist/{BrandingOptions-eeDfvB0R.cjs → BrandingOptions-BUmE4f72.cjs} +1 -1
  4. package/dist/{BrandingOptions--poS5shs.js → BrandingOptions-LbizrmRI.js} +2 -2
  5. package/dist/{CanvasArea--TKubnIM.js → CanvasArea-OSH8wqt1.js} +4 -4
  6. package/dist/{CanvasArea-h4lA4oqP.cjs → CanvasArea-nT6ZJh_V.cjs} +1 -1
  7. package/dist/{CurrentPage-Gw9LJ40j.js → CurrentPage-FzqNBLy4.js} +3 -3
  8. package/dist/{CurrentPage-B3YumhrX.cjs → CurrentPage-SWR9WU4k.cjs} +1 -1
  9. package/dist/{Layers-4r_4F6ST.cjs → Layers-FRHRlPIH.cjs} +1 -1
  10. package/dist/{Layers-d-xge4On.js → Layers-g5_pwwgO.js} +4 -4
  11. package/dist/{PagesPanel-iZLDBwXQ.cjs → PagesPanel-3jcf5-iH.cjs} +1 -1
  12. package/dist/{PagesPanel-E4wSgVcE.js → PagesPanel-PSg6aqlK.js} +4 -4
  13. package/dist/{ProjectPanel-2TcqGnfN.cjs → ProjectPanel-EyEcNyh8.cjs} +1 -1
  14. package/dist/{ProjectPanel-q7upaf7h.js → ProjectPanel-XW_Bx880.js} +4 -4
  15. package/dist/{Settings-y3DHsT88.js → Settings--7qJ7ciF.js} +3 -3
  16. package/dist/{Settings-NuDNH2dR.cjs → Settings-h1c8ukpI.cjs} +1 -1
  17. package/dist/{SidePanels-BK_QnEh9.js → SidePanels-Lmj0Qkd1.js} +4 -4
  18. package/dist/{SidePanels-91l1CjYv.cjs → SidePanels-NbM1mfsY.cjs} +1 -1
  19. package/dist/{Topbar-rEO5z57t.cjs → Topbar-2sOsQD2d.cjs} +1 -1
  20. package/dist/{Topbar-b7jnOD57.js → Topbar-xvrno03z.js} +1 -1
  21. package/dist/{UnsplashImages-p-WdKs3b.cjs → UnsplashImages-EiYSWkBa.cjs} +1 -1
  22. package/dist/{UnsplashImages-Lb78FYx7.js → UnsplashImages-hhPOf7kt.js} +1 -1
  23. package/dist/{UploadImages-zk-IYDx8.cjs → UploadImages-GGCExfQd.cjs} +1 -1
  24. package/dist/{UploadImages-aWG_1r7N.js → UploadImages-JKjE44i7.js} +1 -1
  25. package/dist/{add-page-modal-iUffBbAe.cjs → add-page-modal-65wltt_4.cjs} +1 -1
  26. package/dist/{add-page-modal-7djj9GZj.js → add-page-modal-Bl6y65im.js} +4 -4
  27. package/dist/{confirm-alert-QuqMrpWn.js → confirm-alert-Nw1JCtuu.js} +1 -1
  28. package/dist/{confirm-alert-i3FRAgP4.cjs → confirm-alert-_DCO6hCV.cjs} +1 -1
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.js +3 -3
  31. package/dist/{delete-page-modal-RllDrgxs.cjs → delete-page-modal-Q3Si4nyd.cjs} +1 -1
  32. package/dist/{delete-page-modal-DEBiprds.js → delete-page-modal-tiJ2UA5f.js} +3 -3
  33. package/dist/email-blocks.cjs +1 -1
  34. package/dist/email-blocks.js +27 -27
  35. package/dist/email.cjs +1 -1
  36. package/dist/email.js +4 -4
  37. package/dist/{empty-slot-TF2kd-0X.cjs → empty-slot-2LSrWJaY.cjs} +1 -1
  38. package/dist/{empty-slot-MWycClTb.js → empty-slot-5FRrRq1E.js} +33 -33
  39. package/dist/{form-94xR0NG8.js → form-lbFCPUoE.js} +1 -1
  40. package/dist/{form-yz7h2msc.cjs → form-vNgf0kO2.cjs} +1 -1
  41. package/dist/{index-TEfD-2ti.cjs → index-bfKqnRvZ.cjs} +1 -1
  42. package/dist/{index-XVud0HL8.cjs → index-hS9T9Nub.cjs} +2 -2
  43. package/dist/{index-0m8Zuv5X.js → index-m9VziIOy.js} +2 -2
  44. package/dist/{index-19nTm_cE.js → index-wwk4px_E.js} +3 -3
  45. package/dist/{page-viewer-xPLhXv6k.js → page-viewer-rLCyM4QC.js} +4 -4
  46. package/dist/{page-viewer-_ktv1pgX.cjs → page-viewer-w-ahza8q.cjs} +1 -1
  47. package/dist/{project-general-setting-nULU3Tzw.cjs → project-general-setting-RTcIwUWc.cjs} +1 -1
  48. package/dist/{project-general-setting-XlORLtqJ.js → project-general-setting-pY-Mkc8G.js} +4 -4
  49. package/dist/{project-seo-setting-KQkeHwny.js → project-seo-setting-9V67NFil.js} +3 -3
  50. package/dist/{project-seo-setting-9QkARPhg.cjs → project-seo-setting-aRDdqu88.cjs} +1 -1
  51. package/dist/{single-page-detail-gtVN9hxR.js → single-page-detail-HYX4R3U0.js} +5 -5
  52. package/dist/{single-page-detail-Gb6O3Yyw.cjs → single-page-detail-wHDpn40R.cjs} +1 -1
  53. package/dist/studio.cjs +1 -1
  54. package/dist/studio.js +3 -3
  55. package/dist/ui.cjs +1 -1
  56. package/dist/ui.js +1 -1
  57. package/dist/{useAddBlockByDrop-GU5QLPtz.cjs → useAddBlockByDrop-1WvPoBXa.cjs} +1 -1
  58. package/dist/{useAddBlockByDrop-b5KJh_7w.js → useAddBlockByDrop-bs_SH7Tw.js} +1 -1
  59. package/dist/web-blocks.cjs +1 -1
  60. package/dist/web-blocks.js +129 -129
  61. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";var io=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)};var B=(t,e,a)=>(io(t,e,"read from private field"),a?a.call(t):e.get(t)),z1=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},u1=(t,e,a,r)=>(io(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var Cr=(t,e,a,r)=>({set _(n){u1(t,e,n,a)},get _(){return B(t,e,r)}}),C1=(t,e,a)=>(io(t,e,"access private method"),a);const Vf=require("i18next"),RO=require("react-i18next"),e1=require("./jsx-runtime-Z_BpKhVy.cjs"),d=require("react"),o1=require("./index-TEfD-2ti.cjs"),T2=require("./_commonjsHelpers-wDK0ZLPo.cjs"),wf=require("clsx"),bf=require("react-dom"),NO=require("@radix-ui/react-scroll-area"),pt=require("@floating-ui/react-dom"),TO=require("react-textarea-autosize"),we=require("jotai"),jO=require("flagged"),DO=require("react-dnd"),rt=require("lodash-es"),Dh=require("@minoru/react-dnd-treeview"),FO=require("./Functions-N3yhPYKY.cjs"),d0=require("react-hotkeys-hook"),mi=require("@chaibuilder/runtime"),P4=require("@radix-ui/react-icons"),F2=require("sonner"),qO=require("./html-to-json-2PeOCVey.cjs"),c3=require("lucide-react");require("./web-blocks.cjs");function yf(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const O=yf(d),Pe=yf(NO),WO="Add block",KO="(Enter or paste TailwindCSS HTML snippet)",UO="(Click to add block to page)",ZO="Core",GO="Custom Blocks",JO="Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code.",YO="Tailwind HTML snippet:",QO="Enter your code snippet here...",XO="Import HTML",_O="NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.",$O="Dark mode",tS="This page has no blocks. Add a block by clicking the + button",eS="This page is empty",aS="Please select a block to edit settings or styles",rS="Please select a styling block",nS="Drop your block here",lS="Use setting",iS="Mobile (XS)",oS="Styles set here are applied to all screen unless edited at higher breakpoint",cS="Mobile landscape (SM)",hS="Styles set here are applied at 640px and up unless edited at higher breakpoint",sS="Tablet (MD)",vS="Styles set here are applied at 768px and up",dS="Tablet Landscape (LG)",uS="Styles set here are applied at 1024px and up unless edited at higher breakpoint",gS="Desktop (XL)",fS="Styles set here are applied at 1280px and up unless edited at higher breakpoint",pS="Large Desktop (2XL)",zS="Styles set here are applied at 1536px and up",MS="Breakpoints",mS="Clear",HS="Clear whole canvas?",VS="Are you sure you want to clear the whole canvas?",wS="Cancel",bS="Yes",yS="Preview",xS="Settings",LS="Styling",OS="Data Provider",SS="Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?",CS="Your data provider will be removed from this page and all added data binding will be not visible on blocks.",BS="Remove",AS="You have no data providers registered. Please add a data provider to your project.",ES="Learn more",PS="Add data providers:",IS="Select a provider",kS="Choose",RS="Page data providers:",NS="View Data",TS="Mark as Global",jS="Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.",DS="Global blocks are indicated with",FS="Global blocks are available under 'Global' category",qS="Enter global block name",WS="Eg: Header, Footer",KS="{{length}} blocks selected.",US="Cut",ZS="Copy",GS="Clear Selection",JS="This is dev mode. Visit",YS="to see page preview",QS={add_block:WO,enter_paste_tailwind_html:KO,click_to_add_block:UO,core:ZO,custom_blocks:GO,import:"Import",html_snippet_description:JO,tailwind_html_snippet:YO,enter_code_snippet:QO,import_html:XO,note_imported_html:_O,dark_mode:$O,tree_view_no_blocks:tS,canvas_empty:eS,no_block_selected_for_styling:aS,no_styling_block_selected:rS,drop_here_message:nS,use_setting:lS,mobile_xs_title:iS,mobile_xs_content:oS,mobile_sm_title:cS,mobile_sm_content:hS,tablet_md_title:sS,tablet_md_content:vS,tablet_lg_title:dS,tablet_lg_content:uS,desktop_xl_title:gS,desktop_xl_content:fS,large_desktop_2xl_title:pS,large_desktop_2xl_content:zS,Breakpoints:MS,clear:mS,clear_canvas_title:HS,clear_canvas_description:VS,cancel:wS,yes:bS,preview:yS,settings:xS,styling:LS,data_provider:OS,remove_provider_confirmation:SS,remove_provider_warning:CS,remove:BS,no_data_providers:AS,learn_more:ES,add_data_providers:PS,select_provider:IS,choose:kS,page_data_providers:RS,view_data:NS,mark_as_global:TS,global_block_note:jS,global_block_indicator:DS,global_block_category:FS,enter_global_block_name:qS,eg_header_footer:WS,blocks_selected:KS,cut:US,copy:ZS,delete:"Delete",clear_selection:GS,dev_mode_message:JS,to_see_page_preview:YS,"flex.heading":"Flex Child","flex.basis":"Basis","flex.order":"Order","flex.flex":"Flex","flex.grow":"Grow","flex.shrink":"Shrink","grid.heading":"Grid Child","grid.col_span":"Col Span","grid.col_start":"Col Start","grid.col_end":"Col End","grid.row_span":"Row Span","grid.row_start":"Row Start","grid.row_end":"Row End","grid.order":"Order","layout.heading":"Layout","layout.width":"Width","layout.height":"Height","layout.margin":"Margin","layout.margin_all":"All","layout.margin_lr":"Left-Right","layout.margin_tb":"Top-Bottom","layout.margin_top":"Top","layout.margin_right":"Right","layout.margin_bottom":"Bottom","layout.margin_left":"Left","layout.padding":"Padding","layout.padding_all":"All","layout.padding_lr":"Left-Right","layout.padding_tb":"Top-Bottom","layout.padding_top":"Top","layout.padding_right":"Right","layout.padding_bottom":"Bottom","layout.padding_left":"Left","layout.space_bt":"Space Bt.","layout.space_lr":"Left-Right","layout.space_tb":"Top-Bottom","size.heading":"Size","size.min_width_height":"Min width & height","size.min_width":"Min Width","size.min_height":"Min Height","size.max_width_height":"Max width & height","size.max_width":"Max Width","size.max_height":"Max Height","size.object_options_aspect_ratio":"Object options & aspect ratio","size.aspect":"Aspect","size.fit":"Fit","size.position":"Position","display.heading":"Display","display.display":"Display","display.flex_options":"Flex options","display.flex_direction":"Direction","display.flex_wrap":"Wrap","display.justify_content":"Justify","display.align_content":"Content","display.align_items":"Items","display.gap":"Gap","display.gap_all":"All","display.gap_lr":"Left-Right","display.gap_tb":"Top-Bottom","display.grid_options":"Grid options","display.grid_columns":"Columns","display.grid_rows":"Rows","display.grid_auto_flow":"Auto Flow","display.grid_auto_cols":"Auto Cols","display.grid_auto_rows":"Auto Rows","display.visibility_opacity":"Visibility & Opacity","display.visibility":"Visibility","display.opacity":"Opacity","position.heading":"Position","position.position":"Position","position.options":"Position options","position.direction":"Direction","position.top":"Top","position.right":"Right","position.bottom":"Bottom","position.left":"Left","position.inset":"Inset","position.all":"All","position.lr":"Left Right","position.tb":"Top Bottom","position.z_index":"Z-Index","position.float_clear":"Float & Clear","position.float":"Float","position.clear":"Clear","position.overflow_overscroll":"Overflow & Overscroll","position.overflow":"Overflow","position.overscroll":"Overscroll","typography.heading":"Typography","typography.font":"Font","typography.size":"Size","typography.height":"Height","typography.weight":"Weight","typography.color":"Color","typography.alignments":"Alignments","typography.align":"Align","typography.valign":"V. Align","typography.spacing_decoration_more":"Spacing, decoration & more","typography.spacing":"Spacing","typography.decoration":"Decoration","typography.thickness":"Thickness","typography.transform":"Transform","typography.whitespace_breaks":"White space & breaks","typography.whitespace":"Whitespace","typography.wordbreak":"Wordbreak","background.heading":"Background","background.bgcolor":"Bg. Color","background.position_size_more":"Position, Size & more","background.attachment":"Attachment","background.clipping":"Clipping","background.origin":"Origin","background.position":"Position","background.repeat":"Repeat","background.size":"Size","background.gradient":"Gradient","background.gradient_colors":"Gradient colors","background.from_color":"From","background.via_color":"Via","background.to_color":"To","border.heading":"Border & Outline","border.width":"Width","border.all":"All","border.lr":"Left Right","border.tb":"Top bottom","border.top":"Top","border.right":"Right","border.bottom":"Bottom","border.left":"Left","border.corners":"Corners","border.top_left":"Top Left","border.top_right":"Top right","border.bottom_right":"Bottom right","border.bottom_left":"Bottom left","border.color":"Color","border.style":"Style","border.divide_options":"Divide options","border.divide_color":"Color","border.divide_style":"Style","border.outline_styling":"Outline styling","border.outline_width":"Width","border.outline_offset":"Offset","border.outline_style":"Style","border.ring_options":"Ring options","border.ring_width":"Width","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Off. color","effect.heading":"Effect & Animation","effect.shadow":"Shadow","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Blend & Cursor","effect.mix_blend":"Mix Blend","effect.bg_blend":"Bg. Blend","effect.transform":"Transform","effect.origin":"Origin","effect.scale":"Scale","effect.all":"All","effect.lr":"Left-Right","effect.tb":"Top-Bottom","effect.skew":"Skew","effect.translate":"Translate","effect.rotate":"Rotate","effect.animation":"Animation","effect.transition":"Transition","effect.easing":"Easing","effect.duration":"Duration","effect.delay":"Delay","classes.heading":"Classes"},XS="Adicionar bloco",_S="(Digite ou cole um trecho HTML do TailwindCSS)",$S="(Clique para adicionar bloco à página)",tC="Principal",eC="Personalizados",aC="Use trechos HTML de bibliotecas de componentes Tailwind CSS, etc. ou simplesmente copie e cole seu próprio código HTML.",rC="Trecho HTML do Tailwind:",nC="Digite seu trecho de código aqui...",lC="Importar HTML",iC="NOTA: O HTML importado será adicionado ao bloco atualmente selecionado. Se nenhum bloco for selecionado, o HTML será adicionado à página.",oC="Modo escuro",cC="Esta página não tem blocos. Adicione um bloco clicando no botão +",hC="Esta página está vazia",sC="Selecione um bloco para editar as configurações ou estilos",vC="Selecione um bloco de estilo",dC="Solte seu bloco aqui",uC="Usar configuração",gC="Celular (XS)",fC="Os estilos definidos aqui são aplicados a todas as telas, a menos que editados em um ponto de interrupção mais alto",pC="Celular paisagem (SM)",zC="Os estilos definidos aqui são aplicados a 640px e acima, a menos que editados em um ponto de interrupção mais alto",MC="Tablet (MD)",mC="Os estilos definidos aqui são aplicados a 768px e acima",HC="Paisagem do tablet (LG)",VC="Os estilos definidos aqui são aplicados a 1024px e acima, a menos que editados em um ponto de interrupção mais alto",wC="Desktop (XL)",bC="Os estilos definidos aqui são aplicados a 1280px e acima, a menos que editados em um ponto de interrupção mais alto",yC="Desktop Grande (2XL)",xC="Os estilos definidos aqui são aplicados a 1536px e acima",LC="Pontos de interrupção",OC="Limpar",SC="Limpar toda a tela?",CC="Tem certeza de que deseja limpar toda a tela?",BC="Cancelar",AC="Sim",EC="Visualizar",PC="Configurações",IC="Estilo",kC="Provedor de Dados",RC="Tem certeza de que deseja remover o provedor <span class='text-blue-500'>{name}</span>?",NC="Seu provedor de dados será removido desta página e todas as vinculações de dados adicionadas não serão visíveis nos blocos.",TC="Remover",jC="Você não tem provedores de dados registrados. Adicione um provedor de dados ao seu projeto.",DC="Saiba mais",FC="Adicionar provedores de dados:",qC="Selecione um provedor",WC="Escolher",KC="Provedores de dados da página:",UC="Ver Dados",ZC="Marcar como Global",GC="Nota: Blocos globais são instâncias únicas. Editar blocos globais será refletido em todas as páginas que usam esses blocos.",JC="Blocos globais são indicados com",YC="Blocos globais estão disponíveis na categoria 'Global'",QC="Digite o nome do bloco global",XC="Ex: Cabeçalho, Rodapé",_C="{{length}} blocos selecionados.",$C="Recortar",tB="Copiar",eB="Limpar Seleção",aB="Este é o modo de desenvolvimento. Visite",rB="para ver a pré-visualização da página",nB={add_block:XS,enter_paste_tailwind_html:_S,click_to_add_block:$S,core:tC,custom_blocks:eC,import:"Importar",html_snippet_description:aC,tailwind_html_snippet:rC,enter_code_snippet:nC,import_html:lC,note_imported_html:iC,dark_mode:oC,tree_view_no_blocks:cC,canvas_empty:hC,no_block_selected_for_styling:sC,no_styling_block_selected:vC,drop_here_message:dC,use_setting:uC,mobile_xs_title:gC,mobile_xs_content:fC,mobile_sm_title:pC,mobile_sm_content:zC,tablet_md_title:MC,tablet_md_content:mC,tablet_lg_title:HC,tablet_lg_content:VC,desktop_xl_title:wC,desktop_xl_content:bC,large_desktop_2xl_title:yC,large_desktop_2xl_content:xC,Breakpoints:LC,clear:OC,clear_canvas_title:SC,clear_canvas_description:CC,cancel:BC,yes:AC,preview:EC,settings:PC,styling:IC,data_provider:kC,remove_provider_confirmation:RC,remove_provider_warning:NC,remove:TC,no_data_providers:jC,learn_more:DC,add_data_providers:FC,select_provider:qC,choose:WC,page_data_providers:KC,view_data:UC,mark_as_global:ZC,global_block_note:GC,global_block_indicator:JC,global_block_category:YC,enter_global_block_name:QC,eg_header_footer:XC,blocks_selected:_C,cut:$C,copy:tB,delete:"Excluir",clear_selection:eB,dev_mode_message:aB,to_see_page_preview:rB,"flex.heading":"Filho Flex","flex.basis":"Base","flex.order":"Ordem","flex.flex":"Flex","flex.grow":"Crescer","flex.shrink":"Encolher","grid.heading":"Filho Grade","grid.col_span":"Abrangência da Coluna","grid.col_start":"Início da Coluna","grid.col_end":"Fim da Coluna","grid.row_span":"Abrangência da Linha","grid.row_start":"Início da Linha","grid.row_end":"Fim da Linha","grid.order":"Ordem","layout.heading":"Layout","layout.width":"Largura","layout.height":"Altura","layout.margin":"Margem","layout.margin_all":"Todas","layout.margin_lr":"Esquerda-Direita","layout.margin_tb":"Topo-Baixo","layout.margin_top":"Topo","layout.margin_right":"Direita","layout.margin_bottom":"Baixo","layout.margin_left":"Esquerda","layout.padding":"Preenchimento","layout.padding_all":"Todos","layout.padding_lr":"Esquerda-Direita","layout.padding_tb":"Topo-Baixo","layout.padding_top":"Topo","layout.padding_right":"Direita","layout.padding_bottom":"Baixo","layout.padding_left":"Esquerda","layout.space_bt":"Espaçamento","layout.space_lr":"Esquerda-Direita","layout.space_tb":"Topo-Baixo","size.heading":"Tamanho","size.min_width_height":"Largura & Altura Mínimas","size.min_width":"Largura Mínima","size.min_height":"Altura Mínima","size.max_width_height":"Largura & Altura Máximas","size.max_width":"Largura Máxima","size.max_height":"Altura Máxima","size.object_options_aspect_ratio":"Opções de Objeto & Proporção","size.aspect":"Proporção","size.fit":"Ajuste","size.position":"Posição","display.heading":"Exibição","display.display":"Exibir","display.flex_options":"Opções de Flex","display.flex_direction":"Direção","display.flex_wrap":"Quebra","display.justify_content":"Justificar","display.align_content":"Conteúdo","display.align_items":"Itens","display.gap":"Espaçamento","display.gap_all":"Todos","display.gap_lr":"Esquerda-Direita","display.gap_tb":"Topo-Baixo","display.grid_options":"Opções de Grade","display.grid_columns":"Colunas","display.grid_rows":"Linhas","display.grid_auto_flow":"Fluxo Automático","display.grid_auto_cols":"Colunas Automáticas","display.grid_auto_rows":"Linhas Automáticas","display.visibility_opacity":"Visibilidade & Opacidade","display.visibility":"Visibilidade","display.opacity":"Opacidade","position.heading":"Posição","position.position":"Posição","position.options":"Opções de Posição","position.direction":"Direção","position.top":"Topo","position.right":"Direita","position.bottom":"Baixo","position.left":"Esquerda","position.inset":"Inserção","position.all":"Todos","position.lr":"Esquerda Direita","position.tb":"Topo Baixo","position.z_index":"Z-Index","position.float_clear":"Flutuar & Limpar","position.float":"Flutuar","position.clear":"Limpar","position.overflow_overscroll":"Transbordo & Rolagem Excedente","position.overflow":"Transbordo","position.overscroll":"Rolagem Excedente","typography.heading":"Tipografia","typography.font":"Fonte","typography.size":"Tamanho","typography.height":"Altura","typography.weight":"Peso","typography.color":"Cor","typography.alignments":"Alinhamentos","typography.align":"Alinhar","typography.valign":"V. Alinhar","typography.spacing_decoration_more":"Espaçamento, Decoração & Mais","typography.spacing":"Espaçamento","typography.decoration":"Decoração","typography.thickness":"Espessura","typography.transform":"Transformação","typography.whitespace_breaks":"Espaçamento & Quebras","typography.whitespace":"Espaçamento","typography.wordbreak":"Quebra de Palavra","background.heading":"Fundo","background.bgcolor":"Cor do Fundo","background.position_size_more":"Posição, Tamanho & Mais","background.attachment":"Anexo","background.clipping":"Recorte","background.origin":"Origem","background.position":"Posição","background.repeat":"Repetir","background.size":"Tamanho","background.gradient":"Gradiente","background.gradient_colors":"Cores do Gradiente","background.from_color":"De","background.via_color":"Via","background.to_color":"Para","border.heading":"Borda & Contorno","border.width":"Largura","border.all":"Todos","border.lr":"Esquerda Direita","border.tb":"Topo Baixo","border.top":"Topo","border.right":"Direita","border.bottom":"Baixo","border.left":"Esquerda","border.corners":"Cantoneiras","border.top_left":"Topo Esquerda","border.top_right":"Topo Direita","border.bottom_right":"Baixo Direita","border.bottom_left":"Baixo Esquerda","border.color":"Cor","border.style":"Estilo","border.divide_options":"Opções de Divisão","border.divide_color":"Cor","border.divide_style":"Estilo","border.outline_styling":"Estilização de Contorno","border.outline_width":"Largura","border.outline_offset":"Offset","border.outline_style":"Estilo","border.ring_options":"Opções de Anel","border.ring_width":"Largura","border.ring_color":"Cor","border.ring_offset_width":"Offset","border.ring_offset_color":"Cor do Offset","effect.heading":"Efeito & Animação","effect.shadow":"Sombra","effect.color":"Cor","effect.cursor":"Cursor","effect.blend_cursor":"Mistura & Cursor","effect.mix_blend":"Mistura","effect.bg_blend":"Mistura de Fundo","effect.transform":"Transformação","effect.origin":"Origem","effect.scale":"Escala","effect.all":"Todos","effect.lr":"Esquerda-Direita","effect.tb":"Topo-Baixo","effect.skew":"Inclinação","effect.translate":"Translação","effect.rotate":"Rotação","effect.animation":"Animação","effect.transition":"Transição","effect.easing":"Facilitando","effect.duration":"Duração","effect.delay":"Atraso","classes.heading":"Classes"},lB="Agregar bloque",iB="(Ingrese o pegue un fragmento HTML de TailwindCSS)",oB="(Haga clic para agregar un bloque a la página)",cB="Núcleo",hB="Bloques Personalizados",sB="Use fragmentos de HTML de bibliotecas de componentes de Tailwind CSS, etc. o simplemente copie y pegue su propio código HTML.",vB="Fragmento HTML de Tailwind:",dB="Ingrese su fragmento de código aquí...",uB="Importar HTML",gB="NOTA: El HTML importado se añadirá al bloque seleccionado actualmente. Si no se selecciona ningún bloque, el HTML se añadirá a la página.",fB="Modo oscuro",pB="Esta página no tiene bloques. Agregue un bloque haciendo clic en el botón +",zB="Esta página está vacía",MB="Seleccione un bloque para editar configuraciones o estilos",mB="Seleccione un bloque de estilo",HB="Suelta tu bloque aquí",VB="Usar configuración",wB="Móvil (XS)",bB="Los estilos establecidos aquí se aplican a todas las pantallas a menos que se editen en un punto de interrupción superior",yB="Paisaje móvil (SM)",xB="Los estilos establecidos aquí se aplican a 640px y superiores, a menos que se editen en un punto de interrupción superior",LB="Tableta (MD)",OB="Los estilos establecidos aquí se aplican a 768px y superiores",SB="Paisaje de la tableta (LG)",CB="Los estilos establecidos aquí se aplican a 1024px y superiores, a menos que se editen en un punto de interrupción superior",BB="Escritorio (XL)",AB="Los estilos establecidos aquí se aplican a 1280px y superiores, a menos que se editen en un punto de interrupción superior",EB="Escritorio Grande (2XL)",PB="Los estilos establecidos aquí se aplican a 1536px y superiores",IB="Puntos de interrupción",kB="Limpiar",RB="¿Limpiar todo el lienzo?",NB="¿Estás seguro de que quieres limpiar todo el lienzo?",TB="Cancelar",jB="Sí",DB="Vista previa",FB="Configuraciones",qB="Estilo",WB="Proveedor de Datos",KB="¿Está seguro de que desea eliminar el proveedor <span class='text-blue-500'>{name}</span>?",UB="Su proveedor de datos se eliminará de esta página y todas las vinculaciones de datos añadidas no serán visibles en los bloques.",ZB="Eliminar",GB="No tiene proveedores de datos registrados. Agregue un proveedor de datos a su proyecto.",JB="Aprender más",YB="Agregar proveedores de datos:",QB="Seleccione un proveedor",XB="Elija",_B="Proveedores de datos de la página:",$B="Ver Datos",tA="Marcar como Global",eA="Nota: Los bloques globales son instancias únicas. Editar bloques globales se reflejará en todas las páginas que usen estos bloques.",aA="Los bloques globales se indican con",rA="Los bloques globales están disponibles en la categoría 'Global'",nA="Ingrese el nombre del bloque global",lA="Ej: Encabezado, Pie de página",iA="{{length}} bloques seleccionados.",oA="Cortar",cA="Copiar",hA="Limpiar Selección",sA="Este es el modo de desarrollo. Visite",vA="para ver la vista previa de la página",dA={add_block:lB,enter_paste_tailwind_html:iB,click_to_add_block:oB,core:cB,custom_blocks:hB,import:"Importar",html_snippet_description:sB,tailwind_html_snippet:vB,enter_code_snippet:dB,import_html:uB,note_imported_html:gB,dark_mode:fB,tree_view_no_blocks:pB,canvas_empty:zB,no_block_selected_for_styling:MB,no_styling_block_selected:mB,drop_here_message:HB,use_setting:VB,mobile_xs_title:wB,mobile_xs_content:bB,mobile_sm_title:yB,mobile_sm_content:xB,tablet_md_title:LB,tablet_md_content:OB,tablet_lg_title:SB,tablet_lg_content:CB,desktop_xl_title:BB,desktop_xl_content:AB,large_desktop_2xl_title:EB,large_desktop_2xl_content:PB,Breakpoints:IB,clear:kB,clear_canvas_title:RB,clear_canvas_description:NB,cancel:TB,yes:jB,preview:DB,settings:FB,styling:qB,data_provider:WB,remove_provider_confirmation:KB,remove_provider_warning:UB,remove:ZB,no_data_providers:GB,learn_more:JB,add_data_providers:YB,select_provider:QB,choose:XB,page_data_providers:_B,view_data:$B,mark_as_global:tA,global_block_note:eA,global_block_indicator:aA,global_block_category:rA,enter_global_block_name:nA,eg_header_footer:lA,blocks_selected:iA,cut:oA,copy:cA,delete:"Eliminar",clear_selection:hA,dev_mode_message:sA,to_see_page_preview:vA,"flex.heading":"Hijo Flex","flex.basis":"Base","flex.order":"Orden","flex.flex":"Flex","flex.grow":"Crecer","flex.shrink":"Encoger","grid.heading":"Hijo Grid","grid.col_span":"Extensión de Columna","grid.col_start":"Inicio de Columna","grid.col_end":"Fin de Columna","grid.row_span":"Extensión de Fila","grid.row_start":"Inicio de Fila","grid.row_end":"Fin de Fila","grid.order":"Orden","layout.heading":"Diseño","layout.width":"Ancho","layout.height":"Altura","layout.margin":"Margen","layout.margin_all":"Todas","layout.margin_lr":"Izquierda-Derecha","layout.margin_tb":"Arriba-Abajo","layout.margin_top":"Arriba","layout.margin_right":"Derecha","layout.margin_bottom":"Abajo","layout.margin_left":"Izquierda","layout.padding":"Relleno","layout.padding_all":"Todos","layout.padding_lr":"Izquierda-Derecha","layout.padding_tb":"Arriba-Abajo","layout.padding_top":"Arriba","layout.padding_right":"Derecha","layout.padding_bottom":"Abajo","layout.padding_left":"Izquierda","layout.space_bt":"Espaciado","layout.space_lr":"Izquierda-Derecha","layout.space_tb":"Arriba-Abajo","size.heading":"Tamaño","size.min_width_height":"Ancho & Altura Mínimos","size.min_width":"Ancho Mínimo","size.min_height":"Altura Mínima","size.max_width_height":"Ancho & Altura Máximos","size.max_width":"Ancho Máximo","size.max_height":"Altura Máxima","size.object_options_aspect_ratio":"Opciones de Objeto & Relación de Aspecto","size.aspect":"Aspecto","size.fit":"Ajustar","size.position":"Posición","display.heading":"Mostrar","display.display":"Mostrar","display.flex_options":"Opciones de Flex","display.flex_direction":"Dirección","display.flex_wrap":"Ajustar","display.justify_content":"Justificar","display.align_content":"Contenido","display.align_items":"Elementos","display.gap":"Espaciado","display.gap_all":"Todos","display.gap_lr":"Izquierda-Derecha","display.gap_tb":"Arriba-Abajo","display.grid_options":"Opciones de Grid","display.grid_columns":"Columnas","display.grid_rows":"Filas","display.grid_auto_flow":"Flujo Automático","display.grid_auto_cols":"Columnas Automáticas","display.grid_auto_rows":"Filas Automáticas","display.visibility_opacity":"Visibilidad & Opacidad","display.visibility":"Visibilidad","display.opacity":"Opacidad","position.heading":"Posición","position.position":"Posición","position.options":"Opciones de Posición","position.direction":"Dirección","position.top":"Arriba","position.right":"Derecha","position.bottom":"Abajo","position.left":"Izquierda","position.inset":"Inserción","position.all":"Todos","position.lr":"Izquierda Derecha","position.tb":"Arriba Abajo","position.z_index":"Índice Z","position.float_clear":"Flotar & Limpiar","position.float":"Flotar","position.clear":"Limpiar","position.overflow_overscroll":"Desbordamiento & Exceso de Desplazamiento","position.overflow":"Desbordamiento","position.overscroll":"Exceso de Desplazamiento","typography.heading":"Tipografía","typography.font":"Fuente","typography.size":"Tamaño","typography.height":"Altura","typography.weight":"Peso","typography.color":"Color","typography.alignments":"Alineamientos","typography.align":"Alinear","typography.valign":"V. Alinear","typography.spacing_decoration_more":"Espaciado, Decoración & Más","typography.spacing":"Espaciado","typography.decoration":"Decoración","typography.thickness":"Grosor","typography.transform":"Transformación","typography.whitespace_breaks":"Espaciado & Saltos","typography.whitespace":"Espaciado","typography.wordbreak":"Corte de Palabra","background.heading":"Fondo","background.bgcolor":"Color del Fondo","background.position_size_more":"Posición, Tamaño & Más","background.attachment":"Adjunto","background.clipping":"Recorte","background.origin":"Origen","background.position":"Posición","background.repeat":"Repetir","background.size":"Tamaño","background.gradient":"Gradiente","background.gradient_colors":"Colores del Gradiente","background.from_color":"De","background.via_color":"A través de","background.to_color":"Hacia","border.heading":"Borde & Contorno","border.width":"Ancho","border.all":"Todos","border.lr":"Izquierda Derecha","border.tb":"Arriba Abajo","border.top":"Arriba","border.right":"Derecha","border.bottom":"Abajo","border.left":"Izquierda","border.corners":"Esquinas","border.top_left":"Arriba Izquierda","border.top_right":"Arriba Derecha","border.bottom_right":"Abajo Derecha","border.bottom_left":"Abajo Izquierda","border.color":"Color","border.style":"Estilo","border.divide_options":"Opciones de División","border.divide_color":"Color","border.divide_style":"Estilo","border.outline_styling":"Estilo de Contorno","border.outline_width":"Ancho","border.outline_offset":"Offset","border.outline_style":"Estilo","border.ring_options":"Opciones de Anillo","border.ring_width":"Ancho","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Color del Offset","effect.heading":"Efecto & Animación","effect.shadow":"Sombra","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Mezcla & Cursor","effect.mix_blend":"Mezcla","effect.bg_blend":"Mezcla de Fondo","effect.transform":"Transformación","effect.origin":"Origen","effect.scale":"Escala","effect.all":"Todos","effect.lr":"Izquierda-Derecha","effect.tb":"Arriba-Abajo","effect.skew":"Sesgar","effect.translate":"Trasladar","effect.rotate":"Rotar","effect.animation":"Animación","effect.transition":"Transición","effect.easing":"Facilitación","effect.duration":"Duración","effect.delay":"Retraso","classes.heading":"Clases"};Vf.use(RO.initReactI18next).init({resources:{en:{translation:QS},"pt-BR":{translation:nB},es:{translation:dA}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});var uA=Object.create,xf=Object.defineProperty,gA=Object.getOwnPropertyDescriptor,h3=Object.getOwnPropertyNames,fA=Object.getPrototypeOf,pA=Object.prototype.hasOwnProperty,zA=(t,e)=>function(){return t&&(e=(0,t[h3(t)[0]])(t=0)),e},g1=(t,e)=>function(){return e||(0,t[h3(t)[0]])((e={exports:{}}).exports,e),e.exports},MA=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of h3(e))!pA.call(t,n)&&n!==a&&xf(t,n,{get:()=>e[n],enumerable:!(r=gA(e,n))||r.enumerable});return t},ra=(t,e,a)=>(a=t!=null?uA(fA(t)):{},MA(e||!t||!t.__esModule?xf(a,"default",{value:t,enumerable:!0}):a,t)),j=zA({"react-shim.js"(){"use strict"}});j();j();var mA=(t,e)=>t.size===e.size&&Array.from(t).every(([a,r])=>Object.is(e.get(a),r)),HA=(t,e)=>t.size===e.size&&Array.from(t).every(([a,r])=>{const n=e.get(a);return n&&r.size===n.size&&Array.from(r).every(l=>n.has(l))});function VA({shouldShowPrivateAtoms:t=!1,...e}={}){const a=o1.useStore(e),[r,n]=d.useState(()=>({values:new Map,dependents:new Map})),l=d.useRef(!0);return l.current=!0,d.useLayoutEffect(()=>{l.current=!1}),d.useEffect(()=>{const i=(a==null?void 0:a.dev_subscribe_store)||(a==null?void 0:a.dev_subscribe_state);if(!i)return;let o=new Map,c=new Map;"dev_subscribe_store"in a||console.warn("[DEPRECATION-WARNING]: Your Jotai version is out-of-date and contains deprecated properties that will be removed soon. Please update to the latest version of Jotai.");const v=s=>{var f,z,M;typeof s!="object"&&console.warn("[DEPRECATION-WARNING]: Your Jotai version is out-of-date and contains deprecated properties that will be removed soon. Please update to the latest version of Jotai.");const u=new Map,g=new Map;for(const m of((f=a.dev_get_mounted_atoms)==null?void 0:f.call(a))||[]){if(!t&&m.debugPrivate)continue;const V=(z=a.dev_get_atom_state)==null?void 0:z.call(a,m);V&&"v"in V&&u.set(m,V.v);const b=(M=a.dev_get_mounted)==null?void 0:M.call(a,m);if(b){let w=b.t;t||(w=new Set(Array.from(w.values()).filter(y=>!y.debugPrivate))),g.set(m,w)}}if(mA(o,u)&&HA(c,g))return;o=u,c=g;const p=()=>n({values:u,dependents:g});l.current?Promise.resolve().then(p):p()},h=i==null?void 0:i(v,2);return v({}),h},[a,t]),r}j();function Lf(t){const e=o1.useStore(t);return d.useCallback(a=>{e.dev_restore_atoms&&e.dev_restore_atoms(a.values)},[e])}j();j();j();j();j();function wA(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function bA(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var yA=function(){function t(a){var r=this;this._insertTag=function(n){var l;r.tags.length===0?r.insertionPoint?l=r.insertionPoint.nextSibling:r.prepend?l=r.container.firstChild:l=r.before:l=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(n,l),r.tags.push(n)},this.isSpeedy=a.speedy===void 0?process.env.NODE_ENV==="production":a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(bA(this));var n=this.tags[this.tags.length-1];if(process.env.NODE_ENV!=="production"){var l=r.charCodeAt(0)===64&&r.charCodeAt(1)===105;l&&this._alreadyInsertedOrderInsensitiveRule&&console.error(`You're attempting to insert the following rule:
1
+ "use strict";var io=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)};var B=(t,e,a)=>(io(t,e,"read from private field"),a?a.call(t):e.get(t)),z1=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},u1=(t,e,a,r)=>(io(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var Cr=(t,e,a,r)=>({set _(n){u1(t,e,n,a)},get _(){return B(t,e,r)}}),C1=(t,e,a)=>(io(t,e,"access private method"),a);const Vf=require("i18next"),RO=require("react-i18next"),e1=require("./jsx-runtime-Z_BpKhVy.cjs"),d=require("react"),o1=require("./index-bfKqnRvZ.cjs"),T2=require("./_commonjsHelpers-wDK0ZLPo.cjs"),wf=require("clsx"),bf=require("react-dom"),NO=require("@radix-ui/react-scroll-area"),pt=require("@floating-ui/react-dom"),TO=require("react-textarea-autosize"),we=require("jotai"),jO=require("flagged"),DO=require("react-dnd"),rt=require("lodash-es"),Dh=require("@minoru/react-dnd-treeview"),FO=require("./Functions-N3yhPYKY.cjs"),d0=require("react-hotkeys-hook"),mi=require("@chaibuilder/runtime"),P4=require("@radix-ui/react-icons"),F2=require("sonner"),qO=require("./html-to-json-2PeOCVey.cjs"),c3=require("lucide-react");require("./web-blocks.cjs");function yf(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const O=yf(d),Pe=yf(NO),WO="Add block",KO="(Enter or paste TailwindCSS HTML snippet)",UO="(Click to add block to page)",ZO="Core",GO="Custom Blocks",JO="Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code.",YO="Tailwind HTML snippet:",QO="Enter your code snippet here...",XO="Import HTML",_O="NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.",$O="Dark mode",tS="This page has no blocks. Add a block by clicking the + button",eS="This page is empty",aS="Please select a block to edit settings or styles",rS="Please select a styling block",nS="Drop your block here",lS="Use setting",iS="Mobile (XS)",oS="Styles set here are applied to all screen unless edited at higher breakpoint",cS="Mobile landscape (SM)",hS="Styles set here are applied at 640px and up unless edited at higher breakpoint",sS="Tablet (MD)",vS="Styles set here are applied at 768px and up",dS="Tablet Landscape (LG)",uS="Styles set here are applied at 1024px and up unless edited at higher breakpoint",gS="Desktop (XL)",fS="Styles set here are applied at 1280px and up unless edited at higher breakpoint",pS="Large Desktop (2XL)",zS="Styles set here are applied at 1536px and up",MS="Breakpoints",mS="Clear",HS="Clear whole canvas?",VS="Are you sure you want to clear the whole canvas?",wS="Cancel",bS="Yes",yS="Preview",xS="Settings",LS="Styling",OS="Data Provider",SS="Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?",CS="Your data provider will be removed from this page and all added data binding will be not visible on blocks.",BS="Remove",AS="You have no data providers registered. Please add a data provider to your project.",ES="Learn more",PS="Add data providers:",IS="Select a provider",kS="Choose",RS="Page data providers:",NS="View Data",TS="Mark as Global",jS="Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.",DS="Global blocks are indicated with",FS="Global blocks are available under 'Global' category",qS="Enter global block name",WS="Eg: Header, Footer",KS="{{length}} blocks selected.",US="Cut",ZS="Copy",GS="Clear Selection",JS="This is dev mode. Visit",YS="to see page preview",QS={add_block:WO,enter_paste_tailwind_html:KO,click_to_add_block:UO,core:ZO,custom_blocks:GO,import:"Import",html_snippet_description:JO,tailwind_html_snippet:YO,enter_code_snippet:QO,import_html:XO,note_imported_html:_O,dark_mode:$O,tree_view_no_blocks:tS,canvas_empty:eS,no_block_selected_for_styling:aS,no_styling_block_selected:rS,drop_here_message:nS,use_setting:lS,mobile_xs_title:iS,mobile_xs_content:oS,mobile_sm_title:cS,mobile_sm_content:hS,tablet_md_title:sS,tablet_md_content:vS,tablet_lg_title:dS,tablet_lg_content:uS,desktop_xl_title:gS,desktop_xl_content:fS,large_desktop_2xl_title:pS,large_desktop_2xl_content:zS,Breakpoints:MS,clear:mS,clear_canvas_title:HS,clear_canvas_description:VS,cancel:wS,yes:bS,preview:yS,settings:xS,styling:LS,data_provider:OS,remove_provider_confirmation:SS,remove_provider_warning:CS,remove:BS,no_data_providers:AS,learn_more:ES,add_data_providers:PS,select_provider:IS,choose:kS,page_data_providers:RS,view_data:NS,mark_as_global:TS,global_block_note:jS,global_block_indicator:DS,global_block_category:FS,enter_global_block_name:qS,eg_header_footer:WS,blocks_selected:KS,cut:US,copy:ZS,delete:"Delete",clear_selection:GS,dev_mode_message:JS,to_see_page_preview:YS,"flex.heading":"Flex Child","flex.basis":"Basis","flex.order":"Order","flex.flex":"Flex","flex.grow":"Grow","flex.shrink":"Shrink","grid.heading":"Grid Child","grid.col_span":"Col Span","grid.col_start":"Col Start","grid.col_end":"Col End","grid.row_span":"Row Span","grid.row_start":"Row Start","grid.row_end":"Row End","grid.order":"Order","layout.heading":"Layout","layout.width":"Width","layout.height":"Height","layout.margin":"Margin","layout.margin_all":"All","layout.margin_lr":"Left-Right","layout.margin_tb":"Top-Bottom","layout.margin_top":"Top","layout.margin_right":"Right","layout.margin_bottom":"Bottom","layout.margin_left":"Left","layout.padding":"Padding","layout.padding_all":"All","layout.padding_lr":"Left-Right","layout.padding_tb":"Top-Bottom","layout.padding_top":"Top","layout.padding_right":"Right","layout.padding_bottom":"Bottom","layout.padding_left":"Left","layout.space_bt":"Space Bt.","layout.space_lr":"Left-Right","layout.space_tb":"Top-Bottom","size.heading":"Size","size.min_width_height":"Min width & height","size.min_width":"Min Width","size.min_height":"Min Height","size.max_width_height":"Max width & height","size.max_width":"Max Width","size.max_height":"Max Height","size.object_options_aspect_ratio":"Object options & aspect ratio","size.aspect":"Aspect","size.fit":"Fit","size.position":"Position","display.heading":"Display","display.display":"Display","display.flex_options":"Flex options","display.flex_direction":"Direction","display.flex_wrap":"Wrap","display.justify_content":"Justify","display.align_content":"Content","display.align_items":"Items","display.gap":"Gap","display.gap_all":"All","display.gap_lr":"Left-Right","display.gap_tb":"Top-Bottom","display.grid_options":"Grid options","display.grid_columns":"Columns","display.grid_rows":"Rows","display.grid_auto_flow":"Auto Flow","display.grid_auto_cols":"Auto Cols","display.grid_auto_rows":"Auto Rows","display.visibility_opacity":"Visibility & Opacity","display.visibility":"Visibility","display.opacity":"Opacity","position.heading":"Position","position.position":"Position","position.options":"Position options","position.direction":"Direction","position.top":"Top","position.right":"Right","position.bottom":"Bottom","position.left":"Left","position.inset":"Inset","position.all":"All","position.lr":"Left Right","position.tb":"Top Bottom","position.z_index":"Z-Index","position.float_clear":"Float & Clear","position.float":"Float","position.clear":"Clear","position.overflow_overscroll":"Overflow & Overscroll","position.overflow":"Overflow","position.overscroll":"Overscroll","typography.heading":"Typography","typography.font":"Font","typography.size":"Size","typography.height":"Height","typography.weight":"Weight","typography.color":"Color","typography.alignments":"Alignments","typography.align":"Align","typography.valign":"V. Align","typography.spacing_decoration_more":"Spacing, decoration & more","typography.spacing":"Spacing","typography.decoration":"Decoration","typography.thickness":"Thickness","typography.transform":"Transform","typography.whitespace_breaks":"White space & breaks","typography.whitespace":"Whitespace","typography.wordbreak":"Wordbreak","background.heading":"Background","background.bgcolor":"Bg. Color","background.position_size_more":"Position, Size & more","background.attachment":"Attachment","background.clipping":"Clipping","background.origin":"Origin","background.position":"Position","background.repeat":"Repeat","background.size":"Size","background.gradient":"Gradient","background.gradient_colors":"Gradient colors","background.from_color":"From","background.via_color":"Via","background.to_color":"To","border.heading":"Border & Outline","border.width":"Width","border.all":"All","border.lr":"Left Right","border.tb":"Top bottom","border.top":"Top","border.right":"Right","border.bottom":"Bottom","border.left":"Left","border.corners":"Corners","border.top_left":"Top Left","border.top_right":"Top right","border.bottom_right":"Bottom right","border.bottom_left":"Bottom left","border.color":"Color","border.style":"Style","border.divide_options":"Divide options","border.divide_color":"Color","border.divide_style":"Style","border.outline_styling":"Outline styling","border.outline_width":"Width","border.outline_offset":"Offset","border.outline_style":"Style","border.ring_options":"Ring options","border.ring_width":"Width","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Off. color","effect.heading":"Effect & Animation","effect.shadow":"Shadow","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Blend & Cursor","effect.mix_blend":"Mix Blend","effect.bg_blend":"Bg. Blend","effect.transform":"Transform","effect.origin":"Origin","effect.scale":"Scale","effect.all":"All","effect.lr":"Left-Right","effect.tb":"Top-Bottom","effect.skew":"Skew","effect.translate":"Translate","effect.rotate":"Rotate","effect.animation":"Animation","effect.transition":"Transition","effect.easing":"Easing","effect.duration":"Duration","effect.delay":"Delay","classes.heading":"Classes"},XS="Adicionar bloco",_S="(Digite ou cole um trecho HTML do TailwindCSS)",$S="(Clique para adicionar bloco à página)",tC="Principal",eC="Personalizados",aC="Use trechos HTML de bibliotecas de componentes Tailwind CSS, etc. ou simplesmente copie e cole seu próprio código HTML.",rC="Trecho HTML do Tailwind:",nC="Digite seu trecho de código aqui...",lC="Importar HTML",iC="NOTA: O HTML importado será adicionado ao bloco atualmente selecionado. Se nenhum bloco for selecionado, o HTML será adicionado à página.",oC="Modo escuro",cC="Esta página não tem blocos. Adicione um bloco clicando no botão +",hC="Esta página está vazia",sC="Selecione um bloco para editar as configurações ou estilos",vC="Selecione um bloco de estilo",dC="Solte seu bloco aqui",uC="Usar configuração",gC="Celular (XS)",fC="Os estilos definidos aqui são aplicados a todas as telas, a menos que editados em um ponto de interrupção mais alto",pC="Celular paisagem (SM)",zC="Os estilos definidos aqui são aplicados a 640px e acima, a menos que editados em um ponto de interrupção mais alto",MC="Tablet (MD)",mC="Os estilos definidos aqui são aplicados a 768px e acima",HC="Paisagem do tablet (LG)",VC="Os estilos definidos aqui são aplicados a 1024px e acima, a menos que editados em um ponto de interrupção mais alto",wC="Desktop (XL)",bC="Os estilos definidos aqui são aplicados a 1280px e acima, a menos que editados em um ponto de interrupção mais alto",yC="Desktop Grande (2XL)",xC="Os estilos definidos aqui são aplicados a 1536px e acima",LC="Pontos de interrupção",OC="Limpar",SC="Limpar toda a tela?",CC="Tem certeza de que deseja limpar toda a tela?",BC="Cancelar",AC="Sim",EC="Visualizar",PC="Configurações",IC="Estilo",kC="Provedor de Dados",RC="Tem certeza de que deseja remover o provedor <span class='text-blue-500'>{name}</span>?",NC="Seu provedor de dados será removido desta página e todas as vinculações de dados adicionadas não serão visíveis nos blocos.",TC="Remover",jC="Você não tem provedores de dados registrados. Adicione um provedor de dados ao seu projeto.",DC="Saiba mais",FC="Adicionar provedores de dados:",qC="Selecione um provedor",WC="Escolher",KC="Provedores de dados da página:",UC="Ver Dados",ZC="Marcar como Global",GC="Nota: Blocos globais são instâncias únicas. Editar blocos globais será refletido em todas as páginas que usam esses blocos.",JC="Blocos globais são indicados com",YC="Blocos globais estão disponíveis na categoria 'Global'",QC="Digite o nome do bloco global",XC="Ex: Cabeçalho, Rodapé",_C="{{length}} blocos selecionados.",$C="Recortar",tB="Copiar",eB="Limpar Seleção",aB="Este é o modo de desenvolvimento. Visite",rB="para ver a pré-visualização da página",nB={add_block:XS,enter_paste_tailwind_html:_S,click_to_add_block:$S,core:tC,custom_blocks:eC,import:"Importar",html_snippet_description:aC,tailwind_html_snippet:rC,enter_code_snippet:nC,import_html:lC,note_imported_html:iC,dark_mode:oC,tree_view_no_blocks:cC,canvas_empty:hC,no_block_selected_for_styling:sC,no_styling_block_selected:vC,drop_here_message:dC,use_setting:uC,mobile_xs_title:gC,mobile_xs_content:fC,mobile_sm_title:pC,mobile_sm_content:zC,tablet_md_title:MC,tablet_md_content:mC,tablet_lg_title:HC,tablet_lg_content:VC,desktop_xl_title:wC,desktop_xl_content:bC,large_desktop_2xl_title:yC,large_desktop_2xl_content:xC,Breakpoints:LC,clear:OC,clear_canvas_title:SC,clear_canvas_description:CC,cancel:BC,yes:AC,preview:EC,settings:PC,styling:IC,data_provider:kC,remove_provider_confirmation:RC,remove_provider_warning:NC,remove:TC,no_data_providers:jC,learn_more:DC,add_data_providers:FC,select_provider:qC,choose:WC,page_data_providers:KC,view_data:UC,mark_as_global:ZC,global_block_note:GC,global_block_indicator:JC,global_block_category:YC,enter_global_block_name:QC,eg_header_footer:XC,blocks_selected:_C,cut:$C,copy:tB,delete:"Excluir",clear_selection:eB,dev_mode_message:aB,to_see_page_preview:rB,"flex.heading":"Filho Flex","flex.basis":"Base","flex.order":"Ordem","flex.flex":"Flex","flex.grow":"Crescer","flex.shrink":"Encolher","grid.heading":"Filho Grade","grid.col_span":"Abrangência da Coluna","grid.col_start":"Início da Coluna","grid.col_end":"Fim da Coluna","grid.row_span":"Abrangência da Linha","grid.row_start":"Início da Linha","grid.row_end":"Fim da Linha","grid.order":"Ordem","layout.heading":"Layout","layout.width":"Largura","layout.height":"Altura","layout.margin":"Margem","layout.margin_all":"Todas","layout.margin_lr":"Esquerda-Direita","layout.margin_tb":"Topo-Baixo","layout.margin_top":"Topo","layout.margin_right":"Direita","layout.margin_bottom":"Baixo","layout.margin_left":"Esquerda","layout.padding":"Preenchimento","layout.padding_all":"Todos","layout.padding_lr":"Esquerda-Direita","layout.padding_tb":"Topo-Baixo","layout.padding_top":"Topo","layout.padding_right":"Direita","layout.padding_bottom":"Baixo","layout.padding_left":"Esquerda","layout.space_bt":"Espaçamento","layout.space_lr":"Esquerda-Direita","layout.space_tb":"Topo-Baixo","size.heading":"Tamanho","size.min_width_height":"Largura & Altura Mínimas","size.min_width":"Largura Mínima","size.min_height":"Altura Mínima","size.max_width_height":"Largura & Altura Máximas","size.max_width":"Largura Máxima","size.max_height":"Altura Máxima","size.object_options_aspect_ratio":"Opções de Objeto & Proporção","size.aspect":"Proporção","size.fit":"Ajuste","size.position":"Posição","display.heading":"Exibição","display.display":"Exibir","display.flex_options":"Opções de Flex","display.flex_direction":"Direção","display.flex_wrap":"Quebra","display.justify_content":"Justificar","display.align_content":"Conteúdo","display.align_items":"Itens","display.gap":"Espaçamento","display.gap_all":"Todos","display.gap_lr":"Esquerda-Direita","display.gap_tb":"Topo-Baixo","display.grid_options":"Opções de Grade","display.grid_columns":"Colunas","display.grid_rows":"Linhas","display.grid_auto_flow":"Fluxo Automático","display.grid_auto_cols":"Colunas Automáticas","display.grid_auto_rows":"Linhas Automáticas","display.visibility_opacity":"Visibilidade & Opacidade","display.visibility":"Visibilidade","display.opacity":"Opacidade","position.heading":"Posição","position.position":"Posição","position.options":"Opções de Posição","position.direction":"Direção","position.top":"Topo","position.right":"Direita","position.bottom":"Baixo","position.left":"Esquerda","position.inset":"Inserção","position.all":"Todos","position.lr":"Esquerda Direita","position.tb":"Topo Baixo","position.z_index":"Z-Index","position.float_clear":"Flutuar & Limpar","position.float":"Flutuar","position.clear":"Limpar","position.overflow_overscroll":"Transbordo & Rolagem Excedente","position.overflow":"Transbordo","position.overscroll":"Rolagem Excedente","typography.heading":"Tipografia","typography.font":"Fonte","typography.size":"Tamanho","typography.height":"Altura","typography.weight":"Peso","typography.color":"Cor","typography.alignments":"Alinhamentos","typography.align":"Alinhar","typography.valign":"V. Alinhar","typography.spacing_decoration_more":"Espaçamento, Decoração & Mais","typography.spacing":"Espaçamento","typography.decoration":"Decoração","typography.thickness":"Espessura","typography.transform":"Transformação","typography.whitespace_breaks":"Espaçamento & Quebras","typography.whitespace":"Espaçamento","typography.wordbreak":"Quebra de Palavra","background.heading":"Fundo","background.bgcolor":"Cor do Fundo","background.position_size_more":"Posição, Tamanho & Mais","background.attachment":"Anexo","background.clipping":"Recorte","background.origin":"Origem","background.position":"Posição","background.repeat":"Repetir","background.size":"Tamanho","background.gradient":"Gradiente","background.gradient_colors":"Cores do Gradiente","background.from_color":"De","background.via_color":"Via","background.to_color":"Para","border.heading":"Borda & Contorno","border.width":"Largura","border.all":"Todos","border.lr":"Esquerda Direita","border.tb":"Topo Baixo","border.top":"Topo","border.right":"Direita","border.bottom":"Baixo","border.left":"Esquerda","border.corners":"Cantoneiras","border.top_left":"Topo Esquerda","border.top_right":"Topo Direita","border.bottom_right":"Baixo Direita","border.bottom_left":"Baixo Esquerda","border.color":"Cor","border.style":"Estilo","border.divide_options":"Opções de Divisão","border.divide_color":"Cor","border.divide_style":"Estilo","border.outline_styling":"Estilização de Contorno","border.outline_width":"Largura","border.outline_offset":"Offset","border.outline_style":"Estilo","border.ring_options":"Opções de Anel","border.ring_width":"Largura","border.ring_color":"Cor","border.ring_offset_width":"Offset","border.ring_offset_color":"Cor do Offset","effect.heading":"Efeito & Animação","effect.shadow":"Sombra","effect.color":"Cor","effect.cursor":"Cursor","effect.blend_cursor":"Mistura & Cursor","effect.mix_blend":"Mistura","effect.bg_blend":"Mistura de Fundo","effect.transform":"Transformação","effect.origin":"Origem","effect.scale":"Escala","effect.all":"Todos","effect.lr":"Esquerda-Direita","effect.tb":"Topo-Baixo","effect.skew":"Inclinação","effect.translate":"Translação","effect.rotate":"Rotação","effect.animation":"Animação","effect.transition":"Transição","effect.easing":"Facilitando","effect.duration":"Duração","effect.delay":"Atraso","classes.heading":"Classes"},lB="Agregar bloque",iB="(Ingrese o pegue un fragmento HTML de TailwindCSS)",oB="(Haga clic para agregar un bloque a la página)",cB="Núcleo",hB="Bloques Personalizados",sB="Use fragmentos de HTML de bibliotecas de componentes de Tailwind CSS, etc. o simplemente copie y pegue su propio código HTML.",vB="Fragmento HTML de Tailwind:",dB="Ingrese su fragmento de código aquí...",uB="Importar HTML",gB="NOTA: El HTML importado se añadirá al bloque seleccionado actualmente. Si no se selecciona ningún bloque, el HTML se añadirá a la página.",fB="Modo oscuro",pB="Esta página no tiene bloques. Agregue un bloque haciendo clic en el botón +",zB="Esta página está vacía",MB="Seleccione un bloque para editar configuraciones o estilos",mB="Seleccione un bloque de estilo",HB="Suelta tu bloque aquí",VB="Usar configuración",wB="Móvil (XS)",bB="Los estilos establecidos aquí se aplican a todas las pantallas a menos que se editen en un punto de interrupción superior",yB="Paisaje móvil (SM)",xB="Los estilos establecidos aquí se aplican a 640px y superiores, a menos que se editen en un punto de interrupción superior",LB="Tableta (MD)",OB="Los estilos establecidos aquí se aplican a 768px y superiores",SB="Paisaje de la tableta (LG)",CB="Los estilos establecidos aquí se aplican a 1024px y superiores, a menos que se editen en un punto de interrupción superior",BB="Escritorio (XL)",AB="Los estilos establecidos aquí se aplican a 1280px y superiores, a menos que se editen en un punto de interrupción superior",EB="Escritorio Grande (2XL)",PB="Los estilos establecidos aquí se aplican a 1536px y superiores",IB="Puntos de interrupción",kB="Limpiar",RB="¿Limpiar todo el lienzo?",NB="¿Estás seguro de que quieres limpiar todo el lienzo?",TB="Cancelar",jB="Sí",DB="Vista previa",FB="Configuraciones",qB="Estilo",WB="Proveedor de Datos",KB="¿Está seguro de que desea eliminar el proveedor <span class='text-blue-500'>{name}</span>?",UB="Su proveedor de datos se eliminará de esta página y todas las vinculaciones de datos añadidas no serán visibles en los bloques.",ZB="Eliminar",GB="No tiene proveedores de datos registrados. Agregue un proveedor de datos a su proyecto.",JB="Aprender más",YB="Agregar proveedores de datos:",QB="Seleccione un proveedor",XB="Elija",_B="Proveedores de datos de la página:",$B="Ver Datos",tA="Marcar como Global",eA="Nota: Los bloques globales son instancias únicas. Editar bloques globales se reflejará en todas las páginas que usen estos bloques.",aA="Los bloques globales se indican con",rA="Los bloques globales están disponibles en la categoría 'Global'",nA="Ingrese el nombre del bloque global",lA="Ej: Encabezado, Pie de página",iA="{{length}} bloques seleccionados.",oA="Cortar",cA="Copiar",hA="Limpiar Selección",sA="Este es el modo de desarrollo. Visite",vA="para ver la vista previa de la página",dA={add_block:lB,enter_paste_tailwind_html:iB,click_to_add_block:oB,core:cB,custom_blocks:hB,import:"Importar",html_snippet_description:sB,tailwind_html_snippet:vB,enter_code_snippet:dB,import_html:uB,note_imported_html:gB,dark_mode:fB,tree_view_no_blocks:pB,canvas_empty:zB,no_block_selected_for_styling:MB,no_styling_block_selected:mB,drop_here_message:HB,use_setting:VB,mobile_xs_title:wB,mobile_xs_content:bB,mobile_sm_title:yB,mobile_sm_content:xB,tablet_md_title:LB,tablet_md_content:OB,tablet_lg_title:SB,tablet_lg_content:CB,desktop_xl_title:BB,desktop_xl_content:AB,large_desktop_2xl_title:EB,large_desktop_2xl_content:PB,Breakpoints:IB,clear:kB,clear_canvas_title:RB,clear_canvas_description:NB,cancel:TB,yes:jB,preview:DB,settings:FB,styling:qB,data_provider:WB,remove_provider_confirmation:KB,remove_provider_warning:UB,remove:ZB,no_data_providers:GB,learn_more:JB,add_data_providers:YB,select_provider:QB,choose:XB,page_data_providers:_B,view_data:$B,mark_as_global:tA,global_block_note:eA,global_block_indicator:aA,global_block_category:rA,enter_global_block_name:nA,eg_header_footer:lA,blocks_selected:iA,cut:oA,copy:cA,delete:"Eliminar",clear_selection:hA,dev_mode_message:sA,to_see_page_preview:vA,"flex.heading":"Hijo Flex","flex.basis":"Base","flex.order":"Orden","flex.flex":"Flex","flex.grow":"Crecer","flex.shrink":"Encoger","grid.heading":"Hijo Grid","grid.col_span":"Extensión de Columna","grid.col_start":"Inicio de Columna","grid.col_end":"Fin de Columna","grid.row_span":"Extensión de Fila","grid.row_start":"Inicio de Fila","grid.row_end":"Fin de Fila","grid.order":"Orden","layout.heading":"Diseño","layout.width":"Ancho","layout.height":"Altura","layout.margin":"Margen","layout.margin_all":"Todas","layout.margin_lr":"Izquierda-Derecha","layout.margin_tb":"Arriba-Abajo","layout.margin_top":"Arriba","layout.margin_right":"Derecha","layout.margin_bottom":"Abajo","layout.margin_left":"Izquierda","layout.padding":"Relleno","layout.padding_all":"Todos","layout.padding_lr":"Izquierda-Derecha","layout.padding_tb":"Arriba-Abajo","layout.padding_top":"Arriba","layout.padding_right":"Derecha","layout.padding_bottom":"Abajo","layout.padding_left":"Izquierda","layout.space_bt":"Espaciado","layout.space_lr":"Izquierda-Derecha","layout.space_tb":"Arriba-Abajo","size.heading":"Tamaño","size.min_width_height":"Ancho & Altura Mínimos","size.min_width":"Ancho Mínimo","size.min_height":"Altura Mínima","size.max_width_height":"Ancho & Altura Máximos","size.max_width":"Ancho Máximo","size.max_height":"Altura Máxima","size.object_options_aspect_ratio":"Opciones de Objeto & Relación de Aspecto","size.aspect":"Aspecto","size.fit":"Ajustar","size.position":"Posición","display.heading":"Mostrar","display.display":"Mostrar","display.flex_options":"Opciones de Flex","display.flex_direction":"Dirección","display.flex_wrap":"Ajustar","display.justify_content":"Justificar","display.align_content":"Contenido","display.align_items":"Elementos","display.gap":"Espaciado","display.gap_all":"Todos","display.gap_lr":"Izquierda-Derecha","display.gap_tb":"Arriba-Abajo","display.grid_options":"Opciones de Grid","display.grid_columns":"Columnas","display.grid_rows":"Filas","display.grid_auto_flow":"Flujo Automático","display.grid_auto_cols":"Columnas Automáticas","display.grid_auto_rows":"Filas Automáticas","display.visibility_opacity":"Visibilidad & Opacidad","display.visibility":"Visibilidad","display.opacity":"Opacidad","position.heading":"Posición","position.position":"Posición","position.options":"Opciones de Posición","position.direction":"Dirección","position.top":"Arriba","position.right":"Derecha","position.bottom":"Abajo","position.left":"Izquierda","position.inset":"Inserción","position.all":"Todos","position.lr":"Izquierda Derecha","position.tb":"Arriba Abajo","position.z_index":"Índice Z","position.float_clear":"Flotar & Limpiar","position.float":"Flotar","position.clear":"Limpiar","position.overflow_overscroll":"Desbordamiento & Exceso de Desplazamiento","position.overflow":"Desbordamiento","position.overscroll":"Exceso de Desplazamiento","typography.heading":"Tipografía","typography.font":"Fuente","typography.size":"Tamaño","typography.height":"Altura","typography.weight":"Peso","typography.color":"Color","typography.alignments":"Alineamientos","typography.align":"Alinear","typography.valign":"V. Alinear","typography.spacing_decoration_more":"Espaciado, Decoración & Más","typography.spacing":"Espaciado","typography.decoration":"Decoración","typography.thickness":"Grosor","typography.transform":"Transformación","typography.whitespace_breaks":"Espaciado & Saltos","typography.whitespace":"Espaciado","typography.wordbreak":"Corte de Palabra","background.heading":"Fondo","background.bgcolor":"Color del Fondo","background.position_size_more":"Posición, Tamaño & Más","background.attachment":"Adjunto","background.clipping":"Recorte","background.origin":"Origen","background.position":"Posición","background.repeat":"Repetir","background.size":"Tamaño","background.gradient":"Gradiente","background.gradient_colors":"Colores del Gradiente","background.from_color":"De","background.via_color":"A través de","background.to_color":"Hacia","border.heading":"Borde & Contorno","border.width":"Ancho","border.all":"Todos","border.lr":"Izquierda Derecha","border.tb":"Arriba Abajo","border.top":"Arriba","border.right":"Derecha","border.bottom":"Abajo","border.left":"Izquierda","border.corners":"Esquinas","border.top_left":"Arriba Izquierda","border.top_right":"Arriba Derecha","border.bottom_right":"Abajo Derecha","border.bottom_left":"Abajo Izquierda","border.color":"Color","border.style":"Estilo","border.divide_options":"Opciones de División","border.divide_color":"Color","border.divide_style":"Estilo","border.outline_styling":"Estilo de Contorno","border.outline_width":"Ancho","border.outline_offset":"Offset","border.outline_style":"Estilo","border.ring_options":"Opciones de Anillo","border.ring_width":"Ancho","border.ring_color":"Color","border.ring_offset_width":"Offset","border.ring_offset_color":"Color del Offset","effect.heading":"Efecto & Animación","effect.shadow":"Sombra","effect.color":"Color","effect.cursor":"Cursor","effect.blend_cursor":"Mezcla & Cursor","effect.mix_blend":"Mezcla","effect.bg_blend":"Mezcla de Fondo","effect.transform":"Transformación","effect.origin":"Origen","effect.scale":"Escala","effect.all":"Todos","effect.lr":"Izquierda-Derecha","effect.tb":"Arriba-Abajo","effect.skew":"Sesgar","effect.translate":"Trasladar","effect.rotate":"Rotar","effect.animation":"Animación","effect.transition":"Transición","effect.easing":"Facilitación","effect.duration":"Duración","effect.delay":"Retraso","classes.heading":"Clases"};Vf.use(RO.initReactI18next).init({resources:{en:{translation:QS},"pt-BR":{translation:nB},es:{translation:dA}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});var uA=Object.create,xf=Object.defineProperty,gA=Object.getOwnPropertyDescriptor,h3=Object.getOwnPropertyNames,fA=Object.getPrototypeOf,pA=Object.prototype.hasOwnProperty,zA=(t,e)=>function(){return t&&(e=(0,t[h3(t)[0]])(t=0)),e},g1=(t,e)=>function(){return e||(0,t[h3(t)[0]])((e={exports:{}}).exports,e),e.exports},MA=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of h3(e))!pA.call(t,n)&&n!==a&&xf(t,n,{get:()=>e[n],enumerable:!(r=gA(e,n))||r.enumerable});return t},ra=(t,e,a)=>(a=t!=null?uA(fA(t)):{},MA(e||!t||!t.__esModule?xf(a,"default",{value:t,enumerable:!0}):a,t)),j=zA({"react-shim.js"(){"use strict"}});j();j();var mA=(t,e)=>t.size===e.size&&Array.from(t).every(([a,r])=>Object.is(e.get(a),r)),HA=(t,e)=>t.size===e.size&&Array.from(t).every(([a,r])=>{const n=e.get(a);return n&&r.size===n.size&&Array.from(r).every(l=>n.has(l))});function VA({shouldShowPrivateAtoms:t=!1,...e}={}){const a=o1.useStore(e),[r,n]=d.useState(()=>({values:new Map,dependents:new Map})),l=d.useRef(!0);return l.current=!0,d.useLayoutEffect(()=>{l.current=!1}),d.useEffect(()=>{const i=(a==null?void 0:a.dev_subscribe_store)||(a==null?void 0:a.dev_subscribe_state);if(!i)return;let o=new Map,c=new Map;"dev_subscribe_store"in a||console.warn("[DEPRECATION-WARNING]: Your Jotai version is out-of-date and contains deprecated properties that will be removed soon. Please update to the latest version of Jotai.");const v=s=>{var f,z,M;typeof s!="object"&&console.warn("[DEPRECATION-WARNING]: Your Jotai version is out-of-date and contains deprecated properties that will be removed soon. Please update to the latest version of Jotai.");const u=new Map,g=new Map;for(const m of((f=a.dev_get_mounted_atoms)==null?void 0:f.call(a))||[]){if(!t&&m.debugPrivate)continue;const V=(z=a.dev_get_atom_state)==null?void 0:z.call(a,m);V&&"v"in V&&u.set(m,V.v);const b=(M=a.dev_get_mounted)==null?void 0:M.call(a,m);if(b){let w=b.t;t||(w=new Set(Array.from(w.values()).filter(y=>!y.debugPrivate))),g.set(m,w)}}if(mA(o,u)&&HA(c,g))return;o=u,c=g;const p=()=>n({values:u,dependents:g});l.current?Promise.resolve().then(p):p()},h=i==null?void 0:i(v,2);return v({}),h},[a,t]),r}j();function Lf(t){const e=o1.useStore(t);return d.useCallback(a=>{e.dev_restore_atoms&&e.dev_restore_atoms(a.values)},[e])}j();j();j();j();j();function wA(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function bA(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var yA=function(){function t(a){var r=this;this._insertTag=function(n){var l;r.tags.length===0?r.insertionPoint?l=r.insertionPoint.nextSibling:r.prepend?l=r.container.firstChild:l=r.before:l=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(n,l),r.tags.push(n)},this.isSpeedy=a.speedy===void 0?process.env.NODE_ENV==="production":a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(bA(this));var n=this.tags[this.tags.length-1];if(process.env.NODE_ENV!=="production"){var l=r.charCodeAt(0)===64&&r.charCodeAt(1)===105;l&&this._alreadyInsertedOrderInsensitiveRule&&console.error(`You're attempting to insert the following rule:
2
2
  `+r+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!l}if(this.isSpeedy){var i=wA(n);try{i.insertRule(r,i.cssRules.length)}catch(o){process.env.NODE_ENV!=="production"&&!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(r)&&console.error('There was a problem inserting the following rule: "'+r+'"',o)}}else n.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0,process.env.NODE_ENV!=="production"&&(this._alreadyInsertedOrderInsensitiveRule=!1)},t}(),Pt="-ms-",I4="-moz-",j1="-webkit-",s3="comm",v3="rule",d3="decl";var xA="@import";var Of="@keyframes";var LA="@layer",OA=Math.abs,Hi=String.fromCharCode,SA=Object.assign;function CA(t,e){return Lt(t,0)^45?(((e<<2^Lt(t,0))<<2^Lt(t,1))<<2^Lt(t,2))<<2^Lt(t,3):0}function Sf(t){return t.trim()}function BA(t,e){return(t=e.exec(t))?t[0]:t}function D1(t,e,a){return t.replace(e,a)}function gc(t,e){return t.indexOf(e)}function Lt(t,e){return t.charCodeAt(e)|0}function F0(t,e,a){return t.slice(e,a)}function k2(t){return t.length}function u3(t){return t.length}function Br(t,e){return e.push(t),t}function AA(t,e){return t.map(e).join("")}var Vi=1,Ya=1,Cf=0,Jt=0,ht=0,r0="";function wi(t,e,a,r,n,l,i){return{value:t,root:e,parent:a,type:r,props:n,children:l,line:Vi,column:Ya,length:i,return:""}}function u0(t,e){return SA(wi("",null,null,"",null,null,0),t,{length:-t.length},e)}function EA(){return ht}function PA(){return ht=Jt>0?Lt(r0,--Jt):0,Ya--,ht===10&&(Ya=1,Vi--),ht}function r2(){return ht=Jt<Cf?Lt(r0,Jt++):0,Ya++,ht===10&&(Ya=1,Vi++),ht}function q2(){return Lt(r0,Jt)}function f4(){return Jt}function vr(t,e){return F0(r0,t,e)}function q0(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Bf(t){return Vi=Ya=1,Cf=k2(r0=t),Jt=0,[]}function Af(t){return r0="",t}function p4(t){return Sf(vr(Jt-1,fc(t===91?t+2:t===40?t+1:t)))}function IA(t){for(;(ht=q2())&&ht<33;)r2();return q0(t)>2||q0(ht)>3?"":" "}function kA(t,e){for(;--e&&r2()&&!(ht<48||ht>102||ht>57&&ht<65||ht>70&&ht<97););return vr(t,f4()+(e<6&&q2()==32&&r2()==32))}function fc(t){for(;r2();)switch(ht){case t:return Jt;case 34:case 39:t!==34&&t!==39&&fc(ht);break;case 40:t===41&&fc(t);break;case 92:r2();break}return Jt}function RA(t,e){for(;r2()&&t+ht!==57;)if(t+ht===84&&q2()===47)break;return"/*"+vr(e,Jt-1)+"*"+Hi(t===47?t:r2())}function NA(t){for(;!q0(q2());)r2();return vr(t,Jt)}function TA(t){return Af(z4("",null,null,null,[""],t=Bf(t),0,[0],t))}function z4(t,e,a,r,n,l,i,o,c){for(var v=0,h=0,s=i,u=0,g=0,p=0,f=1,z=1,M=1,m=0,V="",b=n,w=l,y=r,x=V;z;)switch(p=m,m=r2()){case 40:if(p!=108&&Lt(x,s-1)==58){gc(x+=D1(p4(m),"&","&\f"),"&\f")!=-1&&(M=-1);break}case 34:case 39:case 91:x+=p4(m);break;case 9:case 10:case 13:case 32:x+=IA(p);break;case 92:x+=kA(f4()-1,7);continue;case 47:switch(q2()){case 42:case 47:Br(jA(RA(r2(),f4()),e,a),c);break;default:x+="/"}break;case 123*f:o[v++]=k2(x)*M;case 125*f:case 59:case 0:switch(m){case 0:case 125:z=0;case 59+h:M==-1&&(x=D1(x,/\f/g,"")),g>0&&k2(x)-s&&Br(g>32?qh(x+";",r,a,s-1):qh(D1(x," ","")+";",r,a,s-2),c);break;case 59:x+=";";default:if(Br(y=Fh(x,e,a,v,h,n,o,V,b=[],w=[],s),l),m===123)if(h===0)z4(x,e,y,y,b,l,s,o,w);else switch(u===99&&Lt(x,3)===110?100:u){case 100:case 108:case 109:case 115:z4(t,y,y,r&&Br(Fh(t,y,y,0,0,n,o,V,n,b=[],s),w),n,w,s,o,r?b:w);break;default:z4(x,y,y,y,[""],w,0,o,w)}}v=h=g=0,f=M=1,V=x="",s=i;break;case 58:s=1+k2(x),g=p;default:if(f<1){if(m==123)--f;else if(m==125&&f++==0&&PA()==125)continue}switch(x+=Hi(m),m*f){case 38:M=h>0?1:(x+="\f",-1);break;case 44:o[v++]=(k2(x)-1)*M,M=1;break;case 64:q2()===45&&(x+=p4(r2())),u=q2(),h=s=k2(V=x+=NA(f4())),m++;break;case 45:p===45&&k2(x)==2&&(f=0)}}return l}function Fh(t,e,a,r,n,l,i,o,c,v,h){for(var s=n-1,u=n===0?l:[""],g=u3(u),p=0,f=0,z=0;p<r;++p)for(var M=0,m=F0(t,s+1,s=OA(f=i[p])),V=t;M<g;++M)(V=Sf(f>0?u[M]+" "+m:D1(m,/&\f/g,u[M])))&&(c[z++]=V);return wi(t,e,a,n===0?v3:o,c,v,h)}function jA(t,e,a){return wi(t,e,a,s3,Hi(EA()),F0(t,2,-2),0)}function qh(t,e,a,r){return wi(t,e,a,d3,F0(t,0,r),F0(t,r+1,-1),r)}function Ba(t,e){for(var a="",r=u3(t),n=0;n<r;n++)a+=e(t[n],n,t,e)||"";return a}function DA(t,e,a,r){switch(t.type){case LA:if(t.children.length)break;case xA:case d3:return t.return=t.return||t.value;case s3:return"";case Of:return t.return=t.value+"{"+Ba(t.children,r)+"}";case v3:t.value=t.props.join(",")}return k2(a=Ba(t.children,r))?t.return=t.value+"{"+a+"}":""}function FA(t){var e=u3(t);return function(a,r,n,l){for(var i="",o=0;o<e;o++)i+=t[o](a,r,n,l)||"";return i}}function qA(t){return function(e){e.root||(e=e.return)&&t(e)}}var Wh=function(e){var a=new WeakMap;return function(r){if(a.has(r))return a.get(r);var n=e(r);return a.set(r,n),n}};function WA(t){var e=Object.create(null);return function(a){return e[a]===void 0&&(e[a]=t(a)),e[a]}}var KA=function(e,a,r){for(var n=0,l=0;n=l,l=q2(),n===38&&l===12&&(a[r]=1),!q0(l);)r2();return vr(e,Jt)},UA=function(e,a){var r=-1,n=44;do switch(q0(n)){case 0:n===38&&q2()===12&&(a[r]=1),e[r]+=KA(Jt-1,a,r);break;case 2:e[r]+=p4(n);break;case 4:if(n===44){e[++r]=q2()===58?"&\f":"",a[r]=e[r].length;break}default:e[r]+=Hi(n)}while(n=r2());return e},ZA=function(e,a){return Af(UA(Bf(e),a))},Kh=new WeakMap,GA=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var a=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&a.charCodeAt(0)!==58&&!Kh.get(r))&&!n){Kh.set(e,!0);for(var l=[],i=ZA(a,l),o=r.props,c=0,v=0;c<i.length;c++)for(var h=0;h<o.length;h++,v++)e.props[v]=l[c]?i[c].replace(/&\f/g,o[h]):o[h]+" "+i[c]}}},JA=function(e){if(e.type==="decl"){var a=e.value;a.charCodeAt(0)===108&&a.charCodeAt(2)===98&&(e.return="",e.value="")}},YA="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",QA=function(e){return e.type==="comm"&&e.children.indexOf(YA)>-1},XA=function(e){return function(a,r,n){if(!(a.type!=="rule"||e.compat)){var l=a.value.match(/(:first|:nth|:nth-last)-child/g);if(l){for(var i=!!a.parent,o=i?a.parent.children:n,c=o.length-1;c>=0;c--){var v=o[c];if(v.line<a.line)break;if(v.column<a.column){if(QA(v))return;break}}l.forEach(function(h){console.error('The pseudo class "'+h+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+h.split("-child")[0]+'-of-type".')})}}}},Ef=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},_A=function(e,a){for(var r=e-1;r>=0;r--)if(!Ef(a[r]))return!0;return!1},Uh=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},$A=function(e,a,r){Ef(e)&&(e.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Uh(e)):_A(a,r)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Uh(e)))};function Pf(t,e){switch(CA(t,e)){case 5103:return j1+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j1+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return j1+t+I4+t+Pt+t+t;case 6828:case 4268:return j1+t+Pt+t+t;case 6165:return j1+t+Pt+"flex-"+t+t;case 5187:return j1+t+D1(t,/(\w+).+(:[^]+)/,j1+"box-$1$2"+Pt+"flex-$1$2")+t;case 5443:return j1+t+Pt+"flex-item-"+D1(t,/flex-|-self/,"")+t;case 4675:return j1+t+Pt+"flex-line-pack"+D1(t,/align-content|flex-|-self/,"")+t;case 5548:return j1+t+Pt+D1(t,"shrink","negative")+t;case 5292:return j1+t+Pt+D1(t,"basis","preferred-size")+t;case 6060:return j1+"box-"+D1(t,"-grow","")+j1+t+Pt+D1(t,"grow","positive")+t;case 4554:return j1+D1(t,/([^-])(transform)/g,"$1"+j1+"$2")+t;case 6187:return D1(D1(D1(t,/(zoom-|grab)/,j1+"$1"),/(image-set)/,j1+"$1"),t,"")+t;case 5495:case 3959:return D1(t,/(image-set\([^]*)/,j1+"$1$`$1");case 4968:return D1(D1(t,/(.+:)(flex-)?(.*)/,j1+"box-pack:$3"+Pt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j1+t+t;case 4095:case 3583:case 4068:case 2532:return D1(t,/(.+)-inline(.+)/,j1+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(k2(t)-1-e>6)switch(Lt(t,e+1)){case 109:if(Lt(t,e+4)!==45)break;case 102:return D1(t,/(.+:)(.+)-([^]+)/,"$1"+j1+"$2-$3$1"+I4+(Lt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~gc(t,"stretch")?Pf(D1(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Lt(t,e+1)!==115)break;case 6444:switch(Lt(t,k2(t)-3-(~gc(t,"!important")&&10))){case 107:return D1(t,":",":"+j1)+t;case 101:return D1(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j1+(Lt(t,14)===45?"inline-":"")+"box$3$1"+j1+"$2$3$1"+Pt+"$2box$3")+t}break;case 5936:switch(Lt(t,e+11)){case 114:return j1+t+Pt+D1(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return j1+t+Pt+D1(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return j1+t+Pt+D1(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return j1+t+Pt+t+t}return t}var tE=function(e,a,r,n){if(e.length>-1&&!e.return)switch(e.type){case d3:e.return=Pf(e.value,e.length);break;case Of:return Ba([u0(e,{value:D1(e.value,"@","@"+j1)})],n);case v3:if(e.length)return AA(e.props,function(l){switch(BA(l,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ba([u0(e,{props:[D1(l,/:(read-\w+)/,":"+I4+"$1")]})],n);case"::placeholder":return Ba([u0(e,{props:[D1(l,/:(plac\w+)/,":"+j1+"input-$1")]}),u0(e,{props:[D1(l,/:(plac\w+)/,":"+I4+"$1")]}),u0(e,{props:[D1(l,/:(plac\w+)/,Pt+"input-$1")]})],n)}return""})}},eE=[tE],bi=function(e){var a=e.key;if(process.env.NODE_ENV!=="production"&&!a)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
3
3
  If multiple caches share the same key they might "fight" for each other's style elements.`);if(a==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(f){var z=f.getAttribute("data-emotion");z.indexOf(" ")!==-1&&(document.head.appendChild(f),f.setAttribute("data-s",""))})}var n=e.stylisPlugins||eE;if(process.env.NODE_ENV!=="production"&&/[^a-z-]/.test(a))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+a+'" was passed');var l={},i,o=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+a+' "]'),function(f){for(var z=f.getAttribute("data-emotion").split(" "),M=1;M<z.length;M++)l[z[M]]=!0;o.push(f)});var c,v=[GA,JA];process.env.NODE_ENV!=="production"&&v.push(XA({get compat(){return p.compat}}),$A);{var h,s=[DA,process.env.NODE_ENV!=="production"?function(f){f.root||(f.return?h.insert(f.return):f.value&&f.type!==s3&&h.insert(f.value+"{}"))}:qA(function(f){h.insert(f)})],u=FA(v.concat(n,s)),g=function(z){return Ba(TA(z),u)};c=function(z,M,m,V){h=m,process.env.NODE_ENV!=="production"&&M.map!==void 0&&(h={insert:function(w){m.insert(w+M.map)}}),g(z?z+"{"+M.styles+"}":M.styles),V&&(p.inserted[M.name]=!0)}}var p={key:a,sheet:new yA({key:a,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:l,registered:{},insert:c};return p.sheet.hydrate(o),p};function pc(){return pc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},pc.apply(this,arguments)}var k4={exports:{}},F1={};/** @license React v16.13.1
4
4
  * react-is.production.min.js
@@ -203,4 +203,4 @@ object-assign/index.js:
203
203
  (c) Sindre Sorhus
204
204
  @license MIT
205
205
  *)
206
- */j();var f91=process.env.NODE_ENV!=="production"?g91:()=>null;function p91(){return new URLSearchParams(window.location.search).has("dnd")}function z91(){return new URLSearchParams(window.location.search).has("undo")}const M91={dnd:p91(),newUndo:!z91()};class uO extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e1.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[e1.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),e1.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const m91=()=>{const[t,e]=o1.usePreviewMode(),a=o1.useBuilderProp("previewComponent");return e1.jsxRuntimeExports.jsxs("div",{className:FO.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[e1.jsxRuntimeExports.jsx(o1.Button,{size:"sm",className:"absolute right-0 top-0 m-4",onClick:()=>e(!1),children:"Close Preview"}),e1.jsxRuntimeExports.jsx("div",{children:a?e1.jsxRuntimeExports.jsx(d.Suspense,{fallback:e1.jsxRuntimeExports.jsx(o1.Skeleton,{className:"h-96 w-full"}),children:d.createElement(a)}):null})]})},H91=()=>{const[t,e]=o1.useSelectedBlockIds(),a=o1.useRemoveBlocks(),r=o1.useDuplicateBlocks(),{undo:n,redo:l}=o1.useUndoManager();d0.useHotkeys("esc",()=>e([]),{},[e]),d0.useHotkeys("ctrl+d,command+d",()=>r(t),{preventDefault:!0},[t,r]),d0.useHotkeys("ctrl+z,command+z",()=>n(),{},[n]),d0.useHotkeys("ctrl+y,command+y",()=>l(),{},[l]),d0.useHotkeys("del, backspace",i=>{i.preventDefault(),a(t)},{},[t,a])},V91=(t,e)=>{const a=[];let r=rt.find(t,{_id:e}),n=rt.get(r,"_parent","");for(;rt.isString(n)&&!rt.isEmpty(n);)a.push(r==null?void 0:r._parent),r=rt.find(t,{_id:n}),n=r==null?void 0:r._parent;return rt.flatten(a)},gO=we.atom([]),w91=()=>{const[t]=o1.useSelectedBlockIds(),e=we.useAtomValue(o1.presentBlocksAtom),[,a]=we.useAtom(gO);d.useEffect(()=>{let r=[];const n=rt.first(t);rt.isString(n)&&(r=[n,...V91(e,n)]),a(r)},[t,e,a])},b91=()=>we.useAtomValue(gO),fO=()=>we.useAtom(o1.chaiExternalDataAtom),y91=()=>d.useMemo(()=>mi.getChaiDataProviders(),[]),x91=({children:t})=>{const[,e]=fO(),[a]=o1.usePageDataProviders(),r=y91();return d.useEffect(()=>(e({}),rt.each(a,n=>{const l=rt.find(r,{providerKey:n.providerKey});if(l){const i=(l==null?void 0:l.mockFn)||(l==null?void 0:l.dataFn);i&&i(n.args).then(o=>e(c=>({...c,[n.providerKey]:o})))}}),()=>{rt.each(a,n=>{e(l=>(delete l[n.providerKey],l))})}),[r,a,e]),e1.jsxRuntimeExports.jsx(e1.jsxRuntimeExports.Fragment,{children:t})},L91=d.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-91l1CjYv.cjs"))),O91=d.lazy(()=>Promise.resolve().then(()=>require("./Topbar-rEO5z57t.cjs"))),S91=d.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-h4lA4oqP.cjs"))),C91=d.lazy(()=>Promise.resolve().then(()=>require("./Settings-NuDNH2dR.cjs"))),B91=()=>{const[t]=we.useAtom(o1.pageSyncStateAtom),e=n=>{o1.isDevelopment()||n.preventDefault()};H91(),w91(),d.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=o1.useBuilderProp("editable",!0),r=o1.useBuilderProp("nonEditableComponent",null);return e1.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:e1.jsxRuntimeExports.jsxs(o1.TooltipProvider,{children:[e1.jsxRuntimeExports.jsxs("div",{onContextMenu:e,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[e1.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(O91,{})})}),e1.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:d.createElement(r)})}),e1.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(L91,{})})}),e1.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(S91,{})})}),e1.jsxRuntimeExports.jsx("div",{className:"flex h-[90%] w-[280px] min-w-[280px] border-l border-border pb-10",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(C91,{})})})]})]}),e1.jsxRuntimeExports.jsx(m91,{})]})})},$g=we.getDefaultStore(),A91=()=>e1.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:e1.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:e1.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[e1.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),e1.jsxRuntimeExports.jsx("br",{}),e1.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),e1.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})}),E91=t=>{const{dndOptions:e={backend:Dh.MultiBackend}}=t,[,a]=o1.useBlocksStore(),[,r]=o1.useBrandingOptions(),n=o1.useBuilderReset();return d.useEffect(()=>{$g.set(o1.chaiBuilderPropsAtom,rt.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),d.useEffect(()=>{$g.set(o1.dataProvidersAtom,t.dataProviders||[])},[t.dataProviders]),d.useEffect(()=>{a(mi.syncBlocksWithDefaults(t.blocks||[])),n()},[t.blocks]),d.useEffect(()=>{Vf.changeLanguage(t.locale||"en")},[t.locale]),d.useEffect(()=>{r(t.brandingOptions)},[t.brandingOptions,r]),e1.jsxRuntimeExports.jsx(DO.DndProvider,{...e,options:Dh.getBackendOptions(),children:e1.jsxRuntimeExports.jsx(B91,{})})},pO=t=>e1.jsxRuntimeExports.jsxs(uO,{children:[e1.jsxRuntimeExports.jsxs(jO.FlagsProvider,{features:M91,children:[e1.jsxRuntimeExports.jsx(f91,{}),e1.jsxRuntimeExports.jsx(A91,{}),e1.jsxRuntimeExports.jsx(E91,{...t})]}),e1.jsxRuntimeExports.jsx(o1.Toaster,{})]});var h0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},a0=typeof window>"u"||"Deno"in window;function g2(){}function P91(t,e){return typeof t=="function"?t(e):t}function Yc(t){return typeof t=="number"&&t>=0&&t!==1/0}function zO(t,e){return Math.max(t+(e||0)-Date.now(),0)}function tf(t,e){const{type:a="all",exact:r,fetchStatus:n,predicate:l,queryKey:i,stale:o}=t;if(i){if(r){if(e.queryHash!==Rh(i,e.options))return!1}else if(!_0(e.queryKey,i))return!1}if(a!=="all"){const c=e.isActive();if(a==="active"&&!c||a==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||typeof n<"u"&&n!==e.state.fetchStatus||l&&!l(e))}function ef(t,e){const{exact:a,status:r,predicate:n,mutationKey:l}=t;if(l){if(!e.options.mutationKey)return!1;if(a){if(X0(e.options.mutationKey)!==X0(l))return!1}else if(!_0(e.options.mutationKey,l))return!1}return!(r&&e.state.status!==r||n&&!n(e))}function Rh(t,e){return((e==null?void 0:e.queryKeyHashFn)||X0)(t)}function X0(t){return JSON.stringify(t,(e,a)=>Qc(a)?Object.keys(a).sort().reduce((r,n)=>(r[n]=a[n],r),{}):a)}function _0(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(a=>!_0(t[a],e[a])):!1}function MO(t,e){if(t===e)return t;const a=af(t)&&af(e);if(a||Qc(t)&&Qc(e)){const r=a?t.length:Object.keys(t).length,n=a?e:Object.keys(e),l=n.length,i=a?[]:{};let o=0;for(let c=0;c<l;c++){const v=a?c:n[c];i[v]=MO(t[v],e[v]),i[v]===t[v]&&o++}return r===l&&o===r?t:i}return e}function fi(t,e){if(t&&!e||e&&!t)return!1;for(const a in t)if(t[a]!==e[a])return!1;return!0}function af(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Qc(t){if(!rf(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const a=e.prototype;return!(!rf(a)||!a.hasOwnProperty("isPrototypeOf"))}function rf(t){return Object.prototype.toString.call(t)==="[object Object]"}function mO(t){return new Promise(e=>{setTimeout(e,t)})}function nf(t){mO(0).then(t)}function Xc(t,e,a){return typeof a.structuralSharing=="function"?a.structuralSharing(t,e):a.structuralSharing!==!1?MO(t,e):e}function I91(t,e,a=0){const r=[...t,e];return a&&r.length>a?r.slice(1):r}function k91(t,e,a=0){const r=[e,...t];return a&&r.length>a?r.slice(0,-1):r}var Fe,he,Pa,vf,R91=(vf=class extends h0{constructor(){super();z1(this,Fe,void 0);z1(this,he,void 0);z1(this,Pa,void 0);u1(this,Pa,e=>{if(!a0&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){B(this,he)||this.setEventListener(B(this,Pa))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,he))==null||e.call(this),u1(this,he,void 0))}setEventListener(e){var a;u1(this,Pa,e),(a=B(this,he))==null||a.call(this),u1(this,he,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,Fe)!==e&&(u1(this,Fe,e),this.onFocus())}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){var e;return typeof B(this,Fe)=="boolean"?B(this,Fe):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Fe=new WeakMap,he=new WeakMap,Pa=new WeakMap,vf),pi=new R91,Ia,se,ka,df,N91=(df=class extends h0{constructor(){super();z1(this,Ia,!0);z1(this,se,void 0);z1(this,ka,void 0);u1(this,ka,e=>{if(!a0&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}})}onSubscribe(){B(this,se)||this.setEventListener(B(this,ka))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,se))==null||e.call(this),u1(this,se,void 0))}setEventListener(e){var a;u1(this,ka,e),(a=B(this,se))==null||a.call(this),u1(this,se,e(this.setOnline.bind(this)))}setOnline(e){B(this,Ia)!==e&&(u1(this,Ia,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return B(this,Ia)}},Ia=new WeakMap,se=new WeakMap,ka=new WeakMap,df),zi=new N91;function T91(t){return Math.min(1e3*2**t,3e4)}function ro(t){return(t??"online")==="online"?zi.isOnline():!0}var HO=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function uc(t){return t instanceof HO}function VO(t){let e=!1,a=0,r=!1,n,l,i;const o=new Promise((z,M)=>{l=z,i=M}),c=z=>{var M;r||(g(new HO(z)),(M=t.abort)==null||M.call(t))},v=()=>{e=!0},h=()=>{e=!1},s=()=>!pi.isFocused()||t.networkMode!=="always"&&!zi.isOnline(),u=z=>{var M;r||(r=!0,(M=t.onSuccess)==null||M.call(t,z),n==null||n(),l(z))},g=z=>{var M;r||(r=!0,(M=t.onError)==null||M.call(t,z),n==null||n(),i(z))},p=()=>new Promise(z=>{var M;n=m=>{const V=r||!s();return V&&z(m),V},(M=t.onPause)==null||M.call(t)}).then(()=>{var z;n=void 0,r||(z=t.onContinue)==null||z.call(t)}),f=()=>{if(r)return;let z;try{z=t.fn()}catch(M){z=Promise.reject(M)}Promise.resolve(z).then(u).catch(M=>{var y;if(r)return;const m=t.retry??(a0?0:3),V=t.retryDelay??T91,b=typeof V=="function"?V(a,M):V,w=m===!0||typeof m=="number"&&a<m||typeof m=="function"&&m(a,M);if(e||!w){g(M);return}a++,(y=t.onFail)==null||y.call(t,a,M),mO(b).then(()=>{if(s())return p()}).then(()=>{e?g(M):f()})})};return ro(t.networkMode)?f():p().then(f),{promise:o,cancel:c,continue:()=>(n==null?void 0:n())?o:Promise.resolve(),cancelRetry:v,continueRetry:h}}function j91(){let t=[],e=0,a=h=>{h()},r=h=>{h()};const n=h=>{let s;e++;try{s=h()}finally{e--,e||o()}return s},l=h=>{e?t.push(h):nf(()=>{a(h)})},i=h=>(...s)=>{l(()=>{h(...s)})},o=()=>{const h=t;t=[],h.length&&nf(()=>{r(()=>{h.forEach(s=>{a(s)})})})};return{batch:n,batchCalls:i,schedule:l,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{r=h}}}var zt=j91(),qe,uf,wO=(uf=class{constructor(){z1(this,qe,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yc(this.gcTime)&&u1(this,qe,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(a0?1/0:5*60*1e3))}clearGcTimeout(){B(this,qe)&&(clearTimeout(B(this,qe)),u1(this,qe,void 0))}},qe=new WeakMap,uf),Ra,Na,s2,ve,v2,yt,$0,We,Ta,A4,V2,G2,gf,D91=(gf=class extends wO{constructor(e){super();z1(this,Ta);z1(this,V2);z1(this,Ra,void 0);z1(this,Na,void 0);z1(this,s2,void 0);z1(this,ve,void 0);z1(this,v2,void 0);z1(this,yt,void 0);z1(this,$0,void 0);z1(this,We,void 0);u1(this,We,!1),u1(this,$0,e.defaultOptions),C1(this,Ta,A4).call(this,e.options),u1(this,yt,[]),u1(this,s2,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,u1(this,Ra,e.state||F91(this.options)),this.state=B(this,Ra),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!B(this,yt).length&&this.state.fetchStatus==="idle"&&B(this,s2).remove(this)}setData(e,a){const r=Xc(this.state.data,e,this.options);return C1(this,V2,G2).call(this,{data:r,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),r}setState(e,a){C1(this,V2,G2).call(this,{type:"setState",state:e,setStateOptions:a})}cancel(e){var r;const a=B(this,ve);return(r=B(this,v2))==null||r.cancel(e),a?a.then(g2).catch(g2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,Ra))}isActive(){return B(this,yt).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||B(this,yt).some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!zO(this.state.dataUpdatedAt,e)}onFocus(){var a;const e=B(this,yt).find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(a=B(this,v2))==null||a.continue()}onOnline(){var a;const e=B(this,yt).find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(a=B(this,v2))==null||a.continue()}addObserver(e){B(this,yt).includes(e)||(B(this,yt).push(e),this.clearGcTimeout(),B(this,s2).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){B(this,yt).includes(e)&&(u1(this,yt,B(this,yt).filter(a=>a!==e)),B(this,yt).length||(B(this,v2)&&(B(this,We)?B(this,v2).cancel({revert:!0}):B(this,v2).cancelRetry()),this.scheduleGc()),B(this,s2).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return B(this,yt).length}invalidate(){this.state.isInvalidated||C1(this,V2,G2).call(this,{type:"invalidate"})}fetch(e,a){var v,h,s,u;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(B(this,ve))return(v=B(this,v2))==null||v.continueRetry(),B(this,ve)}if(e&&C1(this,Ta,A4).call(this,e),!this.options.queryFn){const g=B(this,yt).find(p=>p.options.queryFn);g&&C1(this,Ta,A4).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n={queryKey:this.queryKey,meta:this.meta},l=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(u1(this,We,!0),r.signal)})};l(n);const i=()=>this.options.queryFn?(u1(this,We,!1),this.options.persister?this.options.persister(this.options.queryFn,n,this):this.options.queryFn(n)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),o={fetchOptions:a,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};l(o),(h=this.options.behavior)==null||h.onFetch(o,this),u1(this,Na,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((s=o.fetchOptions)==null?void 0:s.meta))&&C1(this,V2,G2).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const c=g=>{var p,f,z,M;uc(g)&&g.silent||C1(this,V2,G2).call(this,{type:"error",error:g}),uc(g)||((f=(p=B(this,s2).config).onError)==null||f.call(p,g,this),(M=(z=B(this,s2).config).onSettled)==null||M.call(z,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return u1(this,v2,VO({fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var p,f,z,M;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(f=(p=B(this,s2).config).onSuccess)==null||f.call(p,g,this),(M=(z=B(this,s2).config).onSettled)==null||M.call(z,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(g,p)=>{C1(this,V2,G2).call(this,{type:"failed",failureCount:g,error:p})},onPause:()=>{C1(this,V2,G2).call(this,{type:"pause"})},onContinue:()=>{C1(this,V2,G2).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode})),u1(this,ve,B(this,v2).promise),B(this,ve)}},Ra=new WeakMap,Na=new WeakMap,s2=new WeakMap,ve=new WeakMap,v2=new WeakMap,yt=new WeakMap,$0=new WeakMap,We=new WeakMap,Ta=new WeakSet,A4=function(e){this.options={...B(this,$0),...e},this.updateGcTime(this.options.gcTime)},V2=new WeakSet,G2=function(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:ro(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return uc(n)&&n.revert&&B(this,Na)?{...B(this,Na),fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),zt.batch(()=>{B(this,yt).forEach(r=>{r.onQueryUpdate()}),B(this,s2).notify({query:this,type:"updated",action:e})})},gf);function F91(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,a=typeof e<"u",r=a?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:a?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var A2,ff,q91=(ff=class extends h0{constructor(e={}){super();z1(this,A2,void 0);this.config=e,u1(this,A2,new Map)}build(e,a,r){const n=a.queryKey,l=a.queryHash??Rh(n,a);let i=this.get(l);return i||(i=new D91({cache:this,queryKey:n,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){B(this,A2).has(e.queryHash)||(B(this,A2).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=B(this,A2).get(e.queryHash);a&&(e.destroy(),a===e&&B(this,A2).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,A2).get(e)}getAll(){return[...B(this,A2).values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>tf(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>tf(e,r)):a}notify(e){zt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},A2=new WeakMap,ff),E2,tr,$t,ja,P2,ce,pf,W91=(pf=class extends wO{constructor(e){super();z1(this,P2);z1(this,E2,void 0);z1(this,tr,void 0);z1(this,$t,void 0);z1(this,ja,void 0);this.mutationId=e.mutationId,u1(this,tr,e.defaultOptions),u1(this,$t,e.mutationCache),u1(this,E2,[]),this.state=e.state||bO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...B(this,tr),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,E2).includes(e)||(B(this,E2).push(e),this.clearGcTimeout(),B(this,$t).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){u1(this,E2,B(this,E2).filter(a=>a!==e)),this.scheduleGc(),B(this,$t).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,E2).length||(this.state.status==="pending"?this.scheduleGc():B(this,$t).remove(this))}continue(){var e;return((e=B(this,ja))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var n,l,i,o,c,v,h,s,u,g,p,f,z,M,m,V,b,w,y,x;const a=()=>(u1(this,ja,VO({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,S)=>{C1(this,P2,ce).call(this,{type:"failed",failureCount:L,error:S})},onPause:()=>{C1(this,P2,ce).call(this,{type:"pause"})},onContinue:()=>{C1(this,P2,ce).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),B(this,ja).promise),r=this.state.status==="pending";try{if(!r){C1(this,P2,ce).call(this,{type:"pending",variables:e}),await((l=(n=B(this,$t).config).onMutate)==null?void 0:l.call(n,e,this));const S=await((o=(i=this.options).onMutate)==null?void 0:o.call(i,e));S!==this.state.context&&C1(this,P2,ce).call(this,{type:"pending",context:S,variables:e})}const L=await a();return await((v=(c=B(this,$t).config).onSuccess)==null?void 0:v.call(c,L,e,this.state.context,this)),await((s=(h=this.options).onSuccess)==null?void 0:s.call(h,L,e,this.state.context)),await((g=(u=B(this,$t).config).onSettled)==null?void 0:g.call(u,L,null,this.state.variables,this.state.context,this)),await((f=(p=this.options).onSettled)==null?void 0:f.call(p,L,null,e,this.state.context)),C1(this,P2,ce).call(this,{type:"success",data:L}),L}catch(L){try{throw await((M=(z=B(this,$t).config).onError)==null?void 0:M.call(z,L,e,this.state.context,this)),await((V=(m=this.options).onError)==null?void 0:V.call(m,L,e,this.state.context)),await((w=(b=B(this,$t).config).onSettled)==null?void 0:w.call(b,void 0,L,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,void 0,L,e,this.state.context)),L}finally{C1(this,P2,ce).call(this,{type:"error",error:L})}}}},E2=new WeakMap,tr=new WeakMap,$t=new WeakMap,ja=new WeakMap,P2=new WeakSet,ce=function(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!ro(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),zt.batch(()=>{B(this,E2).forEach(r=>{r.onMutationUpdate(e)}),B(this,$t).notify({mutation:this,type:"updated",action:e})})},pf);function bO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var d2,er,Ke,zf,K91=(zf=class extends h0{constructor(e={}){super();z1(this,d2,void 0);z1(this,er,void 0);z1(this,Ke,void 0);this.config=e,u1(this,d2,[]),u1(this,er,0)}build(e,a,r){const n=new W91({mutationCache:this,mutationId:++Cr(this,er)._,options:e.defaultMutationOptions(a),state:r});return this.add(n),n}add(e){B(this,d2).push(e),this.notify({type:"added",mutation:e})}remove(e){u1(this,d2,B(this,d2).filter(a=>a!==e)),this.notify({type:"removed",mutation:e})}clear(){zt.batch(()=>{B(this,d2).forEach(e=>{this.remove(e)})})}getAll(){return B(this,d2)}find(e){const a={exact:!0,...e};return B(this,d2).find(r=>ef(a,r))}findAll(e={}){return B(this,d2).filter(a=>ef(e,a))}notify(e){zt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){return u1(this,Ke,(B(this,Ke)??Promise.resolve()).then(()=>{const e=B(this,d2).filter(a=>a.state.isPaused);return zt.batch(()=>e.reduce((a,r)=>a.then(()=>r.continue().catch(g2)),Promise.resolve()))}).then(()=>{u1(this,Ke,void 0)})),B(this,Ke)}},d2=new WeakMap,er=new WeakMap,Ke=new WeakMap,zf);function U91(t){return{onFetch:(e,a)=>{const r=async()=>{var p,f,z,M,m;const n=e.options,l=(z=(f=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:f.fetchMore)==null?void 0:z.direction,i=((M=e.state.data)==null?void 0:M.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[],c={pages:[],pageParams:[]};let v=!1;const h=V=>{Object.defineProperty(V,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},s=e.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),u=async(V,b,w)=>{if(v)return Promise.reject();if(b==null&&V.pages.length)return Promise.resolve(V);const y={queryKey:e.queryKey,pageParam:b,direction:w?"backward":"forward",meta:e.options.meta};h(y);const x=await s(y),{maxPages:L}=e.options,S=w?k91:I91;return{pages:S(V.pages,x,L),pageParams:S(V.pageParams,b,L)}};let g;if(l&&i.length){const V=l==="backward",b=V?Z91:lf,w={pages:i,pageParams:o},y=b(n,w);g=await u(w,y,V)}else{g=await u(c,o[0]??n.initialPageParam);const V=t??i.length;for(let b=1;b<V;b++){const w=lf(n,g);g=await u(g,w)}}return g};e.options.persister?e.fetchFn=()=>{var n,l;return(l=(n=e.options).persister)==null?void 0:l.call(n,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},a)}:e.fetchFn=r}}}function lf(t,{pages:e,pageParams:a}){const r=e.length-1;return t.getNextPageParam(e[r],e,a[r],a)}function Z91(t,{pages:e,pageParams:a}){var r;return(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,a[0],a)}var ft,de,ue,Da,Fa,ge,qa,Wa,Mf,G91=(Mf=class{constructor(t={}){z1(this,ft,void 0);z1(this,de,void 0);z1(this,ue,void 0);z1(this,Da,void 0);z1(this,Fa,void 0);z1(this,ge,void 0);z1(this,qa,void 0);z1(this,Wa,void 0);u1(this,ft,t.queryCache||new q91),u1(this,de,t.mutationCache||new K91),u1(this,ue,t.defaultOptions||{}),u1(this,Da,new Map),u1(this,Fa,new Map),u1(this,ge,0)}mount(){Cr(this,ge)._++,B(this,ge)===1&&(u1(this,qa,pi.subscribe(()=>{pi.isFocused()&&(this.resumePausedMutations(),B(this,ft).onFocus())})),u1(this,Wa,zi.subscribe(()=>{zi.isOnline()&&(this.resumePausedMutations(),B(this,ft).onOnline())})))}unmount(){var t,e;Cr(this,ge)._--,B(this,ge)===0&&((t=B(this,qa))==null||t.call(this),u1(this,qa,void 0),(e=B(this,Wa))==null||e.call(this),u1(this,Wa,void 0))}isFetching(t){return B(this,ft).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,de).findAll({...t,status:"pending"}).length}getQueryData(t){var e;return(e=B(this,ft).find({queryKey:t}))==null?void 0:e.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);return e!==void 0?Promise.resolve(e):this.fetchQuery(t)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:e,state:a})=>{const r=a.data;return[e,r]})}setQueryData(t,e,a){const r=B(this,ft).find({queryKey:t}),n=r==null?void 0:r.state.data,l=P91(e,n);if(typeof l>"u")return;const i=this.defaultQueryOptions({queryKey:t});return B(this,ft).build(this,i).setData(l,{...a,manual:!0})}setQueriesData(t,e,a){return zt.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,a)]))}getQueryState(t){var e;return(e=B(this,ft).find({queryKey:t}))==null?void 0:e.state}removeQueries(t){const e=B(this,ft);zt.batch(()=>{e.findAll(t).forEach(a=>{e.remove(a)})})}resetQueries(t,e){const a=B(this,ft),r={type:"active",...t};return zt.batch(()=>(a.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const a={revert:!0,...e},r=zt.batch(()=>B(this,ft).findAll(t).map(n=>n.cancel(a)));return Promise.all(r).then(g2).catch(g2)}invalidateQueries(t={},e={}){return zt.batch(()=>{if(B(this,ft).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const a={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(a,e)})}refetchQueries(t={},e){const a={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=zt.batch(()=>B(this,ft).findAll(t).filter(n=>!n.isDisabled()).map(n=>{let l=n.fetch(void 0,a);return a.throwOnError||(l=l.catch(g2)),n.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(g2)}fetchQuery(t){const e=this.defaultQueryOptions(t);typeof e.retry>"u"&&(e.retry=!1);const a=B(this,ft).build(this,e);return a.isStaleByTime(e.staleTime)?a.fetch(e):Promise.resolve(a.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(g2).catch(g2)}fetchInfiniteQuery(t){return t.behavior=U91(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(g2).catch(g2)}resumePausedMutations(){return B(this,de).resumePausedMutations()}getQueryCache(){return B(this,ft)}getMutationCache(){return B(this,de)}getDefaultOptions(){return B(this,ue)}setDefaultOptions(t){u1(this,ue,t)}setQueryDefaults(t,e){B(this,Da).set(X0(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,Da).values()];let a={};return e.forEach(r=>{_0(t,r.queryKey)&&(a={...a,...r.defaultOptions})}),a}setMutationDefaults(t,e){B(this,Fa).set(X0(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,Fa).values()];let a={};return e.forEach(r=>{_0(t,r.mutationKey)&&(a={...a,...r.defaultOptions})}),a}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const e={...B(this,ue).queries,...(t==null?void 0:t.queryKey)&&this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Rh(e.queryKey,e)),typeof e.refetchOnReconnect>"u"&&(e.refetchOnReconnect=e.networkMode!=="always"),typeof e.throwOnError>"u"&&(e.throwOnError=!!e.suspense),typeof e.networkMode>"u"&&e.persister&&(e.networkMode="offlineFirst"),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,ue).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,ft).clear(),B(this,de).clear()}},ft=new WeakMap,de=new WeakMap,ue=new WeakMap,Da=new WeakMap,Fa=new WeakMap,ge=new WeakMap,qa=new WeakMap,Wa=new WeakMap,Mf),Ut,Q1,Ka,It,Ue,Ua,I2,ar,Za,Ga,Ze,Ge,fe,Je,Ye,R0,rr,_c,nr,$c,lr,t3,ir,e3,or,a3,cr,r3,hr,n3,Mi,yO,mf,J91=(mf=class extends h0{constructor(e,a){super();z1(this,Ye);z1(this,rr);z1(this,nr);z1(this,lr);z1(this,ir);z1(this,or);z1(this,cr);z1(this,hr);z1(this,Mi);z1(this,Ut,void 0);z1(this,Q1,void 0);z1(this,Ka,void 0);z1(this,It,void 0);z1(this,Ue,void 0);z1(this,Ua,void 0);z1(this,I2,void 0);z1(this,ar,void 0);z1(this,Za,void 0);z1(this,Ga,void 0);z1(this,Ze,void 0);z1(this,Ge,void 0);z1(this,fe,void 0);z1(this,Je,void 0);u1(this,Q1,void 0),u1(this,Ka,void 0),u1(this,It,void 0),u1(this,Je,new Set),u1(this,Ut,e),this.options=a,u1(this,I2,null),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,Q1).addObserver(this),of(B(this,Q1),this.options)?C1(this,Ye,R0).call(this):this.updateResult(),C1(this,ir,e3).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l3(B(this,Q1),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l3(B(this,Q1),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,C1(this,or,a3).call(this),C1(this,cr,r3).call(this),B(this,Q1).removeObserver(this)}setOptions(e,a){const r=this.options,n=B(this,Q1);if(this.options=B(this,Ut).defaultQueryOptions(e),fi(r,this.options)||B(this,Ut).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,Q1),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),C1(this,hr,n3).call(this);const l=this.hasListeners();l&&cf(B(this,Q1),n,this.options,r)&&C1(this,Ye,R0).call(this),this.updateResult(a),l&&(B(this,Q1)!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&C1(this,rr,_c).call(this);const i=C1(this,nr,$c).call(this);l&&(B(this,Q1)!==n||this.options.enabled!==r.enabled||i!==B(this,fe))&&C1(this,lr,t3).call(this,i)}getOptimisticResult(e){const a=B(this,Ut).getQueryCache().build(B(this,Ut),e),r=this.createResult(a,e);return Q91(this,r)&&(u1(this,It,r),u1(this,Ua,this.options),u1(this,Ue,B(this,Q1).state)),r}getCurrentResult(){return B(this,It)}trackResult(e){const a={};return Object.keys(e).forEach(r=>{Object.defineProperty(a,r,{configurable:!1,enumerable:!0,get:()=>(B(this,Je).add(r),e[r])})}),a}getCurrentQuery(){return B(this,Q1)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=B(this,Ut).defaultQueryOptions(e),r=B(this,Ut).getQueryCache().build(B(this,Ut),a);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,a))}fetch(e){return C1(this,Ye,R0).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,It)))}createResult(e,a){var y;const r=B(this,Q1),n=this.options,l=B(this,It),i=B(this,Ue),o=B(this,Ua),v=e!==r?e.state:B(this,Ka),{state:h}=e;let{error:s,errorUpdatedAt:u,fetchStatus:g,status:p}=h,f=!1,z;if(a._optimisticResults){const x=this.hasListeners(),L=!x&&of(e,a),S=x&&cf(e,r,a,n);(L||S)&&(g=ro(e.options.networkMode)?"fetching":"paused",h.dataUpdatedAt||(p="pending")),a._optimisticResults==="isRestoring"&&(g="idle")}if(a.select&&typeof h.data<"u")if(l&&h.data===(i==null?void 0:i.data)&&a.select===B(this,ar))z=B(this,Za);else try{u1(this,ar,a.select),z=a.select(h.data),z=Xc(l==null?void 0:l.data,z,a),u1(this,Za,z),u1(this,I2,null)}catch(x){u1(this,I2,x)}else z=h.data;if(typeof a.placeholderData<"u"&&typeof z>"u"&&p==="pending"){let x;if(l!=null&&l.isPlaceholderData&&a.placeholderData===(o==null?void 0:o.placeholderData))x=l.data;else if(x=typeof a.placeholderData=="function"?a.placeholderData((y=B(this,Ga))==null?void 0:y.state.data,B(this,Ga)):a.placeholderData,a.select&&typeof x<"u")try{x=a.select(x),u1(this,I2,null)}catch(L){u1(this,I2,L)}typeof x<"u"&&(p="success",z=Xc(l==null?void 0:l.data,x,a),f=!0)}B(this,I2)&&(s=B(this,I2),z=B(this,Za),u=Date.now(),p="error");const M=g==="fetching",m=p==="pending",V=p==="error",b=m&&M;return{status:p,fetchStatus:g,isPending:m,isSuccess:p==="success",isError:V,isInitialLoading:b,isLoading:b,data:z,dataUpdatedAt:h.dataUpdatedAt,error:s,errorUpdatedAt:u,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>v.dataUpdateCount||h.errorUpdateCount>v.errorUpdateCount,isFetching:M,isRefetching:M&&!m,isLoadingError:V&&h.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:f,isRefetchError:V&&h.dataUpdatedAt!==0,isStale:Nh(e,a),refetch:this.refetch}}updateResult(e){const a=B(this,It),r=this.createResult(B(this,Q1),this.options);if(u1(this,Ue,B(this,Q1).state),u1(this,Ua,this.options),B(this,Ue).data!==void 0&&u1(this,Ga,B(this,Q1)),fi(r,a))return;u1(this,It,r);const n={},l=()=>{if(!a)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!B(this,Je).size)return!0;const c=new Set(o??B(this,Je));return this.options.throwOnError&&c.add("error"),Object.keys(B(this,It)).some(v=>{const h=v;return B(this,It)[h]!==a[h]&&c.has(h)})};(e==null?void 0:e.listeners)!==!1&&l()&&(n.listeners=!0),C1(this,Mi,yO).call(this,{...n,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&C1(this,ir,e3).call(this)}},Ut=new WeakMap,Q1=new WeakMap,Ka=new WeakMap,It=new WeakMap,Ue=new WeakMap,Ua=new WeakMap,I2=new WeakMap,ar=new WeakMap,Za=new WeakMap,Ga=new WeakMap,Ze=new WeakMap,Ge=new WeakMap,fe=new WeakMap,Je=new WeakMap,Ye=new WeakSet,R0=function(e){C1(this,hr,n3).call(this);let a=B(this,Q1).fetch(this.options,e);return e!=null&&e.throwOnError||(a=a.catch(g2)),a},rr=new WeakSet,_c=function(){if(C1(this,or,a3).call(this),a0||B(this,It).isStale||!Yc(this.options.staleTime))return;const a=zO(B(this,It).dataUpdatedAt,this.options.staleTime)+1;u1(this,Ze,setTimeout(()=>{B(this,It).isStale||this.updateResult()},a))},nr=new WeakSet,$c=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,Q1)):this.options.refetchInterval)??!1},lr=new WeakSet,t3=function(e){C1(this,cr,r3).call(this),u1(this,fe,e),!(a0||this.options.enabled===!1||!Yc(B(this,fe))||B(this,fe)===0)&&u1(this,Ge,setInterval(()=>{(this.options.refetchIntervalInBackground||pi.isFocused())&&C1(this,Ye,R0).call(this)},B(this,fe)))},ir=new WeakSet,e3=function(){C1(this,rr,_c).call(this),C1(this,lr,t3).call(this,C1(this,nr,$c).call(this))},or=new WeakSet,a3=function(){B(this,Ze)&&(clearTimeout(B(this,Ze)),u1(this,Ze,void 0))},cr=new WeakSet,r3=function(){B(this,Ge)&&(clearInterval(B(this,Ge)),u1(this,Ge,void 0))},hr=new WeakSet,n3=function(){const e=B(this,Ut).getQueryCache().build(B(this,Ut),this.options);if(e===B(this,Q1))return;const a=B(this,Q1);u1(this,Q1,e),u1(this,Ka,e.state),this.hasListeners()&&(a==null||a.removeObserver(this),e.addObserver(this))},Mi=new WeakSet,yO=function(e){zt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(B(this,It))}),B(this,Ut).getQueryCache().notify({query:B(this,Q1),type:"observerResultsUpdated"})})},mf);function Y91(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function of(t,e){return Y91(t,e)||t.state.dataUpdatedAt>0&&l3(t,e,e.refetchOnMount)}function l3(t,e,a){if(e.enabled!==!1){const r=typeof a=="function"?a(t):a;return r==="always"||r!==!1&&Nh(t,e)}return!1}function cf(t,e,a,r){return a.enabled!==!1&&(t!==e||r.enabled===!1)&&(!a.suspense||t.state.status!=="error")&&Nh(t,a)}function Nh(t,e){return t.isStaleByTime(e.staleTime)}function Q91(t,e){return!fi(t.getCurrentResult(),e)}var pe,Dt,u2,Y2,Ja,E4,sr,i3,Hf,X91=(Hf=class extends h0{constructor(a,r){super();z1(this,Ja);z1(this,sr);z1(this,pe,void 0);z1(this,Dt,void 0);z1(this,u2,void 0);z1(this,Y2,void 0);u1(this,Dt,void 0),u1(this,pe,a),this.setOptions(r),this.bindMethods(),C1(this,Ja,E4).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var n;const r=this.options;this.options=B(this,pe).defaultMutationOptions(a),fi(r,this.options)||B(this,pe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:B(this,u2),observer:this}),(n=B(this,u2))==null||n.setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=B(this,u2))==null||a.removeObserver(this)}onMutationUpdate(a){C1(this,Ja,E4).call(this),C1(this,sr,i3).call(this,a)}getCurrentResult(){return B(this,Dt)}reset(){u1(this,u2,void 0),C1(this,Ja,E4).call(this),C1(this,sr,i3).call(this)}mutate(a,r){var n;return u1(this,Y2,r),(n=B(this,u2))==null||n.removeObserver(this),u1(this,u2,B(this,pe).getMutationCache().build(B(this,pe),this.options)),B(this,u2).addObserver(this),B(this,u2).execute(a)}},pe=new WeakMap,Dt=new WeakMap,u2=new WeakMap,Y2=new WeakMap,Ja=new WeakSet,E4=function(){var r;const a=((r=B(this,u2))==null?void 0:r.state)??bO();u1(this,Dt,{...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset})},sr=new WeakSet,i3=function(a){zt.batch(()=>{var r,n,l,i,o,c,v,h;B(this,Y2)&&this.hasListeners()&&((a==null?void 0:a.type)==="success"?((n=(r=B(this,Y2)).onSuccess)==null||n.call(r,a.data,B(this,Dt).variables,B(this,Dt).context),(i=(l=B(this,Y2)).onSettled)==null||i.call(l,a.data,null,B(this,Dt).variables,B(this,Dt).context)):(a==null?void 0:a.type)==="error"&&((c=(o=B(this,Y2)).onError)==null||c.call(o,a.error,B(this,Dt).variables,B(this,Dt).context),(h=(v=B(this,Y2)).onSettled)==null||h.call(v,void 0,a.error,B(this,Dt).variables,B(this,Dt).context))),this.listeners.forEach(s=>{s(B(this,Dt))})})},Hf);var xO=O.createContext(void 0),n2=t=>{const e=O.useContext(xO);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},_91=({client:t,children:e})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),O.createElement(xO.Provider,{value:t},e)),LO=O.createContext(!1),$91=()=>O.useContext(LO),v61=LO.Provider;function tv1(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ev1=O.createContext(tv1()),av1=()=>O.useContext(ev1);function OO(t,e){return typeof t=="function"?t(...e):!!t}var rv1=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},nv1=t=>{O.useEffect(()=>{t.clearReset()},[t])},lv1=({result:t,errorResetBoundary:e,throwOnError:a,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&OO(a,[t.error,r]);var iv1=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)};var ov1=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,cv1=(t,e,a)=>e.fetchOptimistic(t).catch(()=>{a.clearReset()});function hv1(t,e,a){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=n2(a),n=$91(),l=av1(),i=r.defaultQueryOptions(t);i._optimisticResults=n?"isRestoring":"optimistic",iv1(i),rv1(i,l),nv1(l);const[o]=O.useState(()=>new e(r,i)),c=o.getOptimisticResult(i);if(O.useSyncExternalStore(O.useCallback(v=>{const h=n?()=>{}:o.subscribe(zt.batchCalls(v));return o.updateResult(),h},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),O.useEffect(()=>{o.setOptions(i,{listeners:!1})},[i,o]),ov1(i,c))throw cv1(i,o,l);if(lv1({result:c,errorResetBoundary:l,throwOnError:i.throwOnError,query:o.getCurrentQuery()}))throw c.error;return i.notifyOnChangeProps?c:o.trackResult(c)}function Lr(t,e){return hv1(t,J91,e)}function S2(t,e){const a=n2(e),[r]=O.useState(()=>new X91(a,t));O.useEffect(()=>{r.setOptions(t)},[r,t]);const n=O.useSyncExternalStore(O.useCallback(i=>r.subscribe(zt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=O.useCallback((i,o)=>{r.mutate(i,o).catch(sv1)},[r]);if(n.error&&OO(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:l,mutateAsync:n.mutate}}function sv1(){}function Nt(){return n2().getQueryData(["apiBaseUrl"])||"/api/chaibuilder"}const Oe=()=>{const{data:t,refetch:e}=Lr({queryKey:["currentPage"],queryFn:()=>localStorage.getItem("currentPage")||""});return[t,a=>{a&&(localStorage.setItem("currentPage",a||""),e())}]};let hf="";const Or=()=>(hf=localStorage.getItem("__chai_at"),hf);function vv1(t){const e={method:"GET",headers:{"x-chai-access-token":Or()}};return fetch(t,e)}function dv1(t,e){const a={method:"POST",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}function uv1(t,e){const a={method:"PUT",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}function gv1(t,e){const a={method:"DELETE",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}const l2={get:vv1,post:dv1,put:uv1,delete:gv1},Th=()=>{const[t,e]=Oe(),a=Nt();return Lr({queryKey:["project"],queryFn:async()=>{const{data:r}=await l2.get(`${a}/project`).then(n=>n.json());if(!t&&r){const n=localStorage.getItem("currentPage");e(n||(r==null?void 0:r.homepage))}return r}})},jh=()=>{const t=Nt();return Lr({queryKey:["pages"],queryFn:async()=>{const{data:e}=await l2.get(`${t}/pages`).then(a=>a.json());return e||[]}})},SO=()=>{const[t]=Oe(),e=Nt();return Lr({queryKey:["page_data",t],queryFn:async()=>{const{data:a}=await l2.get(`${e}/page?uuid=${t}`).then(r=>r.json());return a},enabled:!!t,staleTime:3e3})},o3=()=>e1.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-gray-200",children:e1.jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full w-full justify-center items-center",children:[e1.jsxRuntimeExports.jsxs("div",{className:"flex flex-row gap-2",children:[e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]"})]}),e1.jsxRuntimeExports.jsx("div",{className:"text-gray-700 font-thin",children:"Loading Builder..."})]})}),CO=(t="Project updated successfully.")=>{const e=n2(),a=Nt();return S2({mutationFn:async r=>await l2.put(`${a}/project`,r).then(n=>n.json()),onSuccess:()=>{e.invalidateQueries({queryKey:["project"]}),F2.toast.success(t)}})},BO=()=>{const[t]=["SAVED"],[e,a]=Oe(),r=o1.useBuilderReset();return n=>t!=="SAVED"?(F2.toast.error("You have unsaved changes. Please save before changing the page."),!1):e===n.uuid?!1:(r(),setTimeout(()=>{a(n.uuid)},100),!0)},fv1=()=>{const t=n2(),e=BO(),a=Nt();return S2({mutationFn:async r=>l2.post(`${a}/pages`,r).then(n=>n.json()),onSuccess:r=>{t.invalidateQueries({queryKey:["pages"]}),e({uuid:r.uuid,slug:r.slug}),F2.toast.success("Page added successfully.")}})},AO=()=>{const t=Nt(),[e]=Oe(),a=n2();return S2({mutationFn:async r=>l2.put(`${t}/page`,r).then(n=>n.json()),onSuccess:async r=>{var n;if(r.result==="error"&&((n=r.error)==null?void 0:n.code)=="PAGE_LOCKED"){a.invalidateQueries({queryKey:["page_data",e]});return}F2.toast.success("Page saved successfully.")}})},pv1=()=>{const t=Nt(),{data:e}=jh(),[a]=Oe(),{data:r}=Th(),n=n2();return S2({mutationFn:async()=>{const l=e.find(i=>i.uuid===a).slug;return await l2.post(`${t}/publish`,{slug:l,uuid:a,isHomepage:(r==null?void 0:r.homepage)===a}).then(i=>i.json())},onSuccess:async l=>{var i;if(l.result==="error"&&((i=l.error)==null?void 0:i.code)=="PAGE_LOCKED"){n.invalidateQueries({queryKey:["page_data",a]});return}F2.toast.success("Page published successfully.",{position:"bottom-right",duration:2e3})}})},zv1=()=>{const t=n2(),e=Nt();return S2({mutationFn:async a=>l2.delete(`${e}/page`,a).then(r=>r.json()),onSuccess:()=>{F2.toast.success("Page deleted successfully."),t.invalidateQueries({queryKey:["pages"]})}})},Mv1=()=>{const t=n2(),e=Nt();return S2({mutationFn:async a=>l2.post(`${e}/take-control`,{uuid:a}).then(r=>r.json()),onSuccess:(a,r)=>{t.invalidateQueries({queryKey:["page_data",r]})}})},mv1=()=>{const t=Nt();return S2({mutationFn:async()=>{const{data:e}=await l2.get(`${t}/library`).then(a=>a.json());return rt.sortBy(rt.filter(e,a=>!rt.has(a,"hidden")),"group")}})},Hv1=()=>{const t=Nt();return S2({mutationFn:async e=>{if(!e||!e.uuid)return[];try{const{data:a}=await l2.get(`${t}/block?uuid=${e.uuid}&format=${e.format}`).then(async r=>e.format==="html"?qO.getBlocksFromHTML(await r.text()):await r.json());return rt.set(a,"0._name",rt.capitalize(e.group)),a||[]}catch{return[]}}})},Vv1=()=>{const t=Nt();return S2({mutationFn:async e=>{const a=new FormData;a.append("file",e);const{data:r}=await fetch(`${t}/upload`,{method:"POST",headers:{"x-chai-access-token":Or()},body:a}).then(n=>n.json());return r}})};var EO={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},sf=d.createContext&&d.createContext(EO),Ve=function(){return Ve=Object.assign||function(t){for(var e,a=1,r=arguments.length;a<r;a++){e=arguments[a];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},Ve.apply(this,arguments)},wv1=function(t,e){var a={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(a[r[n]]=t[r[n]]);return a};function PO(t){return t&&t.map(function(e,a){return d.createElement(e.tag,Ve({key:a},e.attr),PO(e.child))})}function IO(t){return function(e){return d.createElement(bv1,Ve({attr:Ve({},t.attr)},e),PO(t.child))}}function bv1(t){var e=function(a){var r=t.attr,n=t.size,l=t.title,i=wv1(t,["attr","size","title"]),o=n||a.size||"1em",c;return a.className&&(c=a.className),t.className&&(c=(c?c+" ":"")+t.className),d.createElement("svg",Ve({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,r,i,{className:c,style:Ve(Ve({color:t.color||a.color},a.style),t.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),l&&d.createElement("title",null,l),t.children)};return sf!==void 0?d.createElement(sf.Consumer,null,function(a){return e(a)}):e(EO)}function kO(t){return IO({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}}]})(t)}function yv1(t){return IO({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}}]})(t)}const xv1=()=>{const{mutate:t,isPending:e}=Mv1(),[a]=Oe(),{data:r}=SO(),n=rt.get(r,"lockedBy.name",""),l=rt.get(r,"lockedBy.email","");return e1.jsxRuntimeExports.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl",children:[e1.jsxRuntimeExports.jsxs("h2",{className:"text-2xl font-bold",children:["Page is ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"locked"})]}),e1.jsxRuntimeExports.jsxs("div",{className:"text-gray-500 dark:text-gray-400 font-light",children:["This page is currently being edited by ",e1.jsxRuntimeExports.jsx("br",{}),e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm",children:[e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md",children:[e1.jsxRuntimeExports.jsx(yv1,{className:"w-4 h-4 text-gray-500"})," ",n]}),e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md lowercase",children:[e1.jsxRuntimeExports.jsx(kO,{className:"w-4 h-4 text-gray-500"})," ",l]})]}),e1.jsxRuntimeExports.jsxs("div",{className:"pt-4",children:["If you take control, ",n," will be ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"restricted"})," from making additional edits."]})]}),e1.jsxRuntimeExports.jsx(o1.Button,{disabled:e,onClick:()=>t(a),className:`w-36 ${e?"bg-transparent shadow-none hover:bg-transparent":""}`,children:e?e1.jsxRuntimeExports.jsx(c3.Loader,{className:"text-sm animate-spin text-gray-500"}):"Take Over"})]})},Lv1=()=>{const t=Nt(),e=n2();return S2({mutationFn:async a=>{const r=await fetch(`${t}/login`,{method:"POST",body:JSON.stringify(a)});if(r.ok)return await r.json();throw r.status===401?new Error("Invalid login credentials"):new Error("Invalid")},onSuccess:a=>{const{data:r}=a;if(!r.accessToken){F2.toast.error("Something went wrong. Please try again.",{position:"top-center"});return}localStorage.setItem("__chai_at",r.accessToken),localStorage.setItem("__chai_ur",JSON.stringify(rt.omit(r,["accessToken"]))),e.invalidateQueries({queryKey:["verify"]}),F2.toast.success("Logged in successfully.")},onError:()=>{F2.toast.error("Invalid login credentials. Please try again.",{position:"top-center"})}})},Ov1=()=>{const t=Nt();return Lr({queryKey:["verify"],queryFn:async()=>{const e=await l2.get(`${t}/verify`);return e.ok?(await e.json()).result==="success"?{valid:!0}:(localStorage.removeItem("__chai_at"),{valid:!1}):(localStorage.removeItem("__chai_at"),{valid:!0})}})},Sv1=()=>{const t=Nt(),e=n2();return S2({mutationFn:async()=>{const{result:a}=await l2.post(`${t}/logout`).then(r=>r.json());if(a==="success")return localStorage.clear(),e.invalidateQueries({queryKey:["verify"]}),{logout:!0};throw new Error("Invalid session")}})},Cv1=({children:t})=>{const e=Sv1();return e1.jsxRuntimeExports.jsxs(o1.AlertDialog,{children:[e1.jsxRuntimeExports.jsx(o1.AlertDialogTrigger,{asChild:!0,children:t}),e1.jsxRuntimeExports.jsxs(o1.AlertDialogContent,{children:[e1.jsxRuntimeExports.jsxs(o1.AlertDialogHeader,{children:[e1.jsxRuntimeExports.jsxs(o1.AlertDialogTitle,{children:["Are you sure, you want to ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"Sign Out"}),"?"]}),e1.jsxRuntimeExports.jsx(o1.AlertDialogDescription,{children:"Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information"})]}),e1.jsxRuntimeExports.jsxs(o1.AlertDialogFooter,{children:[e1.jsxRuntimeExports.jsx(o1.AlertDialogCancel,{disabled:e.isPending,children:"Cancel"}),e1.jsxRuntimeExports.jsxs("button",{disabled:e.isPending,onClick:()=>e.mutate(),className:"rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",children:[e.isPending&&e1.jsxRuntimeExports.jsx(c3.Loader2,{className:"animate-spin w-5 h-5"}),"Sign Out"]})]})]})]})},Bv1=()=>e1.jsxRuntimeExports.jsx(Cv1,{children:e1.jsxRuntimeExports.jsx("button",{className:"border-gray-200 rounded-md p-2 mb-2 border",children:e1.jsxRuntimeExports.jsx(c3.LogOutIcon,{className:"w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300"})})}),Av1=d.lazy(()=>Promise.resolve().then(()=>require("./PagesPanel-iZLDBwXQ.cjs"))),Ev1=d.lazy(()=>Promise.resolve().then(()=>require("./ProjectPanel-2TcqGnfN.cjs"))),Pv1=d.lazy(()=>Promise.resolve().then(()=>require("./CurrentPage-B3YumhrX.cjs"))),Iv1=()=>e1.jsxRuntimeExports.jsx("h2",{children:"Your Logo"}),kv1=()=>{const{mutate:t}=pv1();return o1.useBuilderProp("editable",!0)?e1.jsxRuntimeExports.jsx(o1.Button,{onClick:t,className:"bg-blue-600 text-white",children:"Publish"}):null},Rv1=t=>{const{data:e,isLoading:a}=Th(),{data:r,isLoading:n}=jh(),{data:l}=SO(),{mutate:i}=CO(),{mutate:o}=AO(),[c]=Oe(),v=Vv1(),h=mv1(),s=Hv1(),u=Nt(),g=d.useCallback(async m=>await v.mutateAsync(m),[v]),p=d.useCallback(async()=>await h.mutateAsync(),[h]),f=d.useCallback(async m=>await s.mutateAsync(m),[s]),z=async(m=20,V=0)=>{const b=`limit=${m}&offset=${V}`,w=await fetch(`${u}/assets?${b}`).then(y=>y.json());return w.result==="success"?w.data:[]},{logo:M=Iv1}=t;return a||!e?e1.jsxRuntimeExports.jsx(o3,{}):n||!r?e1.jsxRuntimeExports.jsx(o3,{}):e1.jsxRuntimeExports.jsx("div",{className:"bg-background text-foreground",children:e1.jsxRuntimeExports.jsx(pO,{editable:l!=null&&l.lockedBy?l==null?void 0:l.lockedBy.self:!0,nonEditableComponent:xv1,blocks:(l==null?void 0:l.blocks)||[],brandingOptions:e.brandingOptions,darkMode:t.darkMode||!1,dataProviders:(l==null?void 0:l.providers)||[],onSavePage:async({blocks:m,providers:V})=>(await o({blocks:m,providers:V,uuid:c}),!0),onSaveBrandingOptions:async m=>(await i({brandingOptions:m}),!0),topBarComponents:{left:[M],center:[Pv1],right:[kv1]},sideBarComponents:{top:[{icon:P4.FileTextIcon,name:"pages",panel:Av1},{icon:P4.GearIcon,name:"settings",panel:Ev1}],bottom:[Bv1]},uploadMediaCallback:g,fetchMediaCallback:z,getUILibraryBlocks:p,getExternalPredefinedBlock:f,getPages:()=>r,unsplashAccessKey:t.unsplashAccessKey||""})})},Nv1=({logo:t})=>{const[e,a]=d.useState(!1),[r,n]=d.useState(""),[l,i]=d.useState(""),{mutate:o,isPending:c}=Lv1(),v=h=>{h.preventDefault(),o({email:r,password:l})};return e1.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]",children:e1.jsxRuntimeExports.jsx("div",{className:"overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300",children:e1.jsxRuntimeExports.jsxs("div",{className:"p-12",children:[e1.jsxRuntimeExports.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[e1.jsxRuntimeExports.jsx(d.Suspense,{children:t?d.createElement(t):""}),e1.jsxRuntimeExports.jsx("p",{className:"max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin",children:"Enter your login credential to continue"})]}),e1.jsxRuntimeExports.jsx("div",{className:"mt-8",children:e1.jsxRuntimeExports.jsxs("form",{method:"POST",onSubmit:v,className:"space-y-5",children:[e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e1.jsxRuntimeExports.jsx(kO,{})}),e1.jsxRuntimeExports.jsx("input",{value:r,onChange:h=>n(h.target.value),type:"email",id:"email",placeholder:"Enter email",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"})]})}),e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e1.jsxRuntimeExports.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e1.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"})})}),e1.jsxRuntimeExports.jsx("input",{value:l,onChange:h=>i(h.target.value),type:e?"text":"password",id:"pwd",placeholder:"Enter password",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"}),e1.jsxRuntimeExports.jsx("button",{type:"button",className:"absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",onClick:()=>a(!e),children:e?e1.jsxRuntimeExports.jsx(P4.EyeClosedIcon,{}):e1.jsxRuntimeExports.jsx(P4.EyeOpenIcon,{})})]})}),e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsx("button",{disabled:c||rt.size(r)<2||rt.size(l)<2,type:"submit",className:"inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",children:c?"Signing in...":"Login"})})]})}),e1.jsxRuntimeExports.jsx("div",{className:"mt-4 flex items-center justify-end gap-x-2 text-sm",children:e1.jsxRuntimeExports.jsx("a",{href:"https://apps.chaibuilder.com/settings",target:"_blank",className:"text-gray-500 hover:text-blue-400",children:"Forget your password?"})})]})})})},Tv1=t=>{const{data:e,isLoading:a}=Ov1(),r=n2();return d.useEffect(()=>{r.setQueryData(["apiBaseUrl"],t.apiBaseUrl||"/api/chaibuilder")},[t.apiBaseUrl,r]),a?e1.jsxRuntimeExports.jsx(o3,{}):e!=null&&e.valid?e1.jsxRuntimeExports.jsx(Rv1,{...t}):e1.jsxRuntimeExports.jsx(Nv1,{logo:t.logo})},jv1=new G91,Dv1=t=>e1.jsxRuntimeExports.jsxs(_91,{client:jv1,children:[e1.jsxRuntimeExports.jsx(F2.Toaster,{richColors:!0}),e1.jsxRuntimeExports.jsx(Tv1,{...t})]});mi.registerChaiDataProvider("blogs",{name:"Blogs",description:"This is a description",dataFn:async()=>[{heading:"First Blog Heading",subheading:"First Blog Subheading"},{heading:"Second Blog Heading",subheading:"Second Blog Subheading"}]});mi.registerChaiDataProvider("hero",{name:"Hero",description:"This is a description",dataFn:async()=>({heading:"Hello World",subheading:"Lorem Ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",items:[{item:"home"},{item:"about"},{item:"contact"}],meta:{height:10,visible:!0,language:["en","fs"],offset:{x:10,y:20}}})});exports.BlocksExternalDataProvider=x91;exports.ChaiBuilderEditor=pO;exports.ChaiBuilderStudio=Dv1;exports.ErrorBoundary=uO;exports.reactIsExports=If;exports.useAddPage=fv1;exports.useChaiExternalData=fO;exports.useChangePage=BO;exports.useCurrentPage=Oe;exports.useDeletePage=zv1;exports.useExpandedIds=b91;exports.usePages=jh;exports.useProject=Th;exports.useQueryClient=n2;exports.useUpdatePage=AO;exports.useUpdateProject=CO;
206
+ */j();var f91=process.env.NODE_ENV!=="production"?g91:()=>null;function p91(){return new URLSearchParams(window.location.search).has("dnd")}function z91(){return new URLSearchParams(window.location.search).has("undo")}const M91={dnd:p91(),newUndo:!z91()};class uO extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e1.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[e1.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),e1.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const m91=()=>{const[t,e]=o1.usePreviewMode(),a=o1.useBuilderProp("previewComponent");return e1.jsxRuntimeExports.jsxs("div",{className:FO.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[e1.jsxRuntimeExports.jsx(o1.Button,{size:"sm",className:"absolute right-0 top-0 m-4",onClick:()=>e(!1),children:"Close Preview"}),e1.jsxRuntimeExports.jsx("div",{children:a?e1.jsxRuntimeExports.jsx(d.Suspense,{fallback:e1.jsxRuntimeExports.jsx(o1.Skeleton,{className:"h-96 w-full"}),children:d.createElement(a)}):null})]})},H91=()=>{const[t,e]=o1.useSelectedBlockIds(),a=o1.useRemoveBlocks(),r=o1.useDuplicateBlocks(),{undo:n,redo:l}=o1.useUndoManager();d0.useHotkeys("esc",()=>e([]),{},[e]),d0.useHotkeys("ctrl+d,command+d",()=>r(t),{preventDefault:!0},[t,r]),d0.useHotkeys("ctrl+z,command+z",()=>n(),{},[n]),d0.useHotkeys("ctrl+y,command+y",()=>l(),{},[l]),d0.useHotkeys("del, backspace",i=>{i.preventDefault(),a(t)},{},[t,a])},V91=(t,e)=>{const a=[];let r=rt.find(t,{_id:e}),n=rt.get(r,"_parent","");for(;rt.isString(n)&&!rt.isEmpty(n);)a.push(r==null?void 0:r._parent),r=rt.find(t,{_id:n}),n=r==null?void 0:r._parent;return rt.flatten(a)},gO=we.atom([]),w91=()=>{const[t]=o1.useSelectedBlockIds(),e=we.useAtomValue(o1.presentBlocksAtom),[,a]=we.useAtom(gO);d.useEffect(()=>{let r=[];const n=rt.first(t);rt.isString(n)&&(r=[n,...V91(e,n)]),a(r)},[t,e,a])},b91=()=>we.useAtomValue(gO),fO=()=>we.useAtom(o1.chaiExternalDataAtom),y91=()=>d.useMemo(()=>mi.getChaiDataProviders(),[]),x91=({children:t})=>{const[,e]=fO(),[a]=o1.usePageDataProviders(),r=y91();return d.useEffect(()=>(e({}),rt.each(a,n=>{const l=rt.find(r,{providerKey:n.providerKey});if(l){const i=(l==null?void 0:l.mockFn)||(l==null?void 0:l.dataFn);i&&i(n.args).then(o=>e(c=>({...c,[n.providerKey]:o})))}}),()=>{rt.each(a,n=>{e(l=>(delete l[n.providerKey],l))})}),[r,a,e]),e1.jsxRuntimeExports.jsx(e1.jsxRuntimeExports.Fragment,{children:t})},L91=d.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-NbM1mfsY.cjs"))),O91=d.lazy(()=>Promise.resolve().then(()=>require("./Topbar-2sOsQD2d.cjs"))),S91=d.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-nT6ZJh_V.cjs"))),C91=d.lazy(()=>Promise.resolve().then(()=>require("./Settings-h1c8ukpI.cjs"))),B91=()=>{const[t]=we.useAtom(o1.pageSyncStateAtom),e=n=>{o1.isDevelopment()||n.preventDefault()};H91(),w91(),d.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=o1.useBuilderProp("editable",!0),r=o1.useBuilderProp("nonEditableComponent",null);return e1.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:e1.jsxRuntimeExports.jsxs(o1.TooltipProvider,{children:[e1.jsxRuntimeExports.jsxs("div",{onContextMenu:e,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[e1.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(O91,{})})}),e1.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:d.createElement(r)})}),e1.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(L91,{})})}),e1.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(S91,{})})}),e1.jsxRuntimeExports.jsx("div",{className:"flex h-[90%] w-[280px] min-w-[280px] border-l border-border pb-10",children:e1.jsxRuntimeExports.jsx(d.Suspense,{children:e1.jsxRuntimeExports.jsx(C91,{})})})]})]}),e1.jsxRuntimeExports.jsx(m91,{})]})})},$g=we.getDefaultStore(),A91=()=>e1.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:e1.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:e1.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[e1.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),e1.jsxRuntimeExports.jsx("br",{}),e1.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),e1.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})}),E91=t=>{const{dndOptions:e={backend:Dh.MultiBackend}}=t,[,a]=o1.useBlocksStore(),[,r]=o1.useBrandingOptions(),n=o1.useBuilderReset();return d.useEffect(()=>{$g.set(o1.chaiBuilderPropsAtom,rt.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),d.useEffect(()=>{$g.set(o1.dataProvidersAtom,t.dataProviders||[])},[t.dataProviders]),d.useEffect(()=>{a(mi.syncBlocksWithDefaults(t.blocks||[])),n()},[t.blocks]),d.useEffect(()=>{Vf.changeLanguage(t.locale||"en")},[t.locale]),d.useEffect(()=>{r(t.brandingOptions)},[t.brandingOptions,r]),e1.jsxRuntimeExports.jsx(DO.DndProvider,{...e,options:Dh.getBackendOptions(),children:e1.jsxRuntimeExports.jsx(B91,{})})},pO=t=>e1.jsxRuntimeExports.jsxs(uO,{children:[e1.jsxRuntimeExports.jsxs(jO.FlagsProvider,{features:M91,children:[e1.jsxRuntimeExports.jsx(f91,{}),e1.jsxRuntimeExports.jsx(A91,{}),e1.jsxRuntimeExports.jsx(E91,{...t})]}),e1.jsxRuntimeExports.jsx(o1.Toaster,{})]});var h0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},a0=typeof window>"u"||"Deno"in window;function g2(){}function P91(t,e){return typeof t=="function"?t(e):t}function Yc(t){return typeof t=="number"&&t>=0&&t!==1/0}function zO(t,e){return Math.max(t+(e||0)-Date.now(),0)}function tf(t,e){const{type:a="all",exact:r,fetchStatus:n,predicate:l,queryKey:i,stale:o}=t;if(i){if(r){if(e.queryHash!==Rh(i,e.options))return!1}else if(!_0(e.queryKey,i))return!1}if(a!=="all"){const c=e.isActive();if(a==="active"&&!c||a==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||typeof n<"u"&&n!==e.state.fetchStatus||l&&!l(e))}function ef(t,e){const{exact:a,status:r,predicate:n,mutationKey:l}=t;if(l){if(!e.options.mutationKey)return!1;if(a){if(X0(e.options.mutationKey)!==X0(l))return!1}else if(!_0(e.options.mutationKey,l))return!1}return!(r&&e.state.status!==r||n&&!n(e))}function Rh(t,e){return((e==null?void 0:e.queryKeyHashFn)||X0)(t)}function X0(t){return JSON.stringify(t,(e,a)=>Qc(a)?Object.keys(a).sort().reduce((r,n)=>(r[n]=a[n],r),{}):a)}function _0(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(a=>!_0(t[a],e[a])):!1}function MO(t,e){if(t===e)return t;const a=af(t)&&af(e);if(a||Qc(t)&&Qc(e)){const r=a?t.length:Object.keys(t).length,n=a?e:Object.keys(e),l=n.length,i=a?[]:{};let o=0;for(let c=0;c<l;c++){const v=a?c:n[c];i[v]=MO(t[v],e[v]),i[v]===t[v]&&o++}return r===l&&o===r?t:i}return e}function fi(t,e){if(t&&!e||e&&!t)return!1;for(const a in t)if(t[a]!==e[a])return!1;return!0}function af(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Qc(t){if(!rf(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const a=e.prototype;return!(!rf(a)||!a.hasOwnProperty("isPrototypeOf"))}function rf(t){return Object.prototype.toString.call(t)==="[object Object]"}function mO(t){return new Promise(e=>{setTimeout(e,t)})}function nf(t){mO(0).then(t)}function Xc(t,e,a){return typeof a.structuralSharing=="function"?a.structuralSharing(t,e):a.structuralSharing!==!1?MO(t,e):e}function I91(t,e,a=0){const r=[...t,e];return a&&r.length>a?r.slice(1):r}function k91(t,e,a=0){const r=[e,...t];return a&&r.length>a?r.slice(0,-1):r}var Fe,he,Pa,vf,R91=(vf=class extends h0{constructor(){super();z1(this,Fe,void 0);z1(this,he,void 0);z1(this,Pa,void 0);u1(this,Pa,e=>{if(!a0&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){B(this,he)||this.setEventListener(B(this,Pa))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,he))==null||e.call(this),u1(this,he,void 0))}setEventListener(e){var a;u1(this,Pa,e),(a=B(this,he))==null||a.call(this),u1(this,he,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,Fe)!==e&&(u1(this,Fe,e),this.onFocus())}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){var e;return typeof B(this,Fe)=="boolean"?B(this,Fe):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Fe=new WeakMap,he=new WeakMap,Pa=new WeakMap,vf),pi=new R91,Ia,se,ka,df,N91=(df=class extends h0{constructor(){super();z1(this,Ia,!0);z1(this,se,void 0);z1(this,ka,void 0);u1(this,ka,e=>{if(!a0&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}})}onSubscribe(){B(this,se)||this.setEventListener(B(this,ka))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,se))==null||e.call(this),u1(this,se,void 0))}setEventListener(e){var a;u1(this,ka,e),(a=B(this,se))==null||a.call(this),u1(this,se,e(this.setOnline.bind(this)))}setOnline(e){B(this,Ia)!==e&&(u1(this,Ia,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return B(this,Ia)}},Ia=new WeakMap,se=new WeakMap,ka=new WeakMap,df),zi=new N91;function T91(t){return Math.min(1e3*2**t,3e4)}function ro(t){return(t??"online")==="online"?zi.isOnline():!0}var HO=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function uc(t){return t instanceof HO}function VO(t){let e=!1,a=0,r=!1,n,l,i;const o=new Promise((z,M)=>{l=z,i=M}),c=z=>{var M;r||(g(new HO(z)),(M=t.abort)==null||M.call(t))},v=()=>{e=!0},h=()=>{e=!1},s=()=>!pi.isFocused()||t.networkMode!=="always"&&!zi.isOnline(),u=z=>{var M;r||(r=!0,(M=t.onSuccess)==null||M.call(t,z),n==null||n(),l(z))},g=z=>{var M;r||(r=!0,(M=t.onError)==null||M.call(t,z),n==null||n(),i(z))},p=()=>new Promise(z=>{var M;n=m=>{const V=r||!s();return V&&z(m),V},(M=t.onPause)==null||M.call(t)}).then(()=>{var z;n=void 0,r||(z=t.onContinue)==null||z.call(t)}),f=()=>{if(r)return;let z;try{z=t.fn()}catch(M){z=Promise.reject(M)}Promise.resolve(z).then(u).catch(M=>{var y;if(r)return;const m=t.retry??(a0?0:3),V=t.retryDelay??T91,b=typeof V=="function"?V(a,M):V,w=m===!0||typeof m=="number"&&a<m||typeof m=="function"&&m(a,M);if(e||!w){g(M);return}a++,(y=t.onFail)==null||y.call(t,a,M),mO(b).then(()=>{if(s())return p()}).then(()=>{e?g(M):f()})})};return ro(t.networkMode)?f():p().then(f),{promise:o,cancel:c,continue:()=>(n==null?void 0:n())?o:Promise.resolve(),cancelRetry:v,continueRetry:h}}function j91(){let t=[],e=0,a=h=>{h()},r=h=>{h()};const n=h=>{let s;e++;try{s=h()}finally{e--,e||o()}return s},l=h=>{e?t.push(h):nf(()=>{a(h)})},i=h=>(...s)=>{l(()=>{h(...s)})},o=()=>{const h=t;t=[],h.length&&nf(()=>{r(()=>{h.forEach(s=>{a(s)})})})};return{batch:n,batchCalls:i,schedule:l,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{r=h}}}var zt=j91(),qe,uf,wO=(uf=class{constructor(){z1(this,qe,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yc(this.gcTime)&&u1(this,qe,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(a0?1/0:5*60*1e3))}clearGcTimeout(){B(this,qe)&&(clearTimeout(B(this,qe)),u1(this,qe,void 0))}},qe=new WeakMap,uf),Ra,Na,s2,ve,v2,yt,$0,We,Ta,A4,V2,G2,gf,D91=(gf=class extends wO{constructor(e){super();z1(this,Ta);z1(this,V2);z1(this,Ra,void 0);z1(this,Na,void 0);z1(this,s2,void 0);z1(this,ve,void 0);z1(this,v2,void 0);z1(this,yt,void 0);z1(this,$0,void 0);z1(this,We,void 0);u1(this,We,!1),u1(this,$0,e.defaultOptions),C1(this,Ta,A4).call(this,e.options),u1(this,yt,[]),u1(this,s2,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,u1(this,Ra,e.state||F91(this.options)),this.state=B(this,Ra),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!B(this,yt).length&&this.state.fetchStatus==="idle"&&B(this,s2).remove(this)}setData(e,a){const r=Xc(this.state.data,e,this.options);return C1(this,V2,G2).call(this,{data:r,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),r}setState(e,a){C1(this,V2,G2).call(this,{type:"setState",state:e,setStateOptions:a})}cancel(e){var r;const a=B(this,ve);return(r=B(this,v2))==null||r.cancel(e),a?a.then(g2).catch(g2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,Ra))}isActive(){return B(this,yt).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||B(this,yt).some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!zO(this.state.dataUpdatedAt,e)}onFocus(){var a;const e=B(this,yt).find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(a=B(this,v2))==null||a.continue()}onOnline(){var a;const e=B(this,yt).find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(a=B(this,v2))==null||a.continue()}addObserver(e){B(this,yt).includes(e)||(B(this,yt).push(e),this.clearGcTimeout(),B(this,s2).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){B(this,yt).includes(e)&&(u1(this,yt,B(this,yt).filter(a=>a!==e)),B(this,yt).length||(B(this,v2)&&(B(this,We)?B(this,v2).cancel({revert:!0}):B(this,v2).cancelRetry()),this.scheduleGc()),B(this,s2).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return B(this,yt).length}invalidate(){this.state.isInvalidated||C1(this,V2,G2).call(this,{type:"invalidate"})}fetch(e,a){var v,h,s,u;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(B(this,ve))return(v=B(this,v2))==null||v.continueRetry(),B(this,ve)}if(e&&C1(this,Ta,A4).call(this,e),!this.options.queryFn){const g=B(this,yt).find(p=>p.options.queryFn);g&&C1(this,Ta,A4).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n={queryKey:this.queryKey,meta:this.meta},l=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(u1(this,We,!0),r.signal)})};l(n);const i=()=>this.options.queryFn?(u1(this,We,!1),this.options.persister?this.options.persister(this.options.queryFn,n,this):this.options.queryFn(n)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),o={fetchOptions:a,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};l(o),(h=this.options.behavior)==null||h.onFetch(o,this),u1(this,Na,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((s=o.fetchOptions)==null?void 0:s.meta))&&C1(this,V2,G2).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const c=g=>{var p,f,z,M;uc(g)&&g.silent||C1(this,V2,G2).call(this,{type:"error",error:g}),uc(g)||((f=(p=B(this,s2).config).onError)==null||f.call(p,g,this),(M=(z=B(this,s2).config).onSettled)==null||M.call(z,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return u1(this,v2,VO({fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var p,f,z,M;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(f=(p=B(this,s2).config).onSuccess)==null||f.call(p,g,this),(M=(z=B(this,s2).config).onSettled)==null||M.call(z,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(g,p)=>{C1(this,V2,G2).call(this,{type:"failed",failureCount:g,error:p})},onPause:()=>{C1(this,V2,G2).call(this,{type:"pause"})},onContinue:()=>{C1(this,V2,G2).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode})),u1(this,ve,B(this,v2).promise),B(this,ve)}},Ra=new WeakMap,Na=new WeakMap,s2=new WeakMap,ve=new WeakMap,v2=new WeakMap,yt=new WeakMap,$0=new WeakMap,We=new WeakMap,Ta=new WeakSet,A4=function(e){this.options={...B(this,$0),...e},this.updateGcTime(this.options.gcTime)},V2=new WeakSet,G2=function(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:ro(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return uc(n)&&n.revert&&B(this,Na)?{...B(this,Na),fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),zt.batch(()=>{B(this,yt).forEach(r=>{r.onQueryUpdate()}),B(this,s2).notify({query:this,type:"updated",action:e})})},gf);function F91(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,a=typeof e<"u",r=a?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:a?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var A2,ff,q91=(ff=class extends h0{constructor(e={}){super();z1(this,A2,void 0);this.config=e,u1(this,A2,new Map)}build(e,a,r){const n=a.queryKey,l=a.queryHash??Rh(n,a);let i=this.get(l);return i||(i=new D91({cache:this,queryKey:n,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){B(this,A2).has(e.queryHash)||(B(this,A2).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=B(this,A2).get(e.queryHash);a&&(e.destroy(),a===e&&B(this,A2).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,A2).get(e)}getAll(){return[...B(this,A2).values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>tf(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>tf(e,r)):a}notify(e){zt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},A2=new WeakMap,ff),E2,tr,$t,ja,P2,ce,pf,W91=(pf=class extends wO{constructor(e){super();z1(this,P2);z1(this,E2,void 0);z1(this,tr,void 0);z1(this,$t,void 0);z1(this,ja,void 0);this.mutationId=e.mutationId,u1(this,tr,e.defaultOptions),u1(this,$t,e.mutationCache),u1(this,E2,[]),this.state=e.state||bO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...B(this,tr),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,E2).includes(e)||(B(this,E2).push(e),this.clearGcTimeout(),B(this,$t).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){u1(this,E2,B(this,E2).filter(a=>a!==e)),this.scheduleGc(),B(this,$t).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,E2).length||(this.state.status==="pending"?this.scheduleGc():B(this,$t).remove(this))}continue(){var e;return((e=B(this,ja))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var n,l,i,o,c,v,h,s,u,g,p,f,z,M,m,V,b,w,y,x;const a=()=>(u1(this,ja,VO({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,S)=>{C1(this,P2,ce).call(this,{type:"failed",failureCount:L,error:S})},onPause:()=>{C1(this,P2,ce).call(this,{type:"pause"})},onContinue:()=>{C1(this,P2,ce).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),B(this,ja).promise),r=this.state.status==="pending";try{if(!r){C1(this,P2,ce).call(this,{type:"pending",variables:e}),await((l=(n=B(this,$t).config).onMutate)==null?void 0:l.call(n,e,this));const S=await((o=(i=this.options).onMutate)==null?void 0:o.call(i,e));S!==this.state.context&&C1(this,P2,ce).call(this,{type:"pending",context:S,variables:e})}const L=await a();return await((v=(c=B(this,$t).config).onSuccess)==null?void 0:v.call(c,L,e,this.state.context,this)),await((s=(h=this.options).onSuccess)==null?void 0:s.call(h,L,e,this.state.context)),await((g=(u=B(this,$t).config).onSettled)==null?void 0:g.call(u,L,null,this.state.variables,this.state.context,this)),await((f=(p=this.options).onSettled)==null?void 0:f.call(p,L,null,e,this.state.context)),C1(this,P2,ce).call(this,{type:"success",data:L}),L}catch(L){try{throw await((M=(z=B(this,$t).config).onError)==null?void 0:M.call(z,L,e,this.state.context,this)),await((V=(m=this.options).onError)==null?void 0:V.call(m,L,e,this.state.context)),await((w=(b=B(this,$t).config).onSettled)==null?void 0:w.call(b,void 0,L,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,void 0,L,e,this.state.context)),L}finally{C1(this,P2,ce).call(this,{type:"error",error:L})}}}},E2=new WeakMap,tr=new WeakMap,$t=new WeakMap,ja=new WeakMap,P2=new WeakSet,ce=function(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!ro(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),zt.batch(()=>{B(this,E2).forEach(r=>{r.onMutationUpdate(e)}),B(this,$t).notify({mutation:this,type:"updated",action:e})})},pf);function bO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var d2,er,Ke,zf,K91=(zf=class extends h0{constructor(e={}){super();z1(this,d2,void 0);z1(this,er,void 0);z1(this,Ke,void 0);this.config=e,u1(this,d2,[]),u1(this,er,0)}build(e,a,r){const n=new W91({mutationCache:this,mutationId:++Cr(this,er)._,options:e.defaultMutationOptions(a),state:r});return this.add(n),n}add(e){B(this,d2).push(e),this.notify({type:"added",mutation:e})}remove(e){u1(this,d2,B(this,d2).filter(a=>a!==e)),this.notify({type:"removed",mutation:e})}clear(){zt.batch(()=>{B(this,d2).forEach(e=>{this.remove(e)})})}getAll(){return B(this,d2)}find(e){const a={exact:!0,...e};return B(this,d2).find(r=>ef(a,r))}findAll(e={}){return B(this,d2).filter(a=>ef(e,a))}notify(e){zt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){return u1(this,Ke,(B(this,Ke)??Promise.resolve()).then(()=>{const e=B(this,d2).filter(a=>a.state.isPaused);return zt.batch(()=>e.reduce((a,r)=>a.then(()=>r.continue().catch(g2)),Promise.resolve()))}).then(()=>{u1(this,Ke,void 0)})),B(this,Ke)}},d2=new WeakMap,er=new WeakMap,Ke=new WeakMap,zf);function U91(t){return{onFetch:(e,a)=>{const r=async()=>{var p,f,z,M,m;const n=e.options,l=(z=(f=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:f.fetchMore)==null?void 0:z.direction,i=((M=e.state.data)==null?void 0:M.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[],c={pages:[],pageParams:[]};let v=!1;const h=V=>{Object.defineProperty(V,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},s=e.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),u=async(V,b,w)=>{if(v)return Promise.reject();if(b==null&&V.pages.length)return Promise.resolve(V);const y={queryKey:e.queryKey,pageParam:b,direction:w?"backward":"forward",meta:e.options.meta};h(y);const x=await s(y),{maxPages:L}=e.options,S=w?k91:I91;return{pages:S(V.pages,x,L),pageParams:S(V.pageParams,b,L)}};let g;if(l&&i.length){const V=l==="backward",b=V?Z91:lf,w={pages:i,pageParams:o},y=b(n,w);g=await u(w,y,V)}else{g=await u(c,o[0]??n.initialPageParam);const V=t??i.length;for(let b=1;b<V;b++){const w=lf(n,g);g=await u(g,w)}}return g};e.options.persister?e.fetchFn=()=>{var n,l;return(l=(n=e.options).persister)==null?void 0:l.call(n,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},a)}:e.fetchFn=r}}}function lf(t,{pages:e,pageParams:a}){const r=e.length-1;return t.getNextPageParam(e[r],e,a[r],a)}function Z91(t,{pages:e,pageParams:a}){var r;return(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,a[0],a)}var ft,de,ue,Da,Fa,ge,qa,Wa,Mf,G91=(Mf=class{constructor(t={}){z1(this,ft,void 0);z1(this,de,void 0);z1(this,ue,void 0);z1(this,Da,void 0);z1(this,Fa,void 0);z1(this,ge,void 0);z1(this,qa,void 0);z1(this,Wa,void 0);u1(this,ft,t.queryCache||new q91),u1(this,de,t.mutationCache||new K91),u1(this,ue,t.defaultOptions||{}),u1(this,Da,new Map),u1(this,Fa,new Map),u1(this,ge,0)}mount(){Cr(this,ge)._++,B(this,ge)===1&&(u1(this,qa,pi.subscribe(()=>{pi.isFocused()&&(this.resumePausedMutations(),B(this,ft).onFocus())})),u1(this,Wa,zi.subscribe(()=>{zi.isOnline()&&(this.resumePausedMutations(),B(this,ft).onOnline())})))}unmount(){var t,e;Cr(this,ge)._--,B(this,ge)===0&&((t=B(this,qa))==null||t.call(this),u1(this,qa,void 0),(e=B(this,Wa))==null||e.call(this),u1(this,Wa,void 0))}isFetching(t){return B(this,ft).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,de).findAll({...t,status:"pending"}).length}getQueryData(t){var e;return(e=B(this,ft).find({queryKey:t}))==null?void 0:e.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);return e!==void 0?Promise.resolve(e):this.fetchQuery(t)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:e,state:a})=>{const r=a.data;return[e,r]})}setQueryData(t,e,a){const r=B(this,ft).find({queryKey:t}),n=r==null?void 0:r.state.data,l=P91(e,n);if(typeof l>"u")return;const i=this.defaultQueryOptions({queryKey:t});return B(this,ft).build(this,i).setData(l,{...a,manual:!0})}setQueriesData(t,e,a){return zt.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,a)]))}getQueryState(t){var e;return(e=B(this,ft).find({queryKey:t}))==null?void 0:e.state}removeQueries(t){const e=B(this,ft);zt.batch(()=>{e.findAll(t).forEach(a=>{e.remove(a)})})}resetQueries(t,e){const a=B(this,ft),r={type:"active",...t};return zt.batch(()=>(a.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const a={revert:!0,...e},r=zt.batch(()=>B(this,ft).findAll(t).map(n=>n.cancel(a)));return Promise.all(r).then(g2).catch(g2)}invalidateQueries(t={},e={}){return zt.batch(()=>{if(B(this,ft).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const a={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(a,e)})}refetchQueries(t={},e){const a={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=zt.batch(()=>B(this,ft).findAll(t).filter(n=>!n.isDisabled()).map(n=>{let l=n.fetch(void 0,a);return a.throwOnError||(l=l.catch(g2)),n.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(g2)}fetchQuery(t){const e=this.defaultQueryOptions(t);typeof e.retry>"u"&&(e.retry=!1);const a=B(this,ft).build(this,e);return a.isStaleByTime(e.staleTime)?a.fetch(e):Promise.resolve(a.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(g2).catch(g2)}fetchInfiniteQuery(t){return t.behavior=U91(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(g2).catch(g2)}resumePausedMutations(){return B(this,de).resumePausedMutations()}getQueryCache(){return B(this,ft)}getMutationCache(){return B(this,de)}getDefaultOptions(){return B(this,ue)}setDefaultOptions(t){u1(this,ue,t)}setQueryDefaults(t,e){B(this,Da).set(X0(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,Da).values()];let a={};return e.forEach(r=>{_0(t,r.queryKey)&&(a={...a,...r.defaultOptions})}),a}setMutationDefaults(t,e){B(this,Fa).set(X0(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,Fa).values()];let a={};return e.forEach(r=>{_0(t,r.mutationKey)&&(a={...a,...r.defaultOptions})}),a}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const e={...B(this,ue).queries,...(t==null?void 0:t.queryKey)&&this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Rh(e.queryKey,e)),typeof e.refetchOnReconnect>"u"&&(e.refetchOnReconnect=e.networkMode!=="always"),typeof e.throwOnError>"u"&&(e.throwOnError=!!e.suspense),typeof e.networkMode>"u"&&e.persister&&(e.networkMode="offlineFirst"),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,ue).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,ft).clear(),B(this,de).clear()}},ft=new WeakMap,de=new WeakMap,ue=new WeakMap,Da=new WeakMap,Fa=new WeakMap,ge=new WeakMap,qa=new WeakMap,Wa=new WeakMap,Mf),Ut,Q1,Ka,It,Ue,Ua,I2,ar,Za,Ga,Ze,Ge,fe,Je,Ye,R0,rr,_c,nr,$c,lr,t3,ir,e3,or,a3,cr,r3,hr,n3,Mi,yO,mf,J91=(mf=class extends h0{constructor(e,a){super();z1(this,Ye);z1(this,rr);z1(this,nr);z1(this,lr);z1(this,ir);z1(this,or);z1(this,cr);z1(this,hr);z1(this,Mi);z1(this,Ut,void 0);z1(this,Q1,void 0);z1(this,Ka,void 0);z1(this,It,void 0);z1(this,Ue,void 0);z1(this,Ua,void 0);z1(this,I2,void 0);z1(this,ar,void 0);z1(this,Za,void 0);z1(this,Ga,void 0);z1(this,Ze,void 0);z1(this,Ge,void 0);z1(this,fe,void 0);z1(this,Je,void 0);u1(this,Q1,void 0),u1(this,Ka,void 0),u1(this,It,void 0),u1(this,Je,new Set),u1(this,Ut,e),this.options=a,u1(this,I2,null),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,Q1).addObserver(this),of(B(this,Q1),this.options)?C1(this,Ye,R0).call(this):this.updateResult(),C1(this,ir,e3).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l3(B(this,Q1),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l3(B(this,Q1),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,C1(this,or,a3).call(this),C1(this,cr,r3).call(this),B(this,Q1).removeObserver(this)}setOptions(e,a){const r=this.options,n=B(this,Q1);if(this.options=B(this,Ut).defaultQueryOptions(e),fi(r,this.options)||B(this,Ut).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,Q1),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),C1(this,hr,n3).call(this);const l=this.hasListeners();l&&cf(B(this,Q1),n,this.options,r)&&C1(this,Ye,R0).call(this),this.updateResult(a),l&&(B(this,Q1)!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&C1(this,rr,_c).call(this);const i=C1(this,nr,$c).call(this);l&&(B(this,Q1)!==n||this.options.enabled!==r.enabled||i!==B(this,fe))&&C1(this,lr,t3).call(this,i)}getOptimisticResult(e){const a=B(this,Ut).getQueryCache().build(B(this,Ut),e),r=this.createResult(a,e);return Q91(this,r)&&(u1(this,It,r),u1(this,Ua,this.options),u1(this,Ue,B(this,Q1).state)),r}getCurrentResult(){return B(this,It)}trackResult(e){const a={};return Object.keys(e).forEach(r=>{Object.defineProperty(a,r,{configurable:!1,enumerable:!0,get:()=>(B(this,Je).add(r),e[r])})}),a}getCurrentQuery(){return B(this,Q1)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=B(this,Ut).defaultQueryOptions(e),r=B(this,Ut).getQueryCache().build(B(this,Ut),a);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,a))}fetch(e){return C1(this,Ye,R0).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,It)))}createResult(e,a){var y;const r=B(this,Q1),n=this.options,l=B(this,It),i=B(this,Ue),o=B(this,Ua),v=e!==r?e.state:B(this,Ka),{state:h}=e;let{error:s,errorUpdatedAt:u,fetchStatus:g,status:p}=h,f=!1,z;if(a._optimisticResults){const x=this.hasListeners(),L=!x&&of(e,a),S=x&&cf(e,r,a,n);(L||S)&&(g=ro(e.options.networkMode)?"fetching":"paused",h.dataUpdatedAt||(p="pending")),a._optimisticResults==="isRestoring"&&(g="idle")}if(a.select&&typeof h.data<"u")if(l&&h.data===(i==null?void 0:i.data)&&a.select===B(this,ar))z=B(this,Za);else try{u1(this,ar,a.select),z=a.select(h.data),z=Xc(l==null?void 0:l.data,z,a),u1(this,Za,z),u1(this,I2,null)}catch(x){u1(this,I2,x)}else z=h.data;if(typeof a.placeholderData<"u"&&typeof z>"u"&&p==="pending"){let x;if(l!=null&&l.isPlaceholderData&&a.placeholderData===(o==null?void 0:o.placeholderData))x=l.data;else if(x=typeof a.placeholderData=="function"?a.placeholderData((y=B(this,Ga))==null?void 0:y.state.data,B(this,Ga)):a.placeholderData,a.select&&typeof x<"u")try{x=a.select(x),u1(this,I2,null)}catch(L){u1(this,I2,L)}typeof x<"u"&&(p="success",z=Xc(l==null?void 0:l.data,x,a),f=!0)}B(this,I2)&&(s=B(this,I2),z=B(this,Za),u=Date.now(),p="error");const M=g==="fetching",m=p==="pending",V=p==="error",b=m&&M;return{status:p,fetchStatus:g,isPending:m,isSuccess:p==="success",isError:V,isInitialLoading:b,isLoading:b,data:z,dataUpdatedAt:h.dataUpdatedAt,error:s,errorUpdatedAt:u,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>v.dataUpdateCount||h.errorUpdateCount>v.errorUpdateCount,isFetching:M,isRefetching:M&&!m,isLoadingError:V&&h.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:f,isRefetchError:V&&h.dataUpdatedAt!==0,isStale:Nh(e,a),refetch:this.refetch}}updateResult(e){const a=B(this,It),r=this.createResult(B(this,Q1),this.options);if(u1(this,Ue,B(this,Q1).state),u1(this,Ua,this.options),B(this,Ue).data!==void 0&&u1(this,Ga,B(this,Q1)),fi(r,a))return;u1(this,It,r);const n={},l=()=>{if(!a)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!B(this,Je).size)return!0;const c=new Set(o??B(this,Je));return this.options.throwOnError&&c.add("error"),Object.keys(B(this,It)).some(v=>{const h=v;return B(this,It)[h]!==a[h]&&c.has(h)})};(e==null?void 0:e.listeners)!==!1&&l()&&(n.listeners=!0),C1(this,Mi,yO).call(this,{...n,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&C1(this,ir,e3).call(this)}},Ut=new WeakMap,Q1=new WeakMap,Ka=new WeakMap,It=new WeakMap,Ue=new WeakMap,Ua=new WeakMap,I2=new WeakMap,ar=new WeakMap,Za=new WeakMap,Ga=new WeakMap,Ze=new WeakMap,Ge=new WeakMap,fe=new WeakMap,Je=new WeakMap,Ye=new WeakSet,R0=function(e){C1(this,hr,n3).call(this);let a=B(this,Q1).fetch(this.options,e);return e!=null&&e.throwOnError||(a=a.catch(g2)),a},rr=new WeakSet,_c=function(){if(C1(this,or,a3).call(this),a0||B(this,It).isStale||!Yc(this.options.staleTime))return;const a=zO(B(this,It).dataUpdatedAt,this.options.staleTime)+1;u1(this,Ze,setTimeout(()=>{B(this,It).isStale||this.updateResult()},a))},nr=new WeakSet,$c=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,Q1)):this.options.refetchInterval)??!1},lr=new WeakSet,t3=function(e){C1(this,cr,r3).call(this),u1(this,fe,e),!(a0||this.options.enabled===!1||!Yc(B(this,fe))||B(this,fe)===0)&&u1(this,Ge,setInterval(()=>{(this.options.refetchIntervalInBackground||pi.isFocused())&&C1(this,Ye,R0).call(this)},B(this,fe)))},ir=new WeakSet,e3=function(){C1(this,rr,_c).call(this),C1(this,lr,t3).call(this,C1(this,nr,$c).call(this))},or=new WeakSet,a3=function(){B(this,Ze)&&(clearTimeout(B(this,Ze)),u1(this,Ze,void 0))},cr=new WeakSet,r3=function(){B(this,Ge)&&(clearInterval(B(this,Ge)),u1(this,Ge,void 0))},hr=new WeakSet,n3=function(){const e=B(this,Ut).getQueryCache().build(B(this,Ut),this.options);if(e===B(this,Q1))return;const a=B(this,Q1);u1(this,Q1,e),u1(this,Ka,e.state),this.hasListeners()&&(a==null||a.removeObserver(this),e.addObserver(this))},Mi=new WeakSet,yO=function(e){zt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(B(this,It))}),B(this,Ut).getQueryCache().notify({query:B(this,Q1),type:"observerResultsUpdated"})})},mf);function Y91(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function of(t,e){return Y91(t,e)||t.state.dataUpdatedAt>0&&l3(t,e,e.refetchOnMount)}function l3(t,e,a){if(e.enabled!==!1){const r=typeof a=="function"?a(t):a;return r==="always"||r!==!1&&Nh(t,e)}return!1}function cf(t,e,a,r){return a.enabled!==!1&&(t!==e||r.enabled===!1)&&(!a.suspense||t.state.status!=="error")&&Nh(t,a)}function Nh(t,e){return t.isStaleByTime(e.staleTime)}function Q91(t,e){return!fi(t.getCurrentResult(),e)}var pe,Dt,u2,Y2,Ja,E4,sr,i3,Hf,X91=(Hf=class extends h0{constructor(a,r){super();z1(this,Ja);z1(this,sr);z1(this,pe,void 0);z1(this,Dt,void 0);z1(this,u2,void 0);z1(this,Y2,void 0);u1(this,Dt,void 0),u1(this,pe,a),this.setOptions(r),this.bindMethods(),C1(this,Ja,E4).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var n;const r=this.options;this.options=B(this,pe).defaultMutationOptions(a),fi(r,this.options)||B(this,pe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:B(this,u2),observer:this}),(n=B(this,u2))==null||n.setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=B(this,u2))==null||a.removeObserver(this)}onMutationUpdate(a){C1(this,Ja,E4).call(this),C1(this,sr,i3).call(this,a)}getCurrentResult(){return B(this,Dt)}reset(){u1(this,u2,void 0),C1(this,Ja,E4).call(this),C1(this,sr,i3).call(this)}mutate(a,r){var n;return u1(this,Y2,r),(n=B(this,u2))==null||n.removeObserver(this),u1(this,u2,B(this,pe).getMutationCache().build(B(this,pe),this.options)),B(this,u2).addObserver(this),B(this,u2).execute(a)}},pe=new WeakMap,Dt=new WeakMap,u2=new WeakMap,Y2=new WeakMap,Ja=new WeakSet,E4=function(){var r;const a=((r=B(this,u2))==null?void 0:r.state)??bO();u1(this,Dt,{...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset})},sr=new WeakSet,i3=function(a){zt.batch(()=>{var r,n,l,i,o,c,v,h;B(this,Y2)&&this.hasListeners()&&((a==null?void 0:a.type)==="success"?((n=(r=B(this,Y2)).onSuccess)==null||n.call(r,a.data,B(this,Dt).variables,B(this,Dt).context),(i=(l=B(this,Y2)).onSettled)==null||i.call(l,a.data,null,B(this,Dt).variables,B(this,Dt).context)):(a==null?void 0:a.type)==="error"&&((c=(o=B(this,Y2)).onError)==null||c.call(o,a.error,B(this,Dt).variables,B(this,Dt).context),(h=(v=B(this,Y2)).onSettled)==null||h.call(v,void 0,a.error,B(this,Dt).variables,B(this,Dt).context))),this.listeners.forEach(s=>{s(B(this,Dt))})})},Hf);var xO=O.createContext(void 0),n2=t=>{const e=O.useContext(xO);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},_91=({client:t,children:e})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),O.createElement(xO.Provider,{value:t},e)),LO=O.createContext(!1),$91=()=>O.useContext(LO),v61=LO.Provider;function tv1(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ev1=O.createContext(tv1()),av1=()=>O.useContext(ev1);function OO(t,e){return typeof t=="function"?t(...e):!!t}var rv1=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},nv1=t=>{O.useEffect(()=>{t.clearReset()},[t])},lv1=({result:t,errorResetBoundary:e,throwOnError:a,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&OO(a,[t.error,r]);var iv1=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)};var ov1=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,cv1=(t,e,a)=>e.fetchOptimistic(t).catch(()=>{a.clearReset()});function hv1(t,e,a){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=n2(a),n=$91(),l=av1(),i=r.defaultQueryOptions(t);i._optimisticResults=n?"isRestoring":"optimistic",iv1(i),rv1(i,l),nv1(l);const[o]=O.useState(()=>new e(r,i)),c=o.getOptimisticResult(i);if(O.useSyncExternalStore(O.useCallback(v=>{const h=n?()=>{}:o.subscribe(zt.batchCalls(v));return o.updateResult(),h},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),O.useEffect(()=>{o.setOptions(i,{listeners:!1})},[i,o]),ov1(i,c))throw cv1(i,o,l);if(lv1({result:c,errorResetBoundary:l,throwOnError:i.throwOnError,query:o.getCurrentQuery()}))throw c.error;return i.notifyOnChangeProps?c:o.trackResult(c)}function Lr(t,e){return hv1(t,J91,e)}function S2(t,e){const a=n2(e),[r]=O.useState(()=>new X91(a,t));O.useEffect(()=>{r.setOptions(t)},[r,t]);const n=O.useSyncExternalStore(O.useCallback(i=>r.subscribe(zt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=O.useCallback((i,o)=>{r.mutate(i,o).catch(sv1)},[r]);if(n.error&&OO(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:l,mutateAsync:n.mutate}}function sv1(){}function Nt(){return n2().getQueryData(["apiBaseUrl"])||"/api/chaibuilder"}const Oe=()=>{const{data:t,refetch:e}=Lr({queryKey:["currentPage"],queryFn:()=>localStorage.getItem("currentPage")||""});return[t,a=>{a&&(localStorage.setItem("currentPage",a||""),e())}]};let hf="";const Or=()=>(hf=localStorage.getItem("__chai_at"),hf);function vv1(t){const e={method:"GET",headers:{"x-chai-access-token":Or()}};return fetch(t,e)}function dv1(t,e){const a={method:"POST",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}function uv1(t,e){const a={method:"PUT",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}function gv1(t,e){const a={method:"DELETE",headers:{"x-chai-access-token":Or()},body:JSON.stringify(e)};return fetch(t,a)}const l2={get:vv1,post:dv1,put:uv1,delete:gv1},Th=()=>{const[t,e]=Oe(),a=Nt();return Lr({queryKey:["project"],queryFn:async()=>{const{data:r}=await l2.get(`${a}/project`).then(n=>n.json());if(!t&&r){const n=localStorage.getItem("currentPage");e(n||(r==null?void 0:r.homepage))}return r}})},jh=()=>{const t=Nt();return Lr({queryKey:["pages"],queryFn:async()=>{const{data:e}=await l2.get(`${t}/pages`).then(a=>a.json());return e||[]}})},SO=()=>{const[t]=Oe(),e=Nt();return Lr({queryKey:["page_data",t],queryFn:async()=>{const{data:a}=await l2.get(`${e}/page?uuid=${t}`).then(r=>r.json());return a},enabled:!!t,staleTime:3e3})},o3=()=>e1.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-gray-200",children:e1.jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full w-full justify-center items-center",children:[e1.jsxRuntimeExports.jsxs("div",{className:"flex flex-row gap-2",children:[e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]"}),e1.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]"})]}),e1.jsxRuntimeExports.jsx("div",{className:"text-gray-700 font-thin",children:"Loading Builder..."})]})}),CO=(t="Project updated successfully.")=>{const e=n2(),a=Nt();return S2({mutationFn:async r=>await l2.put(`${a}/project`,r).then(n=>n.json()),onSuccess:()=>{e.invalidateQueries({queryKey:["project"]}),F2.toast.success(t)}})},BO=()=>{const[t]=["SAVED"],[e,a]=Oe(),r=o1.useBuilderReset();return n=>t!=="SAVED"?(F2.toast.error("You have unsaved changes. Please save before changing the page."),!1):e===n.uuid?!1:(r(),setTimeout(()=>{a(n.uuid)},100),!0)},fv1=()=>{const t=n2(),e=BO(),a=Nt();return S2({mutationFn:async r=>l2.post(`${a}/pages`,r).then(n=>n.json()),onSuccess:r=>{t.invalidateQueries({queryKey:["pages"]}),e({uuid:r.uuid,slug:r.slug}),F2.toast.success("Page added successfully.")}})},AO=()=>{const t=Nt(),[e]=Oe(),a=n2();return S2({mutationFn:async r=>l2.put(`${t}/page`,r).then(n=>n.json()),onSuccess:async r=>{var n;if(r.result==="error"&&((n=r.error)==null?void 0:n.code)=="PAGE_LOCKED"){a.invalidateQueries({queryKey:["page_data",e]});return}F2.toast.success("Page saved successfully.")}})},pv1=()=>{const t=Nt(),{data:e}=jh(),[a]=Oe(),{data:r}=Th(),n=n2();return S2({mutationFn:async()=>{const l=e.find(i=>i.uuid===a).slug;return await l2.post(`${t}/publish`,{slug:l,uuid:a,isHomepage:(r==null?void 0:r.homepage)===a}).then(i=>i.json())},onSuccess:async l=>{var i;if(l.result==="error"&&((i=l.error)==null?void 0:i.code)=="PAGE_LOCKED"){n.invalidateQueries({queryKey:["page_data",a]});return}F2.toast.success("Page published successfully.",{position:"bottom-right",duration:2e3})}})},zv1=()=>{const t=n2(),e=Nt();return S2({mutationFn:async a=>l2.delete(`${e}/page`,a).then(r=>r.json()),onSuccess:()=>{F2.toast.success("Page deleted successfully."),t.invalidateQueries({queryKey:["pages"]})}})},Mv1=()=>{const t=n2(),e=Nt();return S2({mutationFn:async a=>l2.post(`${e}/take-control`,{uuid:a}).then(r=>r.json()),onSuccess:(a,r)=>{t.invalidateQueries({queryKey:["page_data",r]})}})},mv1=()=>{const t=Nt();return S2({mutationFn:async()=>{const{data:e}=await l2.get(`${t}/library`).then(a=>a.json());return rt.sortBy(rt.filter(e,a=>!rt.has(a,"hidden")),"group")}})},Hv1=()=>{const t=Nt();return S2({mutationFn:async e=>{if(!e||!e.uuid)return[];try{const{data:a}=await l2.get(`${t}/block?uuid=${e.uuid}&format=${e.format}`).then(async r=>e.format==="html"?qO.getBlocksFromHTML(await r.text()):await r.json());return rt.set(a,"0._name",rt.capitalize(e.group)),a||[]}catch{return[]}}})},Vv1=()=>{const t=Nt();return S2({mutationFn:async e=>{const a=new FormData;a.append("file",e);const{data:r}=await fetch(`${t}/upload`,{method:"POST",headers:{"x-chai-access-token":Or()},body:a}).then(n=>n.json());return r}})};var EO={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},sf=d.createContext&&d.createContext(EO),Ve=function(){return Ve=Object.assign||function(t){for(var e,a=1,r=arguments.length;a<r;a++){e=arguments[a];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},Ve.apply(this,arguments)},wv1=function(t,e){var a={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(a[r[n]]=t[r[n]]);return a};function PO(t){return t&&t.map(function(e,a){return d.createElement(e.tag,Ve({key:a},e.attr),PO(e.child))})}function IO(t){return function(e){return d.createElement(bv1,Ve({attr:Ve({},t.attr)},e),PO(t.child))}}function bv1(t){var e=function(a){var r=t.attr,n=t.size,l=t.title,i=wv1(t,["attr","size","title"]),o=n||a.size||"1em",c;return a.className&&(c=a.className),t.className&&(c=(c?c+" ":"")+t.className),d.createElement("svg",Ve({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,r,i,{className:c,style:Ve(Ve({color:t.color||a.color},a.style),t.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),l&&d.createElement("title",null,l),t.children)};return sf!==void 0?d.createElement(sf.Consumer,null,function(a){return e(a)}):e(EO)}function kO(t){return IO({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}}]})(t)}function yv1(t){return IO({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}}]})(t)}const xv1=()=>{const{mutate:t,isPending:e}=Mv1(),[a]=Oe(),{data:r}=SO(),n=rt.get(r,"lockedBy.name",""),l=rt.get(r,"lockedBy.email","");return e1.jsxRuntimeExports.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl",children:[e1.jsxRuntimeExports.jsxs("h2",{className:"text-2xl font-bold",children:["Page is ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"locked"})]}),e1.jsxRuntimeExports.jsxs("div",{className:"text-gray-500 dark:text-gray-400 font-light",children:["This page is currently being edited by ",e1.jsxRuntimeExports.jsx("br",{}),e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm",children:[e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md",children:[e1.jsxRuntimeExports.jsx(yv1,{className:"w-4 h-4 text-gray-500"})," ",n]}),e1.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md lowercase",children:[e1.jsxRuntimeExports.jsx(kO,{className:"w-4 h-4 text-gray-500"})," ",l]})]}),e1.jsxRuntimeExports.jsxs("div",{className:"pt-4",children:["If you take control, ",n," will be ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"restricted"})," from making additional edits."]})]}),e1.jsxRuntimeExports.jsx(o1.Button,{disabled:e,onClick:()=>t(a),className:`w-36 ${e?"bg-transparent shadow-none hover:bg-transparent":""}`,children:e?e1.jsxRuntimeExports.jsx(c3.Loader,{className:"text-sm animate-spin text-gray-500"}):"Take Over"})]})},Lv1=()=>{const t=Nt(),e=n2();return S2({mutationFn:async a=>{const r=await fetch(`${t}/login`,{method:"POST",body:JSON.stringify(a)});if(r.ok)return await r.json();throw r.status===401?new Error("Invalid login credentials"):new Error("Invalid")},onSuccess:a=>{const{data:r}=a;if(!r.accessToken){F2.toast.error("Something went wrong. Please try again.",{position:"top-center"});return}localStorage.setItem("__chai_at",r.accessToken),localStorage.setItem("__chai_ur",JSON.stringify(rt.omit(r,["accessToken"]))),e.invalidateQueries({queryKey:["verify"]}),F2.toast.success("Logged in successfully.")},onError:()=>{F2.toast.error("Invalid login credentials. Please try again.",{position:"top-center"})}})},Ov1=()=>{const t=Nt();return Lr({queryKey:["verify"],queryFn:async()=>{const e=await l2.get(`${t}/verify`);return e.ok?(await e.json()).result==="success"?{valid:!0}:(localStorage.removeItem("__chai_at"),{valid:!1}):(localStorage.removeItem("__chai_at"),{valid:!0})}})},Sv1=()=>{const t=Nt(),e=n2();return S2({mutationFn:async()=>{const{result:a}=await l2.post(`${t}/logout`).then(r=>r.json());if(a==="success")return localStorage.clear(),e.invalidateQueries({queryKey:["verify"]}),{logout:!0};throw new Error("Invalid session")}})},Cv1=({children:t})=>{const e=Sv1();return e1.jsxRuntimeExports.jsxs(o1.AlertDialog,{children:[e1.jsxRuntimeExports.jsx(o1.AlertDialogTrigger,{asChild:!0,children:t}),e1.jsxRuntimeExports.jsxs(o1.AlertDialogContent,{children:[e1.jsxRuntimeExports.jsxs(o1.AlertDialogHeader,{children:[e1.jsxRuntimeExports.jsxs(o1.AlertDialogTitle,{children:["Are you sure, you want to ",e1.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"Sign Out"}),"?"]}),e1.jsxRuntimeExports.jsx(o1.AlertDialogDescription,{children:"Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information"})]}),e1.jsxRuntimeExports.jsxs(o1.AlertDialogFooter,{children:[e1.jsxRuntimeExports.jsx(o1.AlertDialogCancel,{disabled:e.isPending,children:"Cancel"}),e1.jsxRuntimeExports.jsxs("button",{disabled:e.isPending,onClick:()=>e.mutate(),className:"rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",children:[e.isPending&&e1.jsxRuntimeExports.jsx(c3.Loader2,{className:"animate-spin w-5 h-5"}),"Sign Out"]})]})]})]})},Bv1=()=>e1.jsxRuntimeExports.jsx(Cv1,{children:e1.jsxRuntimeExports.jsx("button",{className:"border-gray-200 rounded-md p-2 mb-2 border",children:e1.jsxRuntimeExports.jsx(c3.LogOutIcon,{className:"w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300"})})}),Av1=d.lazy(()=>Promise.resolve().then(()=>require("./PagesPanel-3jcf5-iH.cjs"))),Ev1=d.lazy(()=>Promise.resolve().then(()=>require("./ProjectPanel-EyEcNyh8.cjs"))),Pv1=d.lazy(()=>Promise.resolve().then(()=>require("./CurrentPage-SWR9WU4k.cjs"))),Iv1=()=>e1.jsxRuntimeExports.jsx("h2",{children:"Your Logo"}),kv1=()=>{const{mutate:t}=pv1();return o1.useBuilderProp("editable",!0)?e1.jsxRuntimeExports.jsx(o1.Button,{onClick:t,className:"bg-blue-600 text-white",children:"Publish"}):null},Rv1=t=>{const{data:e,isLoading:a}=Th(),{data:r,isLoading:n}=jh(),{data:l}=SO(),{mutate:i}=CO(),{mutate:o}=AO(),[c]=Oe(),v=Vv1(),h=mv1(),s=Hv1(),u=Nt(),g=d.useCallback(async m=>await v.mutateAsync(m),[v]),p=d.useCallback(async()=>await h.mutateAsync(),[h]),f=d.useCallback(async m=>await s.mutateAsync(m),[s]),z=async(m=20,V=0)=>{const b=`limit=${m}&offset=${V}`,w=await fetch(`${u}/assets?${b}`).then(y=>y.json());return w.result==="success"?w.data:[]},{logo:M=Iv1}=t;return a||!e?e1.jsxRuntimeExports.jsx(o3,{}):n||!r?e1.jsxRuntimeExports.jsx(o3,{}):e1.jsxRuntimeExports.jsx("div",{className:"bg-background text-foreground",children:e1.jsxRuntimeExports.jsx(pO,{editable:l!=null&&l.lockedBy?l==null?void 0:l.lockedBy.self:!0,nonEditableComponent:xv1,blocks:(l==null?void 0:l.blocks)||[],brandingOptions:e.brandingOptions,darkMode:t.darkMode||!1,dataProviders:(l==null?void 0:l.providers)||[],onSavePage:async({blocks:m,providers:V})=>(await o({blocks:m,providers:V,uuid:c}),!0),onSaveBrandingOptions:async m=>(await i({brandingOptions:m}),!0),topBarComponents:{left:[M],center:[Pv1],right:[kv1]},sideBarComponents:{top:[{icon:P4.FileTextIcon,name:"pages",panel:Av1},{icon:P4.GearIcon,name:"settings",panel:Ev1}],bottom:[Bv1]},uploadMediaCallback:g,fetchMediaCallback:z,getUILibraryBlocks:p,getExternalPredefinedBlock:f,getPages:()=>r,unsplashAccessKey:t.unsplashAccessKey||""})})},Nv1=({logo:t})=>{const[e,a]=d.useState(!1),[r,n]=d.useState(""),[l,i]=d.useState(""),{mutate:o,isPending:c}=Lv1(),v=h=>{h.preventDefault(),o({email:r,password:l})};return e1.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]",children:e1.jsxRuntimeExports.jsx("div",{className:"overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300",children:e1.jsxRuntimeExports.jsxs("div",{className:"p-12",children:[e1.jsxRuntimeExports.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[e1.jsxRuntimeExports.jsx(d.Suspense,{children:t?d.createElement(t):""}),e1.jsxRuntimeExports.jsx("p",{className:"max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin",children:"Enter your login credential to continue"})]}),e1.jsxRuntimeExports.jsx("div",{className:"mt-8",children:e1.jsxRuntimeExports.jsxs("form",{method:"POST",onSubmit:v,className:"space-y-5",children:[e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e1.jsxRuntimeExports.jsx(kO,{})}),e1.jsxRuntimeExports.jsx("input",{value:r,onChange:h=>n(h.target.value),type:"email",id:"email",placeholder:"Enter email",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"})]})}),e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[e1.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e1.jsxRuntimeExports.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e1.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"})})}),e1.jsxRuntimeExports.jsx("input",{value:l,onChange:h=>i(h.target.value),type:e?"text":"password",id:"pwd",placeholder:"Enter password",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"}),e1.jsxRuntimeExports.jsx("button",{type:"button",className:"absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",onClick:()=>a(!e),children:e?e1.jsxRuntimeExports.jsx(P4.EyeClosedIcon,{}):e1.jsxRuntimeExports.jsx(P4.EyeOpenIcon,{})})]})}),e1.jsxRuntimeExports.jsx("div",{children:e1.jsxRuntimeExports.jsx("button",{disabled:c||rt.size(r)<2||rt.size(l)<2,type:"submit",className:"inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",children:c?"Signing in...":"Login"})})]})}),e1.jsxRuntimeExports.jsx("div",{className:"mt-4 flex items-center justify-end gap-x-2 text-sm",children:e1.jsxRuntimeExports.jsx("a",{href:"https://apps.chaibuilder.com/settings",target:"_blank",className:"text-gray-500 hover:text-blue-400",children:"Forget your password?"})})]})})})},Tv1=t=>{const{data:e,isLoading:a}=Ov1(),r=n2();return d.useEffect(()=>{r.setQueryData(["apiBaseUrl"],t.apiBaseUrl||"/api/chaibuilder")},[t.apiBaseUrl,r]),a?e1.jsxRuntimeExports.jsx(o3,{}):e!=null&&e.valid?e1.jsxRuntimeExports.jsx(Rv1,{...t}):e1.jsxRuntimeExports.jsx(Nv1,{logo:t.logo})},jv1=new G91,Dv1=t=>e1.jsxRuntimeExports.jsxs(_91,{client:jv1,children:[e1.jsxRuntimeExports.jsx(F2.Toaster,{richColors:!0}),e1.jsxRuntimeExports.jsx(Tv1,{...t})]});mi.registerChaiDataProvider("blogs",{name:"Blogs",description:"This is a description",dataFn:async()=>[{heading:"First Blog Heading",subheading:"First Blog Subheading"},{heading:"Second Blog Heading",subheading:"Second Blog Subheading"}]});mi.registerChaiDataProvider("hero",{name:"Hero",description:"This is a description",dataFn:async()=>({heading:"Hello World",subheading:"Lorem Ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",items:[{item:"home"},{item:"about"},{item:"contact"}],meta:{height:10,visible:!0,language:["en","fs"],offset:{x:10,y:20}}})});exports.BlocksExternalDataProvider=x91;exports.ChaiBuilderEditor=pO;exports.ChaiBuilderStudio=Dv1;exports.ErrorBoundary=uO;exports.reactIsExports=If;exports.useAddPage=fv1;exports.useChaiExternalData=fO;exports.useChangePage=BO;exports.useCurrentPage=Oe;exports.useDeletePage=zv1;exports.useExpandedIds=b91;exports.usePages=jh;exports.useProject=Th;exports.useQueryClient=n2;exports.useUpdatePage=AO;exports.useUpdateProject=CO;
@@ -2262,7 +2262,7 @@ const Da = (e) => {
2262
2262
  }
2263
2263
  )
2264
2264
  ] });
2265
- }, Ea = et.lazy(() => import("./UnsplashImages-Lb78FYx7.js")), Oa = et.lazy(() => import("./UploadImages-aWG_1r7N.js")), js = ({
2265
+ }, Ea = et.lazy(() => import("./UnsplashImages-hhPOf7kt.js")), Oa = et.lazy(() => import("./UploadImages-JKjE44i7.js")), js = ({
2266
2266
  isModalView: e = !1,
2267
2267
  onSelect: t = () => {
2268
2268
  }
@@ -2443,7 +2443,7 @@ const Da = (e) => {
2443
2443
  variant: "destructive",
2444
2444
  title: "Error",
2445
2445
  description: `"${r.type}" cannot be added under "${k ? k == null ? void 0 : k._type : "root"}"`
2446
- });
2446
+ }), t([]);
2447
2447
  return;
2448
2448
  }
2449
2449
  !(k ? Ct(k._type, r.type) : !0) && k && (N._parent = k._parent, I = k._parent);