From 9128a2d91c9bb8b5f85d0d36cbabed8ecdb78495 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Sun, 4 Feb 2024 01:45:22 +0100 Subject: [PATCH] Remove build directory --- public/build/assets/404-KL0t3AFS.js | 1 - .../build/assets/AccountSetting-zssyjsw1.js | 1 - .../assets/AddressInformation-qFuBEMKS.js | 1 - public/build/assets/AstronautIcon-WQj7jOy8.js | 1 - public/build/assets/BackupSetting-HWj6Noff.js | 1 - public/build/assets/BaseEditor-8o6Sf_Iq.css | 1 - public/build/assets/BaseEditor-OMcJZctr.js | 92 -- public/build/assets/BaseListItem-YR-uygjx.js | 1 - .../build/assets/BaseMultiselect-X4tv9x1X.js | 1 - public/build/assets/BaseTable-ePsFhhtw.js | 1 - public/build/assets/CapsuleIcon-0VdBgza4.js | 1 - public/build/assets/CategoryModal-a6hq1Rp5.js | 1 - .../assets/CompanyInfoSettings-Q6oBSqVG.js | 1 - public/build/assets/Create-0CAq2sgw.js | 1 - public/build/assets/Create-GjP_r10o.js | 1 - public/build/assets/Create-bIbqW6Oi.js | 1 - public/build/assets/Create-ldI9v8mR.js | 1 - public/build/assets/Create-xjAesJHz.js | 1 - .../assets/CreateCustomFields--vFU38k2.js | 7 - .../assets/CustomFieldsSetting--g1dwzzI.js | 7 - .../assets/CustomerIndexDropdown-yAJT5lg8.js | 1 - .../build/assets/CustomerSettings-ESefEL3K.js | 1 - .../assets/CustomizationSetting-Doi_CNOR.js | 1 - public/build/assets/Dashboard-4t0kORFb.js | 1 - public/build/assets/Dashboard-e83T2oy4.js | 1 - public/build/assets/DateTimeType-qwy7_LT1.js | 1 - public/build/assets/DateType-mWUjtDdt.js | 1 - public/build/assets/DragIcon-5BDgiv1X.js | 10 - public/build/assets/DropdownType-SV0vY1Sc.js | 1 - .../build/assets/EstimateCreate-NLa0dCKB.js | 1 - public/build/assets/EstimateIcon-YddV57H2.js | 1 - .../assets/EstimateIndexDropdown-3kRrr45C.js | 1 - .../assets/ExchangeRateConverter-G19_Li5d.js | 1 - .../ExchangeRateProviderSetting-NW3XoFRZ.js | 1 - .../assets/ExpenseCategorySetting-cHhPl5Na.js | 1 - .../build/assets/FileDiskSetting-u-EUuL3T.js | 1 - .../build/assets/ForgotPassword-XAdNf2CF.js | 1 - .../build/assets/ForgotPassword-xkfZDi_m.js | 1 - public/build/assets/Index--0oqOUrP.js | 1 - public/build/assets/Index-1RZaUrxW.js | 1 - public/build/assets/Index-2sEVGso_.js | 1 - public/build/assets/Index-RdOwo3dW.js | 1 - public/build/assets/Index-TaziZM_y.js | 1 - public/build/assets/Index-WT3rQwca.js | 1 - public/build/assets/Index-YgRZBeBF.js | 1 - public/build/assets/Index-kRsMmCzt.js | 1 - public/build/assets/Index-mamFJiVU.js | 1 - public/build/assets/Index-ostgXq0C.js | 1 - public/build/assets/Index-rMVOuW_S.js | 1 - public/build/assets/Index-rynPG1fa.js | 1 - public/build/assets/Index-yD8j64Xz.js | 1 - public/build/assets/InputType-qZxU-Xid.js | 1 - public/build/assets/Installation-FJEulIYR.js | 1 - public/build/assets/InvoiceCreate-29BZaDye.js | 1 - .../assets/InvoiceIndexDropdown-0fSeYILf.js | 1 - .../assets/InvoicePublicPage-RMvPOI6W.js | 1 - public/build/assets/ItemUnitModal-iO02fk5D.js | 1 - public/build/assets/LayoutBasic-BGZ2A4IW.js | 1 - public/build/assets/LayoutBasic-VomtuFXg.js | 1 - .../assets/LayoutInstallation-83z5OX8a.js | 1 - public/build/assets/LayoutLogin-ZXC2T-pc.js | 1 - public/build/assets/LayoutLogin-nZZH3Wrx.js | 1 - public/build/assets/LineChart-SqnrSwOJ.js | 56 - public/build/assets/LoadingIcon--U35iTrM.js | 1 - public/build/assets/Login-7Py-JC1N.js | 1 - public/build/assets/Login-dWIALDfT.js | 1 - .../assets/MailConfigSetting-qhgFGm9x.js | 1 - .../build/assets/MoonwalkerIcon-ESLGNpmw.js | 1 - public/build/assets/NoteModal-jScVrYU1.js | 1 - public/build/assets/NoteModal-lSPPZux7.css | 1 - public/build/assets/NotesSetting-N-s10STV.js | 1 - .../build/assets/NotificationRoot-302eH0Cs.js | 1 - .../assets/NotificationsSetting-DHZvHryG.js | 1 - public/build/assets/NumberType-8jze5LxD.js | 1 - .../build/assets/ObservatoryIcon-pO4X6anV.js | 1 - .../build/assets/PaymentModeModal-VST8lRV4.js | 1 - .../assets/PaymentsModeSetting-Bz0CP0S3.js | 1 - public/build/assets/PhoneType-Yi4rIspz.js | 1 - .../build/assets/Poppins-Black-tiyKixU2.ttf | Bin 151340 -> 0 bytes .../build/assets/Poppins-Light-oQZpbsDM.ttf | Bin 159848 -> 0 bytes .../build/assets/Poppins-Medium-8AJSf1CK.ttf | Bin 156480 -> 0 bytes .../build/assets/Poppins-Regular-gxOM_eBK.ttf | Bin 158192 -> 0 bytes .../assets/Poppins-SemiBold-xkkfLQvD.ttf | Bin 155192 -> 0 bytes .../assets/PreferencesSetting-Eza5MSUt.js | 1 - .../assets/RecurringInvoiceCreate-28LfWqNI.js | 1 - .../RecurringInvoiceIndexDropdown-8t-VeTkj.js | 1 - public/build/assets/ResetPassword-AB5UIh7X.js | 1 - public/build/assets/ResetPassword-YtGuQNFx.js | 1 - public/build/assets/RolesSettings-_Bygl07n.js | 1 - public/build/assets/SalesTax-1bCXExhs.js | 1 - .../build/assets/SelectNotePopup-wzqC6aO8.js | 1 - .../assets/SendEstimateModal-ZGAnoJhC.js | 1 - .../build/assets/SendInvoiceModal-ShMmKpAF.js | 1 - .../build/assets/SendPaymentModal-8UUnccIY.js | 1 - public/build/assets/SettingsIndex-SEzRPbG3.js | 1 - public/build/assets/SettingsIndex-Y_m4UtLO.js | 1 - public/build/assets/SwitchType-7_ZdWo64.js | 1 - public/build/assets/THSarabunNew-AjsEQpFw.ttf | Bin 473880 -> 0 bytes .../assets/THSarabunNew-Bold-6rQIu1fB.ttf | Bin 360692 -> 0 bytes .../THSarabunNew-BoldItalic-t52o19PJ.ttf | Bin 112572 -> 0 bytes .../assets/THSarabunNew-Italic-AIglRIUE.ttf | Bin 111020 -> 0 bytes public/build/assets/TaxTypeModal-E-PaOV8a.js | 1 - .../build/assets/TaxTypesSetting-VH4BjOhf.js | 1 - public/build/assets/TextAreaType-gbitLNyC.js | 1 - public/build/assets/TimeType-Z-KOAcSE.js | 1 - .../build/assets/UpdateAppSetting-md8To8a1.js | 1 - .../assets/UpdateAppSetting-rzmq_by0.css | 1 - public/build/assets/UrlType-eEo4kYnl.js | 1 - public/build/assets/View-4-EuSE2N.js | 1 - public/build/assets/View-9HZTK8fN.js | 1 - public/build/assets/View-P1RGrJLV.js | 1 - public/build/assets/View-QHX6dSgG.js | 1 - public/build/assets/View-UEvrITZF.js | 1 - public/build/assets/View-Z7VFpScd.js | 1 - public/build/assets/View-fmI3sb2a.js | 1 - public/build/assets/View-gpBkjb6F.js | 1 - public/build/assets/View-o_JT62GZ.js | 1 - public/build/assets/auth-CmUq6Ysp.js | 1 - public/build/assets/category-6thwPNPZ.js | 1 - .../build/assets/default-avatar-4j3-l2sn.jpg | Bin 33164 -> 0 bytes public/build/assets/disk-GtAn6IIK.js | 1 - .../assets/dynamic-import-helper-0gtGTknh.js | 1 - public/build/assets/estimate-j8ZruerW.js | 1 - public/build/assets/exchange-rate-dmwjabGR.js | 1 - public/build/assets/expense--byyUT9J.js | 1 - public/build/assets/frame-u8HpZIO2.svg | 26 - public/build/assets/global-VOW0aAlU.js | 1 - public/build/assets/icon-BI8tR8R6.png | Bin 790337 -> 0 bytes public/build/assets/index-1C8OGUyy.js | 1 - public/build/assets/invoice-aiypw1uF.js | 1 - public/build/assets/invoice1-eInfYhl4.png | Bin 96871 -> 0 bytes public/build/assets/invoice2-WhNY4coq.png | Bin 95540 -> 0 bytes public/build/assets/invoice3-oNC02WIt.png | Bin 107435 -> 0 bytes .../build/assets/login-vector1-FbAMlCtm.svg | 10 - .../build/assets/login-vector2-NfewgmhZ.svg | 9 - .../build/assets/login-vector3-B4jR7JVY.svg | 3 - public/build/assets/logo-gray-5nGU86PO.png | Bin 31583 -> 0 bytes public/build/assets/logo-white-nGDfNlBY.png | Bin 26528 -> 0 bytes public/build/assets/logo-xCiSAN0z.png | Bin 29482 -> 0 bytes public/build/assets/mail-driver-pKOn2Cq7.js | 1 - public/build/assets/main-WMXHPsTs.js | 146 -- public/build/assets/main-qvsb96KG.css | 1 - public/build/assets/payment-2EqiApiu.js | 1 - public/build/assets/payment-41Om6QZO.js | 1 - public/build/assets/tick-ZCqPAN6j.png | Bin 942 -> 0 bytes public/build/assets/users-ekDlhDXB.js | 1 - public/build/manifest.json | 1291 ----------------- 147 files changed, 1775 deletions(-) delete mode 100644 public/build/assets/404-KL0t3AFS.js delete mode 100644 public/build/assets/AccountSetting-zssyjsw1.js delete mode 100644 public/build/assets/AddressInformation-qFuBEMKS.js delete mode 100644 public/build/assets/AstronautIcon-WQj7jOy8.js delete mode 100644 public/build/assets/BackupSetting-HWj6Noff.js delete mode 100644 public/build/assets/BaseEditor-8o6Sf_Iq.css delete mode 100644 public/build/assets/BaseEditor-OMcJZctr.js delete mode 100644 public/build/assets/BaseListItem-YR-uygjx.js delete mode 100644 public/build/assets/BaseMultiselect-X4tv9x1X.js delete mode 100644 public/build/assets/BaseTable-ePsFhhtw.js delete mode 100644 public/build/assets/CapsuleIcon-0VdBgza4.js delete mode 100644 public/build/assets/CategoryModal-a6hq1Rp5.js delete mode 100644 public/build/assets/CompanyInfoSettings-Q6oBSqVG.js delete mode 100644 public/build/assets/Create-0CAq2sgw.js delete mode 100644 public/build/assets/Create-GjP_r10o.js delete mode 100644 public/build/assets/Create-bIbqW6Oi.js delete mode 100644 public/build/assets/Create-ldI9v8mR.js delete mode 100644 public/build/assets/Create-xjAesJHz.js delete mode 100644 public/build/assets/CreateCustomFields--vFU38k2.js delete mode 100644 public/build/assets/CustomFieldsSetting--g1dwzzI.js delete mode 100644 public/build/assets/CustomerIndexDropdown-yAJT5lg8.js delete mode 100644 public/build/assets/CustomerSettings-ESefEL3K.js delete mode 100644 public/build/assets/CustomizationSetting-Doi_CNOR.js delete mode 100644 public/build/assets/Dashboard-4t0kORFb.js delete mode 100644 public/build/assets/Dashboard-e83T2oy4.js delete mode 100644 public/build/assets/DateTimeType-qwy7_LT1.js delete mode 100644 public/build/assets/DateType-mWUjtDdt.js delete mode 100644 public/build/assets/DragIcon-5BDgiv1X.js delete mode 100644 public/build/assets/DropdownType-SV0vY1Sc.js delete mode 100644 public/build/assets/EstimateCreate-NLa0dCKB.js delete mode 100644 public/build/assets/EstimateIcon-YddV57H2.js delete mode 100644 public/build/assets/EstimateIndexDropdown-3kRrr45C.js delete mode 100644 public/build/assets/ExchangeRateConverter-G19_Li5d.js delete mode 100644 public/build/assets/ExchangeRateProviderSetting-NW3XoFRZ.js delete mode 100644 public/build/assets/ExpenseCategorySetting-cHhPl5Na.js delete mode 100644 public/build/assets/FileDiskSetting-u-EUuL3T.js delete mode 100644 public/build/assets/ForgotPassword-XAdNf2CF.js delete mode 100644 public/build/assets/ForgotPassword-xkfZDi_m.js delete mode 100644 public/build/assets/Index--0oqOUrP.js delete mode 100644 public/build/assets/Index-1RZaUrxW.js delete mode 100644 public/build/assets/Index-2sEVGso_.js delete mode 100644 public/build/assets/Index-RdOwo3dW.js delete mode 100644 public/build/assets/Index-TaziZM_y.js delete mode 100644 public/build/assets/Index-WT3rQwca.js delete mode 100644 public/build/assets/Index-YgRZBeBF.js delete mode 100644 public/build/assets/Index-kRsMmCzt.js delete mode 100644 public/build/assets/Index-mamFJiVU.js delete mode 100644 public/build/assets/Index-ostgXq0C.js delete mode 100644 public/build/assets/Index-rMVOuW_S.js delete mode 100644 public/build/assets/Index-rynPG1fa.js delete mode 100644 public/build/assets/Index-yD8j64Xz.js delete mode 100644 public/build/assets/InputType-qZxU-Xid.js delete mode 100644 public/build/assets/Installation-FJEulIYR.js delete mode 100644 public/build/assets/InvoiceCreate-29BZaDye.js delete mode 100644 public/build/assets/InvoiceIndexDropdown-0fSeYILf.js delete mode 100644 public/build/assets/InvoicePublicPage-RMvPOI6W.js delete mode 100644 public/build/assets/ItemUnitModal-iO02fk5D.js delete mode 100644 public/build/assets/LayoutBasic-BGZ2A4IW.js delete mode 100644 public/build/assets/LayoutBasic-VomtuFXg.js delete mode 100644 public/build/assets/LayoutInstallation-83z5OX8a.js delete mode 100644 public/build/assets/LayoutLogin-ZXC2T-pc.js delete mode 100644 public/build/assets/LayoutLogin-nZZH3Wrx.js delete mode 100644 public/build/assets/LineChart-SqnrSwOJ.js delete mode 100644 public/build/assets/LoadingIcon--U35iTrM.js delete mode 100644 public/build/assets/Login-7Py-JC1N.js delete mode 100644 public/build/assets/Login-dWIALDfT.js delete mode 100644 public/build/assets/MailConfigSetting-qhgFGm9x.js delete mode 100644 public/build/assets/MoonwalkerIcon-ESLGNpmw.js delete mode 100644 public/build/assets/NoteModal-jScVrYU1.js delete mode 100644 public/build/assets/NoteModal-lSPPZux7.css delete mode 100644 public/build/assets/NotesSetting-N-s10STV.js delete mode 100644 public/build/assets/NotificationRoot-302eH0Cs.js delete mode 100644 public/build/assets/NotificationsSetting-DHZvHryG.js delete mode 100644 public/build/assets/NumberType-8jze5LxD.js delete mode 100644 public/build/assets/ObservatoryIcon-pO4X6anV.js delete mode 100644 public/build/assets/PaymentModeModal-VST8lRV4.js delete mode 100644 public/build/assets/PaymentsModeSetting-Bz0CP0S3.js delete mode 100644 public/build/assets/PhoneType-Yi4rIspz.js delete mode 100644 public/build/assets/Poppins-Black-tiyKixU2.ttf delete mode 100644 public/build/assets/Poppins-Light-oQZpbsDM.ttf delete mode 100644 public/build/assets/Poppins-Medium-8AJSf1CK.ttf delete mode 100644 public/build/assets/Poppins-Regular-gxOM_eBK.ttf delete mode 100644 public/build/assets/Poppins-SemiBold-xkkfLQvD.ttf delete mode 100644 public/build/assets/PreferencesSetting-Eza5MSUt.js delete mode 100644 public/build/assets/RecurringInvoiceCreate-28LfWqNI.js delete mode 100644 public/build/assets/RecurringInvoiceIndexDropdown-8t-VeTkj.js delete mode 100644 public/build/assets/ResetPassword-AB5UIh7X.js delete mode 100644 public/build/assets/ResetPassword-YtGuQNFx.js delete mode 100644 public/build/assets/RolesSettings-_Bygl07n.js delete mode 100644 public/build/assets/SalesTax-1bCXExhs.js delete mode 100644 public/build/assets/SelectNotePopup-wzqC6aO8.js delete mode 100644 public/build/assets/SendEstimateModal-ZGAnoJhC.js delete mode 100644 public/build/assets/SendInvoiceModal-ShMmKpAF.js delete mode 100644 public/build/assets/SendPaymentModal-8UUnccIY.js delete mode 100644 public/build/assets/SettingsIndex-SEzRPbG3.js delete mode 100644 public/build/assets/SettingsIndex-Y_m4UtLO.js delete mode 100644 public/build/assets/SwitchType-7_ZdWo64.js delete mode 100644 public/build/assets/THSarabunNew-AjsEQpFw.ttf delete mode 100644 public/build/assets/THSarabunNew-Bold-6rQIu1fB.ttf delete mode 100644 public/build/assets/THSarabunNew-BoldItalic-t52o19PJ.ttf delete mode 100644 public/build/assets/THSarabunNew-Italic-AIglRIUE.ttf delete mode 100644 public/build/assets/TaxTypeModal-E-PaOV8a.js delete mode 100644 public/build/assets/TaxTypesSetting-VH4BjOhf.js delete mode 100644 public/build/assets/TextAreaType-gbitLNyC.js delete mode 100644 public/build/assets/TimeType-Z-KOAcSE.js delete mode 100644 public/build/assets/UpdateAppSetting-md8To8a1.js delete mode 100644 public/build/assets/UpdateAppSetting-rzmq_by0.css delete mode 100644 public/build/assets/UrlType-eEo4kYnl.js delete mode 100644 public/build/assets/View-4-EuSE2N.js delete mode 100644 public/build/assets/View-9HZTK8fN.js delete mode 100644 public/build/assets/View-P1RGrJLV.js delete mode 100644 public/build/assets/View-QHX6dSgG.js delete mode 100644 public/build/assets/View-UEvrITZF.js delete mode 100644 public/build/assets/View-Z7VFpScd.js delete mode 100644 public/build/assets/View-fmI3sb2a.js delete mode 100644 public/build/assets/View-gpBkjb6F.js delete mode 100644 public/build/assets/View-o_JT62GZ.js delete mode 100644 public/build/assets/auth-CmUq6Ysp.js delete mode 100644 public/build/assets/category-6thwPNPZ.js delete mode 100644 public/build/assets/default-avatar-4j3-l2sn.jpg delete mode 100644 public/build/assets/disk-GtAn6IIK.js delete mode 100644 public/build/assets/dynamic-import-helper-0gtGTknh.js delete mode 100644 public/build/assets/estimate-j8ZruerW.js delete mode 100644 public/build/assets/exchange-rate-dmwjabGR.js delete mode 100644 public/build/assets/expense--byyUT9J.js delete mode 100644 public/build/assets/frame-u8HpZIO2.svg delete mode 100644 public/build/assets/global-VOW0aAlU.js delete mode 100644 public/build/assets/icon-BI8tR8R6.png delete mode 100644 public/build/assets/index-1C8OGUyy.js delete mode 100644 public/build/assets/invoice-aiypw1uF.js delete mode 100644 public/build/assets/invoice1-eInfYhl4.png delete mode 100644 public/build/assets/invoice2-WhNY4coq.png delete mode 100644 public/build/assets/invoice3-oNC02WIt.png delete mode 100644 public/build/assets/login-vector1-FbAMlCtm.svg delete mode 100644 public/build/assets/login-vector2-NfewgmhZ.svg delete mode 100644 public/build/assets/login-vector3-B4jR7JVY.svg delete mode 100644 public/build/assets/logo-gray-5nGU86PO.png delete mode 100644 public/build/assets/logo-white-nGDfNlBY.png delete mode 100644 public/build/assets/logo-xCiSAN0z.png delete mode 100644 public/build/assets/mail-driver-pKOn2Cq7.js delete mode 100644 public/build/assets/main-WMXHPsTs.js delete mode 100644 public/build/assets/main-qvsb96KG.css delete mode 100644 public/build/assets/payment-2EqiApiu.js delete mode 100644 public/build/assets/payment-41Om6QZO.js delete mode 100644 public/build/assets/tick-ZCqPAN6j.png delete mode 100644 public/build/assets/users-ekDlhDXB.js delete mode 100644 public/build/manifest.json diff --git a/public/build/assets/404-KL0t3AFS.js b/public/build/assets/404-KL0t3AFS.js deleted file mode 100644 index bdb4687a..00000000 --- a/public/build/assets/404-KL0t3AFS.js +++ /dev/null @@ -1 +0,0 @@ -import{L as u,e as m,k as d,r as n,o as p,c as h,b as s,t as o,a as c,w as _,p as f}from"./main-WMXHPsTs.js";const x={class:"w-full h-screen"},g={class:"flex items-center justify-center w-full h-full"},w={class:"flex flex-col items-center justify-center"},y={class:"text-primary-500",style:{"font-size":"10rem"}},b={class:"mb-10 text-3xl text-primary-500"},B={__name:"404",setup(v){const e=u();m();const l=d(()=>{if(e.path.indexOf("customer")>-1&&e.params.company)return`/${e.params.company}/customer/dashboard`;if(e.params.catchAll){let a=e.params.catchAll.indexOf("/");return a>-1?`/${e.params.catchAll.substring(a,0)}/customer/dashboard`:"/"}else return"/admin/dashboard"});return(t,a)=>{const r=n("BaseIcon"),i=n("router-link");return p(),h("div",x,[s("div",g,[s("div",w,[s("h1",y,o(t.$t("general.four_zero_four")),1),s("h5",b,o(t.$t("general.you_got_lost")),1),c(i,{class:"flex items-center w-32 h-12 px-3 py-1 text-base font-medium leading-none text-center text-white rounded whitespace-nowrap bg-primary-500 btn-lg hover:text-white",to:l.value},{default:_(()=>[c(r,{name:"ArrowLeftIcon",class:"mr-2 text-white icon"}),f(" "+o(t.$t("general.go_home")),1)]),_:1},8,["to"])])])])}}};export{B as default}; diff --git a/public/build/assets/AccountSetting-zssyjsw1.js b/public/build/assets/AccountSetting-zssyjsw1.js deleted file mode 100644 index fe8d6add..00000000 --- a/public/build/assets/AccountSetting-zssyjsw1.js +++ /dev/null @@ -1 +0,0 @@ -import{M as N,G as D,E as R,v as h,f as $,k as B,H as j,j as E,r as u,o as V,c as L,a as o,w as l,l as s,n as z,m as H,J,K,p as P,t as T,q as O,b as Q,g as f,h as b,i as W,I as X,a0 as Y}from"./main-WMXHPsTs.js";const Z=Q("span",null,null,-1),ae={__name:"AccountSetting",setup(x){const i=N(),I=D(),U=R(),{t:g}=h.useI18n();let d=$(!1),m=$(null),c=$([]);const w=$(!1);i.currentUser.avatar&&c.value.push({image:i.currentUser.avatar});const S=B(()=>({name:{required:f.withMessage(g("validation.required"),b)},email:{required:f.withMessage(g("validation.required"),b),email:f.withMessage(g("validation.email_incorrect"),W)},password:{minLength:f.withMessage(g("validation.password_length",{count:8}),X(8))},confirm_password:{sameAsPassword:f.withMessage(g("validation.password_incorrect"),Y(a.password))}})),a=j({name:i.currentUser.name,email:i.currentUser.email,language:i.currentUserSettings.language||U.selectedCompanySettings.language,password:"",confirm_password:""}),n=E(S,B(()=>a));function y(r,e){m.value=e}function C(){m.value=null,w.value=!0}async function M(){if(n.value.$touch(),n.value.$invalid)return!0;d.value=!0;let r={name:a.name,email:a.email};try{if(a.password!=null&&a.password!==void 0&&a.password!==""&&(r={...r,password:a.password}),i.currentUserSettings.language!==a.language&&await i.updateUserSettings({settings:{language:a.language}}),(await i.updateCurrentUser(r)).data.data){if(d.value=!1,m.value||w.value){let v=new FormData;m.value&&v.append("admin_avatar",m.value),v.append("is_admin_avatar_removed",w.value),await i.uploadAvatar(v),m.value=null,w.value=!1}a.password="",a.confirm_password=""}}catch{return d.value=!1,!0}}return(r,e)=>{const v=u("BaseFileUploader"),p=u("BaseInputGroup"),_=u("BaseInput"),q=u("BaseMultiselect"),F=u("BaseInputGrid"),k=u("BaseIcon"),A=u("BaseButton"),G=u("BaseSettingCard");return V(),L("form",{class:"relative",onSubmit:O(M,["prevent"])},[o(G,{title:r.$t("settings.account_settings.account_settings"),description:r.$t("settings.account_settings.section_description")},{default:l(()=>[o(F,null,{default:l(()=>[o(p,{label:r.$t("settings.account_settings.profile_picture")},{default:l(()=>[o(v,{modelValue:s(c),"onUpdate:modelValue":e[0]||(e[0]=t=>z(c)?c.value=t:c=t),avatar:!0,accept:"image/*",onChange:y,onRemove:C},null,8,["modelValue"])]),_:1},8,["label"]),Z,o(p,{label:r.$t("settings.account_settings.name"),error:s(n).name.$error&&s(n).name.$errors[0].$message,required:""},{default:l(()=>[o(_,{modelValue:a.name,"onUpdate:modelValue":e[1]||(e[1]=t=>a.name=t),invalid:s(n).name.$error,onInput:e[2]||(e[2]=t=>s(n).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(p,{label:r.$t("settings.account_settings.email"),error:s(n).email.$error&&s(n).email.$errors[0].$message,required:""},{default:l(()=>[o(_,{modelValue:a.email,"onUpdate:modelValue":e[3]||(e[3]=t=>a.email=t),invalid:s(n).email.$error,onInput:e[4]||(e[4]=t=>s(n).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(p,{error:s(n).password.$error&&s(n).password.$errors[0].$message,label:r.$t("settings.account_settings.password")},{default:l(()=>[o(_,{modelValue:a.password,"onUpdate:modelValue":e[5]||(e[5]=t=>a.password=t),type:"password",onInput:e[6]||(e[6]=t=>s(n).password.$touch())},null,8,["modelValue"])]),_:1},8,["error","label"]),o(p,{label:r.$t("settings.account_settings.confirm_password"),error:s(n).confirm_password.$error&&s(n).confirm_password.$errors[0].$message},{default:l(()=>[o(_,{modelValue:a.confirm_password,"onUpdate:modelValue":e[7]||(e[7]=t=>a.confirm_password=t),type:"password",onInput:e[8]||(e[8]=t=>s(n).confirm_password.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"]),o(p,{label:r.$t("settings.language")},{default:l(()=>[o(q,{modelValue:a.language,"onUpdate:modelValue":e[9]||(e[9]=t=>a.language=t),options:s(I).config.languages,label:"name","value-prop":"code","track-by":"name","open-direction":"top"},null,8,["modelValue","options"])]),_:1},8,["label"])]),_:1}),o(A,{loading:s(d),disabled:s(d),class:"mt-6"},{left:l(t=>[s(d)?K("",!0):(V(),H(k,{key:0,name:"SaveIcon",class:J(t.class)},null,8,["class"]))]),default:l(()=>[P(" "+T(r.$t("settings.company_info.save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title","description"])],32)}}};export{ae as default}; diff --git a/public/build/assets/AddressInformation-qFuBEMKS.js b/public/build/assets/AddressInformation-qFuBEMKS.js deleted file mode 100644 index 73fb8aea..00000000 --- a/public/build/assets/AddressInformation-qFuBEMKS.js +++ /dev/null @@ -1 +0,0 @@ -import{L as x,v as I,f as C,r as m,o as b,c as y,a as o,w as r,b as d,t as p,l as e,J as h,p as F,K as v,m as z,q as k}from"./main-WMXHPsTs.js";import{a as w,u as S}from"./global-VOW0aAlU.js";import"./auth-CmUq6Ysp.js";const D={class:"mb-6"},j={class:"font-bold text-left"},A={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},N={class:"grid grid-cols-5 gap-4 mb-8"},G={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},T={class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},q={class:"md:col-span-3"},E={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},J={class:"p-1"},K={class:"grid grid-cols-5 gap-4 mb-8"},L={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},R={key:0,class:"grid col-span-5 lg:col-span-4 gap-y-6 gap-x-4 md:grid-cols-6"},H={class:"md:col-span-3"},O={class:"flex items-center justify-end"},Z={__name:"AddressInformation",setup(P){const l=w();x();const{tm:$,t:Q}=I.useI18n(),g=S();let u=C(!1);g.fetchCountries();function B(){u.value=!0;let a=l.userForm;l.updateCurrentUser({data:a,message:$("customers.address_updated_message")}).then(s=>{u.value=!1}).catch(s=>{u.value=!1})}return(a,s)=>{const i=m("BaseInput"),n=m("BaseInputGroup"),f=m("BaseMultiselect"),c=m("BaseTextarea"),U=m("BaseDivider"),_=m("BaseIcon"),V=m("BaseButton"),M=m("BaseCard");return b(),y("form",{class:"relative h-full mt-4",onSubmit:k(B,["prevent"])},[o(M,null,{default:r(()=>[d("div",D,[d("h6",j,p(a.$t("settings.menu_title.address_information")),1),d("p",A,p(a.$t("settings.address_information.section_description")),1)]),d("div",N,[d("h6",G,p(a.$t("customers.billing_address")),1),d("div",T,[o(n,{label:a.$t("customers.name"),class:"w-full md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.billing.name,"onUpdate:modelValue":s[0]||(s[0]=t=>e(l).userForm.billing.name=t),modelModifiers:{trim:!0},type:"text",class:"w-full",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:r(()=>[o(f,{modelValue:e(l).userForm.billing.country_id,"onUpdate:modelValue":s[1]||(s[1]=t=>e(l).userForm.billing.country_id=t),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.billing.state,"onUpdate:modelValue":s[2]||(s[2]=t=>e(l).userForm.billing.state=t),name:"billing.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.billing.city,"onUpdate:modelValue":s[3]||(s[3]=t=>e(l).userForm.billing.city=t),name:"billing.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:r(()=>[o(c,{modelValue:e(l).userForm.billing.address_street_1,"onUpdate:modelValue":s[4]||(s[4]=t=>e(l).userForm.billing.address_street_1=t),modelModifiers:{trim:!0},placeholder:a.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(l).userForm.billing.address_street_2,"onUpdate:modelValue":s[5]||(s[5]=t=>e(l).userForm.billing.address_street_2=t),modelModifiers:{trim:!0},placeholder:a.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",q,[o(n,{label:a.$t("customers.phone"),class:"text-left"},{default:r(()=>[o(i,{modelValue:e(l).userForm.billing.phone,"onUpdate:modelValue":s[6]||(s[6]=t=>e(l).userForm.billing.phone=t),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:r(()=>[o(i,{modelValue:e(l).userForm.billing.zip,"onUpdate:modelValue":s[7]||(s[7]=t=>e(l).userForm.billing.zip=t),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])]),o(U,{class:"mb-5 md:mb-8"}),d("div",E,[d("div",J,[o(V,{ref:"sameAddress",type:"button",onClick:s[8]||(s[8]=t=>e(l).copyAddress(!0))},{left:r(t=>[o(_,{name:"DocumentDuplicateIcon",class:h(t.class)},null,8,["class"])]),default:r(()=>[F(" "+p(a.$t("customers.copy_billing_address")),1)]),_:1},512)])]),d("div",K,[d("h6",L,p(a.$t("customers.shipping_address")),1),e(l).userForm.shipping?(b(),y("div",R,[o(n,{label:a.$t("customers.name"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.shipping.name,"onUpdate:modelValue":s[9]||(s[9]=t=>e(l).userForm.shipping.name=t),modelModifiers:{trim:!0},type:"text",name:"address_name"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.country"),class:"md:col-span-3"},{default:r(()=>[o(f,{modelValue:e(l).userForm.shipping.country_id,"onUpdate:modelValue":s[10]||(s[10]=t=>e(l).userForm.shipping.country_id=t),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"",options:e(g).countries,placeholder:a.$t("general.select_country"),class:"w-full"},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.state"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.shipping.state,"onUpdate:modelValue":s[11]||(s[11]=t=>e(l).userForm.shipping.state=t),name:"shipping.state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.city"),class:"md:col-span-3"},{default:r(()=>[o(i,{modelValue:e(l).userForm.shipping.city,"onUpdate:modelValue":s[12]||(s[12]=t=>e(l).userForm.shipping.city=t),name:"shipping.city",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.address"),class:"md:col-span-3"},{default:r(()=>[o(c,{modelValue:e(l).userForm.shipping.address_street_1,"onUpdate:modelValue":s[13]||(s[13]=t=>e(l).userForm.shipping.address_street_1=t),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_1"),name:"shipping_street1"},null,8,["modelValue","placeholder"]),o(c,{modelValue:e(l).userForm.shipping.address_street_2,"onUpdate:modelValue":s[14]||(s[14]=t=>e(l).userForm.shipping.address_street_2=t),modelModifiers:{trim:!0},type:"text",placeholder:a.$t("general.street_2"),name:"shipping_street2",class:"mt-3"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),d("div",H,[o(n,{label:a.$t("customers.phone"),class:"text-left"},{default:r(()=>[o(i,{modelValue:e(l).userForm.shipping.phone,"onUpdate:modelValue":s[15]||(s[15]=t=>e(l).userForm.shipping.phone=t),modelModifiers:{trim:!0},type:"text",name:"phone"},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:a.$t("customers.zip_code"),class:"mt-2 text-left"},{default:r(()=>[o(i,{modelValue:e(l).userForm.shipping.zip,"onUpdate:modelValue":s[16]||(s[16]=t=>e(l).userForm.shipping.zip=t),modelModifiers:{trim:!0},type:"text",name:"zip"},null,8,["modelValue"])]),_:1},8,["label"])])])):v("",!0)]),d("div",O,[o(V,{loading:e(u),disabled:e(u)},{left:r(t=>[e(u)?v("",!0):(b(),z(_,{key:0,name:"SaveIcon",class:h(t.class)},null,8,["class"]))]),default:r(()=>[F(" "+p(a.$t("general.save")),1)]),_:1},8,["loading","disabled"])])]),_:1})],32)}}};export{Z as default}; diff --git a/public/build/assets/AstronautIcon-WQj7jOy8.js b/public/build/assets/AstronautIcon-WQj7jOy8.js deleted file mode 100644 index 651e21fa..00000000 --- a/public/build/assets/AstronautIcon-WQj7jOy8.js +++ /dev/null @@ -1 +0,0 @@ -import{o,c as n,b as l,J as d}from"./main-WMXHPsTs.js";const i={width:"125",height:"110",viewBox:"0 0 125 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},C=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"124.808",height:"110",fill:"white"})])],-1),s={__name:"AstronautIcon",props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(o(),n("svg",i,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M46.8031 84.4643C46.8031 88.8034 43.3104 92.3215 39.0026 92.3215C34.6948 92.3215 31.2021 88.8034 31.2021 84.4643C31.2021 80.1252 34.6948 76.6072 39.0026 76.6072C43.3104 76.6072 46.8031 80.1252 46.8031 84.4643Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M60.4536 110H64.3539V72.6785H60.4536V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M85.8055 76.6072H70.2045C69.1319 76.6072 68.2544 77.4911 68.2544 78.5715V82.5C68.2544 83.5804 69.1319 84.4643 70.2045 84.4643H85.8055C86.878 84.4643 87.7556 83.5804 87.7556 82.5V78.5715C87.7556 77.4911 86.878 76.6072 85.8055 76.6072ZM70.2045 82.5H85.8055V78.5715H70.2045V82.5Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.6556 1.96429C94.8811 1.96429 97.506 4.60821 97.506 7.85714V19.6429H83.8181L85.308 21.6071H99.4561V7.85714C99.4561 3.53571 95.9459 0 91.6556 0H33.152C28.8618 0 25.3516 3.53571 25.3516 7.85714V21.6071H39.3203L40.8745 19.6429H27.3017V7.85714C27.3017 4.60821 29.9265 1.96429 33.152 1.96429H91.6556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M122.858 92.3213H117.007C115.935 92.3213 115.057 93.2052 115.057 94.2856V102.143C115.057 103.223 115.935 104.107 117.007 104.107H122.858C123.93 104.107 124.808 103.223 124.808 102.143V94.2856C124.808 93.2052 123.93 92.3213 122.858 92.3213ZM117.007 102.143H122.858V94.2856H117.007V102.143Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M103.356 43.2142V70.7142H21.4511V43.2142H26.1821V41.2498H19.501V72.6783H105.306V41.2498H98.3541L98.2839 43.2142H103.356Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 21.6071C104.632 21.6071 107.257 24.251 107.257 27.5V41.25H98.2257L98.0853 43.2142H109.207V27.5C109.207 23.1609 105.714 19.6428 101.406 19.6428H83.8182L85.0878 21.6071H101.406ZM40.8746 19.6428H23.4016C19.0937 19.6428 15.6011 23.1609 15.6011 27.5V43.2142H26.1961L26.3365 41.25H17.5512V27.5C17.5512 24.251 20.1761 21.6071 23.4016 21.6071H39.3204L40.8746 19.6428Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 9.82153C45.1709 9.82153 31.2021 23.8917 31.2021 41.2501C31.2021 58.6085 45.1709 72.6787 62.4041 72.6787C79.6373 72.6787 93.606 58.6085 93.606 41.2501C93.606 23.8917 79.6373 9.82153 62.4041 9.82153ZM62.4041 11.7858C78.5335 11.7858 91.6559 25.0035 91.6559 41.2501C91.6559 57.4967 78.5335 70.7144 62.4041 70.7144C46.2746 70.7144 33.1523 57.4967 33.1523 41.2501C33.1523 25.0035 46.2746 11.7858 62.4041 11.7858Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M62.4041 19.6428C45.1709 19.6428 31.2021 23.8916 31.2021 41.25C31.2021 58.6084 45.1709 66.7857 62.4041 66.7857C79.6373 66.7857 93.606 58.6084 93.606 41.25C93.606 23.8916 79.6373 19.6428 62.4041 19.6428ZM62.4041 21.6071C82.6346 21.6071 91.6559 27.665 91.6559 41.25C91.6559 56.0096 80.7216 64.8214 62.4041 64.8214C44.0866 64.8214 33.1523 56.0096 33.1523 41.25C33.1523 27.665 42.1735 21.6071 62.4041 21.6071Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M101.406 70.7144H23.4014C10.478 70.7144 0 81.2685 0 94.2858V110H124.808V94.2858C124.808 81.2685 114.33 70.7144 101.406 70.7144ZM101.406 72.6786C113.234 72.6786 122.858 82.3724 122.858 94.2858V108.036H1.95012V94.2858C1.95012 82.3724 11.574 72.6786 23.4014 72.6786H101.406Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M33.152 33.3928H29.2518C27.0969 33.3928 25.3516 35.1509 25.3516 37.3214V45.1785C25.3516 47.3491 27.0969 49.1071 29.2518 49.1071H33.152V33.3928ZM31.2019 35.3571V47.1428H29.2518C28.1773 47.1428 27.3017 46.2609 27.3017 45.1785V37.3214C27.3017 36.2391 28.1773 35.3571 29.2518 35.3571H31.2019Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M95.556 33.3928H91.6558V49.1071H95.556C97.7109 49.1071 99.4562 47.3491 99.4562 45.1785V37.3214C99.4562 35.1509 97.7109 33.3928 95.556 33.3928ZM95.556 35.3571C96.6305 35.3571 97.5061 36.2391 97.5061 37.3214V45.1785C97.5061 46.2609 96.6305 47.1428 95.556 47.1428H93.6059V35.3571H95.556Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M94.581 15.7144C94.0447 15.7144 93.606 16.1563 93.606 16.6965V34.3751C93.606 34.9152 94.0447 35.3572 94.581 35.3572C95.1173 35.3572 95.5561 34.9152 95.5561 34.3751V16.6965C95.5561 16.1563 95.1173 15.7144 94.581 15.7144Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M38.0273 41.2499C37.4891 41.2499 37.0522 40.8099 37.0522 40.2678C37.0522 33.3142 44.1409 25.5356 53.6283 25.5356C54.1665 25.5356 54.6033 25.9756 54.6033 26.5178C54.6033 27.0599 54.1665 27.4999 53.6283 27.4999C45.2564 27.4999 39.0024 34.2414 39.0024 40.2678C39.0024 40.8099 38.5655 41.2499 38.0273 41.2499Z",class:d(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M97.5059 110H99.456V72.6785H97.5059V110Z",class:d(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.3516 110H27.3017V72.6785H25.3516V110Z",class:d(e.secondaryFillColor)},null,2)]),C]))}};export{s as _}; diff --git a/public/build/assets/BackupSetting-HWj6Noff.js b/public/build/assets/BackupSetting-HWj6Noff.js deleted file mode 100644 index 2db2224b..00000000 --- a/public/build/assets/BackupSetting-HWj6Noff.js +++ /dev/null @@ -1 +0,0 @@ -import{a4 as W,s as q,a1 as j,u as x,f as y,H as U,F as E,v as O,k as w,g as P,h as F,j as Y,r,o as G,m as L,w as n,b as D,p as $,t as S,l as c,a as s,q as Z,J as R,K as ee,a7 as te,c as ae,N as se}from"./main-WMXHPsTs.js";import{u as A}from"./disk-GtAn6IIK.js";const H=(I=!1)=>{const m=I?window.pinia.defineStore:W,{global:_}=window.i18n;return m({id:"backup",state:()=>({backups:[],currentBackupData:{option:"full",selected_disk:null}}),actions:{fetchBackups(f){return new Promise((o,a)=>{q.get("/api/v1/backups",{params:f}).then(e=>{this.backups=e.data.data,o(e)}).catch(e=>{j(e),a(e)})})},createBackup(f){return new Promise((o,a)=>{q.post("/api/v1/backups",f).then(e=>{x().showNotification({type:"success",message:_.t("settings.backup.created_message")}),o(e)}).catch(e=>{j(e),a(e)})})},removeBackup(f){return new Promise((o,a)=>{q.delete(`/api/v1/backups/${f.disk}`,{params:f}).then(e=>{x().showNotification({type:"success",message:_.t("settings.backup.deleted_message")}),o(e)}).catch(e=>{j(e),a(e)})})}}})()},oe={class:"flex justify-between w-full"},ne={class:"p-6"},le={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid"},ce={__name:"BackupModal",setup(I){y(null),y(!1);let m=y(!1),_=y(!1);const f=U(["full","only-db","only-files"]),o=H(),a=E(),e=A(),{t:p}=O.useI18n(),k=w(()=>a.active&&a.componentName==="BackupModal"),M=w(()=>e.disks.map(l=>({...l,name:l.name+" — ["+l.driver+"]"}))),V=w(()=>({currentBackupData:{option:{required:P.withMessage(p("validation.required"),F)},selected_disk:{required:P.withMessage(p("validation.required"),F)}}})),b=Y(V,w(()=>o));async function N(){if(b.value.currentBackupData.$touch(),b.value.currentBackupData.$invalid)return!0;let l={option:o.currentBackupData.option,file_disk_id:o.currentBackupData.selected_disk.id};try{m.value=!0,(await o.createBackup(l)).data&&(m.value=!1,a.refreshData&&a.refreshData(),a.closeModal())}catch{m.value=!1}}async function z(){_.value=!0;let l=await e.fetchDisks({limit:"all"});o.currentBackupData.selected_disk=l.data.data[0],_.value=!1}function C(){a.closeModal(),setTimeout(()=>{b.value.$reset(),o.$reset()})}return(l,g)=>{const t=r("BaseIcon"),i=r("BaseMultiselect"),d=r("BaseInputGroup"),u=r("BaseInputGrid"),h=r("BaseButton"),T=r("BaseModal");return G(),L(T,{show:k.value,onClose:C,onOpen:z},{header:n(()=>[D("div",oe,[$(S(c(a).title)+" ",1),s(t,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:C})])]),default:n(()=>[D("form",{onSubmit:Z(N,["prevent"])},[D("div",ne,[s(u,{layout:"one-column"},{default:n(()=>[s(d,{label:l.$t("settings.backup.select_backup_type"),error:c(b).currentBackupData.option.$error&&c(b).currentBackupData.option.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:n(()=>[s(i,{modelValue:c(o).currentBackupData.option,"onUpdate:modelValue":g[0]||(g[0]=B=>c(o).currentBackupData.option=B),options:f,"can-deselect":!1,placeholder:l.$t("settings.backup.select_backup_type"),searchable:""},null,8,["modelValue","options","placeholder"])]),_:1},8,["label","error"]),s(d,{label:l.$t("settings.disk.select_disk"),error:c(b).currentBackupData.selected_disk.$error&&c(b).currentBackupData.selected_disk.$errors[0].$message,horizontal:"",required:"",class:"py-2"},{default:n(()=>[s(i,{modelValue:c(o).currentBackupData.selected_disk,"onUpdate:modelValue":g[1]||(g[1]=B=>c(o).currentBackupData.selected_disk=B),"content-loading":c(_),options:M.value,searchable:!0,"allow-empty":!1,label:"name","value-prop":"id",placeholder:l.$t("settings.disk.select_disk"),"track-by":"name",object:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","error"])]),_:1})]),D("div",le,[s(h,{class:"mr-3",variant:"primary-outline",type:"button",onClick:C},{default:n(()=>[$(S(l.$t("general.cancel")),1)]),_:1}),s(h,{loading:c(m),disabled:c(m),variant:"primary",type:"submit"},{left:n(B=>[c(m)?ee("",!0):(G(),L(t,{key:0,name:"SaveIcon",class:R(B.class)},null,8,["class"]))]),default:n(()=>[$(" "+S(l.$t("general.create")),1)]),_:1},8,["loading","disabled"])])],32)]),_:1},8,["show"])}}},re={class:"grid my-14 md:grid-cols-3"},ie={class:"inline-block"},pe={__name:"BackupSetting",setup(I){const m=te(),_=H(),f=E(),o=A(),{t:a}=O.useI18n(),e=U({selected_disk:{driver:"local"}}),p=y("");let k=y(!0);const M=w(()=>[{key:"path",label:a("settings.backup.path"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"created_at",label:a("settings.backup.created_at"),tdClass:"font-medium text-gray-900"},{key:"size",label:a("settings.backup.size"),tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]),V=w(()=>o.disks.map(t=>({...t,name:t.name+" — ["+t.driver+"]"})));z();function b(t){m.openDialog({title:a("general.are_you_sure"),message:a("settings.backup.backup_confirm_delete"),yesLabel:a("general.ok"),noLabel:a("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async i=>{if(i){let d={disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:t.path},u=await _.removeBackup(d);if(u.data.success||u.data.backup)return p.value&&p.value.refresh(),!0}})}function N(){setTimeout(()=>{p.value.refresh()},100)}async function z(){k.value=!0;let t=await o.fetchDisks({limit:"all"});t.data.error,e.selected_disk=t.data.data.find(i=>i.set_as_default==0),k.value=!1}async function C({page:t,filter:i,sort:d}){let u={disk:e.selected_disk.driver,filed_disk_id:e.selected_disk.id};k.value=!0;let h=await _.fetchBackups(u);return k.value=!1,{data:h.data.backups,pagination:{totalPages:1,currentPage:1}}}async function l(){f.openModal({title:a("settings.backup.create_backup"),componentName:"BackupModal",refreshData:p.value&&p.value.refresh,size:"sm"})}async function g(t){k.value=!0,window.axios({method:"GET",url:"/api/v1/download-backup",responseType:"blob",params:{disk:e.selected_disk.driver,file_disk_id:e.selected_disk.id,path:t.path}}).then(i=>{const d=window.URL.createObjectURL(new Blob([i.data])),u=document.createElement("a");u.href=d,u.setAttribute("download",t.path.split("/")[1]),document.body.appendChild(u),u.click(),k.value=!1}).catch(i=>{k.value=!1})}return(t,i)=>{const d=r("BaseIcon"),u=r("BaseButton"),h=r("BaseMultiselect"),T=r("BaseInputGroup"),B=r("BaseDropdownItem"),J=r("BaseDropdown"),K=r("BaseTable"),X=r("BaseSettingCard");return G(),ae(se,null,[s(ce),s(X,{title:t.$t("settings.backup.title",1),description:t.$t("settings.backup.description")},{action:n(()=>[s(u,{variant:"primary-outline",onClick:l},{left:n(v=>[s(d,{class:R(v.class),name:"PlusIcon"},null,8,["class"])]),default:n(()=>[$(" "+S(t.$t("settings.backup.new_backup")),1)]),_:1})]),default:n(()=>[D("div",re,[s(T,{label:t.$t("settings.disk.select_disk"),"content-loading":c(k)},{default:n(()=>[s(h,{modelValue:e.selected_disk,"onUpdate:modelValue":i[0]||(i[0]=v=>e.selected_disk=v),"content-loading":c(k),options:V.value,"track-by":"name",placeholder:t.$t("settings.disk.select_disk"),label:"name",searchable:!0,object:"",class:"w-full","value-prop":"id",onSelect:N},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"])]),s(K,{ref_key:"table",ref:p,class:"mt-10","show-filter":!1,data:C,columns:M.value},{"cell-actions":n(({row:v})=>[s(J,null,{activator:n(()=>[D("div",ie,[s(d,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:n(()=>[s(B,{onClick:Q=>g(v.data)},{default:n(()=>[s(d,{name:"CloudDownloadIcon",class:"mr-3 text-gray-600"}),$(" "+S(t.$t("general.download")),1)]),_:2},1032,["onClick"]),s(B,{onClick:Q=>b(v.data)},{default:n(()=>[s(d,{name:"TrashIcon",class:"mr-3 text-gray-600"}),$(" "+S(t.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{pe as default}; diff --git a/public/build/assets/BaseEditor-8o6Sf_Iq.css b/public/build/assets/BaseEditor-8o6Sf_Iq.css deleted file mode 100644 index 37f6af02..00000000 --- a/public/build/assets/BaseEditor-8o6Sf_Iq.css +++ /dev/null @@ -1 +0,0 @@ -.ProseMirror{min-height:200px;padding:8px 12px;outline:none;border-radius:.375rem;border-top-left-radius:0;border-top-right-radius:0;border-width:1px;border-color:transparent}.ProseMirror h1{font-size:2em;font-weight:700}.ProseMirror h2{font-size:1.5em;font-weight:700}.ProseMirror h3{font-size:1.17em;font-weight:700}.ProseMirror ul{padding:0 1rem;list-style:disc!important}.ProseMirror ol{padding:0 1rem;list-style:auto!important}.ProseMirror blockquote{padding-left:1rem;border-left:2px solid rgba(13,13,13,.1)}.ProseMirror code{background-color:#6161611a;color:#616161;border-radius:.4rem;font-size:.9rem;padding:.1rem .3rem}.ProseMirror pre{background:#0d0d0d;color:#fff;font-family:JetBrainsMono,monospace;padding:.75rem 1rem;border-radius:.5rem}.ProseMirror pre code{color:inherit;padding:0;background:none;font-size:.8rem}.ProseMirror:focus{border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--color-primary-400),var(--tw-border-opacity));--tw-ring-opacity: 1;--tw-ring-color: rgba(var(--color-primary-400), var(--tw-ring-opacity))} diff --git a/public/build/assets/BaseEditor-OMcJZctr.js b/public/build/assets/BaseEditor-OMcJZctr.js deleted file mode 100644 index a029ab76..00000000 --- a/public/build/assets/BaseEditor-OMcJZctr.js +++ /dev/null @@ -1,92 +0,0 @@ -import{b0 as go,f as yo,bp as bo,an as ko,bo as xo,l as So,aD as $i,bq as xn,br as Mo,bs as wo,Y as Co,H as To,bt as Oo,bu as vo,Z as le,o as Q,c as ie,b as w,$ as Ao,bv as No,bw as Eo,bx as Do,bg as Io,z as Ro,aa as Po,r as z,m as Bo,w as Sn,a as D,J as E,K as Lo}from"./main-WMXHPsTs.js";function J(r){this.content=r}J.prototype={constructor:J,find:function(r){for(var e=0;e>1}};J.from=function(r){if(r instanceof J)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new J(e)};function Hi(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Hi(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function _i(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let c=0,d=Math.min(o.text.length,l.text.length);for(;ce&&n(a,i+l,s||null,o)!==!1&&a.content.size){let d=l+1;a.nodesBetween(Math.max(0,e-d),Math.min(a.content.size,t-d),n,i+d)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new b(n,i)}cutByIndex(e,t){return e==t?b.empty:e==0&&t==this.content.length?this:new b(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new b(i,s)}addToStart(e){return new b([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new b(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Ft(n+1,o):Ft(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return b.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new b(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return b.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}};I.none=[];class qt extends Error{}class k{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Ji(this.content,e+this.openStart,t);return n&&new k(n,this.openStart,this.openEnd)}removeBetween(e,t){return new k(ji(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return k.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new k(b.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new k(e,n,i)}}k.empty=new k(b.empty,0,0);function ji(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(ji(s.content,e-i-1,t-i-1)))}function Ji(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Ji(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}function zo(r,e,t){if(t.openStart>r.depth)throw new qt("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new qt("Inconsistent open depths");return Wi(r,e,t,0)}function Wi(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function wt(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(Ke(r.nodeAfter,n),s++));for(let l=s;li&&qn(r,e,i+1),o=n.depth>i&&qn(t,n,i+1),l=[];return wt(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(qi(s,o),Ke(Ue(s,Ki(r,e,t,n,i+1)),l)):(s&&Ke(Ue(s,Kt(r,e,i+1)),l),wt(e,t,i,l),o&&Ke(Ue(o,Kt(t,n,i+1)),l)),wt(n,null,i,l),new b(l)}function Kt(r,e,t){let n=[];if(wt(null,r,t,n),r.depth>t){let i=qn(r,e,t+1);Ke(Ue(i,Kt(r,e,t+1)),n)}return wt(e,null,t,n),new b(n)}function Fo(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(b.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class vt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ut(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(n.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new vt(t,n,s)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ui(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=b.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=b.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}};Ge.prototype.text=void 0;class Gt extends Ge{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ui(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Gt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Gt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ui(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ze{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Ho(e,t);if(n.next==null)return Ze.empty;let i=Gi(n);n.next&&n.err("Unexpected trailing text");let s=Uo(Ko(i));return Go(s,n),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(n.next[o].next);return s}).join(` -`)}}Ze.empty=new Ze(!0);class Ho{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Gi(r){let e=[];do e.push(_o(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function _o(r){let e=[];do e.push(jo(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function jo(r){let e=qo(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=Jo(r,e);else break;return e}function Er(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function Jo(r,e){let t=Er(r),n=t;return r.eat(",")&&(r.next!="}"?n=Er(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function Wo(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function qo(r){if(r.eat("(")){let e=Gi(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=Wo(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Ko(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{r[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d{c||i.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let s=e[n.join(",")]=new Ze(n.indexOf(r.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tn[s]=new es(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class Yo{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ln{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Qi(i.attrs),this.excluded=null;let s=Xi(this.attrs);this.instance=s?new I(this,s):null}create(e=null){return!e&&this.instance?this.instance:new I(this,Zi(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new ln(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t-1}}class Xo{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=J.from(e.nodes),t.marks=J.from(e.marks||{}),this.nodes=Ir.compile(this.spec.nodes,this),this.marks=ln.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;s.contentMatch=n[o]||(n[o]=Ze.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=l=="_"?null:l?Rr(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Rr(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ir){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new Gt(n,n.defaultAttrs,e,I.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Ge.fromJSON(this,e)}markFromJSON(e){return I.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Rr(r,e){let t=[];for(let n=0;n-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}class ut{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new Br(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Br(this,t,!0);return n.addAll(e,t.from,t.to),k.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=Lr(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Lr(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ut(e,ut.schemaRules(e)))}}const ts={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Zo={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ns={ol:!0,ul:!0},Yt=1,Xt=2,Ct=4;function Pr(r,e,t){return e!=null?(e?Yt:0)|(e==="full"?Xt:0):r&&r.whitespace=="pre"?Yt|Xt:t&~Ct}class Vt{constructor(e,t,n,i,s,o,l){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=I.none,this.stashMarks=[],this.match=o||(l&Ct?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(b.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Yt)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=b.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(b.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;tthis.addAll(e)),o&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,s,s.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=I.none,n=I.none;for(let i=0;i{o.clearMark(l)&&(n=l.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,n]}addElementByRule(e,t,n){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,n){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let d=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!d||d.name!=c&&d.groups.indexOf(c)==-1)return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=rl(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function Qo(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&ns.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function el(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function tl(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function Lr(r){let e={};for(let t in r)e[t]=r[t];return e}function nl(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&ke.renderSpec(Tn(n),i(e,t))}static renderSpec(e,t,n=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?e.createElementNS(n,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let d in a)if(a[d]!=null){let u=d.indexOf(" ");u>0?l.setAttributeNS(d.slice(0,u),d.slice(u+1),a[d]):l.setAttribute(d,a[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:h}=ke.renderSpec(e,u,n);if(l.appendChild(f),h){if(o)throw new RangeError("Multiple content holes");o=h}}}return{dom:l,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ke(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=zr(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return zr(e.marks)}}function zr(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Tn(r){return r.document||window.document}const rs=65535,is=Math.pow(2,16);function il(r,e){return r+e*is}function Fr(r){return r&rs}function sl(r){return(r-(r&rs))/is}const ss=1,ls=2,_t=4,as=8;class Un{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&as)>0}get deletedBefore(){return(this.delInfo&(ss|_t))>0}get deletedAfter(){return(this.delInfo&(ls|_t))>0}get deletedAcross(){return(this.delInfo&_t)>0}}class oe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&oe.empty)return oe.empty}recover(e){let t=0,n=Fr(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+s],d=this.ranges[l+o],u=a+c;if(e<=u){let f=c?e==a?-1:e==u?1:t:t,h=a+i+(f<0?0:d);if(n)return h;let p=e==(t<0?a:u)?null:il(l/3,e-a),m=e==a?ls:e==u?ss:_t;return(t<0?e!=a:e!=u)&&(m|=as),new Un(h,m,p)}i+=d-c}return n?e+i:new Un(e+i,0,null)}touches(e,t){let n=0,i=Fr(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+s],d=a+c;if(e<=d&&l==i*3)return!0;n+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new lt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;ns&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return F.fromReplace(e,this.from,this.to,s)}invert(){return new xe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new De(t.pos,n.pos,this.mark)}merge(e){return e instanceof De&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new De(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new De(t.from,t.to,e.markFromJSON(t.mark))}}X.jsonID("addMark",De);class xe extends X{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new k(ur(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return F.fromReplace(e,this.from,this.to,n)}invert(){return new De(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new xe(t.pos,n.pos,this.mark)}merge(e){return e instanceof xe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xe(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xe(t.from,t.to,e.markFromJSON(t.mark))}}X.jsonID("removeMark",xe);class Ie extends X{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return F.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return F.fromReplace(e,this.pos,this.pos+1,new k(b.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new H(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new H(t.from,t.to,t.gapFrom,t.gapTo,k.fromJSON(e,t.slice),t.insert,!!t.structure)}}X.jsonID("replaceAround",H);function Gn(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function ol(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,c,d)=>{if(!a.isInline)return;let u=a.marks;if(!n.isInSet(u)&&d.type.allowsMarkType(n.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=n.addToSet(u);for(let m=0;mr.step(a)),s.forEach(a=>r.step(a))}function ll(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof ln){let c=o.marks,d;for(;d=n.isInSet(c);)(a||(a=[])).push(d),c=d.removeFromSet(c)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let d=0;dr.step(new xe(o.from,o.to,o.style)))}function al(r,e,t,n=t.contentMatch){let i=r.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l=0;l--)r.step(s[l])}function cl(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function bt(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(nt;p--)m||n.index(p)>0?(m=!0,d=b.from(n.node(p).copy(d)),u++):a--;let f=b.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=b.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new H(i,s,i,s,new k(n,0,0),t.length,!0))}function pl(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{if(o.isTextblock&&!o.hasMarkup(n,i)&&ml(r.doc,r.mapping.slice(s).map(l),n)){r.clearIncompatible(r.mapping.slice(s).map(l,1),n);let a=r.mapping.slice(s),c=a.map(l,1),d=a.map(l+o.nodeSize,1);return r.step(new H(c,d,c+1,d-1,new k(b.from(n.create(i,null,o.marks)),0,0),1,!0)),!1}})}function ml(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function gl(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new H(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new k(b.from(o),0,0),1,!0))}function at(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=t-2;c>s;c--,d--){let u=i.node(c),f=i.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=n&&n[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=n&&n[d]||u;if(!u.canReplace(f+1,u.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function yl(r,e,t=1,n){let i=r.doc.resolve(e),s=b.empty,o=b.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){s=b.from(i.node(l).copy(s));let d=n&&n[c];o=b.from(d?d.type.create(d.attrs,o):i.node(l).copy(o))}r.step(new W(e,e,new k(s.append(o),t,t),!0))}function Ve(r,e){let t=r.resolve(e),n=t.index();return cs(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function cs(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function an(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&cs(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function bl(r,e,t){let n=new W(e-t,e+t,k.empty,!0);r.step(n)}function kl(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),c=n.node(o),d=!1;if(s==1)d=c.canReplace(a,a,i);else{let u=c.contentMatchAt(a).findWrapping(i.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function hr(r,e,t=e,n=k.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return us(i,s,n)?new W(e,t,n):new xl(i,s,n).fit()}function us(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class xl{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=b.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=b.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new k(s,o,l);return e>-1?new H(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new W(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=vn(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],d,u=null;if(t==1&&(o?c.matchType(o.type)||(u=c.fillBefore(b.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:u};if(t==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:d};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=vn(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new k(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=vn(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new k(xt(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new k(xt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let m=0;m1||a==0||m.content.size)&&(u=g,d.push(fs(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=St(this.placed,t,b.from(d)),this.frontier[t].match=u,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t=0;l--){let{match:a,type:c}=this.frontier[l],d=An(e,l,c,a,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=St(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=St(this.placed,this.depth,b.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(b.empty,!0);t.childCount&&(this.placed=St(this.placed,this.frontier.length,t))}}function xt(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(xt(r.firstChild.content,e-1,t)))}function St(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(St(r.lastChild.content,e-1,t)))}function vn(r,e){for(let t=0;t1&&(n=n.replaceChild(0,fs(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(b.empty,!0)))),r.copy(n)}function An(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!Sl(t,s.content,o)?l:null}function Sl(r,e,t){for(let n=t;n0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],d=n.openStart;for(let f=n.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==n.openStart)break;f=p.content}for(let f=d-1;f>=0;f--){let h=c[f],p=Ml(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))d=f;else if(p||!h.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let h=(f+d+1)%(n.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(r.replace(e,t,n),!(r.steps.length>u));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function hs(r,e,t,n,i){if(en){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(b.empty,!0))}return r}function Cl(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=kl(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new k(b.from(n),0,0))}function Tl(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=ps(n,i);for(let o=0;o0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o)return r.delete(n.before(o),t);r.delete(e,t)}function ps(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(se.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class ct extends X{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return F.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return F.fromReplace(e,this.pos,this.pos+1,new k(b.from(i),0,t.isLeaf?0:1))}getMap(){return oe.empty}invert(e){return new ct(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ct(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ct(t.pos,t.attr,t.value)}}X.jsonID("attr",ct);class At extends X{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return F.ok(n)}getMap(){return oe.empty}invert(e){return new At(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new At(t.attr,t.value)}}X.jsonID("docAttr",At);let ht=class extends Error{};ht=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};ht.prototype=Object.create(Error.prototype);ht.prototype.constructor=ht;ht.prototype.name="TransformError";class Ol{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ht(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=k.empty){let i=hr(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new k(b.from(n),0,0))}delete(e,t){return this.replace(e,t,k.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return wl(this,e,t,n),this}replaceRangeWith(e,t,n){return Cl(this,e,t,n),this}deleteRange(e,t){return Tl(this,e,t),this}lift(e,t){return dl(this,e,t),this}join(e,t=1){return bl(this,e,t),this}wrap(e,t){return hl(this,e,t),this}setBlockType(e,t=e,n,i=null){return pl(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return gl(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new ct(e,t,n)),this}setDocAttribute(e,t){return this.step(new At(e,t)),this}addNodeMark(e,t){return this.step(new Ie(e,t)),this}removeNodeMark(e,t){if(!(t instanceof I)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new ft(e,t)),this}split(e,t=1,n){return yl(this,e,t,n),this}addMark(e,t,n){return ol(this,e,t,n),this}removeMark(e,t,n){return ll(this,e,t,n),this}clearIncompatible(e,t,n){return al(this,e,t,n),this}}const Nn=Object.create(null);class v{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new vl(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;s--){let o=t<0?rt(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):rt(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new pe(e.node(0))}static atStart(e){return rt(e,e,0,0,1)||new pe(e)}static atEnd(e){return rt(e,e,e.content.size,e.childCount,-1)||new pe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Nn[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Nn)throw new RangeError("Duplicate use of selection JSON ID "+e);return Nn[e]=t,t.prototype.jsonID=e,t}getBookmark(){return C.between(this.$anchor,this.$head).getBookmark()}}v.prototype.visible=!0;class vl{constructor(e,t){this.$from=e,this.$to=t}}let $r=!1;function Hr(r){!$r&&!r.parent.inlineContent&&($r=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class C extends v{constructor(e,t=e){Hr(e),Hr(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return v.near(n);let i=e.resolve(t.map(this.anchor));return new C(i.parent.inlineContent?i:n,n)}replace(e,t=k.empty){if(super.replace(e,t),t==k.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof C&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new cn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new C(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=v.findFrom(t,n,!0)||v.findFrom(t,-n,!0);if(s)t=s.$head;else return v.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(v.findFrom(e,-n,!0)||v.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&M.isSelectable(l))return M.create(r,t-(i<0?l.nodeSize:0))}else{let a=rt(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function _r(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=d)}),r.setSelection(v.near(r.doc.resolve(o),t))}const jr=1,$t=2,Jr=4;class Nl extends Ol{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=$t,this}ensureMarks(e){return I.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&$t)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~$t,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||I.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),n=n??t,!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),this.selection.empty||this.setSelection(v.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Jr,this}get scrolledIntoView(){return(this.updated&Jr)>0}}function Wr(r,e){return!e||!r?r:r.bind(e)}class Mt{constructor(e,t,n){this.name=e,this.init=Wr(t.init,n),this.apply=Wr(t.apply,n)}}const El=[new Mt("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Mt("selection",{init(r,e){return r.selection||v.atStart(e.doc)},apply(r){return r.selection}}),new Mt("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Mt("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class En{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=El.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Mt(n.key,n.spec.state,n))})}}class st{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;nn.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new En(e.schema,e.plugins),s=new st(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Ge.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=v.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let a=n[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=c.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function ms(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=ms(i,e,{})),t[n]=i}return t}class ue{constructor(e){this.spec=e,this.props={},e.props&&ms(e.props,this,this.props),this.key=e.key?e.key.key:gs("plugin")}getState(e){return e[this.key]}}const Dn=Object.create(null);function gs(r){return r in Dn?r+"$"+ ++Dn[r]:(Dn[r]=0,r+"$")}class $e{constructor(e="key"){this.key=gs(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Z=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Nt=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let qr=null;const Te=function(r,e,t){let n=qr||(qr=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},Qe=function(r,e,t,n){return t&&(Kr(r,e,t,n,-1)||Kr(r,e,t,n,1))},Dl=/^(img|br|input|textarea|hr)$/i;function Kr(r,e,t,n,i){for(;;){if(r==t&&e==n)return!0;if(e==(i<0?0:be(r))){let s=r.parentNode;if(!s||s.nodeType!=1||mr(r)||Dl.test(r.nodeName)||r.contentEditable=="false")return!1;e=Z(r)+(i<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(i<0?-1:0)],r.contentEditable=="false")return!1;e=i<0?be(r):0}else return!1}}function be(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Il(r,e,t){for(let n=e==0,i=e==be(r);n||i;){if(r==t)return!0;let s=Z(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==be(r)}}function mr(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const dn=function(r){return r.focusNode&&Qe(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function je(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function Rl(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Pl(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:n.startOffset}}}const Se=typeof navigator<"u"?navigator:null,Ur=typeof document<"u"?document:null,He=Se&&Se.userAgent||"",Yn=/Edge\/(\d+)/.exec(He),ys=/MSIE \d/.exec(He),Xn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(He),re=!!(ys||Xn||Yn),Pe=ys?document.documentMode:Xn?+Xn[1]:Yn?+Yn[1]:0,me=!re&&/gecko\/(\d+)/i.test(He);me&&+(/Firefox\/(\d+)/.exec(He)||[0,0])[1];const Zn=!re&&/Chrome\/(\d+)/.exec(He),G=!!Zn,Bl=Zn?+Zn[1]:0,ee=!re&&!!Se&&/Apple Computer/.test(Se.vendor),pt=ee&&(/Mobile\/\w+/.test(He)||!!Se&&Se.maxTouchPoints>2),ae=pt||(Se?/Mac/.test(Se.platform):!1),Ll=Se?/Win/.test(Se.platform):!1,fe=/Android \d/.test(He),Bt=!!Ur&&"webkitFontSmoothing"in Ur.documentElement.style,zl=Bt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Fl(r){return{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function Ce(r,e){return typeof r=="number"?r:r[e]}function Vl(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function Gr(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;o=Nt(o)){if(o.nodeType!=1)continue;let l=o,a=l==s.body,c=a?Fl(s):Vl(l),d=0,u=0;if(e.topc.bottom-Ce(n,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Ce(i,"top")-c.top:e.bottom-c.bottom+Ce(i,"bottom")),e.leftc.right-Ce(n,"right")&&(d=e.right-c.right+Ce(i,"right")),d||u)if(a)s.defaultView.scrollBy(d,u);else{let f=l.scrollLeft,h=l.scrollTop;u&&(l.scrollTop+=u),d&&(l.scrollLeft+=d);let p=l.scrollLeft-f,m=l.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function $l(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o=t-20){n=l,i=a.top;break}}return{refDOM:n,refTop:i,stack:bs(r.dom)}}function bs(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=Nt(n));return e}function Hl({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;ks(t,n==0?0:n-e)}function ks(r,e){for(let t=0;t=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=d,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=u+1)}}return!t&&a&&(t=a,i=c,n=0),t&&t.nodeType==3?jl(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:xs(t,i)}function jl(r,e){let t=r.nodeValue.length,n=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:r,offset:0}}function gr(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function Jl(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function ql(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let l=r.docView.nearestDesc(s,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!o||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!o&&(o=!0,a.left>n.left||a.top>n.top?i=l.posBefore:(a.right-1?i:r.docView.posFromDOM(e,t,-1)}function Ss(r,e,t){let n=r.childNodes.length;if(n&&t.tope.top&&i++}let c;Bt&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=ql(r,n,i,e))}l==null&&(l=Wl(r,o,e));let a=r.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Yr(r){return r.top=0&&i==n.nodeValue.length?(a--,d=1):t<0?a--:c++,kt(ve(Te(n,a,c),d),d<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==be(n))){let a=n.childNodes[i-1];if(a.nodeType==1)return In(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==be(n))){let a=n.childNodes[i-1],c=a.nodeType==3?Te(a,be(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return kt(ve(c,1),!1)}if(s==null&&i=0)}function kt(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function In(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function ws(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function Gl(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return ws(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=r.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=Ms(r,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Te(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cd.top+1&&(t=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const Yl=/[\u0590-\u08ac]/;function Xl(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=r.domSelection();return!Yl.test(n.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:ws(r,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:d,anchorOffset:u}=r.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:p,focusOffset:m}=r.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(d,u),a&&(a!=d||c!=u)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let Xr=null,Zr=null,Qr=!1;function Zl(r,e,t){return Xr==e&&Zr==t?Qr:(Xr=e,Zr=t,Qr=t=="up"||t=="down"?Gl(r,e,t):Xl(r,e,t))}const de=0,ei=1,Je=2,Me=3;class Lt{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=de,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tZ(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||o instanceof Ts){i=e-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof Cs&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?Z(s.dom)+1:0}}else{let s,o=!0;for(;s=n=d&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,d);e=o;for(let u=l;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Z(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let d=l+1;dh&&ot){let h=l;l=a,a=h}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i=n:en){let l=n+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==n||t==o?Je:ei,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Me:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Je:Me}n=o}this.dirty=Je}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Je:ei;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==de&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ql extends Lt{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class et extends Lt{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=ke.renderSpec(document,t.type.spec.toDOM(t,n))),new et(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Me||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Me&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=de){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(s=tr(s,0,e,n));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},n,i),d=c&&c.dom,u=c&&c.contentDOM;if(t.isText){if(!d)d=document.createTextNode(t.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=ke.renderSpec(document,t.type.spec.toDOM(t)));!u&&!t.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let f=d;return d=As(d,n,t),c?a=new ea(e,t,n,i,d,u||null,f,c,s,o+1):t.isText?new un(e,t,n,i,d,f,s):new Be(e,t,n,i,d,u||null,f,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>b.empty)}return e}matchesNode(e,t,n){return this.dirty==de&&e.eq(this.node)&&er(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new na(this,o&&o.node,e);sa(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?a.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!u&&a.syncToMarks(d==this.node.childCount?I.none:this.node.child(d).marks,n,e),a.placeWidget(c,e,i)},(c,d,u,f)=>{a.syncToMarks(c.marks,n,e);let h;a.findNodeMatch(c,d,u,f)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,d,u,h,e)||a.updateNextNode(c,d,u,e,f,i)||a.addNode(c,d,u,e,i),i+=c.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Je)&&(o&&this.protectLocalComposition(e,o),Os(this.contentDOM,this.children,e),pt&&oa(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof C)||nt+this.node.content.size)return null;let s=e.domSelectionRange(),o=la(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let l=o.nodeValue,a=aa(this.node.content,l,n-t,i-t);return a<0?null:{node:o,pos:a,text:l}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Ql(this,s,t,i);e.input.compositionNodes.push(o),this.children=tr(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==Me||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=de}updateOuterDeco(e){if(er(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=vs(this.dom,this.nodeDOM,Qn(this.outerDeco,this.node,t),Qn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ti(r,e,t,n,i){As(n,e,r);let s=new Be(void 0,r,e,t,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class un extends Be{constructor(e,t,n,i,s,o,l){super(e,t,n,i,s,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==Me||this.dirty!=de&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=de||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=de,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new un(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Me)}get domAtom(){return!1}}class Ts extends Lt{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==de&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ea extends Be{constructor(e,t,n,i,s,o,l,a,c,d){super(e,t,n,i,s,o,l,c,d),this.spec=a}update(e,t,n,i){if(this.dirty==Me)return!1;if(this.spec.update){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Os(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=et.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(n){let c=t.children[n-1];if(c instanceof et)t=c,n=c.children.length;else{l=c,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=r.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function ia(r,e){return r.type.side-e.type.side}function sa(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let c=0;cs;)l.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let g=p;o!g.inline):l.slice();n(f,m,e.forChild(s,f),h),s=p}}function oa(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function la(r,e){for(;;){if(r.nodeType==3)return r;if(r.nodeType==1&&e>0){if(r.childNodes.length>e&&r.childNodes[e].nodeType==3)return r.childNodes[e];r=r.childNodes[e-1],e=be(r)}else if(r.nodeType==1&&e=t){if(s>=n&&a.slice(n-e.length-l,n-l)==e)return n-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==n&&a.length>=n+e.length-l&&a.slice(n-l,n-l+e.length)==e)return n}}return-1}function tr(r,e,t,n,i){let s=[];for(let o=0,l=0;o=t||d<=e?s.push(a):(ct&&s.push(a.slice(t-c,a.size,n)))}return s}function yr(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=n.resolve(o),a,c;if(dn(t)){for(a=l;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&M.isSelectable(d)&&i.parent&&!(d.isInline&&Il(t.focusNode,t.focusOffset,i.dom))){let u=i.posBefore;c=new M(o==u?l:n.resolve(u))}}else{let d=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(d<0)return null;a=n.resolve(d)}if(!c){let d=e=="pointer"||r.state.selection.head{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Ns(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function da(r){let e=r.domSelection(),t=document.createRange(),n=r.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.setEnd(n.parentNode,Z(n)+1):t.setEnd(n,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!r.state.selection.visible&&re&&Pe<=11&&(n.disabled=!0,n.disabled=!1)}function Es(r,e){if(e instanceof M){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(oi(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else oi(r)}function oi(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function br(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||C.between(e,t,n)}function li(r){return r.editable&&!r.hasFocus()?!1:Ds(r)}function Ds(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ua(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Qe(e.node,e.offset,t.anchorNode,t.anchorOffset)}function nr(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&v.findFrom(s,e)}function Ae(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function ai(r,e,t){let n=r.state.selection;if(n instanceof C)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ae(r,new C(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=nr(r.state,e);return i&&i instanceof M?Ae(r,i):!1}else if(!(ae&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(l))&&!o.contentDOM?M.isSelectable(s)?Ae(r,new M(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):Bt?Ae(r,new C(r.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof M&&n.node.isInline)return Ae(r,new C(e>0?n.$to:n.$from));{let i=nr(r.state,e);return i?Ae(r,i):!1}}}function Zt(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Ot(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function nt(r,e){return e<0?fa(r):ha(r)}function fa(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(me&&t.nodeType==1&&n0){if(t.nodeType!=1)break;{let l=t.childNodes[n-1];if(Ot(l,-1))i=t,s=--n;else if(l.nodeType==3)t=l,n=t.nodeValue.length;else break}}else{if(Is(t))break;{let l=t.previousSibling;for(;l&&Ot(l,-1);)i=t.parentNode,s=Z(l),l=l.previousSibling;if(l)t=l,n=Zt(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?rr(r,t,n):i&&rr(r,i,s)}function ha(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=Zt(t),s,o;for(;;)if(n{r.state==i&&Oe(r)},50)}function ci(r,e){let t=r.state.doc.resolve(e);if(!(G||Ll)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function di(r,e,t){let n=r.state.selection;if(n instanceof C&&!n.empty||t.indexOf("s")>-1||ae&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=nr(r.state,e);if(o&&o instanceof M)return Ae(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=n instanceof pe?v.near(o,e):v.findFrom(o,e);return l?Ae(r,l):!1}return!1}function ui(r,e){if(!(r.state.selection instanceof C))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function fi(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function ga(r){if(!ee||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;fi(r,n,"true"),setTimeout(()=>fi(r,n,"false"),20)}return!1}function ya(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function ba(r,e){let t=e.keyCode,n=ya(e);if(t==8||ae&&t==72&&n=="c")return ui(r,-1)||nt(r,-1);if(t==46&&!e.shiftKey||ae&&t==68&&n=="c")return ui(r,1)||nt(r,1);if(t==13||t==27)return!0;if(t==37||ae&&t==66&&n=="c"){let i=t==37?ci(r,r.state.selection.from)=="ltr"?-1:1:-1;return ai(r,i,n)||nt(r,i)}else if(t==39||ae&&t==70&&n=="c"){let i=t==39?ci(r,r.state.selection.from)=="ltr"?1:-1:1;return ai(r,i,n)||nt(r,i)}else{if(t==38||ae&&t==80&&n=="c")return di(r,-1,n)||nt(r,-1);if(t==40||ae&&t==78&&n=="c")return ga(r)||di(r,1,n)||nt(r,1);if(n==(ae?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Rs(r,e){r.someProp("transformCopied",h=>{e=h(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let h=n.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),n=h.content}let o=r.someProp("clipboardSerializer")||ke.fromSchema(r.state.schema),l=Vs(),a=l.createElement("div");a.appendChild(o.serializeFragment(n,{document:l}));let c=a.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=Fs[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let p=l.createElement(d[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),u++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${u?` -${u}`:""} ${JSON.stringify(t)}`);let f=r.someProp("clipboardTextSerializer",h=>h(e,r))||e.content.textBetween(0,e.content.size,` - -`);return{dom:a,text:f}}function Ps(r,e,t,n,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=e&&(n||s||!t);if(a){if(r.someProp("transformPastedText",f=>{e=f(e,s||n,r)}),s)return e?new k(b.from(r.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):k.empty;let u=r.someProp("clipboardTextParser",f=>f(e,i,n,r));if(u)l=u;else{let f=i.marks(),{schema:h}=r.state,p=ke.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else r.someProp("transformPastedHTML",u=>{t=u(t,r)}),o=Sa(t),Bt&&Ma(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(r.someProp("clipboardParser")||r.someProp("domParser")||ut.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ka.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=wa(hi(l,+d[1],+d[2]),d[4]);else if(l=k.maxOpen(xa(l.content,i),!0),l.openStart||l.openEnd){let u=0,f=0;for(let h=l.content.firstChild;u{l=u(l,r)}),l}const ka=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function xa(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&s.length&&Ls(a,s,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=zs(o[o.length-1],s.length));let d=Bs(l,a);o.push(d),i=i.matchType(d.type),s=a}}),o)return b.from(o)}return r}function Bs(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,b.from(r));return r}function Ls(r,e,t,n,i){if(i1&&(s=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(l))}function hi(r,e,t){return e]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Vs().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&Fs[n[1].toLowerCase()])&&(r=i.map(s=>"<"+s+">").join("")+r+i.map(s=>"").reverse().join("")),t.innerHTML=r,i)for(let s=0;s=0;l-=2){let a=t.nodes[n[l]];if(!a||a.hasRequiredAttrs())break;i=b.from(a.create(n[l+1],i)),s++,o++}return new k(i,s,o)}const te={},ne={},Ca={touchstart:!0,touchmove:!0};class Ta{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Oa(r){for(let e in te){let t=te[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{Aa(r,n)&&!kr(r,n)&&(r.editable||!(n.type in ne))&&t(r,n)},Ca[e]?{passive:!0}:void 0)}ee&&r.dom.addEventListener("input",()=>null),sr(r)}function Re(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function va(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function sr(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>kr(r,n))})}function kr(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function Aa(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Na(r,e){!kr(r,e)&&te[e.type]&&(r.editable||!(e.type in ne))&&te[e.type](r,e)}ne.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!Hs(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(fe&&G&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),pt&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,je(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||ba(r,t)?t.preventDefault():Re(r,"key")};ne.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};ne.keypress=(r,e)=>{let t=e;if(Hs(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||ae&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof C)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",s=>s(r,n.$from.pos,n.$to.pos,i))&&r.dispatch(r.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function fn(r){return{left:r.clientX,top:r.clientY}}function Ea(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function xr(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,l=>o>s.depth?l(r,t,s.nodeAfter,s.before(o),i,!0):l(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function dt(r,e,t){r.focused||r.focus();let n=r.state.tr.setSelection(e);t=="pointer"&&n.setMeta("pointer",!0),r.dispatch(n)}function Da(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&M.isSelectable(n)?(dt(r,new M(t),"pointer"),!0):!1}function Ia(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof M&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(M.isSelectable(l)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(dt(r,M.create(r.state.doc,i),"pointer"),!0):!1}function Ra(r,e,t,n,i){return xr(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?Ia(r,t):Da(r,t))}function Pa(r,e,t,n){return xr(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function Ba(r,e,t,n){return xr(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||La(r,t,n)}function La(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(dt(r,C.create(n,0,n.content.size),"pointer"),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)dt(r,C.create(n,l+1,l+1+o.content.size),"pointer");else if(M.isSelectable(o))dt(r,M.create(n,l),"pointer");else continue;return!0}}function Sr(r){return Qt(r)}const $s=ae?"metaKey":"ctrlKey";te.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=Sr(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&Ea(t,r.input.lastClick)&&!t[$s]&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=r.posAtCoords(fn(t));o&&(s=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new za(r,o,t,!!n)):(s=="doubleClick"?Pa:Ba)(r,o.pos,o.inside,t)?t.preventDefault():Re(r,"pointer"))};class za{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[$s],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let d=e.state.doc.resolve(t.pos);s=d.parent,o=d.depth?d.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof M&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&me&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Re(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Oe(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(fn(e))),this.updateAllowDefault(e),this.allowDefault||!t?Re(this.view,"pointer"):Ra(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ee&&this.mightDrag&&!this.mightDrag.node.isAtom||G&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(dt(this.view,v.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Re(this.view,"pointer")}move(e){this.updateAllowDefault(e),Re(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}te.touchstart=r=>{r.input.lastTouch=Date.now(),Sr(r),Re(r,"pointer")};te.touchmove=r=>{r.input.lastTouch=Date.now(),Re(r,"pointer")};te.contextmenu=r=>Sr(r);function Hs(r,e){return r.composing?!0:ee&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const Fa=fe?5e3:-1;ne.compositionstart=ne.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))r.markCursor=r.state.storedMarks||t.marks(),Qt(r,!0),r.markCursor=null;else if(Qt(r),me&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){r.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}_s(r,Fa)};ne.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,_s(r,20))};function _s(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>Qt(r),e))}function js(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Va());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function Va(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function Qt(r,e=!1){if(!(fe&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),js(r),e||r.docView&&r.docView.dirty){let t=yr(r);return t&&!t.eq(r.state.selection)?r.dispatch(r.state.tr.setSelection(t)):r.updateState(r.state),!0}return!1}}function $a(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const Et=re&&Pe<15||pt&&zl<604;te.copy=ne.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=Et?null:t.clipboardData,o=n.content(),{dom:l,text:a}=Rs(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):$a(r,l),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Ha(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function _a(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?Dt(r,n.value,null,i,e):Dt(r,n.textContent,n.innerHTML,i,e)},50)}function Dt(r,e,t,n,i){let s=Ps(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",a=>a(r,i,s||k.empty)))return!0;if(!s)return!1;let o=Ha(s),l=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Js(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}ne.paste=(r,e)=>{let t=e;if(r.composing&&!fe)return;let n=Et?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&Dt(r,Js(n),n.getData("text/html"),i,t)?t.preventDefault():_a(r,t)};class Ws{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const qs=ae?"altKey":"ctrlKey";te.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(fn(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof M?i.to-1:i.to))){if(n&&n.mightDrag)o=M.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=M.create(r.state.doc,d.posBefore))}}let l=(o||r.state.selection).content(),{dom:a,text:c}=Rs(r,l);t.dataTransfer.clearData(),t.dataTransfer.setData(Et?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Et||t.dataTransfer.setData("text/plain",c),r.dragging=new Ws(l,!t[qs],o)};te.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};ne.dragover=ne.dragenter=(r,e)=>e.preventDefault();ne.drop=(r,e)=>{let t=e,n=r.dragging;if(r.dragging=null,!t.dataTransfer)return;let i=r.posAtCoords(fn(t));if(!i)return;let s=r.state.doc.resolve(i.pos),o=n&&n.slice;o?r.someProp("transformPasted",p=>{o=p(o,r)}):o=Ps(r,Js(t.dataTransfer),Et?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&!t[qs]);if(r.someProp("handleDrop",p=>p(r,t,o||k.empty,l))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?ds(r.state.doc,s.pos,o):s.pos;a==null&&(a=s.pos);let c=r.state.tr;if(l){let{node:p}=n;p?p.replace(c):c.deleteSelection()}let d=c.mapping.map(a),u=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(d,d,o.content.firstChild):c.replaceRange(d,d,o),c.doc.eq(f))return;let h=c.doc.resolve(d);if(u&&M.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new M(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,x)=>p=x),c.setSelection(br(r,h,c.doc.resolve(p)))}r.focus(),r.dispatch(c.setMeta("uiEvent","drop"))};te.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&Oe(r)},20))};te.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};te.beforeinput=(r,e)=>{if(G&&fe&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,je(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in ne)te[r]=ne[r];function It(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class en{constructor(e,t){this.toDOM=e,this.spec=t||Ye,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new ce(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof en&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&It(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Le{constructor(e,t){this.attrs=e,this.spec=t||Ye}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new ce(s,o,this)}valid(e,t){return t.from=e&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,i+l,s)}}map(e,t,n){return this==U||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ye)}mapInner(e,t,n,i,s){let o;for(let l=0;l{let c=a+n,d;if(d=Us(t,l,c)){for(i||(i=this.children.slice());sl&&u.to=e){this.children[l]==e&&(n=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;ls&&a.type instanceof Le){let c=Math.max(s,a.from)-s,d=Math.min(o,a.to)-s;ci.map(e,t,Ye));return Ee.from(n)}forChild(e,t){if(t.isLeaf)return V.empty;let n=[];for(let i=0;it instanceof V)?e:e.reduce((t,n)=>t.concat(n instanceof V?n:n.members),[]))}}}function ja(r,e,t,n,i,s,o){let l=r.slice();for(let c=0,d=s;c{let g=m-p-(h-f);for(let y=0;yx+d-u)continue;let N=l[y]+d-u;h>=N?l[y+1]=f<=N?-2:-1:f>=d&&g&&(l[y]+=g,l[y+1]+=g)}u+=g}),d=t.maps[c].map(d,-1)}let a=!1;for(let c=0;c=n.content.size){a=!0;continue}let f=t.map(r[c+1]+s,-1),h=f-i,{index:p,offset:m}=n.content.findIndex(u),g=n.maybeChild(p);if(g&&m==u&&m+g.nodeSize==h){let y=l[c+2].mapInner(t,g,d+1,r[c]+s+1,o);y!=U?(l[c]=u,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Ja(l,r,e,t,i,s,o),d=tn(c,n,0,o);e=d.local;for(let u=0;ut&&o.to{let c=Us(r,l,a+t);if(c){s=!0;let d=tn(c,l,t+a+1,n);d!=U&&i.push(a,a+l.nodeSize,d)}});let o=Ks(s?Gs(r):r,-t).sort(Xe);for(let l=0;l0;)e++;r.splice(e,0,t)}function Pn(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=U&&e.push(n)}),r.cursorWrapper&&e.push(V.create(r.state.doc,[r.cursorWrapper.deco])),Ee.from(e)}const Wa={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},qa=re&&Pe<=11;class Ka{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Ua{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ka,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),qa&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Wa)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(li(this.view)){if(this.suppressingSelectionUpdates)return Oe(this.view);if(re&&Pe<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qe(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=Nt(s))t.add(s);for(let s=e.anchorNode;s;s=Nt(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&li(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let d=0;d1){let d=a.filter(u=>u.nodeName=="BR");if(d.length==2){let u=d[0],f=d[1];u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove()}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(s>-1&&(e.docView.markDirty(s,o),Ga(e)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Oe(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;g--){let y=n.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){s=g;break}if(!x||x.size)break}let u=r.state.doc,f=r.someProp("domParser")||ut.fromSchema(r.state.schema),h=u.resolve(o),p=null,m=f.parse(n,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Za,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+o,head:y+o}}return{doc:m,sel:p,from:o,to:l}}function Za(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(ee&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||ee&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Qa=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ec(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let A=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,T=yr(r,A);if(T&&!r.state.selection.eq(T)){if(G&&fe&&r.input.lastKeyCode===13&&Date.now()-100mo(r,je(13,"Enter"))))return;let zt=r.state.tr.setSelection(T);A=="pointer"?zt.setMeta("pointer",!0):A=="key"&&zt.scrollIntoView(),s&&zt.setMeta("composition",s),r.dispatch(zt)}return}let o=r.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=r.state.doc.resolve(t).after(l+1);let a=r.state.selection,c=Xa(r,e,t),d=r.state.doc,u=d.slice(c.from,c.to),f,h;r.input.lastKeyCode===8&&Date.now()-100Date.now()-225||fe)&&i.some(A=>A.nodeType==1&&!Qa.test(A.nodeName))&&(!p||p.endA>=p.endB)&&r.someProp("handleKeyDown",A=>A(r,je(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!p)if(n&&a instanceof C&&!a.empty&&a.$head.sameParent(a.$anchor)&&!r.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let A=bi(r,r.state.doc,c.sel);if(A&&!A.eq(r.state.selection)){let T=r.state.tr.setSelection(A);s&&T.setMeta("composition",s),r.dispatch(T)}}return}if(G&&r.cursorWrapper&&c.sel&&c.sel.anchor==r.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let A=p.endB-p.start;c.sel={anchor:c.sel.anchor+A,head:c.sel.anchor+A}}r.input.domChangeCount++,r.state.selection.fromr.state.selection.from&&p.start<=r.state.selection.from+2&&r.state.selection.from>=c.from?p.start=r.state.selection.from:p.endA=r.state.selection.to-2&&r.state.selection.to<=c.to&&(p.endB+=r.state.selection.to-p.endA,p.endA=r.state.selection.to)),re&&Pe<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=d.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,N;if((pt&&r.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&m.posA(r,je(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>p.start&&nc(d,p.start,p.endA,m,g)&&r.someProp("handleKeyDown",A=>A(r,je(8,"Backspace")))){fe&&G&&r.domObserver.suppressSelectionUpdates();return}G&&fe&&p.endB==p.start&&(r.input.lastAndroidDelete=Date.now()),fe&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{r.someProp("handleKeyDown",function(A){return A(r,je(13,"Enter"))})},20));let P=p.start,B=p.endA,R,K,ge;if(x){if(m.pos==g.pos)re&&Pe<=11&&m.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>Oe(r),20)),R=r.state.tr.delete(P,B),K=d.resolve(p.start).marksAcross(d.resolve(p.endA));else if(p.endA==p.endB&&(ge=tc(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))R=r.state.tr,ge.type=="add"?R.addMark(P,B,ge.mark):R.removeMark(P,B,ge.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,g.parentOffset);if(r.someProp("handleTextInput",T=>T(r,P,B,A)))return;R=r.state.tr.insertText(A,P,B)}}if(R||(R=r.state.tr.replace(P,B,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let A=bi(r,R.doc,c.sel);A&&!(G&&fe&&r.composing&&A.empty&&(p.start!=p.endB||r.input.lastAndroidDeletee.content.size?null:br(r,e.resolve(t.anchor),e.resolve(t.head))}function tc(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,l,a;for(let d=0;dd.mark(l.addToSet(d.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=d=>d.mark(l.removeFromSet(d.marks));else return null;let c=[];for(let d=0;dt||Bn(o,!0,!1)0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function rc(r,e,t,n,i){let s=r.findDiffStart(e,t);if(s==null)return null;let{a:o,b:l}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o=o?s-n:0;s-=a,s&&s=l?s-n:0;s-=a,s&&s=56320&&e<=57343&&t>=55296&&t<=56319}class ic{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ta,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ci),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Mi(this),Si(this),this.nodeViews=wi(this),this.docView=ti(this.state.doc,xi(this),Pn(this),this.dom,this),this.domObserver=new Ua(this,(n,i,s,o)=>ec(this,n,i,s,o)),this.domObserver.start(),Oa(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ci),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(js(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=wi(this);oc(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&sr(this),this.editable=Mi(this),Si(this);let a=Pn(this),c=xi(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=s||!this.docView.matchesNode(e.doc,c,a);(u||!e.selection.eq(i.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&$l(this);if(o){this.domObserver.stop();let h=u&&(re||G)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&sc(i.selection,e.selection);if(u){let p=G?this.trackWrites=this.domSelectionRange().focusNode:null;(s||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ti(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ua(this))?Oe(this,h):(Es(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&Hl(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof M){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Gr(this,t.getBoundingClientRect(),e)}else Gr(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new Ws(e.slice,e.move,i<0?void 0:M.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;ot.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Kl(this,e)}coordsAtPos(e,t=1){return Ms(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Zl(this,t||this.state,e)}pasteHTML(e,t){return Dt(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Dt(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(va(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Pn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Na(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return ee&&this.root.nodeType===11&&Rl(this.dom.ownerDocument)==this.dom?Ya(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function xi(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[ce.node(0,r.state.doc.content.size,e)]}function Si(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:ce.widget(r.state.selection.head,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function Mi(r){return!r.someProp("editable",e=>e(r.state)===!1)}function sc(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function wi(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function oc(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function Ci(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Fe={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lc=typeof navigator<"u"&&/Mac/.test(navigator.platform),ac=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var q=0;q<10;q++)Fe[48+q]=Fe[96+q]=String(q);for(var q=1;q<=24;q++)Fe[q+111]="F"+q;for(var q=65;q<=90;q++)Fe[q]=String.fromCharCode(q+32),nn[q]=String.fromCharCode(q);for(var Ln in Fe)nn.hasOwnProperty(Ln)||(nn[Ln]=Fe[Ln]);function cc(r){var e=lc&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||ac&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?nn:Fe)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const dc=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function uc(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let l=0;l127)&&(s=Fe[n.keyCode])&&s!=i){let l=e[zn(s,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const pc=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function mc(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const gc=(r,e,t)=>{let n=mc(r,t);if(!n)return!1;let i=Xs(n);if(!i){let o=n.blockRange(),l=o&&bt(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&eo(r,i,e))return!0;if(n.parent.content.size==0&&(mt(s,"end")||M.isSelectable(s))){let o=hr(r.doc,n.before(),n.after(),k.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=Xs(n)}let o=s&&s.nodeBefore;return!o||!M.isSelectable(o)?!1:(e&&e(r.tr.setSelection(M.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Xs(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function bc(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=bc(r,t);if(!n)return!1;let i=Zs(n);if(!i)return!1;let s=i.nodeAfter;if(eo(r,i,e))return!0;if(n.parent.content.size==0&&(mt(s,"start")||M.isSelectable(s))){let o=hr(r.doc,n.before(),n.after(),k.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof M,i;if(n){if(t.node.isTextblock||!Ve(r.doc,t.from))return!1;i=t.from}else if(i=an(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(M.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Mc=(r,e)=>{let t=r.selection,n;if(t instanceof M){if(t.node.isTextblock||!Ve(r.doc,t.to))return!1;n=t.to}else if(n=an(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},wc=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&bt(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},Cc=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` -`).scrollIntoView()),!0)};function Qs(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=Qs(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(v.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Oc=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof pe||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=Qs(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(at(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&bt(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)},Ac=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(M.create(r.doc,i))),!0)};function Nc(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ve(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function eo(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(Nc(r,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let u=e.pos+i.nodeSize,f=b.empty;for(let m=s.length-1;m>=0;m--)f=b.from(s[m].create(null,f));f=b.from(n.copy(f));let h=r.tr.step(new H(e.pos-1,u,e.pos,u,new k(f,1,0),s.length,!0)),p=u+2*s.length;Ve(h.doc,p)&&h.join(p),t(h.scrollIntoView())}return!0}let a=v.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),d=c&&bt(c);if(d!=null&&d>=e.depth)return t&&t(r.tr.lift(c,d).scrollIntoView()),!0;if(l&&mt(i,"start",!0)&&mt(n,"end")){let u=n,f=[];for(;f.push(u),!u.isTextblock;)u=u.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(u.canReplace(u.childCount,u.childCount,h.content)){if(t){let m=b.empty;for(let y=f.length-1;y>=0;y--)m=b.from(f[y].copy(m));let g=r.tr.step(new H(e.pos-f.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new k(m,f.length,0),0,!0));t(g.scrollIntoView())}return!0}}return!1}function to(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(C.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const Ec=to(-1),Dc=to(1);function Ic(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&fr(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ti(r,e=null){return function(t,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let d=t.doc.resolve(c),u=d.index();i=d.parent.canReplaceWith(u,u+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o=2&&i.node(o.depth-1).type.compatibleContent(r)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let d=t.doc.resolve(o.start-2);a=new Ut(d,d,o.depth),o.endIndex=0;d--)s=b.from(t[d].type.create(t[d].attrs,s));r.step(new H(e.start-(n?2:0),e.end,e.start,e.end,new k(s,0,0),t.length,!0));let o=0;for(let d=0;do.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?Lc(e,t,r,s):zc(e,t,s):!0:!1}}function Lc(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);sm;p--)h-=i.child(p).nodeSize,n.delete(h-1,h+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(l?0:1),d+1,o.content.append(a?b.empty:b.from(i))))return!1;let u=s.pos,f=u+o.nodeSize;return n.step(new H(u-(l?1:0),f+(a?1:0),u+1,f-1,new k((l?b.empty:b.from(i.copy(b.empty))).append(a?b.empty:b.from(i.copy(b.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function Fc(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,d=b.from(c?r.create():null),u=new k(b.from(r.create(null,b.from(l.type.create(null,d)))),c?3:1,0),f=s.start,h=s.end;t(e.tr.step(new H(f-(c?3:1),h,f,h,u,1,!0)).scrollIntoView())}return!0}}function hn(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}class pn{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...d)=>{const u=a(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,c=e||s.tr,d=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),l.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(n).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,t),y=h(...m)(g);return l.push(y),u}])),run:d};return u}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:hn({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...d)=>c(...d)(l)]))}};return l}}class Vc{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function S(r,e,t){return r.config[e]===void 0&&r.parent?S(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?S(r.parent,e,t):null}):r.config[e]}function mn(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function no(r){const e=[],{nodeExtensions:t,markExtensions:n}=mn(r),i=[...t,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=S(o,"addGlobalAttributes",l);if(!a)return;a().forEach(d=>{d.types.forEach(u=>{Object.entries(d.attributes).forEach(([f,h])=>{e.push({type:u,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=S(o,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([d,u])=>{const f={...s,...u};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:d,attribute:f})})}),e}function j(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function $(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const l=s?s.split(" "):[],a=n[i]?n[i].split(" "):[],c=l.filter(d=>!a.includes(d));n[i]=[...a,...c].join(" ")}else i==="style"?n[i]=[n[i],s].join("; "):n[i]=s}),n},{})}function or(r,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>$(t,n),{})}function ro(r){return typeof r=="function"}function O(r,e=void 0,...t){return ro(r)?e?r.bind(e)(...t):r(...t):r}function $c(r={}){return Object.keys(r).length===0&&r.constructor===Object}function Hc(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function Oi(r,e){return r.style?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):Hc(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function vi(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&$c(t)?!1:t!=null))}function _c(r,e){var t;const n=no(r),{nodeExtensions:i,markExtensions:s}=mn(r),o=(t=i.find(c=>S(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const d=n.filter(y=>y.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=r.reduce((y,x)=>{const N=S(x,"extendNodeSchema",u);return{...y,...N?N(c):{}}},{}),h=vi({...f,content:O(S(c,"content",u)),marks:O(S(c,"marks",u)),group:O(S(c,"group",u)),inline:O(S(c,"inline",u)),atom:O(S(c,"atom",u)),selectable:O(S(c,"selectable",u)),draggable:O(S(c,"draggable",u)),code:O(S(c,"code",u)),defining:O(S(c,"defining",u)),isolating:O(S(c,"isolating",u)),attrs:Object.fromEntries(d.map(y=>{var x;return[y.name,{default:(x=y==null?void 0:y.attribute)===null||x===void 0?void 0:x.default}]}))}),p=O(S(c,"parseHTML",u));p&&(h.parseDOM=p.map(y=>Oi(y,d)));const m=S(c,"renderHTML",u);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:or(y,d)}));const g=S(c,"renderText",u);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(s.map(c=>{const d=n.filter(g=>g.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=r.reduce((g,y)=>{const x=S(y,"extendMarkSchema",u);return{...g,...x?x(c):{}}},{}),h=vi({...f,inclusive:O(S(c,"inclusive",u)),excludes:O(S(c,"excludes",u)),group:O(S(c,"group",u)),spanning:O(S(c,"spanning",u)),code:O(S(c,"code",u)),attrs:Object.fromEntries(d.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),p=O(S(c,"parseHTML",u));p&&(h.parseDOM=p.map(g=>Oi(g,d)));const m=S(c,"renderHTML",u);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:or(g,d)})),[c.name,h]}));return new Xo({topNode:o,nodes:l,marks:a})}function Fn(r,e){return e.nodes[r]||e.marks[r]||null}function Ai(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}const jc=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,l)=>{var a,c;const d=((c=(a=i.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=d.slice(0,Math.max(0,n-s))}),t};function Cr(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class gn{constructor(e){this.find=e.find,this.handler=e.handler}}const Jc=(r,e)=>{if(Cr(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function Vn(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:l}=r,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(n);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const u=jc(c)+s;return o.forEach(f=>{if(d)return;const h=Jc(u,f.find);if(!h)return;const p=a.state.tr,m=hn({state:a.state,transaction:p}),g={from:n-(h[0].length-s.length),to:i},{commands:y,chain:x,can:N}=new pn({editor:t,state:m});f.handler({state:m,range:g,match:h,commands:y,chain:x,can:N})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:n,to:i,text:s}),a.dispatch(p),d=!0)}),d}function Wc(r){const{editor:e,rules:t}=r,n=new ue({state:{init(){return null},apply(i,s){const o=i.getMeta(n);return o||(i.selectionSet||i.docChanged?null:s)}},props:{handleTextInput(i,s,o,l){return Vn({editor:e,from:s,to:o,text:l,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Vn({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Vn({editor:e,from:o.pos,to:o.pos,text:` -`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function qc(r){return typeof r=="number"}class Kc{constructor(e){this.find=e.find,this.handler=e.handler}}const Uc=(r,e,t)=>{if(Cr(e))return[...r.matchAll(e)];const n=e(r,t);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=r,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function Gc(r){const{editor:e,state:t,from:n,to:i,rule:s,pasteEvent:o,dropEvent:l}=r,{commands:a,chain:c,can:d}=new pn({editor:e,state:t}),u=[];return t.doc.nodesBetween(n,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(n,p),g=Math.min(i,p+h.content.size),y=h.textBetween(m-p,g-p,void 0,"");Uc(y,s.find,o).forEach(N=>{if(N.index===void 0)return;const P=m+N.index+1,B=P+N[0].length,R={from:t.tr.mapping.map(P),to:t.tr.mapping.map(B)},K=s.handler({state:t,range:R,match:N,commands:a,chain:c,can:d,pasteEvent:o,dropEvent:l});u.push(K)})}),u.every(h=>h!==null)}function Yc(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1,o=new ClipboardEvent("paste"),l=new DragEvent("drop");return t.map(c=>new ue({view(d){const u=f=>{var h;n=!((h=d.dom.parentElement)===null||h===void 0)&&h.contains(f.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",u),{destroy(){window.removeEventListener("dragstart",u)}}},props:{handleDOMEvents:{drop:(d,u)=>(s=n===d.dom.parentElement,l=u,!1),paste:(d,u)=>{var f;const h=(f=u.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=u,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(d,u,f)=>{const h=d[0],p=h.getMeta("uiEvent")==="paste"&&!i,m=h.getMeta("uiEvent")==="drop"&&!s;if(!p&&!m)return;const g=u.doc.content.findDiffStart(f.doc.content),y=u.doc.content.findDiffEnd(f.doc.content);if(!qc(g)||!y||g===y.b)return;const x=f.tr,N=hn({state:f,transaction:x});if(!(!Gc({editor:e,state:N,from:Math.max(g-1,0),to:y.b-1,rule:c,pasteEvent:o,dropEvent:l})||!x.steps.length))return l=new DragEvent("drop"),o=new ClipboardEvent("paste"),x}}))}function Xc(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return[...new Set(e)]}class ot{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ot.resolve(e),this.schema=_c(this.extensions,t),this.extensions.forEach(n=>{var i;this.editor.extensionStorage[n.name]=n.storage;const s={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Fn(n.name,this.schema)};n.type==="mark"&&(!((i=O(S(n,"keepOnSplit",s)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(n.name);const o=S(n,"onBeforeCreate",s);o&&this.editor.on("beforeCreate",o);const l=S(n,"onCreate",s);l&&this.editor.on("create",l);const a=S(n,"onUpdate",s);a&&this.editor.on("update",a);const c=S(n,"onSelectionUpdate",s);c&&this.editor.on("selectionUpdate",c);const d=S(n,"onTransaction",s);d&&this.editor.on("transaction",d);const u=S(n,"onFocus",s);u&&this.editor.on("focus",u);const f=S(n,"onBlur",s);f&&this.editor.on("blur",f);const h=S(n,"onDestroy",s);h&&this.editor.on("destroy",h)})}static resolve(e){const t=ot.sort(ot.flatten(e)),n=Xc(t.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},i=S(t,"addExtensions",n);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=S(n,"priority")||100,o=S(i,"priority")||100;return s>o?-1:s{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Fn(t.name,this.schema)},i=S(t,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=ot.sort([...this.extensions].reverse()),n=[],i=[],s=t.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Fn(o.name,this.schema)},a=[],c=S(o,"addKeyboardShortcuts",l);let d={};if(o.type==="mark"&&o.config.exitable&&(d.ArrowRight=()=>we.handleExit({editor:e,mark:o})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));d={...d,...m}}const u=hc(d);a.push(u);const f=S(o,"addInputRules",l);Ai(o,e.options.enableInputRules)&&f&&n.push(...f());const h=S(o,"addPasteRules",l);Ai(o,e.options.enablePasteRules)&&h&&i.push(...h());const p=S(o,"addProseMirrorPlugins",l);if(p){const m=p();a.push(...m)}return a}).flat();return[Wc({editor:e,rules:n}),...Yc({editor:e,rules:i}),...s]}get attributes(){return no(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=mn(this.extensions);return Object.fromEntries(t.filter(n=>!!S(n,"addNodeView")).map(n=>{const i=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:j(n.name,this.schema)},o=S(n,"addNodeView",s);if(!o)return[];const l=(a,c,d,u)=>{const f=or(a,i);return o()({editor:e,node:a,getPos:d,decorations:u,HTMLAttributes:f,extension:n})};return[n.name,l]}))}}function Zc(r){return Object.prototype.toString.call(r).slice(8,-1)}function $n(r){return Zc(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function yn(r,e){const t={...r};return $n(r)&&$n(e)&&Object.keys(e).forEach(n=>{$n(e[n])?n in r?t[n]=yn(r[n],e[n]):Object.assign(t,{[n]:e[n]}):Object.assign(t,{[n]:e[n]})}),t}class se{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=O(S(this,"addOptions",{name:this.name}))),this.storage=O(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new se(e)}configure(e={}){const t=this.extend();return t.options=yn(this.options,e),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new se(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=O(S(t,"addOptions",{name:t.name})),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}}function io(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=` - -`,textSerializers:o={}}=t||{};let l="",a=!0;return r.nodesBetween(n,i,(c,d,u,f)=>{var h;const p=o==null?void 0:o[c.type.name];p?(c.isBlock&&!a&&(l+=s,a=!0),u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e}))):c.isText?(l+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(n,d)-d,i-d),a=!1):c.isBlock&&!a&&(l+=s,a=!0)}),l}function so(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const Qc=se.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new ue({key:new $e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),a=so(t);return io(n,{from:o,to:l},{textSerializers:a})}}})]}}),ed=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),td=(r=!1)=>({commands:e})=>e.setContent("",r),nd=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:d}=e,u=c.resolve(d.map(a)),f=c.resolve(d.map(a+l.nodeSize)),h=u.blockRange(f);if(!h)return;const p=bt(h);if(l.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},rd=r=>e=>r(e),id=()=>({state:r,dispatch:e})=>Oc(r,e),sd=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new C(n.doc.resolve(o-1))),!0},od=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},ld=r=>({tr:e,state:t,dispatch:n})=>{const i=j(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),c=s.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},ad=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},cd=()=>({state:r,dispatch:e})=>pc(r,e),dd=()=>({commands:r})=>r.keyboardShortcut("Enter"),ud=()=>({state:r,dispatch:e})=>Tc(r,e);function rn(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Cr(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function lr(r,e,t={}){return r.find(n=>n.type===e&&rn(n.attrs,t))}function fd(r,e,t={}){return!!lr(r,e,t)}function Tr(r,e,t={}){if(!r||!e)return;let n=r.parent.childAfter(r.parentOffset);if(r.parentOffset===n.offset&&n.offset!==0&&(n=r.parent.childBefore(r.parentOffset)),!n.node)return;const i=lr([...n.node.marks],e,t);if(!i)return;let s=n.index,o=r.start()+n.offset,l=s+1,a=o+n.node.nodeSize;for(lr([...n.node.marks],e,t);s>0&&i.isInSet(r.parent.child(s-1).marks);)s-=1,o-=r.parent.child(s).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const s=_e(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:d}=l;if(i){const u=Tr(a,s,e);if(u&&u.from<=c&&u.to>=d){const f=C.create(o,u.from,u.to);t.setSelection(f)}}return!0},pd=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Or()&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!oo(t.state.selection))return o(),!0;const l=lo(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},gd=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),yd=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),ar=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&!/\S/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&ar(n)}return r};function Ni(r){const e=`${r}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return ar(t),ar(t)}function sn(r,e,t){if(t={slice:!0,parseOptions:{},...t},typeof r=="object"&&r!==null)try{return Array.isArray(r)&&r.length>0?b.fromArray(r.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(r)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",n),sn("",e,t)}if(typeof r=="string"){const n=ut.fromSchema(e);return t.slice?n.parseSlice(Ni(r),t.parseOptions).content:n.parse(Ni(r),t.parseOptions)}return sn("",e,t)}function bd(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=d)}),r.setSelection(v.near(r.doc.resolve(o),t))}const kd=r=>r.toString().startsWith("<"),xd=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=sn(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},c=!0,d=!0;if((kd(o)?o:[o]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,d=d?f.isBlock:!1}),l===a&&d){const{parent:f}=n.doc.resolve(l);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(l-=1,a+=1)}c?Array.isArray(e)?n.insertText(e.map(f=>f.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?n.insertText(e.text,l,a):n.insertText(e,l,a):n.replaceWith(l,a,o),t.updateSelection&&bd(n,n.steps.length-1,-1)}return!0},Sd=()=>({state:r,dispatch:e})=>Sc(r,e),Md=()=>({state:r,dispatch:e})=>Mc(r,e),wd=()=>({state:r,dispatch:e})=>gc(r,e),Cd=()=>({state:r,dispatch:e})=>kc(r,e),Td=()=>({tr:r,state:e,dispatch:t})=>{try{const n=an(e.doc,e.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),t&&t(r),!0)}catch{return!1}},Od=()=>({state:r,dispatch:e,tr:t})=>{try{const n=an(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}};function vr(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vd(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l({editor:e,view:t,tr:n,dispatch:i})=>{const s=vd(r).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const d=c.map(n.mapping);d&&i&&n.maybeStep(d)}),!0};function Rt(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?j(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(u,f)=>{if(u.isText)return;const h=Math.max(n,f),p=Math.min(i,f+u.nodeSize);l.push({node:u,from:h,to:p})});const a=i-n,c=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>rn(u.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((u,f)=>u+f.to-f.from,0)>=a}const Nd=(r,e={})=>({state:t,dispatch:n})=>{const i=j(r,t.schema);return Rt(t,i,e)?wc(t,n):!1},Ed=()=>({state:r,dispatch:e})=>vc(r,e),Dd=r=>({state:e,dispatch:t})=>{const n=j(r,e.schema);return Bc(n)(e,t)},Id=()=>({state:r,dispatch:e})=>Cc(r,e);function bn(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function Ei(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const Rd=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=bn(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=j(r,n.schema)),l==="mark"&&(o=_e(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,d)=>{s&&s===c.type&&t.setNodeMarkup(d,void 0,Ei(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(u=>{o===u.type&&t.addMark(d,d+c.nodeSize,o.create(Ei(u.attrs,e)))})})}),!0):!1},Pd=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),Bd=()=>({tr:r,commands:e})=>e.setTextSelection({from:0,to:r.doc.content.size}),Ld=()=>({state:r,dispatch:e})=>yc(r,e),zd=()=>({state:r,dispatch:e})=>xc(r,e),Fd=()=>({state:r,dispatch:e})=>Ac(r,e),Vd=()=>({state:r,dispatch:e})=>Dc(r,e),$d=()=>({state:r,dispatch:e})=>Ec(r,e);function ao(r,e,t={}){return sn(r,e,{slice:!1,parseOptions:t})}const Hd=(r,e=!1,t={})=>({tr:n,editor:i,dispatch:s})=>{const{doc:o}=n,l=ao(r,i.schema,t);return s&&n.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function kn(r,e){const t=_e(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function _d(r){for(let e=0;e0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Ar(r){return e=>jd(e.$from,r)}function Jd(r,e){const t=ke.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Wd(r,e){const t={from:0,to:r.content.size};return io(r,t,e)}function qd(r,e){const t=j(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Kd(r,e){const t=bn(typeof e=="string"?e:e.name,r.schema);return t==="node"?qd(r,e):t==="mark"?kn(r,e):{}}function co(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r-1),o=Tr(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||i.nodeSize===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}function jt(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function cr(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?_e(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>rn(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:f})=>{const h=u.pos,p=f.pos;r.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,g),x=Math.min(p,g+m.nodeSize),N=x-y;o+=N,l.push(...m.marks.map(P=>({mark:P,from:y,to:x})))})}),o===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>rn(u.mark.attrs,t,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,f)=>u+f.to-f.from,0);return(a>0?a+c:a)>=o}function Ud(r,e,t={}){if(!e)return Rt(r,null,t)||cr(r,null,t);const n=bn(e,r.schema);return n==="node"?Rt(r,e,t):n==="mark"?cr(r,e,t):!1}function Di(r,e){const{nodeExtensions:t}=mn(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=O(S(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Gd(r){var e;const t=(e=r.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),n=r.toJSON();return JSON.stringify(t)===JSON.stringify(n)}function Yd(r,e,t){var n;const{selection:i}=e;let s=null;if(oo(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(d,u,f)=>{if(c)return!1;if(d.isInline){const h=!f||f.type.allowsMarkType(t),p=!!t.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}const Xd=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=_e(r,n.schema);if(i)if(o){const c=kn(n,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(d,u,(f,h)=>{const p=Math.max(h,d),m=Math.min(h+f.nodeSize,u);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Yd(n,t,a)},Zd=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),Qd=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=j(r,t.schema);return s.isTextblock?i().command(({commands:o})=>Ti(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Ti(s,e)(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},eu=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=qe(r,0,n.content.size),s=M.create(n,i);e.setSelection(s)}return!0},tu=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=C.atStart(n).from,l=C.atEnd(n).to,a=qe(i,o,l),c=qe(s,o,l),d=C.create(n,a,c);e.setSelection(d)}return!0},nu=r=>({state:e,dispatch:t})=>{const n=j(r,e.schema);return Fc(n)(e,t)};function Ii(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const ru=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,c=i.extensionManager.attributes,d=jt(c,l.node().type.name,l.node().attrs);if(s instanceof M&&s.node.isBlock)return!l.parentOffset||!at(o,l.pos)?!1:(n&&(r&&Ii(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(n){const u=a.parentOffset===a.parent.content.size;s instanceof C&&e.deleteSelection();const f=l.depth===0?void 0:_d(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&f?[{type:f,attrs:d}]:void 0,p=at(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&at(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:d}]:void 0),p&&(e.split(e.mapping.map(l.pos),1,h),f&&!u&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}r&&Ii(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},iu=r=>({tr:e,state:t,dispatch:n,editor:i})=>{var s;const o=j(r,t.schema),{$from:l,$to:a}=t.selection,c=t.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const d=l.node(-1);if(d.type!==o)return!1;const u=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){let g=b.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let K=l.depth-y;K>=l.depth-3;K-=1)g=b.from(l.node(K).copy(g));const x=l.indexAfter(-1){if(R>-1)return!1;K.isTextblock&&K.content.size===0&&(R=ge+1)}),R>-1&&e.setSelection(C.near(e.doc.resolve(R))),e.scrollIntoView()}return!0}const f=a.pos===l.end()?d.contentMatchAt(0).defaultType:null,h=jt(u,d.type.name,d.attrs),p=jt(u,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const m=f?[{type:o,attrs:h},{type:f,attrs:p}]:[{type:o,attrs:h}];if(!at(e.doc,l.pos,2))return!1;if(n){const{selection:g,storedMarks:y}=t,{splittableMarks:x}=i.extensionManager,N=y||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,m).scrollIntoView(),!N||!n)return!0;const P=N.filter(B=>x.includes(B.type.name));e.ensureMarks(P)}return!0},Hn=(r,e)=>{const t=Ar(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Ve(r.doc,t.pos)&&r.join(t.pos),!0},_n=(r,e)=>{const t=Ar(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Ve(r.doc,n)&&r.join(n),!0},su=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:c,can:d})=>{const{extensions:u,splittableMarks:f}=i.extensionManager,h=j(r,o.schema),p=j(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,N=y.blockRange(x),P=g||m.$to.parentOffset&&m.$from.marks();if(!N)return!1;const B=Ar(R=>Di(R.type.name,u))(m);if(N.depth>=1&&B&&N.depth-B.depth<=1){if(B.node.type===h)return c.liftListItem(p);if(Di(B.node.type.name,u)&&h.validContent(B.node.content)&&l)return a().command(()=>(s.setNodeMarkup(B.pos,h),!0)).command(()=>Hn(s,h)).command(()=>_n(s,h)).run()}return!t||!P||!l?a().command(()=>d().wrapInList(h,n)?!0:c.clearNodes()).wrapInList(h,n).command(()=>Hn(s,h)).command(()=>_n(s,h)).run():a().command(()=>{const R=d().wrapInList(h,n),K=P.filter(ge=>f.includes(ge.type.name));return s.ensureMarks(K),R?!0:c.clearNodes()}).wrapInList(h,n).command(()=>Hn(s,h)).command(()=>_n(s,h)).run()},ou=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=_e(r,n.schema);return cr(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},lu=(r,e,t={})=>({state:n,commands:i})=>{const s=j(r,n.schema),o=j(e,n.schema);return Rt(n,s,t)?i.setNode(o):i.setNode(s,t)},au=(r,e={})=>({state:t,commands:n})=>{const i=j(r,t.schema);return Rt(t,i,e)?n.lift(i):n.wrapIn(i,e)},cu=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},du=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},uu=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=_e(r,n.schema),{$from:c,empty:d,ranges:u}=l;if(!i)return!0;if(d&&o){let{from:f,to:h}=l;const p=(s=c.marks().find(g=>g.type===a))===null||s===void 0?void 0:s.attrs,m=Tr(c,a,p);m&&(f=m.from,h=m.to),t.removeMark(f,h,a)}else u.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},fu=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=bn(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=j(r,n.schema)),l==="mark"&&(o=_e(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const c=a.$from.pos,d=a.$to.pos;n.doc.nodesBetween(c,d,(u,f)=>{s&&s===u.type&&t.setNodeMarkup(f,void 0,{...u.attrs,...e}),o&&u.marks.length&&u.marks.forEach(h=>{if(o===h.type){const p=Math.max(f,c),m=Math.min(f+u.nodeSize,d);t.addMark(p,m,o.create({...h.attrs,...e}))}})})}),!0):!1},hu=(r,e={})=>({state:t,dispatch:n})=>{const i=j(r,t.schema);return Ic(i,e)(t,n)},pu=(r,e={})=>({state:t,dispatch:n})=>{const i=j(r,t.schema);return Rc(i,e)(t,n)};var mu=Object.freeze({__proto__:null,blur:ed,clearContent:td,clearNodes:nd,command:rd,createParagraphNear:id,cut:sd,deleteCurrentNode:od,deleteNode:ld,deleteRange:ad,deleteSelection:cd,enter:dd,exitCode:ud,extendMarkRange:hd,first:pd,focus:md,forEach:gd,insertContent:yd,insertContentAt:xd,joinUp:Sd,joinDown:Md,joinBackward:wd,joinForward:Cd,joinItemBackward:Td,joinItemForward:Od,keyboardShortcut:Ad,lift:Nd,liftEmptyBlock:Ed,liftListItem:Dd,newlineInCode:Id,resetAttributes:Rd,scrollIntoView:Pd,selectAll:Bd,selectNodeBackward:Ld,selectNodeForward:zd,selectParentNode:Fd,selectTextblockEnd:Vd,selectTextblockStart:$d,setContent:Hd,setMark:Xd,setMeta:Zd,setNode:Qd,setNodeSelection:eu,setTextSelection:tu,sinkListItem:nu,splitBlock:ru,splitListItem:iu,toggleList:su,toggleMark:ou,toggleNode:lu,toggleWrap:au,undoInputRule:cu,unsetAllMarks:du,unsetMark:uu,updateAttributes:fu,wrapIn:hu,wrapInList:pu});const gu=se.create({name:"commands",addCommands(){return{...mu}}}),yu=se.create({name:"editable",addProseMirrorPlugins(){return[new ue({key:new $e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),bu=se.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new ue({key:new $e("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),ku=se.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock?l.doc.resolve(f-1):u,m=p.parent.type.spec.isolating,g=u.pos-u.parentOffset,y=m&&p.parent.childCount===1?g===u.pos:v.atStart(c).from===f;return!d||!y||!h.type.isTextblock||h.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Or()||vr()?s:i},addProseMirrorPlugins(){return[new ue({key:new $e("clearDocument"),appendTransaction:(r,e,t)=>{if(!(r.some(p=>p.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=v.atStart(e.doc).from,a=v.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const u=t.tr,f=hn({state:t,transaction:u}),{commands:h}=new pn({editor:this.editor,state:f});if(h.clearNodes(),!!u.steps.length)return u}})]}}),xu=se.create({name:"tabindex",addProseMirrorPlugins(){return[new ue({key:new $e("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Su=Object.freeze({__proto__:null,ClipboardTextSerializer:Qc,Commands:gu,Editable:yu,FocusEvents:bu,Keymap:ku,Tabindex:xu});const Mu=`.ProseMirror { - position: relative; -} - -.ProseMirror { - word-wrap: break-word; - white-space: pre-wrap; - white-space: break-spaces; - -webkit-font-variant-ligatures: none; - font-variant-ligatures: none; - font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ -} - -.ProseMirror [contenteditable="false"] { - white-space: normal; -} - -.ProseMirror [contenteditable="false"] [contenteditable="true"] { - white-space: pre-wrap; -} - -.ProseMirror pre { - white-space: pre-wrap; -} - -img.ProseMirror-separator { - display: inline !important; - border: none !important; - margin: 0 !important; - width: 1px !important; - height: 1px !important; -} - -.ProseMirror-gapcursor { - display: none; - pointer-events: none; - position: absolute; - margin: 0; -} - -.ProseMirror-gapcursor:after { - content: ""; - display: block; - position: absolute; - top: -2px; - width: 20px; - border-top: 1px solid black; - animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; -} - -@keyframes ProseMirror-cursor-blink { - to { - visibility: hidden; - } -} - -.ProseMirror-hideselection *::selection { - background: transparent; -} - -.ProseMirror-hideselection *::-moz-selection { - background: transparent; -} - -.ProseMirror-hideselection * { - caret-color: transparent; -} - -.ProseMirror-focused .ProseMirror-gapcursor { - display: block; -} - -.tippy-box[data-animation=fade][data-state=hidden] { - opacity: 0 -}`;function wu(r,e,t){const n=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(i),i}let Cu=class extends Vc{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=wu(Mu,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=ro(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(Su):[],...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new ot(t,this)}createCommandManager(){this.commandManager=new pn({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=ao(this.options.content,this.schema,this.options.parseOptions),t=lo(e,this.options.autofocus);this.view=new ic(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:st.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Kd(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return Ud(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jd(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` - -`,textSerializers:n={}}=e||{};return Wd(this.state.doc,{blockSeparator:t,textSerializers:{...so(this.schema),...n}})}get isEmpty(){return Gd(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function gt(r){return new gn({find:r.find,handler:({state:e,range:t,match:n})=>{const i=O(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),d=c+o.length;if(co(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===r.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;dt.from&&s.delete(t.from+a,c);const f=t.from+a+o.length;s.addMark(t.from+a,f,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}function Tu(r){return new gn({find:r.find,handler:({state:e,range:t,match:n})=>{const i=O(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;const a=r.type.create(i);if(n[1]){const c=n[0].lastIndexOf(n[1]);let d=o+c;d>l?d=l:l=d+n[1].length;const u=n[0][n[0].length-1];s.insertText(u,o+n[0].length-1),s.replaceWith(d,l,a)}else n[0]&&s.insert(o-1,r.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l));s.scrollIntoView()}})}function dr(r){return new gn({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=O(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)}})}function Pt(r){return new gn({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=O(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),c=a&&fr(a,r.type,s);if(!c)return null;if(o.wrap(a,c),r.keepMarks&&r.editor){const{selection:u,storedMarks:f}=e,{splittableMarks:h}=r.editor.extensionManager,p=f||u.$to.parentOffset&&u.$from.marks();if(p){const m=p.filter(g=>h.includes(g.type.name));o.ensureMarks(m)}}if(r.keepAttributes){const u=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=o.doc.resolve(t.from-1).nodeBefore;d&&d.type===r.type&&Ve(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,d))&&o.join(t.from-1)}})}class we{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=O(S(this,"addOptions",{name:this.name}))),this.storage=O(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new we(e)}configure(e={}){const t=this.extend();return t.options=yn(this.options,e),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new we(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=O(S(t,"addOptions",{name:t.name})),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}class Y{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=O(S(this,"addOptions",{name:this.name}))),this.storage=O(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Y(e)}configure(e={}){const t=this.extend();return t.options=yn(this.options,e),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Y(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=O(S(t,"addOptions",{name:t.name})),t.storage=O(S(t,"addStorage",{name:t.name,options:t.options})),t}}function yt(r){return new Kc({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=O(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,l=n[n.length-1],a=n[0];let c=t.to;if(l){const d=a.search(/\S/),u=t.from+a.indexOf(l),f=u+l.length;if(co(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===r.type&&g!==p.mark.type)).filter(p=>p.to>u).length)return null;ft.from&&o.delete(t.from+d,u),c=t.from+d+l.length,o.addMark(t.from+d,c,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function Ri(r){return vo((e,t)=>({get(){return e(),r},set(n){r=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class Ou extends Cu{constructor(e={}){return super(e),this.vueRenderers=To(new Map),this.contentComponent=null,this.reactiveState=Ri(this.view.state),this.reactiveExtensionStorage=Ri(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),Oo(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const vu=go({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(r){const e=yo(),t=bo();return ko(()=>{const n=r.editor;n&&n.options.element&&e.value&&xo(()=>{if(!e.value||!n.options.element.firstChild)return;const i=So(e.value);e.value.append(...n.options.element.childNodes),n.contentComponent=t.ctx._,n.setOptions({element:i}),n.createNodeViews()})}),$i(()=>{const n=r.editor;if(!n||(n.isDestroyed||n.view.setProps({nodeViews:{}}),n.contentComponent=null,!n.options.element.firstChild))return;const i=document.createElement("div");i.append(...n.options.element.childNodes),n.setOptions({element:i})}),{rootEl:e}},render(){const r=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=xn(Mo,{to:e.teleportElement,key:e.id},xn(e.component,{ref:e.id,...e.props}));r.push(t)}),xn("div",{ref:e=>{this.rootEl=e}},...r)}}),Au=(r={})=>{const e=wo();return Co(()=>{e.value=new Ou(r)}),$i(()=>{var t;(t=e.value)===null||t===void 0||t.destroy()}),e},Nu=/^\s*>\s$/,Eu=Y.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Pt({find:Nu,type:this.type})]}}),Du=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Iu=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Ru=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Pu=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Bu=we.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[gt({find:Du,type:this.type}),gt({find:Ru,type:this.type})]},addPasteRules(){return[yt({find:Iu,type:this.type}),yt({find:Pu,type:this.type})]}}),Lu=Y.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",$(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Pi=we.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",$(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=kn(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Bi=/^\s*([-+*])\s$/,zu=Y.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",$(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Lu.name,this.editor.getAttributes(Pi.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=Pt({find:Bi,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Pt({find:Bi,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Pi.name),editor:this.editor})),[r]}}),Fu=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Vu=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,$u=we.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[gt({find:Fu,type:this.type})]},addPasteRules(){return[yt({find:Vu,type:this.type})]}}),Hu=/^```([a-z]+)?[\s\n]$/,_u=/^~~~([a-z]+)?[\s\n]$/,ju=Y.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",$(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` - -`);return!s||!o?!1:r.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||n.nodeAt(l)?!1:r.commands.exitCode()}}},addInputRules(){return[dr({find:Hu,type:this.type,getAttributes:r=>({language:r[1]})}),dr({find:_u,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new ue({key:new $e("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o}=r.state;return o.replaceSelectionWith(this.type.create({language:s})),o.setSelection(C.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(t.replace(/\r\n?/g,` -`)),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),Ju=Y.create({name:"doc",topNode:!0,content:"block+"});function Wu(r={}){return new ue({view(e){return new qu(e,r)}})}class qu{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let d=c.getBoundingClientRect(),u=l?d.bottom:d.top;l&&a&&(u=(u+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:d.left,right:d.right,top:u-this.width/2,bottom:u+this.width/2}}}}if(!n){let l=this.editorView.coordsAtPos(this.cursorPos);n={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let l=i.getBoundingClientRect();s=l.left-i.scrollLeft,o=l.top-i.scrollTop}this.element.style.left=n.left-s+"px",this.element.style.top=n.top-o+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ds(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Ku=se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Wu(this.options)]}});class L extends v{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return L.valid(n)?new L(n):v.near(n)}content(){return k.empty}eq(e){return e instanceof L&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new L(e.resolve(t.pos))}getBookmark(){return new Nr(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Uu(e)||!Gu(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&L.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(L.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!M.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(L.valid(l))return l}return null}}}L.prototype.visible=!1;L.findFrom=L.findGapCursorFrom;v.jsonID("gapcursor",L);class Nr{constructor(e){this.pos=e}map(e){return new Nr(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return L.valid(t)?new L(t):v.near(t)}}function Uu(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Gu(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Yu(){return new ue({props:{decorations:ef,createSelectionBetween(r,e,t){return e.pos==t.pos&&L.valid(t)?new L(t):null},handleClick:Zu,handleKeyDown:Xu,handleDOMEvents:{beforeinput:Qu}}})}const Xu=Ys({ArrowLeft:Ht("horiz",-1),ArrowRight:Ht("horiz",1),ArrowUp:Ht("vert",-1),ArrowDown:Ht("vert",1)});function Ht(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof C){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=n.doc.resolve(e>0?l.after():l.before())}let c=L.findGapCursorFrom(l,e,a);return c?(i&&i(n.tr.setSelection(new L(c))),!0):!1}}function Zu(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!L.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&M.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new L(n))),!0)}function Qu(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof L))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=b.empty;for(let o=n.length-1;o>=0;o--)i=b.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new k(i,0,0));return s.setSelection(C.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function ef(r){if(!(r.selection instanceof L))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",V.create(r.doc,[ce.widget(r.selection.head,e,{key:"gapcursor"})])}const tf=se.create({name:"gapCursor",addProseMirrorPlugins(){return[Yu()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=O(S(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),nf=Y.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",$(this.options.HTMLAttributes,r)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&o){const u=a.filter(f=>l.includes(f.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rf=Y.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,$(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>dr({find:new RegExp(`^(#{1,${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var on=200,_=function(){};_.prototype.append=function(e){return e.length?(e=_.from(e),!this.length&&e||e.length=t?_.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};_.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};_.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};_.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};_.from=function(e){return e instanceof _?e:e&&e.length?new uo(e):_.empty};var uo=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=on)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=on)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(_);_.empty=new uo([]);var sf=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return nl&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(_);const of=500;class he{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,c=[],d=[];return this.items.forEach((u,f)=>{if(!u.step){i||(i=this.remapping(n,f+1),s=i.maps.length),s--,d.push(u);return}if(i){d.push(new ye(u.map));let h=u.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new ye(p,void 0,void 0,c.length+d.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(u.step);if(u.selection)return l=i?u.selection.map(i.slice(s)):u.selection,a=new he(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let d=0;daf&&(l=lf(l,c),o-=c),new he(l.append(s),o)}remapping(e,t){let n=new lt;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new he(this.items.append(e.map(t=>new ye(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(s.slice(a+1,h));g&&l++,n.push(new ye(p,m,g))}else n.push(new ye(p))},i);let c=[];for(let f=t;fof&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),c=a&&a.getMap();if(n--,c&&t.appendMap(c,n),a){let d=o.selection&&o.selection.map(t.slice(n));d&&s++;let u=new ye(c.invert(),a,d),f,h=i.length-1;(f=i.length&&i[h].merge(u))?i[h]=f:i.push(u)}}else o.map&&n--},this.items.length,0),new he(_.from(i.reverse()),s)}}he.empty=new he(_.empty,0);function lf(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class ye{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ye(t.getMap().invert(),t,this.selection)}}}class Ne{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const af=20;function cf(r,e,t,n){let i=t.getMeta(ze),s;if(i)return i.historyState;t.getMeta(uf)&&(r=new Ne(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(ze))return o.getMeta(ze).redo?new Ne(r.done.addTransform(t,void 0,n,Jt(e)),r.undone,Li(t.mapping.maps[t.steps.length-1]),r.prevTime,r.prevComposition):new Ne(r.done,r.undone.addTransform(t,void 0,n,Jt(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!df(t,r.prevRanges)),c=o?jn(r.prevRanges,t.mapping):Li(t.mapping.maps[t.steps.length-1]);return new Ne(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,Jt(e)),he.empty,c,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Ne(r.done.rebased(t,s),r.undone.rebased(t,s),jn(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Ne(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),jn(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function df(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s=e[s]&&(t=!0)}),t}function Li(r){let e=[];return r.forEach((t,n,i,s)=>e.push(i,s)),e}function jn(r,e){if(!r)return null;let t=[];for(let n=0;n{let t=ze.getState(r);return!t||t.done.eventCount==0?!1:(e&&fo(t,r,e,!1),!0)},po=(r,e)=>{let t=ze.getState(r);return!t||t.undone.eventCount==0?!1:(e&&fo(t,r,e,!0),!0)},hf=se.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>ho(r,e),redo:()=>({state:r,dispatch:e})=>po(r,e)}},addProseMirrorPlugins(){return[ff(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),pf=Y.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",$(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r,state:e})=>{const{$to:t}=e.selection,n=r();return t.parentOffset===0?n.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):n.insertContent({type:this.name}),n.command(({tr:i,dispatch:s})=>{var o;if(s){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(C.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(M.create(i.doc,l.pos)):i.setSelection(C.create(i.doc,l.pos));else{const c=(o=l.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();c&&(i.insert(a,c),i.setSelection(C.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Tu({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),mf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,gf=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,yf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,bf=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,kf=we.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[gt({find:mf,type:this.type}),gt({find:yf,type:this.type})]},addPasteRules(){return[yt({find:gf,type:this.type}),yt({find:bf,type:this.type})]}}),xf=Y.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",$(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Sf=Y.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",$(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Fi=we.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",$(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=kn(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Vi=/^(\d+)\.\s$/,Mf=Y.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",$(this.options.HTMLAttributes,t),0]:["ol",$(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Sf.name,this.editor.getAttributes(Fi.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=Pt({find:Vi,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Pt({find:Vi,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Fi.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),wf=Y.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Cf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Tf=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Of=we.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",$(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){const r={};return vr()?r["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():r["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),r},addInputRules(){return[gt({find:Cf,type:this.type})]},addPasteRules(){return[yt({find:Tf,type:this.type})]}}),vf=Y.create({name:"text",group:"inline"}),Af=se.create({name:"starterKit",addExtensions(){var r,e,t,n,i,s,o,l,a,c,d,u,f,h,p,m,g,y;const x=[];return this.options.blockquote!==!1&&x.push(Eu.configure((r=this.options)===null||r===void 0?void 0:r.blockquote)),this.options.bold!==!1&&x.push(Bu.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(zu.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&x.push($u.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&x.push(ju.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(Ju.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&x.push(Ku.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&x.push(tf.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&x.push(nf.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&x.push(rf.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(hf.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&x.push(pf.configure((u=this.options)===null||u===void 0?void 0:u.horizontalRule)),this.options.italic!==!1&&x.push(kf.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&x.push(xf.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&x.push(Mf.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&x.push(wf.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&x.push(Of.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&x.push(vf.configure((y=this.options)===null||y===void 0?void 0:y.text)),x}}),Nf=se.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:r=>r.style.textAlign||this.options.defaultAlignment,renderHTML:r=>r.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${r.textAlign}`}}}}]},addCommands(){return{setTextAlign:r=>({commands:e})=>this.options.alignments.includes(r)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:r})):!1,unsetTextAlign:()=>({commands:r})=>this.options.types.every(e=>r.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Ef={},Df={viewBox:"0 0 24 24"},If=w("path",{d:"M17.194 10.962A6.271 6.271 0 0012.844.248H4.3a1.25 1.25 0 000 2.5h1.013a.25.25 0 01.25.25V21a.25.25 0 01-.25.25H4.3a1.25 1.25 0 100 2.5h9.963a6.742 6.742 0 002.93-12.786zm-4.35-8.214a3.762 3.762 0 010 7.523H8.313a.25.25 0 01-.25-.25V3a.25.25 0 01.25-.25zm1.42 18.5H8.313a.25.25 0 01-.25-.25v-7.977a.25.25 0 01.25-.25h5.951a4.239 4.239 0 010 8.477z"},null,-1),Rf=[If];function Pf(r,e){return Q(),ie("svg",Df,Rf)}const Bf=le(Ef,[["render",Pf]]),Lf={},zf={viewBox:"0 0 24 24"},Ff=w("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Vf=[Ff];function $f(r,e){return Q(),ie("svg",zf,Vf)}const Hf=le(Lf,[["render",$f]]),_f={},jf={viewBox:"0 0 24 24"},Jf=w("path",{d:"M22.5.248h-7.637a1.25 1.25 0 000 2.5h1.086a.25.25 0 01.211.384L4.78 21.017a.5.5 0 01-.422.231H1.5a1.25 1.25 0 000 2.5h7.637a1.25 1.25 0 000-2.5H8.051a.25.25 0 01-.211-.384L19.22 2.98a.5.5 0 01.422-.232H22.5a1.25 1.25 0 000-2.5z"},null,-1),Wf=[Jf];function qf(r,e){return Q(),ie("svg",jf,Wf)}const Kf=le(_f,[["render",qf]]),Uf={},Gf={viewBox:"0 0 24 24"},Yf=w("path",{d:"M7.75 4.5h15a1 1 0 000-2h-15a1 1 0 000 2zm15 6.5h-15a1 1 0 100 2h15a1 1 0 000-2zm0 8.5h-15a1 1 0 000 2h15a1 1 0 000-2zM2.212 17.248a2 2 0 00-1.933 1.484.75.75 0 101.45.386.5.5 0 11.483.63.75.75 0 100 1.5.5.5 0 11-.482.635.75.75 0 10-1.445.4 2 2 0 103.589-1.648.251.251 0 010-.278 2 2 0 00-1.662-3.111zm2.038-6.5a2 2 0 00-4 0 .75.75 0 001.5 0 .5.5 0 011 0 1.031 1.031 0 01-.227.645L.414 14.029A.75.75 0 001 15.248h2.5a.75.75 0 000-1.5h-.419a.249.249 0 01-.195-.406L3.7 12.33a2.544 2.544 0 00.55-1.582zM4 5.248h-.25A.25.25 0 013.5 5V1.623A1.377 1.377 0 002.125.248H1.5a.75.75 0 000 1.5h.25A.25.25 0 012 2v3a.25.25 0 01-.25.25H1.5a.75.75 0 000 1.5H4a.75.75 0 000-1.5z"},null,-1),Xf=[Yf];function Zf(r,e){return Q(),ie("svg",Gf,Xf)}const Qf=le(Uf,[["render",Zf]]),eh={},th={viewBox:"0 0 24 24"},nh=Ao('',6),rh=[nh];function ih(r,e){return Q(),ie("svg",th,rh)}const sh=le(eh,[["render",ih]]),oh={},lh={viewBox:"0 0 24 24"},ah=w("path",{d:"M22.5.248H7.228a6.977 6.977 0 100 13.954h2.318a.25.25 0 01.25.25V22.5a1.25 1.25 0 002.5 0V3a.25.25 0 01.25-.25h3.682a.25.25 0 01.25.25v19.5a1.25 1.25 0 002.5 0V3a.249.249 0 01.25-.25H22.5a1.25 1.25 0 000-2.5zM9.8 11.452a.25.25 0 01-.25.25H7.228a4.477 4.477 0 110-8.954h2.318A.25.25 0 019.8 3z"},null,-1),ch=[ah];function dh(r,e){return Q(),ie("svg",lh,ch)}const uh=le(oh,[["render",dh]]),fh={},hh={viewBox:"0 0 24 24"},ph=w("path",{d:"M18.559 3.932a4.942 4.942 0 100 9.883 4.609 4.609 0 001.115-.141.25.25 0 01.276.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.71 9.71 0 009.428-9.95V8.873a4.947 4.947 0 00-4.941-4.941zm-12.323 0a4.942 4.942 0 000 9.883 4.6 4.6 0 001.115-.141.25.25 0 01.277.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.711 9.711 0 009.428-9.95V8.873a4.947 4.947 0 00-4.942-4.941z"},null,-1),mh=[ph];function gh(r,e){return Q(),ie("svg",hh,mh)}const yh=le(fh,[["render",gh]]),bh={},kh={viewBox:"0 0 24 24"},xh=w("path",{d:"M23.75 12.952A1.25 1.25 0 0022.5 11.7h-8.936a.492.492 0 01-.282-.09c-.722-.513-1.482-.981-2.218-1.432-2.8-1.715-4.5-2.9-4.5-4.863 0-2.235 2.207-2.569 3.523-2.569a4.54 4.54 0 013.081.764 2.662 2.662 0 01.447 1.99v.3a1.25 1.25 0 102.5 0v-.268a4.887 4.887 0 00-1.165-3.777C13.949.741 12.359.248 10.091.248c-3.658 0-6.023 1.989-6.023 5.069 0 2.773 1.892 4.512 4 5.927a.25.25 0 01-.139.458H1.5a1.25 1.25 0 000 2.5h10.977a.251.251 0 01.159.058 4.339 4.339 0 011.932 3.466c0 3.268-3.426 3.522-4.477 3.522-1.814 0-3.139-.405-3.834-1.173a3.394 3.394 0 01-.65-2.7 1.25 1.25 0 00-2.488-.246A5.76 5.76 0 004.4 21.753c1.2 1.324 3.114 2 5.688 2 4.174 0 6.977-2.42 6.977-6.022a6.059 6.059 0 00-.849-3.147.25.25 0 01.216-.377H22.5a1.25 1.25 0 001.25-1.255z"},null,-1),Sh=[xh];function Mh(r,e){return Q(),ie("svg",kh,Sh)}const wh=le(bh,[["render",Mh]]),Ch={},Th={viewBox:"0 0 24 24"},Oh=w("path",{d:"M17.786 3.77a12.542 12.542 0 00-12.965-.865.249.249 0 01-.292-.045L1.937.269A.507.507 0 001.392.16a.5.5 0 00-.308.462v6.7a.5.5 0 00.5.5h6.7a.5.5 0 00.354-.854L6.783 5.115a.253.253 0 01-.068-.228.249.249 0 01.152-.181 10 10 0 019.466 1.1 9.759 9.759 0 01.094 15.809 1.25 1.25 0 001.473 2.016 12.122 12.122 0 005.013-9.961 12.125 12.125 0 00-5.127-9.9z"},null,-1),vh=[Oh];function Ah(r,e){return Q(),ie("svg",Th,vh)}const Nh=le(Ch,[["render",Ah]]),Eh={},Dh={viewBox:"0 0 24 24"},Ih=w("path",{d:"M22.608.161a.5.5 0 00-.545.108L19.472 2.86a.25.25 0 01-.292.045 12.537 12.537 0 00-12.966.865A12.259 12.259 0 006.1 23.632a1.25 1.25 0 001.476-2.018 9.759 9.759 0 01.091-15.809 10 10 0 019.466-1.1.25.25 0 01.084.409l-1.85 1.85a.5.5 0 00.354.853h6.7a.5.5 0 00.5-.5V.623a.5.5 0 00-.313-.462z"},null,-1),Rh=[Ih];function Ph(r,e){return Q(),ie("svg",Dh,Rh)}const Bh=le(Eh,[["render",Ph]]),Lh={},zh={viewBox:"0 0 24 24"},Fh=w("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Vh=[Fh];function $h(r,e){return Q(),ie("svg",zh,Vh)}const Hh=le(Lh,[["render",$h]]),_h={},jh={viewBox:"0 0 24 24"},Jh=w("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.75 5.25h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 0 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zm-4 4h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 1 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5z"},null,-1),Wh=[Jh];function qh(r,e){return Q(),ie("svg",jh,Wh)}const Kh=le(_h,[["render",qh]]),Uh={components:{EditorContent:vu,BoldIcon:Bf,CodingIcon:Hf,ItalicIcon:Kf,ListIcon:Qf,ListUlIcon:sh,ParagraphIcon:uh,QuoteIcon:yh,StrikethroughIcon:wh,UndoIcon:Nh,RedoIcon:Bh,CodeBlockIcon:Hh,DotsVerticalIcon:No,MenuCenterIcon:Kh,MenuAlt2Icon:Eo,MenuAlt3Icon:Do,MenuIcon:Io},props:{modelValue:{type:String,default:""},contentLoading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=Au({content:r.modelValue,extensions:[Af,Nf.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"]})],onUpdate:()=>{e("update:modelValue",t.value.getHTML())}});return Ro(()=>r.modelValue,n=>{t.value.getHTML()!==n&&t.value.commands.setContent(r.modelValue,!1)}),Po(()=>{setTimeout(()=>{t.value.destroy()},500)}),{editor:t}}},Gh={key:1,class:"box-border w-full text-sm leading-8 text-left bg-white border border-gray-200 rounded-md min-h-[200px] overflow-hidden"},Yh={key:0,class:"editor-content"},Xh={class:"flex justify-end p-2 border-b border-gray-200 md:hidden"},Zh={class:"flex items-center justify-center w-6 h-6 ml-2 text-sm text-black bg-white rounded-sm md:h-9 md:w-9"},Qh={class:"flex flex-wrap space-x-1"},ep={class:"hidden p-2 border-b border-gray-200 md:flex"},tp={class:"flex flex-wrap space-x-1"};function np(r,e,t,n,i,s){const o=z("BaseContentPlaceholdersBox"),l=z("BaseContentPlaceholders"),a=z("dots-vertical-icon"),c=z("bold-icon"),d=z("italic-icon"),u=z("strikethrough-icon"),f=z("coding-icon"),h=z("paragraph-icon"),p=z("list-ul-icon"),m=z("list-icon"),g=z("quote-icon"),y=z("code-block-icon"),x=z("undo-icon"),N=z("redo-icon"),P=z("BaseDropdown"),B=z("menu-alt2-icon"),R=z("menu-alt3-icon"),K=z("menu-icon"),ge=z("menu-center-icon"),A=z("editor-content");return t.contentLoading?(Q(),Bo(l,{key:0},{default:Sn(()=>[D(o,{rounded:!0,class:"w-full",style:{height:"200px"}})]),_:1})):(Q(),ie("div",Gh,[n.editor?(Q(),ie("div",Yh,[w("div",Xh,[D(P,{"width-class":"w-48"},{activator:Sn(()=>[w("div",Zh,[D(a,{class:"w-6 h-6 text-gray-600"})])]),default:Sn(()=>[w("div",Qh,[w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:e[0]||(e[0]=T=>n.editor.chain().focus().toggleBold().run())},[D(c,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:e[1]||(e[1]=T=>n.editor.chain().focus().toggleItalic().run())},[D(d,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:e[2]||(e[2]=T=>n.editor.chain().focus().toggleStrike().run())},[D(u,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:e[3]||(e[3]=T=>n.editor.chain().focus().toggleCode().run())},[D(f,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:e[4]||(e[4]=T=>n.editor.chain().focus().setParagraph().run())},[D(h,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:e[5]||(e[5]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:e[6]||(e[6]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:e[7]||(e[7]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:e[8]||(e[8]=T=>n.editor.chain().focus().toggleBulletList().run())},[D(p,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:e[9]||(e[9]=T=>n.editor.chain().focus().toggleOrderedList().run())},[D(m,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:e[10]||(e[10]=T=>n.editor.chain().focus().toggleBlockquote().run())},[D(g,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:e[11]||(e[11]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[D(y,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:e[12]||(e[12]=T=>n.editor.chain().focus().undo().run())},[D(x,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:e[13]||(e[13]=T=>n.editor.chain().focus().redo().run())},[D(N,{class:"h-3 cursor-pointer fill-current"})],2)])]),_:1})]),w("div",ep,[w("div",tp,[w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:e[14]||(e[14]=T=>n.editor.chain().focus().toggleBold().run())},[D(c,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:e[15]||(e[15]=T=>n.editor.chain().focus().toggleItalic().run())},[D(d,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:e[16]||(e[16]=T=>n.editor.chain().focus().toggleStrike().run())},[D(u,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:e[17]||(e[17]=T=>n.editor.chain().focus().toggleCode().run())},[D(f,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:e[18]||(e[18]=T=>n.editor.chain().focus().setParagraph().run())},[D(h,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:e[19]||(e[19]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:e[20]||(e[20]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:e[21]||(e[21]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:e[22]||(e[22]=T=>n.editor.chain().focus().toggleBulletList().run())},[D(p,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:e[23]||(e[23]=T=>n.editor.chain().focus().toggleOrderedList().run())},[D(m,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:e[24]||(e[24]=T=>n.editor.chain().focus().toggleBlockquote().run())},[D(g,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:e[25]||(e[25]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[D(y,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:e[26]||(e[26]=T=>n.editor.chain().focus().undo().run())},[D(x,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:e[27]||(e[27]=T=>n.editor.chain().focus().redo().run())},[D(N,{class:"h-3 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"left"})}]),onClick:e[28]||(e[28]=T=>n.editor.chain().focus().setTextAlign("left").run())},[D(B,{class:"h-5 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"right"})}]),onClick:e[29]||(e[29]=T=>n.editor.chain().focus().setTextAlign("right").run())},[D(R,{class:"h-5 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"justify"})}]),onClick:e[30]||(e[30]=T=>n.editor.chain().focus().setTextAlign("justify").run())},[D(K,{class:"h-5 cursor-pointer fill-current"})],2),w("span",{class:E(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"center"})}]),onClick:e[31]||(e[31]=T=>n.editor.chain().focus().setTextAlign("center").run())},[D(ge,{class:"h-5 cursor-pointer fill-current"})],2)])]),D(A,{editor:n.editor,class:"box-border relative w-full text-sm leading-8 text-left editor__content"},null,8,["editor"])])):Lo("",!0)]))}const sp=le(Uh,[["render",np]]);export{sp as default}; diff --git a/public/build/assets/BaseListItem-YR-uygjx.js b/public/build/assets/BaseListItem-YR-uygjx.js deleted file mode 100644 index caeb4bbd..00000000 --- a/public/build/assets/BaseListItem-YR-uygjx.js +++ /dev/null @@ -1 +0,0 @@ -import{Z as c,o as n,c as l,a2 as i,k as o,r as d,m,w as _,K as f,b as $,t as B,aJ as h}from"./main-WMXHPsTs.js";const k={name:"List"},x={class:"list-none"};function y(e,a,t,s,r,u){return n(),l("div",x,[i(e.$slots,"default")])}const I=c(k,[["render",y]]),C={name:"ListItem",props:{title:{type:String,required:!1,default:""},active:{type:Boolean,required:!0},index:{type:Number,default:null}},setup(e,{slots:a}){const t="cursor-pointer pb-2 pr-0 text-sm font-medium leading-5 flex items-center";let s=o(()=>!!a.icon),r=o(()=>e.active?`${t} text-primary-500`:`${t} text-gray-500`);return{hasIconSlot:s,containerClass:r}}},g={key:0,class:"mr-3"};function S(e,a,t,s,r,u){const p=d("router-link");return n(),m(p,h(e.$attrs,{class:s.containerClass}),{default:_(()=>[s.hasIconSlot?(n(),l("span",g,[i(e.$slots,"icon")])):f("",!0),$("span",null,B(t.title),1)]),_:3},16,["class"])}const L=c(C,[["render",S]]);export{L as B,I as a}; diff --git a/public/build/assets/BaseMultiselect-X4tv9x1X.js b/public/build/assets/BaseMultiselect-X4tv9x1X.js deleted file mode 100644 index bb173227..00000000 --- a/public/build/assets/BaseMultiselect-X4tv9x1X.js +++ /dev/null @@ -1 +0,0 @@ -import{bn as x,f as M,k as O,z as re,bo as Ie,Z as We,r as qe,o as I,m as Je,w as Ze,a as Qe,c as q,J as w,q as de,K as E,N as le,O as ne,a2 as C,p as Ue,t as J,b as P}from"./main-WMXHPsTs.js";function H(e){return[null,void 0,!1].indexOf(e)!==-1}function Xe(e,u,a){const{object:i,valueProp:o,mode:v}=x(e),f=a.iv,g=p=>{f.value=c(p);const b=t(p);u.emit("change",b),u.emit("input",b),u.emit("update:modelValue",b)},t=p=>i.value||H(p)?p:Array.isArray(p)?p.map(b=>b[o.value]):p[o.value],c=p=>H(p)?v.value==="single"?{}:[]:p;return{update:g}}function Ye(e,u){const{value:a,modelValue:i,mode:o,valueProp:v}=x(e),f=M(o.value!=="single"?[]:{}),g=u.expose!==void 0?i:a,t=O(()=>o.value==="single"?f.value[v.value]:f.value.map(p=>p[v.value])),c=O(()=>o.value!=="single"?f.value.map(p=>p[v.value]).join(","):f.value[v.value]);return{iv:f,internalValue:f,ev:g,externalValue:g,textValue:c,plainValue:t}}function $e(e,u,a){const{preserveSearch:i}=x(e),o=M(e.initialSearch)||M(null),v=M(null),f=()=>{i.value||(o.value="")},g=c=>{o.value=c.target.value},t=c=>{u.emit("paste",c)};return re(o,c=>{u.emit("search-change",c)}),{search:o,input:v,clearSearch:f,handleSearchInput:g,handlePaste:t}}function _e(e,u,a){const{groupSelect:i,mode:o,groups:v}=x(e),f=M(null),g=c=>{c===void 0||c!==null&&c.disabled||v.value&&c&&c.group&&(o.value==="single"||!i.value)||(f.value=c)};return{pointer:f,setPointer:g,clearPointer:()=>{g(null)}}}function Be(e,u=!0){return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim()}function el(e){return Object.prototype.toString.call(e)==="[object Object]"}function ll(e,u){const a=u.slice().sort();return e.length===u.length&&e.slice().sort().every(function(i,o){return i===a[o]})}function al(e,u,a){const{options:i,mode:o,trackBy:v,limit:f,hideSelected:g,createTag:t,label:c,appendNewTag:p,multipleLabel:b,object:B,loading:V,delay:D,resolveOnLoad:h,minChars:r,filterResults:j,clearOnSearch:X,clearOnSelect:k,valueProp:d,canDeselect:R,max:L,strict:Z,closeOnSelect:Q,groups:Y,groupLabel:se,groupOptions:A,groupHideEmpty:ve,groupSelect:pe}=x(e),S=a.iv,F=a.ev,T=a.search,$=a.clearSearch,_=a.update,fe=a.pointer,ue=a.clearPointer,K=a.blur,ae=a.deactivate,n=M([]),m=M([]),G=M(!1),N=O(()=>{if(Y.value){let l=m.value||[],s=[];return l.forEach(y=>{Se(y[A.value]).forEach(W=>{s.push(Object.assign({},W,y.disabled?{disabled:!0}:{}))})}),s}else{let l=Se(m.value||[]);return n.value.length&&(l=l.concat(n.value)),l}}),Oe=O(()=>Y.value?Fe((m.value||[]).map(l=>{const s=Se(l[A.value]);return{...l,group:!0,[A.value]:ye(s,!1).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{})),__VISIBLE__:ye(s).map(y=>Object.assign({},y,l.disabled?{disabled:!0}:{}))}})):[]),oe=O(()=>{let l=N.value;return be.value.length&&(l=be.value.concat(l)),l=ye(l),f.value>0&&(l=l.slice(0,f.value)),l}),ge=O(()=>{switch(o.value){case"single":return!H(S.value[d.value]);case"multiple":case"tags":return!H(S.value)&&S.value.length>0}}),Te=O(()=>b!==void 0&&b.value!==void 0?b.value(S.value):S.value&&S.value.length>1?`${S.value.length} options selected`:"1 option selected"),Ce=O(()=>!N.value.length&&!G.value&&!be.value.length),De=O(()=>N.value.length>0&&oe.value.length==0&&(T.value&&Y.value||!Y.value)),be=O(()=>t.value===!1||!T.value?[]:Ne(T.value)!==-1?[]:[{[d.value]:T.value,[c.value]:T.value,[v.value]:T.value}]),Ee=O(()=>{switch(o.value){case"single":return null;case"multiple":case"tags":return[]}}),Ve=O(()=>V.value||G.value),te=l=>{switch(typeof l!="object"&&(l=z(l)),o.value){case"single":_(l);break;case"multiple":case"tags":_(S.value.concat(l));break}u.emit("select",we(l),l)},ee=l=>{switch(typeof l!="object"&&(l=z(l)),o.value){case"single":Pe();break;case"tags":case"multiple":_(Array.isArray(l)?S.value.filter(s=>l.map(y=>y[d.value]).indexOf(s[d.value])===-1):S.value.filter(s=>s[d.value]!=l[d.value]));break}u.emit("deselect",we(l),l)},we=l=>B.value?l:l[d.value],Le=l=>{ee(l)},Re=(l,s)=>{if(s.button!==0){s.preventDefault();return}Le(l)},Pe=()=>{u.emit("clear"),_(Ee.value)},U=l=>{if(l.group!==void 0)return o.value==="single"?!1:Me(l[A.value])&&l[A.value].length;switch(o.value){case"single":return!H(S.value)&&S.value[d.value]==l[d.value];case"tags":case"multiple":return!H(S.value)&&S.value.map(s=>s[d.value]).indexOf(l[d.value])!==-1}},he=l=>l.disabled===!0,me=()=>L===void 0||L.value===-1||!ge.value&&L.value>0?!1:S.value.length>=L.value,Ge=l=>{if(!he(l)){switch(o.value){case"single":if(U(l)){R.value&&ee(l);return}K(),te(l);break;case"multiple":if(U(l)){ee(l);return}if(me())return;te(l),k.value&&$(),g.value&&ue(),Q.value&&K();break;case"tags":if(U(l)){ee(l);return}if(me())return;z(l[d.value])===void 0&&t.value&&(u.emit("tag",l[d.value]),p.value&&xe(l),$()),k.value&&$(),te(l),g.value&&ue(),Q.value&&K();break}Q.value&&ae()}},je=l=>{if(!(he(l)||o.value==="single"||!pe.value)){switch(o.value){case"multiple":case"tags":Ae(l[A.value])?ee(l[A.value]):te(l[A.value].filter(s=>S.value.map(y=>y[d.value]).indexOf(s[d.value])===-1).filter(s=>!s.disabled).filter((s,y)=>S.value.length+1+y<=L.value||L.value===-1));break}Q.value&&ae()}},Ae=l=>l.find(s=>!U(s)&&!s.disabled)===void 0,Me=l=>l.find(s=>!U(s))===void 0,z=l=>N.value[N.value.map(s=>String(s[d.value])).indexOf(String(l))],Ne=(l,s=!0)=>N.value.map(y=>y[v.value]).indexOf(l),He=l=>["tags","multiple"].indexOf(o.value)!==-1&&g.value&&U(l),xe=l=>{n.value.push(l)},Fe=l=>ve.value?l.filter(s=>T.value?s.__VISIBLE__.length:s[A.value].length):l.filter(s=>T.value?s.__VISIBLE__.length:!0),ye=(l,s=!0)=>{let y=l;return T.value&&j.value&&(y=y.filter(W=>Be(W[v.value],Z.value).indexOf(Be(T.value,Z.value))!==-1)),g.value&&s&&(y=y.filter(W=>!He(W))),y},Se=l=>{let s=l;return el(s)&&(s=Object.keys(s).map(y=>{let W=s[y];return{[d.value]:y,[v.value]:W,[c.value]:W}})),s=s.map(y=>typeof y=="object"?y:{[d.value]:y,[v.value]:y,[c.value]:y}),s},ie=()=>{H(F.value)||(S.value=ce(F.value))},ke=l=>{G.value=!0,i.value(T.value).then(s=>{m.value=s,typeof l=="function"&&l(s),G.value=!1})},ze=()=>{if(ge.value)if(o.value==="single"){let l=z(S.value[d.value])[c.value];S.value[c.value]=l,B.value&&(F.value[c.value]=l)}else S.value.forEach((l,s)=>{let y=z(S.value[s][d.value])[c.value];S.value[s][c.value]=y,B.value&&(F.value[s][c.value]=y)})},Ke=l=>{ke(l)},ce=l=>H(l)?o.value==="single"?{}:[]:B.value?l:o.value==="single"?z(l)||{}:l.filter(s=>!!z(s)).map(s=>z(s));if(o.value!=="single"&&!H(F.value)&&!Array.isArray(F.value))throw new Error(`v-model must be an array when using "${o.value}" mode`);return i&&typeof i.value=="function"?h.value?ke(ie):B.value==!0&&ie():(m.value=i.value,ie()),D.value>-1&&re(T,l=>{l.length{l==T.value&&i.value(T.value).then(s=>{l==T.value&&(m.value=s,fe.value=oe.value.filter(y=>y.disabled!==!0)[0]||null,G.value=!1)})},D.value))},{flush:"sync"}),re(F,l=>{if(H(l)){S.value=ce(l);return}switch(o.value){case"single":(B.value?l[d.value]!=S.value[d.value]:l!=S.value[d.value])&&(S.value=ce(l));break;case"multiple":case"tags":ll(B.value?l.map(s=>s[d.value]):l,S.value.map(s=>s[d.value]))||(S.value=ce(l));break}},{deep:!0}),typeof e.options!="function"&&re(i,(l,s)=>{m.value=e.options,Object.keys(S.value).length||ie(),ze()}),{fo:oe,filteredOptions:oe,hasSelected:ge,multipleLabelText:Te,eo:N,extendedOptions:N,fg:Oe,filteredGroups:Oe,noOptions:Ce,noResults:De,resolving:G,busy:Ve,select:te,deselect:ee,remove:Le,clear:Pe,isSelected:U,isDisabled:he,isMax:me,getOption:z,handleOptionClick:Ge,handleGroupClick:je,handleTagRemove:Re,refreshOptions:Ke,resolveOptions:ke}}function tl(e,u,a){const{valueProp:i,showOptions:o,searchable:v,groupLabel:f,groups:g,mode:t,groupSelect:c}=x(e),p=a.fo,b=a.fg,B=a.handleOptionClick,V=a.handleGroupClick,D=a.search,h=a.pointer,r=a.setPointer,j=a.clearPointer,X=a.multiselect,k=O(()=>p.value.filter(n=>!n.disabled)),d=O(()=>b.value.filter(n=>!n.disabled)),R=O(()=>t.value!=="single"&&c.value),L=O(()=>h.value&&h.value.group),Z=O(()=>K(h.value)),Q=O(()=>{const n=L.value?h.value:K(h.value),m=d.value.map(N=>N[f.value]).indexOf(n[f.value]);let G=d.value[m-1];return G===void 0&&(G=se.value),G}),Y=O(()=>{let n=d.value.map(m=>m.label).indexOf(L.value?h.value[f.value]:K(h.value)[f.value])+1;return d.value.length<=n&&(n=0),d.value[n]}),se=O(()=>[...d.value].slice(-1)[0]),A=O(()=>h.value.__VISIBLE__.filter(n=>!n.disabled)[0]),ve=O(()=>{const n=Z.value.__VISIBLE__.filter(m=>!m.disabled);return n[n.map(m=>m[i.value]).indexOf(h.value[i.value])-1]}),pe=O(()=>{const n=K(h.value).__VISIBLE__.filter(m=>!m.disabled);return n[n.map(m=>m[i.value]).indexOf(h.value[i.value])+1]}),S=O(()=>[...Q.value.__VISIBLE__.filter(n=>!n.disabled)].slice(-1)[0]),F=O(()=>[...se.value.__VISIBLE__.filter(n=>!n.disabled)].slice(-1)[0]),T=n=>{if(h.value)return n.group?h.value[f.value]==n[f.value]:h.value[i.value]==n[i.value]},$=()=>{r(k.value[0]||null)},_=()=>{!h.value||h.value.disabled===!0||(L.value?V(h.value):B(h.value))},fe=()=>{if(h.value===null)r((g.value&&R.value?d.value[0]:k.value[0])||null);else if(g.value&&R.value){let n=L.value?A.value:pe.value;n===void 0&&(n=Y.value),r(n||null)}else{let n=k.value.map(m=>m[i.value]).indexOf(h.value[i.value])+1;k.value.length<=n&&(n=0),r(k.value[n]||null)}Ie(()=>{ae()})},ue=()=>{if(h.value===null){let n=k.value[k.value.length-1];g.value&&R.value&&(n=F.value,n===void 0&&(n=se.value)),r(n||null)}else if(g.value&&R.value){let n=L.value?S.value:ve.value;n===void 0&&(n=L.value?Q.value:Z.value),r(n||null)}else{let n=k.value.map(m=>m[i.value]).indexOf(h.value[i.value])-1;n<0&&(n=k.value.length-1),r(k.value[n]||null)}Ie(()=>{ae()})},K=n=>d.value.find(m=>m.__VISIBLE__.map(G=>G[i.value]).indexOf(n[i.value])!==-1),ae=()=>{let n=X.value.querySelector("[data-pointed]");if(!n)return;let m=n.parentElement.parentElement;g.value&&(m=L.value?n.parentElement.parentElement.parentElement:n.parentElement.parentElement.parentElement.parentElement),n.offsetTop+n.offsetHeight>m.clientHeight+m.scrollTop&&(m.scrollTop=n.offsetTop+n.offsetHeight-m.clientHeight),n.offsetTop{v.value&&(n.length&&o.value?$():j())}),{pointer:h,canPointGroups:R,isPointed:T,setPointerFirst:$,selectPointer:_,forwardPointer:fe,backwardPointer:ue}}function nl(e,u,a){const{disabled:i}=x(e),o=M(!1);return{isOpen:o,open:()=>{o.value||i.value||(o.value=!0,u.emit("open"))},close:()=>{o.value&&(o.value=!1,u.emit("close"))}}}function rl(e,u,a){const{searchable:i,disabled:o}=x(e),v=a.input,f=a.open,g=a.close,t=a.clearSearch,c=M(null),p=M(!1),b=O(()=>i.value||o.value?-1:0),B=()=>{i.value&&v.value.blur(),c.value.blur()},V=()=>{i.value&&!o.value&&v.value.focus()},D=()=>{o.value||(p.value=!0,f())},h=()=>{p.value=!1,setTimeout(()=>{p.value||(g(),t())},1)};return{multiselect:c,tabindex:b,isActive:p,blur:B,handleFocus:V,activate:D,deactivate:h,handleCaretClick:()=>{p.value?(h(),B()):D()}}}function sl(e,u,a){const{mode:i,addTagOn:o,createTag:v,openDirection:f,searchable:g,showOptions:t,valueProp:c,groups:p}=x(e),b=a.iv,B=a.update,V=a.search,D=a.setPointer,h=a.selectPointer,r=a.backwardPointer,j=a.forwardPointer,X=a.blur,k=a.fo,d=()=>{i.value==="tags"&&!t.value&&v.value&&g.value&&!p.value&&D(k.value[k.value.map(L=>L[c.value]).indexOf(V.value)])};return{handleKeydown:L=>{switch(L.keyCode){case 8:if(i.value==="single"||g.value&&[null,""].indexOf(V.value)===-1||b.value.length===0)return;B([...b.value].slice(0,-1));break;case 13:if(L.preventDefault(),i.value==="tags"&&o.value.indexOf("enter")===-1&&v.value)return;d(),h();break;case 32:if(g.value&&i.value!=="tags"&&!v.value||i.value==="tags"&&(o.value.indexOf("space")===-1&&v.value||!v.value))return;L.preventDefault(),d(),h();break;case 9:case 186:case 188:if(i.value!=="tags")return;const Z={9:"tab",186:";",188:","};if(o.value.indexOf(Z[L.keyCode])===-1||!v.value)return;d(),h(),L.preventDefault();break;case 27:X();break;case 38:if(L.preventDefault(),!t.value)return;f.value==="top"?j():r();break;case 40:if(L.preventDefault(),!t.value)return;f.value==="top"?r():j();break}},preparePointer:d}}function ul(e,u,a){const i=x(e),{disabled:o,openDirection:v,showOptions:f,invalid:g}=i,t=a.isOpen,c=a.isPointed,p=a.isSelected,b=a.isDisabled,B=a.isActive,V=a.canPointGroups,D=a.resolving,h=a.fo,r={container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",containerInvalid:"is-invalid",containerInvalidActive:"is-invalid-active",singleLabel:"multiselect-single-label",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer",...i.classes.value},j=O(()=>!!(t.value&&f.value&&(!D.value||D.value&&h.value.length)));return{classList:O(()=>({container:[r.container].concat(o.value?r.containerDisabled:[]).concat(j.value&&v.value==="top"?r.containerOpenTop:[]).concat(j.value&&v.value!=="top"?r.containerOpen:[]).concat(B.value?r.containerActive:[]).concat(g.value?r.containerInvalid:[]),spacer:r.spacer,singleLabel:r.singleLabel,multipleLabel:r.multipleLabel,search:r.search,tags:r.tags,tag:[r.tag].concat(o.value?r.tagDisabled:[]),tagRemove:r.tagRemove,tagRemoveIcon:r.tagRemoveIcon,tagsSearchWrapper:r.tagsSearchWrapper,tagsSearch:r.tagsSearch,tagsSearchCopy:r.tagsSearchCopy,placeholder:r.placeholder,caret:[r.caret].concat(t.value?r.caretOpen:[]),clear:r.clear,clearIcon:r.clearIcon,spinner:r.spinner,dropdown:[r.dropdown].concat(v.value==="top"?r.dropdownTop:[]).concat(!t.value||!f.value||!j.value?r.dropdownHidden:[]),options:[r.options].concat(v.value==="top"?r.optionsTop:[]),group:r.group,groupLabel:k=>{let d=[r.groupLabel];return c(k)?d.push(p(k)?r.groupLabelSelectedPointed:r.groupLabelPointed):p(k)&&V.value?d.push(b(k)?r.groupLabelSelectedDisabled:r.groupLabelSelected):b(k)&&d.push(r.groupLabelDisabled),V.value&&d.push(r.groupLabelPointable),d},groupOptions:r.groupOptions,option:(k,d)=>{let R=[r.option];return c(k)?R.push(p(k)?r.optionSelectedPointed:r.optionPointed):p(k)?R.push(b(k)?r.optionSelectedDisabled:r.optionSelected):(b(k)||d&&b(d))&&R.push(r.optionDisabled),R},noOptions:r.noOptions,noResults:r.noResults,fakeInput:r.fakeInput})),showDropdown:j}}const ol={name:"BaseMultiselect",props:{preserveSearch:{type:Boolean,default:!1},initialSearch:{type:String,default:null},contentLoading:{type:Boolean,default:!1},value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!1},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},invalid:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({container:"p-0 relative mx-auto w-full flex items-center justify-end box-border cursor-pointer border border-gray-200 rounded-md bg-white text-sm leading-snug outline-none max-h-10",containerDisabled:"cursor-default bg-gray-200 bg-opacity-50 !text-gray-400",containerOpen:"",containerOpenTop:"",containerActive:"ring-1 ring-primary-400 border-primary-400",containerInvalid:"border-red-400 ring-red-400 focus:ring-red-400 focus:border-red-400",containerInvalidActive:"ring-1 border-red-400 ring-red-400",singleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",multipleLabel:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5",search:"w-full absolute inset-0 outline-none appearance-none box-border border-0 text-sm font-sans bg-white rounded-md pl-3.5",tags:"grow shrink flex flex-wrap mt-1 pl-2",tag:"bg-primary-500 text-white text-sm font-semibold py-0.5 pl-2 rounded mr-1 mb-1 flex items-center whitespace-nowrap",tagDisabled:"pr-2 !bg-gray-400 text-white",tagRemove:"flex items-center justify-center p-1 mx-0.5 rounded-sm hover:bg-black hover:bg-opacity-10 group",tagRemoveIcon:"bg-multiselect-remove text-white bg-center bg-no-repeat opacity-30 inline-block w-3 h-3 group-hover:opacity-60",tagsSearchWrapper:"inline-block relative mx-1 mb-1 grow shrink h-full",tagsSearch:"absolute inset-0 border-0 focus:outline-none !shadow-none !focus:shadow-none appearance-none p-0 text-sm font-sans box-border w-full",tagsSearchCopy:"invisible whitespace-pre-wrap inline-block h-px",placeholder:"flex items-center h-full absolute left-0 top-0 pointer-events-none bg-transparent leading-snug pl-3.5 text-gray-400 text-sm",caret:"bg-multiselect-caret bg-center bg-no-repeat w-5 h-5 py-px box-content z-5 relative mr-1 opacity-40 shrink-0 grow-0 transition-transform",caretOpen:"rotate-180 pointer-events-auto",clear:"pr-3.5 relative z-10 opacity-40 transition duration-300 shrink-0 grow-0 flex hover:opacity-80",clearIcon:"bg-multiselect-remove bg-center bg-no-repeat w-2.5 h-4 py-px box-content inline-block",spinner:"bg-multiselect-spinner bg-center bg-no-repeat w-4 h-4 z-10 mr-3.5 animate-spin shrink-0 grow-0",dropdown:"max-h-60 shadow-lg absolute -left-px -right-px -bottom-1 translate-y-full border border-gray-300 mt-1 overflow-y-auto z-50 bg-white flex flex-col rounded-md",dropdownTop:"-translate-y-full -top-2 bottom-auto flex-col-reverse rounded-md",dropdownHidden:"hidden",options:"flex flex-col p-0 m-0 list-none",optionsTop:"flex-col-reverse",group:"p-0 m-0",groupLabel:"flex text-sm box-border items-center justify-start text-left py-1 px-3 font-semibold bg-gray-200 cursor-default leading-normal",groupLabelPointable:"cursor-pointer",groupLabelPointed:"bg-gray-300 text-gray-700",groupLabelSelected:"bg-primary-600 text-white",groupLabelDisabled:"bg-gray-100 text-gray-300 cursor-not-allowed",groupLabelSelectedPointed:"bg-primary-600 text-white opacity-90",groupLabelSelectedDisabled:"text-primary-100 bg-primary-600 bg-opacity-50 cursor-not-allowed",groupOptions:"p-0 m-0",option:"flex items-center justify-start box-border text-left cursor-pointer text-sm leading-snug py-2 px-3",optionPointed:"text-gray-800 bg-gray-100",optionSelected:"text-white bg-primary-500",optionDisabled:"text-gray-300 cursor-not-allowed",optionSelectedPointed:"text-white bg-primary-500 opacity-90",optionSelectedDisabled:"text-primary-100 bg-primary-500 bg-opacity-50 cursor-not-allowed",noOptions:"py-2 px-3 text-gray-600 bg-white",noResults:"py-2 px-3 text-gray-600 bg-white",fakeInput:"bg-transparent absolute left-0 right-0 -bottom-px w-full h-px border-0 p-0 appearance-none outline-none text-transparent",spacer:"h-9 py-px box-content"})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"}},emits:["open","close","select","deselect","input","search-change","tag","update:modelValue","change","clear"],setup(e,u){const a=Ye(e,u),i=_e(e),o=nl(e,u),v=$e(e,u),f=Xe(e,u,{iv:a.iv}),g=rl(e,u,{input:v.input,open:o.open,close:o.close,clearSearch:v.clearSearch}),t=al(e,u,{ev:a.ev,iv:a.iv,search:v.search,clearSearch:v.clearSearch,update:f.update,pointer:i.pointer,clearPointer:i.clearPointer,blur:g.blur,deactivate:g.deactivate}),c=tl(e,u,{fo:t.fo,fg:t.fg,handleOptionClick:t.handleOptionClick,handleGroupClick:t.handleGroupClick,search:v.search,pointer:i.pointer,setPointer:i.setPointer,clearPointer:i.clearPointer,multiselect:g.multiselect}),p=sl(e,u,{iv:a.iv,update:f.update,search:v.search,setPointer:i.setPointer,selectPointer:c.selectPointer,backwardPointer:c.backwardPointer,forwardPointer:c.forwardPointer,blur:g.blur,fo:t.fo}),b=ul(e,u,{isOpen:o.isOpen,isPointed:c.isPointed,canPointGroups:c.canPointGroups,isSelected:t.isSelected,isDisabled:t.isDisabled,isActive:g.isActive,resolving:t.resolving,fo:t.fo});return{...a,...o,...g,...i,...f,...v,...t,...c,...p,...b}}},il=["id","tabindex"],cl=["type","modelValue","value","autocomplete"],dl=["onMousedown"],vl=["type","modelValue","value","autocomplete"],pl={class:"w-full overflow-y-auto"},fl=["data-pointed","onMouseenter","onClick"],gl=["data-pointed","onMouseenter","onClick"],bl=["data-pointed","onMouseenter","onClick"],hl=["innerHTML"],ml=["innerHTML"],yl=["value"],Sl=["name","value"],kl=["name","value"];function Ol(e,u,a,i,o,v){const f=qe("BaseContentPlaceholdersBox"),g=qe("BaseContentPlaceholders");return a.contentLoading?(I(),Je(g,{key:0},{default:Ze(()=>[Qe(f,{rounded:!0,class:"w-full",style:{height:"40px"}})]),_:1})):(I(),q("div",{key:1,id:a.id,ref:"multiselect",tabindex:e.tabindex,class:w(e.classList.container),onFocusin:u[6]||(u[6]=(...t)=>e.activate&&e.activate(...t)),onFocusout:u[7]||(u[7]=(...t)=>e.deactivate&&e.deactivate(...t)),onKeydown:u[8]||(u[8]=(...t)=>e.handleKeydown&&e.handleKeydown(...t)),onFocus:u[9]||(u[9]=(...t)=>e.handleFocus&&e.handleFocus(...t))},[a.mode!=="tags"&&a.searchable&&!a.disabled?(I(),q("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:w(e.classList.search),autocomplete:a.autocomplete,onInput:u[0]||(u[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[1]||(u[1]=de((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,cl)):E("",!0),a.mode=="tags"?(I(),q("div",{key:1,class:w(e.classList.tags)},[(I(!0),q(le,null,ne(e.iv,(t,c,p)=>C(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},()=>[(I(),q("span",{key:p,class:w(e.classList.tag)},[Ue(J(t[a.label])+" ",1),a.disabled?E("",!0):(I(),q("span",{key:0,class:w(e.classList.tagRemove),onMousedown:de(b=>e.handleTagRemove(t,b),["stop"])},[P("span",{class:w(e.classList.tagRemoveIcon)},null,2)],42,dl))],2))])),256)),P("div",{class:w(e.classList.tagsSearchWrapper)},[P("span",{class:w(e.classList.tagsSearchCopy)},J(e.search),3),a.searchable&&!a.disabled?(I(),q("input",{key:0,ref:"input",type:a.inputType,modelValue:e.search,value:e.search,class:w(e.classList.tagsSearch),autocomplete:a.autocomplete,style:{"box-shadow":"none !important"},onInput:u[2]||(u[2]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[3]||(u[3]=de((...t)=>e.handlePaste&&e.handlePaste(...t),["stop"]))},null,42,vl)):E("",!0)],2)],2)):E("",!0),a.mode=="single"&&e.hasSelected&&!e.search&&e.iv?C(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[P("div",{class:w(e.classList.singleLabel)},J(e.iv[a.label]),3)]):E("",!0),a.mode=="multiple"&&e.hasSelected&&!e.search?C(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[P("div",{class:w(e.classList.multipleLabel)},J(e.multipleLabelText),3)]):E("",!0),a.placeholder&&!e.hasSelected&&!e.search?C(e.$slots,"placeholder",{key:4},()=>[P("div",{class:w(e.classList.placeholder)},J(a.placeholder),3)]):E("",!0),e.busy?C(e.$slots,"spinner",{key:5},()=>[P("span",{class:w(e.classList.spinner)},null,2)]):E("",!0),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?C(e.$slots,"clear",{key:6,clear:e.clear},()=>[P("span",{class:w(e.classList.clear),onMousedown:u[4]||(u[4]=(...t)=>e.clear&&e.clear(...t))},[P("span",{class:w(e.classList.clearIcon)},null,2)],34)]):E("",!0),a.caret?C(e.$slots,"caret",{key:7},()=>[P("span",{class:w(e.classList.caret),onMousedown:u[5]||(u[5]=de((...t)=>e.handleCaretClick&&e.handleCaretClick(...t),["prevent","stop"]))},null,34)]):E("",!0),P("div",{class:w(e.classList.dropdown),tabindex:"-1"},[P("div",pl,[C(e.$slots,"beforelist",{options:e.fo}),P("ul",{class:w(e.classList.options)},[a.groups?(I(!0),q(le,{key:0},ne(e.fg,(t,c,p)=>(I(),q("li",{key:p,class:w(e.classList.group)},[P("div",{class:w(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleGroupClick(t)},[C(e.$slots,"grouplabel",{group:t},()=>[P("span",null,J(t[a.groupLabel]),1)])],42,fl),P("ul",{class:w(e.classList.groupOptions)},[(I(!0),q(le,null,ne(t.__VISIBLE__,(b,B,V)=>(I(),q("li",{key:V,class:w(e.classList.option(b,t)),"data-pointed":e.isPointed(b),onMouseenter:D=>e.setPointer(b),onClick:D=>e.handleOptionClick(b)},[C(e.$slots,"option",{option:b,search:e.search},()=>[P("span",null,J(b[a.label]),1)])],42,gl))),128))],2)],2))),128)):(I(!0),q(le,{key:1},ne(e.fo,(t,c,p)=>(I(),q("li",{key:p,class:w(e.classList.option(t)),"data-pointed":e.isPointed(t),onMouseenter:b=>e.setPointer(t),onClick:b=>e.handleOptionClick(t)},[C(e.$slots,"option",{option:t,search:e.search},()=>[P("span",null,J(t[a.label]),1)])],42,bl))),128))],2),e.noOptions?C(e.$slots,"nooptions",{key:0},()=>[P("div",{class:w(e.classList.noOptions),innerHTML:a.noOptionsText},null,10,hl)]):E("",!0),e.noResults?C(e.$slots,"noresults",{key:1},()=>[P("div",{class:w(e.classList.noResults),innerHTML:a.noResultsText},null,10,ml)]):E("",!0),C(e.$slots,"afterlist",{options:e.fo})]),C(e.$slots,"action")],2),a.required?(I(),q("input",{key:8,class:w(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,yl)):E("",!0),a.nativeSupport?(I(),q(le,{key:9},[a.mode=="single"?(I(),q("input",{key:0,type:"hidden",name:a.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,Sl)):(I(!0),q(le,{key:1},ne(e.plainValue,(t,c)=>(I(),q("input",{key:c,type:"hidden",name:`${a.name}[]`,value:t},null,8,kl))),128))],64)):E("",!0),P("div",{class:w(e.classList.spacer)},null,2)],42,il))}const Ll=We(ol,[["render",Ol]]);export{Ll as default}; diff --git a/public/build/assets/BaseTable-ePsFhhtw.js b/public/build/assets/BaseTable-ePsFhhtw.js deleted file mode 100644 index a462f24c..00000000 --- a/public/build/assets/BaseTable-ePsFhhtw.js +++ /dev/null @@ -1 +0,0 @@ -import{ab as G,Z as J,r as T,o as i,c as s,b as u,J as h,p as P,t as c,K as f,a as w,N as k,O as C,H as N,f as F,k as L,z as K,Y as Z,a2 as A,l as p,w as Q,S as U,m as X,P as $}from"./main-WMXHPsTs.js";function V(a,t){if(!t||a===null||typeof a!="object")return a;const[e,n]=t.split(/\.(.+)/);return V(a[e],n)}function ee(a,t){return t.reduce((e,n)=>(e[n]=a[n],e),{})}class te{constructor(t,e){this.data=t,this.columns=e}getValue(t){return V(this.data,t)}getColumn(t){return this.columns.find(e=>e.key===t)}getSortableValue(t){const e=this.getColumn(t).dataType;let n=this.getValue(t);if(n==null)return"";if(n instanceof String&&(n=n.toLowerCase()),e.startsWith("date")){const b=e.replace("date:","");return G(n,b).format("YYYYMMDDHHmmss")}return e==="numeric"?n:n.toString()}}class ae{constructor(t){const e=ee(t,["key","label","thClass","tdClass","sortBy","sortable","hidden","dataType"]);for(const n in e)this[n]=t[n];e.dataType||(this.dataType="string"),e.sortable===void 0&&(this.sortable=!0)}getFilterFieldName(){return this.filterOn||this.key}isSortable(){return this.sortable}getSortPredicate(t,e){const n=this.getSortFieldName(),l=e.find(g=>g.key===n).dataType;return l.startsWith("date")||l==="numeric"?(g,d)=>{const m=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x{const m=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x.localeCompare(m):m.localeCompare(x)}}getSortFieldName(){return this.sortBy||this.key}}const ne={props:{pagination:{type:Object,default:()=>({})}},computed:{pages(){return this.pagination.totalPages===void 0?[]:this.pageLinks()},hasFirst(){return this.pagination.currentPage>=4||this.pagination.totalPages<10},hasLast(){return this.pagination.currentPage<=this.pagination.totalPages-3||this.pagination.totalPages<10},hasFirstEllipsis(){return this.pagination.currentPage>=4&&this.pagination.totalPages>=10},hasLastEllipsis(){return this.pagination.currentPage<=this.pagination.totalPages-3&&this.pagination.totalPages>=10},shouldShowPagination(){return this.pagination.totalPages===void 0||this.pagination.count===0?!1:this.pagination.totalPages>1}},methods:{isActive(a){return(this.pagination.currentPage||1)===a},pageClicked(a){a==="..."||a===this.pagination.currentPage||a>this.pagination.totalPages||a<1||this.$emit("pageChange",a)},pageLinks(){const a=[];let t=2,e=this.pagination.totalPages-1;this.pagination.totalPages>=10&&(t=Math.max(1,this.pagination.currentPage-2),e=Math.min(this.pagination.currentPage+2,this.pagination.totalPages));for(let n=t;n<=e;n++)a.push(n);return a}}},re={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 sm:px-6"},ie={class:"flex justify-between flex-1 sm:hidden"},se={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},le={class:"text-sm text-gray-700"},oe={key:0,class:"font-medium"},de={key:1,class:"font-medium"},ge={key:0},ue={key:1},ce={key:2,class:"font-medium"},he={class:"relative z-0 inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},ye=u("span",{class:"sr-only"},"Previous",-1),fe={key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},me=["onClick"],pe={key:2,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},be=u("span",{class:"sr-only"},"Next",-1);function xe(a,t,e,n,b,l){const g=T("BaseIcon");return l.shouldShowPagination?(i(),s("div",re,[u("div",ie,[u("a",{href:"#",class:h([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[0]||(t[0]=d=>l.pageClicked(e.pagination.currentPage-1))}," Previous ",2),u("a",{href:"#",class:h([{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages},"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[1]||(t[1]=d=>l.pageClicked(e.pagination.currentPage+1))}," Next ",2)]),u("div",se,[u("div",null,[u("p",le,[P(" Showing "+c(" ")+" "),e.pagination.limit&&e.pagination.currentPage?(i(),s("span",oe,c(e.pagination.currentPage*e.pagination.limit-(e.pagination.limit-1)),1)):f("",!0),P(" "+c(" ")+" to "+c(" ")+" "),e.pagination.limit&&e.pagination.currentPage?(i(),s("span",de,[e.pagination.currentPage*e.pagination.limit<=e.pagination.totalCount?(i(),s("span",ge,c(e.pagination.currentPage*e.pagination.limit),1)):(i(),s("span",ue,c(e.pagination.totalCount),1))])):f("",!0),P(" "+c(" ")+" of "+c(" ")+" "),e.pagination.totalCount?(i(),s("span",ce,c(e.pagination.totalCount),1)):f("",!0),P(" "+c(" ")+" results ")])]),u("div",null,[u("nav",he,[u("a",{href:"#",class:h([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"]),onClick:t[2]||(t[2]=d=>l.pageClicked(e.pagination.currentPage-1))},[ye,w(g,{name:"ChevronLeftIcon"})],2),l.hasFirst?(i(),s("a",{key:0,href:"#","aria-current":"page",class:h([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(1),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(1)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[3]||(t[3]=d=>l.pageClicked(1))}," 1 ",2)):f("",!0),l.hasFirstEllipsis?(i(),s("span",fe," ... ")):f("",!0),(i(!0),s(k,null,C(l.pages,d=>(i(),s("a",{key:d,href:"#",class:h([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(d),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(d),disabled:d==="..."},"relative items-center hidden px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 md:inline-flex"]),onClick:m=>l.pageClicked(d)},c(d),11,me))),128)),l.hasLastEllipsis?(i(),s("span",pe," ... ")):f("",!0),l.hasLast?(i(),s("a",{key:3,href:"#","aria-current":"page",class:h([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(e.pagination.totalPages),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(e.pagination.totalPages)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[4]||(t[4]=d=>l.pageClicked(e.pagination.totalPages))},c(e.pagination.totalPages),3)):f("",!0),u("a",{href:"#",class:h(["relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50",{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages}]),onClick:t[5]||(t[5]=d=>l.pageClicked(e.pagination.currentPage+1))},[be,w(g,{name:"ChevronRightIcon"})],2)])])])])):f("",!0)}const ve=J(ne,[["render",xe]]),ke={class:"flex flex-col"},Ce={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 pb-4 lg:pb-0"},Pe={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},we={class:"relative overflow-hidden bg-white border-b border-gray-200 shadow sm:rounded-lg"},_e=["onClick"],Se={key:0,class:"asc-direction"},Te={key:1,class:"desc-direction"},Ne={key:0},Be={key:1},Fe={key:0,class:"absolute top-0 left-0 z-10 flex items-center justify-center w-full h-full bg-white bg-opacity-60"},Le={key:1,class:"text-center text-gray-500 pb-2 flex h-[160px] justify-center items-center flex-col"},Ae={class:"block mt-1"},Ie={__name:"BaseTable",props:{columns:{type:Array,required:!0},data:{type:[Array,Function],required:!0},sortBy:{type:String,default:""},sortOrder:{type:String,default:""},tableClass:{type:String,default:"min-w-full divide-y divide-gray-200"},theadClass:{type:String,default:"bg-gray-50"},tbodyClass:{type:String,default:""},noResultsMessage:{type:String,default:"No Results Found"},loading:{type:Boolean,default:!1},loadingType:{type:String,default:"placeholder",validator:function(a){return["placeholder","spinner"].indexOf(a)!==-1}},placeholderCount:{type:Number,default:3}},setup(a,{expose:t}){const e=a;let n=N([]),b=F(!1),l=N(e.columns.map(r=>new ae(r))),g=N({fieldName:"",order:""}),d=F("");const m=L(()=>Array.isArray(e.data)),x=L(()=>{if(!m.value||g.fieldName===""||l.length===0)return n.value;const r=I(g.fieldName);return r?[...n.value].sort(r.getSortPredicate(g.order,l)):n.value});function I(r){return l.find(o=>o.key===r)}function z(r){let o="whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";return r.defaultThClass&&(o=r.defaultThClass),r.sortable?o=`${o} cursor-pointer`:o=`${o} pointer-events-none`,r.thClass&&(o=`${o} ${r.thClass}`),o}function B(r){let o="px-6 py-4 text-sm text-gray-500 whitespace-nowrap";return r.defaultTdClass&&(o=r.defaultTdClass),r.tdClass&&(o=`${o} ${r.tdClass}`),o}function D(r){let o="w-full";return r.placeholderClass&&(o=`${o} ${r.placeholderClass}`),o}function E(){return d.value=null,e.data}async function M(){const r=d.value&&d.value.currentPage||1;b.value=!0;const o=await e.data({sort:g,page:r});return b.value=!1,d.value=o.pagination,o.data}function R(r){g.fieldName!==r.key?(g.fieldName=r.key,g.order="asc"):g.order=g.order==="asc"?"desc":"asc",m.value||_()}async function _(){const r=m.value?E():await M();n.value=r.map(o=>new te(o,l))}async function Y(r){d.value.currentPage=r,await _()}async function H(){await _()}function q(r,o){return $.get(r,o)}return m.value&&K(()=>e.data,()=>{_()}),Z(async()=>{await _()}),t({refresh:H}),(r,o)=>{const O=T("base-content-placeholders-text"),W=T("base-content-placeholders"),j=T("BaseIcon");return i(),s("div",ke,[u("div",Ce,[u("div",Pe,[u("div",we,[A(r.$slots,"header"),u("table",{class:h(a.tableClass)},[u("thead",{class:h(a.theadClass)},[u("tr",null,[(i(!0),s(k,null,C(p(l),y=>(i(),s("th",{key:y.key,class:h([z(y),{"text-bold text-black":p(g).fieldName===y.key}]),onClick:v=>R(y)},[P(c(y.label)+" ",1),p(g).fieldName===y.key&&p(g).order==="asc"?(i(),s("span",Se," ↑ ")):f("",!0),p(g).fieldName===y.key&&p(g).order==="desc"?(i(),s("span",Te," ↓ ")):f("",!0)],10,_e))),128))])],2),a.loadingType==="placeholder"&&(a.loading||p(b))?(i(),s("tbody",Ne,[(i(!0),s(k,null,C(a.placeholderCount,y=>(i(),s("tr",{key:y,class:h(y%2===0?"bg-white":"bg-gray-50")},[(i(!0),s(k,null,C(a.columns,v=>(i(),s("td",{key:v.key,class:h(["",B(v)])},[w(W,{class:h(D(v)),rounded:!0},{default:Q(()=>[w(O,{class:"w-full h-6",lines:1})]),_:2},1032,["class"])],2))),128))],2))),128))])):(i(),s("tbody",Be,[(i(!0),s(k,null,C(x.value,(y,v)=>(i(),s("tr",{key:v,class:h(v%2===0?"bg-white":"bg-gray-50")},[(i(!0),s(k,null,C(a.columns,S=>(i(),s("td",{key:S.key,class:h(["",B(S)])},[A(r.$slots,"cell-"+S.key,{row:y},()=>[P(c(q(y.data,S.key)),1)])],2))),128))],2))),128))]))],2),a.loadingType==="spinner"&&(a.loading||p(b))?(i(),s("div",Fe,[w(U,{class:"w-10 h-10 text-primary-500"})])):!a.loading&&!p(b)&&x.value&&x.value.length===0?(i(),s("div",Le,[w(j,{name:"ExclamationCircleIcon",class:"w-6 h-6 text-gray-400"}),u("span",Ae,c(a.noResultsMessage),1)])):f("",!0),p(d)?(i(),X(ve,{key:2,pagination:p(d),onPageChange:Y},null,8,["pagination"])):f("",!0)])])])])}}};export{Ie as default}; diff --git a/public/build/assets/CapsuleIcon-0VdBgza4.js b/public/build/assets/CapsuleIcon-0VdBgza4.js deleted file mode 100644 index ed6a372e..00000000 --- a/public/build/assets/CapsuleIcon-0VdBgza4.js +++ /dev/null @@ -1 +0,0 @@ -import{o as d,c as i,b as l,J as C}from"./main-WMXHPsTs.js";const o={width:"118",height:"110",viewBox:"0 0 118 110",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r={"clip-path":"url(#clip0)"},n=l("defs",null,[l("clipPath",{id:"clip0"},[l("rect",{width:"117.333",height:"110",fill:"white"})])],-1),s={__name:"CapsuleIcon",props:{primaryFillColor:{type:String,default:"fill-primary-500"},secondaryFillColor:{type:String,default:"fill-gray-600"}},setup(e){return(a,c)=>(d(),i("svg",o,[l("g",r,[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6672 32.9999C42.1415 32.9999 32.973 28.5119 32.5898 28.3194L33.4093 26.6804C33.4992 26.7244 42.6127 31.1666 58.6672 31.1666C74.542 31.1666 83.8388 26.7208 83.9323 26.6768L84.7354 28.3231C84.3449 28.5156 74.9618 32.9999 58.6672 32.9999Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M25.2438 39.0117L28.4191 40.8451C28.839 41.0871 29.1415 41.4831 29.2698 41.9597C29.3963 42.4346 29.3321 42.9296 29.0901 43.3494L14.4235 68.7521C14.099 69.3167 13.4866 69.6669 12.8248 69.6669C12.504 69.6669 12.1978 69.5844 11.9191 69.4231L8.74382 67.5897L7.82715 69.1774L11.0025 71.0107C11.5763 71.3426 12.2051 71.5002 12.8248 71.5002C14.0953 71.5002 15.3346 70.8421 16.0111 69.6687L30.6778 44.2661C31.6861 42.5189 31.083 40.2657 29.3358 39.2574L26.1605 37.4241L25.2438 39.0117Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M91.1729 37.4241L87.9976 39.2574C86.2504 40.2657 85.6472 42.5189 86.6556 44.2661L101.322 69.6687C101.999 70.8421 103.238 71.5002 104.509 71.5002C105.128 71.5002 105.757 71.3426 106.331 71.0107L109.506 69.1774L108.59 67.5897L105.414 69.4231C105.139 69.5826 104.826 69.6669 104.509 69.6669C103.847 69.6669 103.234 69.3167 102.91 68.7521L88.2432 43.3494C88.0012 42.9296 87.9371 42.4346 88.0636 41.9597C88.1919 41.4831 88.4944 41.0871 88.9142 40.8451L92.0896 39.0117L91.1729 37.4241Z",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M115.5 84.3333V87.6993C115.5 89.2797 114.424 90.6308 112.88 90.9883C112.013 91.19 111.049 91.4393 109.96 91.7198C102.573 93.6228 88.8268 97.1667 58.6667 97.1667C28.292 97.1667 14.6942 93.6338 7.38833 91.7345C6.29383 91.4503 5.324 91.1992 4.44767 90.9938C2.90767 90.6363 1.83333 89.2833 1.83333 87.7067V84.3333L0 82.5V87.7067C0 90.134 1.66833 92.2295 4.0315 92.7795C10.9322 94.3873 23.6812 99 58.6667 99C93.3478 99 106.372 94.3818 113.296 92.7758C115.661 92.2258 117.333 90.1285 117.333 87.6993V82.5",class:C(e.primaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M79.6139 20.1666L115.245 81.7354C115.841 82.7566 115.344 84.0656 114.214 84.4102C107.345 86.4966 89.3159 89.8333 58.6662 89.8333C27.9744 89.8333 9.97652 86.3371 3.12535 84.2526C1.99602 83.9079 1.49919 82.5989 2.09502 81.5778L37.7204 20.1666L36.6662 18.3333L0.503686 80.6666C-0.686148 82.7071 0.322186 85.3251 2.58085 86.0163C9.60985 88.1704 27.7104 91.6666 58.6662 91.6666C89.4625 91.6666 107.664 88.3189 114.742 86.1666C117.008 85.4772 118.022 82.8574 116.829 80.8133L80.6662 18.3333",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M110.814 92.4116L115.245 100.069C115.841 101.089 115.344 102.4 114.214 102.742C107.345 104.831 89.3159 108.167 58.6662 108.167C27.9744 108.167 9.97469 104.671 3.12535 102.585C1.99602 102.242 1.49919 100.931 2.09502 99.9117L6.41985 92.4556L4.75885 91.6672L0.503686 99.0006C-0.686148 101.041 0.322185 103.657 2.58085 104.35C9.60985 106.504 27.7104 110.001 58.6662 110.001C89.4625 110.001 107.664 106.653 114.742 104.501C117.007 103.811 118.022 101.191 116.829 99.1472L112.682 91.9789L110.814 92.4116Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.667 0C47.238 0 36.667 7.1335 36.667 18.3407V20.1667C36.667 20.1667 42.6052 23.8333 58.667 23.8333C74.6665 23.8333 80.667 20.1667 80.667 20.1667V18.3333C80.667 7.24167 70.767 0 58.667 0ZM58.667 1.83333C70.3527 1.83333 78.8337 8.7725 78.8337 18.3333V19.0172C76.6887 19.9302 70.5103 22 58.667 22C46.7705 22 40.6197 19.9283 38.5003 19.0227V18.3407C38.5003 12.3658 41.7692 8.55617 44.51 6.41117C48.2317 3.50167 53.3907 1.83333 58.667 1.83333Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M69.6667 53.1666C70.6768 53.1666 71.5 53.9898 71.5 54.9999V89.8333H73.3333V54.9999C73.3333 52.9741 71.6925 51.3333 69.6667 51.3333H47.6667C45.6408 51.3333 44 52.9741 44 54.9999V89.8333H45.8333V54.9999C45.8333 53.9898 46.6565 53.1666 47.6667 53.1666H69.6667Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M58.6667 56.8333C53.6048 56.8333 49.5 60.9381 49.5 65.9999C49.5 71.0618 53.6048 75.1666 58.6667 75.1666C63.7285 75.1666 67.8333 71.0618 67.8333 65.9999C67.8333 60.9381 63.7285 56.8333 58.6667 56.8333ZM58.6667 58.6666C62.711 58.6666 66 61.9556 66 65.9999C66 70.0443 62.711 73.3333 58.6667 73.3333C54.6223 73.3333 51.3333 70.0443 51.3333 65.9999C51.3333 61.9556 54.6223 58.6666 58.6667 58.6666Z",class:C(e.secondaryFillColor)},null,2),l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M63.2503 66C62.7443 66 62.3337 65.5893 62.3337 65.0833C62.3337 63.5672 61.0998 62.3333 59.5837 62.3333C59.0777 62.3333 58.667 61.9227 58.667 61.4167C58.667 60.9107 59.0777 60.5 59.5837 60.5C62.11 60.5 64.167 62.5552 64.167 65.0833C64.167 65.5893 63.7563 66 63.2503 66Z",class:C(e.primaryFillColor)},null,2)]),n]))}};export{s as _}; diff --git a/public/build/assets/CategoryModal-a6hq1Rp5.js b/public/build/assets/CategoryModal-a6hq1Rp5.js deleted file mode 100644 index 8c2cc48d..00000000 --- a/public/build/assets/CategoryModal-a6hq1Rp5.js +++ /dev/null @@ -1 +0,0 @@ -import{F as k,v as q,f as N,k as g,g as y,h as j,I as D,ai as G,j as L,r as i,o as B,m as b,w as r,b as m,p as v,t as C,l as e,a as n,q as T,J as z,K as E}from"./main-WMXHPsTs.js";import{u as U}from"./category-6thwPNPZ.js";const A={class:"flex justify-between w-full"},F={class:"p-8 sm:p-6"},J={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},O={__name:"CategoryModal",setup(K){const t=U(),u=k(),{t:p}=q.useI18n();let c=N(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),j),minLength:y.withMessage(p("validation.name_min_length",{count:3}),D(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),G(255))}}})),a=L(h,g(()=>t)),I=g(()=>u.active&&u.componentName==="CategoryModal");async function w(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const f=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),M=i("BaseTextarea"),V=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:I.value,onClose:d},{header:r(()=>[m("div",A,[v(C(e(u).title)+" ",1),n(f,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:T(w,["prevent"])},[m("div",F,[n(V,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(M,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",J,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[v(C(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?E("",!0):(B(),b(f,{key:0,name:"SaveIcon",class:z(l.class)},null,8,["class"]))]),default:r(()=>[v(" "+C(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],32)]),_:1},8,["show"])}}};export{O as _}; diff --git a/public/build/assets/CompanyInfoSettings-Q6oBSqVG.js b/public/build/assets/CompanyInfoSettings-Q6oBSqVG.js deleted file mode 100644 index 55196480..00000000 --- a/public/build/assets/CompanyInfoSettings-Q6oBSqVG.js +++ /dev/null @@ -1 +0,0 @@ -import{E as R,F as T,G as A,e as ee,v as E,f as V,H as J,k as q,g as w,h as x,a0 as ae,j as H,r,o as I,m as F,w as l,b as i,t as g,l as o,q as K,a as t,p as k,J as O,K as G,a5 as te,c as L,n as oe,N as ne,I as se}from"./main-WMXHPsTs.js";const le={class:"flex justify-between w-full"},de={class:"px-6 pt-6"},re={class:"font-medium text-lg text-left"},ie={class:"mt-2 text-sm leading-snug text-gray-500",style:{"max-width":"680px"}},ue={class:"p-4 sm:p-6 space-y-4"},me={class:"z-0 flex justify-end p-4 bg-gray-50 border-modal-bg"},pe={__name:"DeleteCompanyModal",setup(P){const p=R(),v=T(),h=A(),$=ee(),{t:S}=E.useI18n();let u=V(!1);const e=J({id:p.selectedCompany.id,name:null}),b=q(()=>v.active&&v.componentName==="DeleteCompanyModal"),f={formData:{name:{required:w.withMessage(S("validation.required"),x),sameAsName:w.withMessage(S("validation.company_name_not_same"),ae(p.selectedCompany.name))}}},c=H(f,{formData:e},{$scope:!1});async function B(){if(c.value.$touch(),c.value.$invalid)return!0;const y=p.companies[0];u.value=!0;try{const _=await p.deleteCompany(e);console.log(_.data.success),_.data.success&&(m(),await p.setSelectedCompany(y),$.push("/admin/dashboard"),await h.setIsAppLoaded(!1),await h.bootstrap()),u.value=!1}catch{u.value=!1}}function M(){e.id=null,e.name="",c.value.$reset()}function m(){v.closeModal(),setTimeout(()=>{M(),c.value.$reset()},300)}return(y,_)=>{const N=r("BaseInput"),U=r("BaseInputGroup"),s=r("BaseButton"),a=r("BaseIcon"),D=r("BaseModal");return I(),F(D,{show:b.value,onClose:m},{default:l(()=>[i("div",le,[i("div",de,[i("h6",re,g(o(v).title),1),i("p",ie,g(y.$t("settings.company_info.delete_company_modal_desc",{company:o(p).selectedCompany.name})),1)])]),i("form",{action:"",onSubmit:K(B,["prevent"])},[i("div",ue,[t(U,{label:y.$t("settings.company_info.delete_company_modal_label",{company:o(p).selectedCompany.name}),error:o(c).formData.name.$error&&o(c).formData.name.$errors[0].$message,required:""},{default:l(()=>[t(N,{modelValue:e.name,"onUpdate:modelValue":_[0]||(_[0]=d=>e.name=d),invalid:o(c).formData.name.$error,onInput:_[1]||(_[1]=d=>o(c).formData.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),i("div",me,[t(s,{class:"mr-3 text-sm",variant:"primary-outline",outline:"",type:"button",onClick:m},{default:l(()=>[k(g(y.$t("general.cancel")),1)]),_:1}),t(s,{loading:o(u),disabled:o(u),variant:"danger",type:"submit"},{left:l(d=>[o(u)?G("",!0):(I(),F(a,{key:0,name:"TrashIcon",class:O(d.class)},null,8,["class"]))]),default:l(()=>[k(" "+g(y.$t("general.delete")),1)]),_:1},8,["loading","disabled"])])],32)]),_:1},8,["show"])}}},ce={key:0,class:"py-5"},_e={class:"text-lg leading-6 font-medium text-gray-900"},fe={class:"mt-2 max-w-xl text-sm text-gray-500"},ye={class:"mt-5"},ve={__name:"CompanyInfoSettings",setup(P){const p=R(),v=A(),h=T(),{t:$}=E.useI18n(),S=te("utils");let u=V(!1);const e=J({name:null,logo:null,address:{address_street_1:"",address_street_2:"",website:"",country_id:null,state:"",city:"",phone:"",zip:""}});S.mergeSettings(e,{...p.selectedCompany});let b=V([]),f=V(null),c=V(null);const B=V(!1);e.logo&&b.value.push({image:e.logo});const M=q(()=>({name:{required:w.withMessage($("validation.required"),x),minLength:w.withMessage($("validation.name_min_length"),se(3))},address:{country_id:{required:w.withMessage($("validation.required"),x)}}})),m=H(M,q(()=>e));v.fetchCountries();function y(s,a,D,d){c.value=d.name,f.value=a}function _(){f.value=null,B.value=!0}async function N(){if(m.value.$touch(),m.value.$invalid)return!0;if(u.value=!0,(await p.updateCompany(e)).data.data){if(f.value||B.value){let a=new FormData;f.value&&a.append("company_logo",JSON.stringify({name:c.value,data:f.value})),a.append("is_company_logo_removed",B.value),await p.updateCompanyLogo(a),f.value=null,B.value=!1}u.value=!1}u.value=!1}function U(s){h.openModal({title:$("settings.company_info.are_you_absolutely_sure"),componentName:"DeleteCompanyModal",size:"sm"})}return(s,a)=>{const D=r("BaseFileUploader"),d=r("BaseInputGroup"),z=r("BaseInputGrid"),C=r("BaseInput"),Q=r("BaseMultiselect"),j=r("BaseTextarea"),W=r("BaseIcon"),X=r("BaseButton"),Y=r("BaseDivider"),Z=r("BaseSettingCard");return I(),L(ne,null,[i("form",{onSubmit:K(N,["prevent"])},[t(Z,{title:s.$t("settings.company_info.company_info"),description:s.$t("settings.company_info.section_description")},{default:l(()=>[t(z,{class:"mt-5"},{default:l(()=>[t(d,{label:s.$t("settings.company_info.company_logo")},{default:l(()=>[t(D,{modelValue:o(b),"onUpdate:modelValue":a[0]||(a[0]=n=>oe(b)?b.value=n:b=n),base64:"",onChange:y,onRemove:_},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),t(z,{class:"mt-5"},{default:l(()=>[t(d,{label:s.$t("settings.company_info.company_name"),error:o(m).name.$error&&o(m).name.$errors[0].$message,required:""},{default:l(()=>[t(C,{modelValue:e.name,"onUpdate:modelValue":a[1]||(a[1]=n=>e.name=n),invalid:o(m).name.$error,onBlur:a[2]||(a[2]=n=>o(m).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),t(d,{label:s.$t("settings.company_info.phone")},{default:l(()=>[t(C,{modelValue:e.address.phone,"onUpdate:modelValue":a[3]||(a[3]=n=>e.address.phone=n)},null,8,["modelValue"])]),_:1},8,["label"]),t(d,{label:s.$t("settings.company_info.country"),error:o(m).address.country_id.$error&&o(m).address.country_id.$errors[0].$message,required:""},{default:l(()=>[t(Q,{modelValue:e.address.country_id,"onUpdate:modelValue":a[4]||(a[4]=n=>e.address.country_id=n),label:"name",invalid:o(m).address.country_id.$error,options:o(v).countries,"value-prop":"id","can-deselect":!0,"can-clear":!1,searchable:"","track-by":"name"},null,8,["modelValue","invalid","options"])]),_:1},8,["label","error"]),t(d,{label:s.$t("settings.company_info.state")},{default:l(()=>[t(C,{modelValue:e.address.state,"onUpdate:modelValue":a[5]||(a[5]=n=>e.address.state=n),name:"state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),t(d,{label:s.$t("settings.company_info.city")},{default:l(()=>[t(C,{modelValue:e.address.city,"onUpdate:modelValue":a[6]||(a[6]=n=>e.address.city=n),type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),t(d,{label:s.$t("settings.company_info.zip")},{default:l(()=>[t(C,{modelValue:e.address.zip,"onUpdate:modelValue":a[7]||(a[7]=n=>e.address.zip=n)},null,8,["modelValue"])]),_:1},8,["label"]),i("div",null,[t(d,{label:s.$t("settings.company_info.address")},{default:l(()=>[t(j,{modelValue:e.address.address_street_1,"onUpdate:modelValue":a[8]||(a[8]=n=>e.address.address_street_1=n),rows:"2"},null,8,["modelValue"])]),_:1},8,["label"]),t(j,{modelValue:e.address.address_street_2,"onUpdate:modelValue":a[9]||(a[9]=n=>e.address.address_street_2=n),rows:"2",row:2,class:"mt-2"},null,8,["modelValue"])])]),_:1}),t(X,{loading:o(u),disabled:o(u),type:"submit",class:"mt-6"},{left:l(n=>[o(u)?G("",!0):(I(),F(W,{key:0,class:O(n.class),name:"SaveIcon"},null,8,["class"]))]),default:l(()=>[k(" "+g(s.$t("settings.company_info.save")),1)]),_:1},8,["loading","disabled"]),o(p).companies.length!==1?(I(),L("div",ce,[t(Y,{class:"my-4"}),i("h3",_e,g(s.$t("settings.company_info.delete_company")),1),i("div",fe,[i("p",null,g(s.$t("settings.company_info.delete_company_description")),1)]),i("div",ye,[i("button",{type:"button",class:"inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm",onClick:U},g(s.$t("general.delete")),1)])])):G("",!0)]),_:1},8,["title","description"])],32),t(pe)],64)}}};export{ve as default}; diff --git a/public/build/assets/Create-0CAq2sgw.js b/public/build/assets/Create-0CAq2sgw.js deleted file mode 100644 index 66cf8c8f..00000000 --- a/public/build/assets/Create-0CAq2sgw.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as oe,ae as re,G as le,E as se,v as ae,e as ie,L as ue,f as w,k as h,j as de,r as p,o as f,m as _,w as i,b as m,a as r,J as E,p as G,t as $,l as e,af as me,K as v,n as k,c as j,q as ce,g,h as N,I as z,ag as T,i as pe,a0 as ge,ah as be,ai as S}from"./main-WMXHPsTs.js";import{_ as Ce}from"./CreateCustomFields--vFU38k2.js";import"./dynamic-import-helper-0gtGTknh.js";const fe={class:"flex items-center justify-end"},_e={class:"grid grid-cols-5 gap-4 mb-8"},$e={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},ve={class:"grid grid-cols-5 gap-4 mb-8"},ye={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ve={class:"md:col-span-2"},we={class:"text-sm text-gray-500"},he={class:"grid grid-cols-5 gap-4 mb-8"},Be={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ie={class:"space-y-6"},Me={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},xe={class:"p-1"},Ue={key:0,class:"grid grid-cols-5 gap-4 mb-8"},ke={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Se={class:"space-y-6"},qe={class:"grid grid-cols-5 gap-2 mb-8"},Le={key:0,class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},ze={class:"col-span-5 lg:col-span-4"},A="customFields",Ge={__name:"Create",setup(Pe){const n=oe(),P=re(),q=le(),R=se(),{t:c}=ae.useI18n(),H=ie(),O=ue();let l=w(!1),b=w(!1),C=w(!1);w(!1);const B=w(!1),V=h(()=>O.name==="customers.edit");let J=h(()=>n.isFetchingInitialSettings);const F=h(()=>V.value?c("customers.edit_customer"):c("customers.new_customer")),K=h(()=>({currentCustomer:{name:{required:g.withMessage(c("validation.required"),N),minLength:g.withMessage(c("validation.name_min_length",{count:3}),z(3))},prefix:{minLength:g.withMessage(c("validation.name_min_length",{count:3}),z(3))},currency_id:{required:g.withMessage(c("validation.required"),N)},email:{required:g.withMessage(c("validation.required"),T(n.currentCustomer.enable_portal==!0)),email:g.withMessage(c("validation.email_incorrect"),pe)},password:{required:g.withMessage(c("validation.required"),T(n.currentCustomer.enable_portal==!0&&!n.currentCustomer.password_added)),minLength:g.withMessage(c("validation.password_min_length",{count:8}),z(8))},confirm_password:{sameAsPassword:g.withMessage(c("validation.password_incorrect"),ge(n.currentCustomer.password))},website:{url:g.withMessage(c("validation.invalid_url"),be)},billing:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),S(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),S(255))}},shipping:{address_street_1:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),S(255))},address_street_2:{maxLength:g.withMessage(c("validation.address_maxlength",{count:255}),S(255))}}}})),Q=h(()=>`${window.location.origin}/${R.selectedCompany.slug}/customer/login`),a=de(K,n,{$scope:A});n.resetCurrentCustomer(),n.fetchCustomerInitialSettings(V.value);async function W(){if(a.value.$touch(),a.value.$invalid)return!0;B.value=!0;let s={...n.currentCustomer},t=null;try{t=await(V.value?n.updateCustomer:n.addCustomer)(s)}catch{B.value=!1;return}H.push(`/admin/customers/${t.data.data.id}/view`)}return(s,t)=>{const I=p("BaseBreadcrumbItem"),X=p("BaseBreadcrumb-item"),Y=p("BaseBreadcrumb"),y=p("BaseIcon"),D=p("BaseButton"),Z=p("BasePageHeader"),d=p("BaseInput"),u=p("BaseInputGroup"),L=p("BaseMultiselect"),M=p("BaseInputGrid"),x=p("BaseDivider"),ee=p("BaseSwitch"),U=p("BaseTextarea"),te=p("BaseCard"),ne=p("BasePage");return f(),_(ne,null,{default:i(()=>[m("form",{onSubmit:ce(W,["prevent"])},[r(Z,{title:F.value},{actions:i(()=>[m("div",fe,[r(D,{type:"submit",loading:B.value,disabled:B.value},{left:i(o=>[r(y,{name:"SaveIcon",class:E(o.class)},null,8,["class"])]),default:i(()=>[G(" "+$(V.value?s.$t("customers.update_customer"):s.$t("customers.save_customer")),1)]),_:1},8,["loading","disabled"])])]),default:i(()=>[r(Y,null,{default:i(()=>[r(I,{title:s.$t("general.home"),to:"dashboard"},null,8,["title"]),r(I,{title:s.$t("customers.customer",2),to:"/admin/customers"},null,8,["title"]),r(X,{title:F.value,to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(te,{class:"mt-5"},{default:i(()=>[m("div",_e,[m("h6",$e,$(s.$t("customers.basic_info")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:s.$t("customers.display_name"),required:"",error:e(a).currentCustomer.name.$error&&e(a).currentCustomer.name.$errors[0].$message,"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.name,"onUpdate:modelValue":t[0]||(t[0]=o=>e(n).currentCustomer.name=o),"content-loading":e(l),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.name.$error,onInput:t[1]||(t[1]=o=>e(a).currentCustomer.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(u,{label:s.$t("customers.primary_contact_name"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.contact_name,"onUpdate:modelValue":t[2]||(t[2]=o=>e(n).currentCustomer.contact_name=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{error:e(a).currentCustomer.email.$error&&e(a).currentCustomer.email.$errors[0].$message,"content-loading":e(l),label:s.$t("customers.email")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.email,"onUpdate:modelValue":t[3]||(t[3]=o=>e(n).currentCustomer.email=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"email",invalid:e(a).currentCustomer.email.$error,onInput:t[4]||(t[4]=o=>e(a).currentCustomer.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["error","content-loading","label"]),r(u,{label:s.$t("customers.phone"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.phone,"onUpdate:modelValue":t[5]||(t[5]=o=>e(n).currentCustomer.phone=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:s.$t("customers.primary_currency"),"content-loading":e(l),error:e(a).currentCustomer.currency_id.$error&&e(a).currentCustomer.currency_id.$errors[0].$message,required:""},{default:i(()=>[r(L,{modelValue:e(n).currentCustomer.currency_id,"onUpdate:modelValue":t[6]||(t[6]=o=>e(n).currentCustomer.currency_id=o),"value-prop":"id",label:"name","track-by":"name","content-loading":e(l),options:e(q).currencies,searchable:"","can-deselect":!1,placeholder:s.$t("customers.select_currency"),invalid:e(a).currentCustomer.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(u,{error:e(a).currentCustomer.website.$error&&e(a).currentCustomer.website.$errors[0].$message,label:s.$t("customers.website"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.website,"onUpdate:modelValue":t[7]||(t[7]=o=>e(n).currentCustomer.website=o),"content-loading":e(l),type:"url",onInput:t[8]||(t[8]=o=>e(a).currentCustomer.website.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["error","label","content-loading"]),r(u,{label:s.$t("customers.prefix"),error:e(a).currentCustomer.prefix.$error&&e(a).currentCustomer.prefix.$errors[0].$message,"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.prefix,"onUpdate:modelValue":t[9]||(t[9]=o=>e(n).currentCustomer.prefix=o),"content-loading":e(l),type:"text",name:"name",class:"",invalid:e(a).currentCustomer.prefix.$error,onInput:t[10]||(t[10]=o=>e(a).currentCustomer.prefix.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"])]),_:1})]),r(x,{class:"mb-5 md:mb-8"}),m("div",ve,[m("h6",ye,$(s.$t("customers.portal_access")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[m("div",Ve,[m("p",we,$(s.$t("customers.portal_access_text")),1),r(ee,{modelValue:e(n).currentCustomer.enable_portal,"onUpdate:modelValue":t[11]||(t[11]=o=>e(n).currentCustomer.enable_portal=o),class:"mt-1 flex"},null,8,["modelValue"])]),e(n).currentCustomer.enable_portal?(f(),_(u,{key:0,"content-loading":e(l),label:s.$t("customers.portal_access_url"),class:"md:col-span-2","help-text":s.$t("customers.portal_access_url_help")},{default:i(()=>[r(me,{token:Q.value},null,8,["token"])]),_:1},8,["content-loading","label","help-text"])):v("",!0),e(n).currentCustomer.enable_portal?(f(),_(u,{key:1,"content-loading":e(l),error:e(a).currentCustomer.password.$error&&e(a).currentCustomer.password.$errors[0].$message,label:s.$t("customers.password")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.password,"onUpdate:modelValue":t[14]||(t[14]=o=>e(n).currentCustomer.password=o),modelModifiers:{trim:!0},"content-loading":e(l),type:e(b)?"text":"password",name:"password",invalid:e(a).currentCustomer.password.$error,onInput:t[15]||(t[15]=o=>e(a).currentCustomer.password.$touch())},{right:i(()=>[e(b)?(f(),_(y,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[12]||(t[12]=o=>k(b)?b.value=!e(b):b=!e(b))})):(f(),_(y,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[13]||(t[13]=o=>k(b)?b.value=!e(b):b=!e(b))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["content-loading","error","label"])):v("",!0),e(n).currentCustomer.enable_portal?(f(),_(u,{key:2,error:e(a).currentCustomer.confirm_password.$error&&e(a).currentCustomer.confirm_password.$errors[0].$message,"content-loading":e(l),label:"Confirm Password"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.confirm_password,"onUpdate:modelValue":t[18]||(t[18]=o=>e(n).currentCustomer.confirm_password=o),modelModifiers:{trim:!0},"content-loading":e(l),type:e(C)?"text":"password",name:"confirm_password",invalid:e(a).currentCustomer.confirm_password.$error,onInput:t[19]||(t[19]=o=>e(a).currentCustomer.confirm_password.$touch())},{right:i(()=>[e(C)?(f(),_(y,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[16]||(t[16]=o=>k(C)?C.value=!e(C):C=!e(C))})):(f(),_(y,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:t[17]||(t[17]=o=>k(C)?C.value=!e(C):C=!e(C))}))]),_:1},8,["modelValue","content-loading","type","invalid"])]),_:1},8,["error","content-loading"])):v("",!0)]),_:1})]),r(x,{class:"mb-5 md:mb-8"}),m("div",he,[m("h6",Be,$(s.$t("customers.billing_address")),1),e(n).currentCustomer.billing?(f(),_(M,{key:0,class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{label:s.$t("customers.name"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.name,"onUpdate:modelValue":t[20]||(t[20]=o=>e(n).currentCustomer.billing.name=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",class:"w-full",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{label:s.$t("customers.country"),"content-loading":e(l)},{default:i(()=>[r(L,{modelValue:e(n).currentCustomer.billing.country_id,"onUpdate:modelValue":t[21]||(t[21]=o=>e(n).currentCustomer.billing.country_id=o),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(l),options:e(q).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:s.$t("customers.state"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.state,"onUpdate:modelValue":t[22]||(t[22]=o=>e(n).currentCustomer.billing.state=o),"content-loading":e(l),name:"billing.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(l),label:s.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.city,"onUpdate:modelValue":t[23]||(t[23]=o=>e(n).currentCustomer.billing.city=o),"content-loading":e(l),name:"billing.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:s.$t("customers.address"),error:e(a).currentCustomer.billing.address_street_1.$error&&e(a).currentCustomer.billing.address_street_1.$errors[0].$message||e(a).currentCustomer.billing.address_street_2.$error&&e(a).currentCustomer.billing.address_street_2.$errors[0].$message,"content-loading":e(l)},{default:i(()=>[r(U,{modelValue:e(n).currentCustomer.billing.address_street_1,"onUpdate:modelValue":t[24]||(t[24]=o=>e(n).currentCustomer.billing.address_street_1=o),modelModifiers:{trim:!0},"content-loading":e(l),placeholder:s.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3",onInput:t[25]||(t[25]=o=>e(a).currentCustomer.billing.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(U,{modelValue:e(n).currentCustomer.billing.address_street_2,"onUpdate:modelValue":t[26]||(t[26]=o=>e(n).currentCustomer.billing.address_street_2=o),modelModifiers:{trim:!0},"content-loading":e(l),placeholder:s.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3",onInput:t[27]||(t[27]=o=>e(a).currentCustomer.billing.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","error","content-loading"]),m("div",Ie,[r(u,{"content-loading":e(l),label:s.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.phone,"onUpdate:modelValue":t[28]||(t[28]=o=>e(n).currentCustomer.billing.phone=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:s.$t("customers.zip_code"),"content-loading":e(l),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.billing.zip,"onUpdate:modelValue":t[29]||(t[29]=o=>e(n).currentCustomer.billing.zip=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})):v("",!0)]),r(x,{class:"mb-5 md:mb-8"}),m("div",Me,[m("div",xe,[r(D,{type:"button","content-loading":e(l),size:"sm",variant:"primary-outline",onClick:t[30]||(t[30]=o=>e(n).copyAddress(!0))},{left:i(o=>[r(y,{name:"DocumentDuplicateIcon",class:E(o.class)},null,8,["class"])]),default:i(()=>[G(" "+$(s.$t("customers.copy_billing_address")),1)]),_:1},8,["content-loading"])])]),e(n).currentCustomer.shipping?(f(),j("div",Ue,[m("h6",ke,$(s.$t("customers.shipping_address")),1),r(M,{class:"col-span-5 lg:col-span-4"},{default:i(()=>[r(u,{"content-loading":e(l),label:s.$t("customers.name")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.name,"onUpdate:modelValue":t[31]||(t[31]=o=>e(n).currentCustomer.shipping.name=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:s.$t("customers.country"),"content-loading":e(l)},{default:i(()=>[r(L,{modelValue:e(n).currentCustomer.shipping.country_id,"onUpdate:modelValue":t[32]||(t[32]=o=>e(n).currentCustomer.shipping.country_id=o),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(l),options:e(q).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),r(u,{label:s.$t("customers.state"),"content-loading":e(l)},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.state,"onUpdate:modelValue":t[33]||(t[33]=o=>e(n).currentCustomer.shipping.state=o),"content-loading":e(l),name:"shipping.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(u,{"content-loading":e(l),label:s.$t("customers.city")},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.city,"onUpdate:modelValue":t[34]||(t[34]=o=>e(n).currentCustomer.shipping.city=o),"content-loading":e(l),name:"shipping.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:s.$t("customers.address"),"content-loading":e(l),error:e(a).currentCustomer.shipping.address_street_1.$error&&e(a).currentCustomer.shipping.address_street_1.$errors[0].$message||e(a).currentCustomer.shipping.address_street_2.$error&&e(a).currentCustomer.shipping.address_street_2.$errors[0].$message},{default:i(()=>[r(U,{modelValue:e(n).currentCustomer.shipping.address_street_1,"onUpdate:modelValue":t[35]||(t[35]=o=>e(n).currentCustomer.shipping.address_street_1=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",placeholder:s.$t("general.street_1"),name:"shipping_street1",onInput:t[36]||(t[36]=o=>e(a).currentCustomer.shipping.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),r(U,{modelValue:e(n).currentCustomer.shipping.address_street_2,"onUpdate:modelValue":t[37]||(t[37]=o=>e(n).currentCustomer.shipping.address_street_2=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",placeholder:s.$t("general.street_2"),name:"shipping_street2",class:"mt-3","container-class":"mt-3",onInput:t[38]||(t[38]=o=>e(a).currentCustomer.shipping.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","content-loading","error"]),m("div",Se,[r(u,{"content-loading":e(l),label:s.$t("customers.phone"),class:"text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.phone,"onUpdate:modelValue":t[39]||(t[39]=o=>e(n).currentCustomer.shipping.phone=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),r(u,{label:s.$t("customers.zip_code"),"content-loading":e(l),class:"mt-2 text-left"},{default:i(()=>[r(d,{modelValue:e(n).currentCustomer.shipping.zip,"onUpdate:modelValue":t[40]||(t[40]=o=>e(n).currentCustomer.shipping.zip=o),modelModifiers:{trim:!0},"content-loading":e(l),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})])):v("",!0),e(P).customFields.length>0?(f(),_(x,{key:1,class:"mb-5 md:mb-8"})):v("",!0),m("div",qe,[e(P).customFields.length>0?(f(),j("h6",Le,$(s.$t("settings.custom_fields.title")),1)):v("",!0),m("div",ze,[r(Ce,{type:"Customer",store:e(n),"store-prop":"currentCustomer","is-edit":V.value,"is-loading":e(J),"custom-field-scope":A},null,8,["store","is-edit","is-loading"])])])]),_:1})],32)]),_:1})}}};export{Ge as default}; diff --git a/public/build/assets/Create-GjP_r10o.js b/public/build/assets/Create-GjP_r10o.js deleted file mode 100644 index 469fa1c3..00000000 --- a/public/build/assets/Create-GjP_r10o.js +++ /dev/null @@ -1 +0,0 @@ -import{at as X,au as Z,F as ee,E as te,v as ae,L as ne,e as oe,M as se,f as $,k as c,j as le,Q as re,r as s,o as y,m as V,w as l,a as o,b as C,l as a,p as U,t as k,K as P,J as ie,q as ue,g as h,h as me,I as ce,ai as de}from"./main-WMXHPsTs.js";import{_ as pe}from"./ItemUnitModal-iO02fk5D.js";const ve={__name:"Create",setup(_e){const t=X(),S=Z(),v=ee(),E=te(),{t:d}=ae.useI18n(),f=ne(),N=oe(),q=se(),_=$(!1),B=$(E.selectedCompanySettings.tax_per_item);let r=$(!1);t.$reset(),j();const b=c({get:()=>t.currentItem.price/100,set:e=>{t.currentItem.price=Math.round(e*100)}}),T=c({get:()=>{var e,n;return(n=(e=t==null?void 0:t.currentItem)==null?void 0:e.taxes)==null?void 0:n.map(m=>{if(m)return{...m,tax_type_id:m.id,tax_name:m.name+" ("+m.percent+"%)"}})},set:e=>{t.currentItem.taxes=e}}),g=c(()=>f.name==="items.edit"),w=c(()=>g.value?d("items.edit_item"):d("items.new_item")),L=c(()=>S.taxTypes.map(e=>({...e,tax_type_id:e.id,tax_name:e.name+" ("+e.percent+"%)"}))),z=c(()=>B.value==="YES"),A=c(()=>({currentItem:{name:{required:h.withMessage(d("validation.required"),me),minLength:h.withMessage(d("validation.name_min_length",{count:3}),ce(3))},description:{maxLength:h.withMessage(d("validation.description_maxlength"),de(65e3))}}})),u=le(A,t);async function G(){v.openModal({title:d("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",size:"sm"})}async function j(){if(r.value=!0,await t.fetchItemUnits({limit:"all"}),q.hasAbilities(re.VIEW_TAX_TYPE)&&await S.fetchTaxTypes({limit:"all"}),g.value){let e=f.params.id;await t.fetchItem(e),t.currentItem.tax_per_item===1?B.value="YES":B.value="NO"}r.value=!1}async function D(){if(u.value.currentItem.$touch(),u.value.currentItem.$invalid)return!1;_.value=!0;try{let n={id:f.params.id,...t.currentItem};t.currentItem&&t.currentItem.taxes&&(n.taxes=t.currentItem.taxes.map(p=>({tax_type_id:p.tax_type_id,amount:b.value*p.percent,percent:p.percent,name:p.name,collective_tax:0}))),await(g.value?t.updateItem:t.addItem)(n),_.value=!1,N.push("/admin/items"),e()}catch{_.value=!1;return}function e(){v.closeModal(),setTimeout(()=>{t.resetCurrentItem(),v.$reset(),u.value.$reset()},300)}}return(e,n)=>{const m=s("BaseBreadcrumbItem"),p=s("BaseBreadcrumb"),Y=s("BasePageHeader"),F=s("BaseInput"),I=s("BaseInputGroup"),H=s("BaseMoney"),x=s("BaseIcon"),R=s("BaseSelectAction"),M=s("BaseMultiselect"),J=s("BaseTextarea"),K=s("BaseButton"),O=s("BaseInputGrid"),Q=s("BaseCard"),W=s("BasePage");return y(),V(W,null,{default:l(()=>[o(Y,{title:w.value},{default:l(()=>[o(p,null,{default:l(()=>[o(m,{title:e.$t("general.home"),to:"dashboard"},null,8,["title"]),o(m,{title:e.$t("items.item",2),to:"/admin/items"},null,8,["title"]),o(m,{title:w.value,to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(pe),C("form",{class:"grid lg:grid-cols-2 mt-6",action:"submit",onSubmit:ue(D,["prevent"])},[o(Q,{class:"w-full"},{default:l(()=>[o(O,{layout:"one-column"},{default:l(()=>[o(I,{label:e.$t("items.name"),"content-loading":a(r),required:"",error:a(u).currentItem.name.$error&&a(u).currentItem.name.$errors[0].$message},{default:l(()=>[o(F,{modelValue:a(t).currentItem.name,"onUpdate:modelValue":n[0]||(n[0]=i=>a(t).currentItem.name=i),"content-loading":a(r),invalid:a(u).currentItem.name.$error,onInput:n[1]||(n[1]=i=>a(u).currentItem.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o(I,{label:e.$t("items.price"),"content-loading":a(r)},{default:l(()=>[o(H,{modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=i=>b.value=i),"content-loading":a(r)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(I,{"content-loading":a(r),label:e.$t("items.unit")},{default:l(()=>[o(M,{modelValue:a(t).currentItem.unit_id,"onUpdate:modelValue":n[3]||(n[3]=i=>a(t).currentItem.unit_id=i),"content-loading":a(r),label:"name",options:a(t).itemUnits,"value-prop":"id",placeholder:e.$t("items.select_a_unit"),searchable:"","track-by":"name"},{action:l(()=>[o(R,{onClick:G},{default:l(()=>[o(x,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),U(" "+k(e.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),z.value?(y(),V(I,{key:0,label:e.$t("items.taxes"),"content-loading":a(r)},{default:l(()=>[o(M,{modelValue:T.value,"onUpdate:modelValue":n[4]||(n[4]=i=>T.value=i),"content-loading":a(r),options:L.value,mode:"tags",label:"tax_name",class:"w-full","value-prop":"id","can-deselect":!1,"can-clear":!1,searchable:"","track-by":"tax_name",object:""},null,8,["modelValue","content-loading","options"])]),_:1},8,["label","content-loading"])):P("",!0),o(I,{label:e.$t("items.description"),"content-loading":a(r),error:a(u).currentItem.description.$error&&a(u).currentItem.description.$errors[0].$message},{default:l(()=>[o(J,{modelValue:a(t).currentItem.description,"onUpdate:modelValue":n[5]||(n[5]=i=>a(t).currentItem.description=i),"content-loading":a(r),name:"description",row:2,rows:"2",onInput:n[6]||(n[6]=i=>a(u).currentItem.description.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading","error"]),C("div",null,[o(K,{"content-loading":a(r),type:"submit",loading:_.value},{left:l(i=>[_.value?P("",!0):(y(),V(x,{key:0,name:"SaveIcon",class:ie(i.class)},null,8,["class"]))]),default:l(()=>[U(" "+k(g.value?e.$t("items.update_item"):e.$t("items.save_item")),1)]),_:1},8,["content-loading","loading"])])]),_:1})]),_:1})],32)]),_:1})}}};export{ve as default}; diff --git a/public/build/assets/Create-bIbqW6Oi.js b/public/build/assets/Create-bIbqW6Oi.js deleted file mode 100644 index 60196d36..00000000 --- a/public/build/assets/Create-bIbqW6Oi.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as ue,E as ie,ae as de,F as ce,L as pe,e as me,v as ge,G as xe,f as k,k as b,j as _e,aD as ye,r as i,o as f,c as fe,a as r,w as o,b as q,l as e,m as E,J as F,p as w,t as I,K as h,q as ve,N as Ee,g as m,h as C,aF as $e,ai as N,ag as be,X as he}from"./main-WMXHPsTs.js";import{u as Ce}from"./expense--byyUT9J.js";import{u as Be}from"./category-6thwPNPZ.js";import{_ as Ve}from"./CreateCustomFields--vFU38k2.js";import{_ as we}from"./CategoryModal-a6hq1Rp5.js";import{_ as Ie}from"./ExchangeRateConverter-G19_Li5d.js";import"./dynamic-import-helper-0gtGTknh.js";import"./exchange-rate-dmwjabGR.js";const Se={class:"hidden md:block"},Me={class:"block md:hidden"},G="newExpense",je={__name:"Create",setup(ke){const _=ue(),D=ie(),t=Ce(),y=Be(),j=de(),A=ce(),v=pe(),L=me(),{t:d}=ge.useI18n(),U=xe();let g=k(!1),u=k(!1);const S=k(!1),T=b(()=>({currentExpense:{expense_category_id:{required:m.withMessage(d("validation.required"),C)},expense_date:{required:m.withMessage(d("validation.required"),C)},amount:{required:m.withMessage(d("validation.required"),C),minValue:m.withMessage(d("validation.price_minvalue"),$e(.1)),maxLength:m.withMessage(d("validation.price_maxlength"),N(20))},notes:{maxLength:m.withMessage(d("validation.description_maxlength"),N(65e3))},currency_id:{required:m.withMessage(d("validation.required"),C)},exchange_rate:{required:be(function(){return m.withMessage(d("validation.required"),C),t.showExchangeRate}),decimal:m.withMessage(d("validation.valid_exchange_rate"),he)}}})),l=_e(T,t,{$scope:G}),R=b({get:()=>t.currentExpense.amount/100,set:a=>{t.currentExpense.amount=Math.round(a*100)}}),c=b(()=>v.name==="expenses.edit"),P=b(()=>c.value?d("expenses.edit_expense"):d("expenses.new_expense")),z=b(()=>c.value?`/reports/expenses/${v.params.id}/download-receipt`:"");t.resetCurrentExpenseData(),j.resetCustomFields(),W();function H(a,n){t.currentExpense.attachment_receipt=n}function O(){t.currentExpense.attachment_receipt=null,S.value=!0}function J(){A.openModal({title:d("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm"})}function K(a){t.currentExpense.selectedCurrency=U.currencies.find(n=>n.id===a)}async function X(a){let n=await y.fetchCategories({search:a});if(n.data.data.length>0&&y.editCategory&&!n.data.data.find(p=>p.id==y.editCategory.id)){let p=Object.assign({},y.editCategory);n.data.data.unshift(p)}return n.data.data}async function Q(a){let n=await _.fetchCustomers({search:a});if(n.data.data.length>0&&_.editCustomer&&!n.data.data.find(p=>p.id==_.editCustomer.id)){let p=Object.assign({},_.editCustomer);n.data.data.unshift(p)}return n.data.data}async function W(){if(c.value||(t.currentExpense.currency_id=D.selectedCompanyCurrency.id,t.currentExpense.selectedCurrency=D.selectedCompanyCurrency),u.value=!0,await t.fetchPaymentModes({limit:"all"}),c.value){const a=await t.fetchExpense(v.params.id);t.currentExpense.currency_id=t.currentExpense.selectedCurrency.id,a.data&&(!y.editCategory&&a.data.data.expense_category&&(y.editCategory=a.data.data.expense_category),!_.editCustomer&&a.data.data.customer&&(_.editCustomer=a.data.data.customer))}else v.query.customer&&(t.currentExpense.customer_id=v.query.customer);u.value=!1}async function Y(){if(l.value.$touch(),l.value.$invalid)return;g.value=!0;let a=t.currentExpense;try{c.value?await t.updateExpense({id:v.params.id,data:a,isAttachmentReceiptRemoved:S.value}):await t.addExpense(a),g.value=!1,t.currentExpense.attachment_receipt=null,S.value=!1,L.push("/admin/expenses")}catch(n){console.error(n),g.value=!1;return}}return ye(()=>{t.resetCurrentExpenseData(),_.editCustomer=null,y.editCategory=null}),(a,n)=>{const $=i("BaseBreadcrumbItem"),p=i("BaseBreadcrumb"),B=i("BaseIcon"),M=i("BaseButton"),Z=i("BasePageHeader"),ee=i("BaseSelectAction"),V=i("BaseMultiselect"),x=i("BaseInputGroup"),te=i("BaseDatePicker"),ne=i("BaseMoney"),ae=i("BaseTextarea"),re=i("BaseFileUploader"),se=i("BaseInputGrid"),oe=i("BaseCard"),le=i("BasePage");return f(),fe(Ee,null,[r(we),r(le,{class:"relative"},{default:o(()=>[q("form",{action:"",onSubmit:ve(Y,["prevent"])},[r(Z,{title:P.value,class:"mb-5"},{actions:o(()=>[c.value&&e(t).currentExpense.attachment_receipt_url?(f(),E(M,{key:0,href:z.value,tag:"a",variant:"primary-outline",type:"button",class:"mr-2"},{left:o(s=>[r(B,{name:"DownloadIcon",class:F(s.class)},null,8,["class"])]),default:o(()=>[w(" "+I(a.$t("expenses.download_receipt")),1)]),_:1},8,["href"])):h("",!0),q("div",Se,[r(M,{loading:e(g),"content-loading":e(u),disabled:e(g),variant:"primary",type:"submit"},{left:o(s=>[e(g)?h("",!0):(f(),E(B,{key:0,name:"SaveIcon",class:F(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+I(c.value?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading","content-loading","disabled"])])]),default:o(()=>[r(p,null,{default:o(()=>[r($,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r($,{title:a.$t("expenses.expense",2),to:"/admin/expenses"},null,8,["title"]),r($,{title:P.value,to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(oe,null,{default:o(()=>[r(se,null,{default:o(()=>[r(x,{label:a.$t("expenses.category"),error:e(l).currentExpense.expense_category_id.$error&&e(l).currentExpense.expense_category_id.$errors[0].$message,"content-loading":e(u),required:""},{default:o(()=>[e(u)?h("",!0):(f(),E(V,{key:0,modelValue:e(t).currentExpense.expense_category_id,"onUpdate:modelValue":n[0]||(n[0]=s=>e(t).currentExpense.expense_category_id=s),"content-loading":e(u),"value-prop":"id",label:"name","track-by":"id",options:X,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",invalid:e(l).currentExpense.expense_category_id.$error,placeholder:a.$t("expenses.categories.select_a_category"),onInput:n[1]||(n[1]=s=>e(l).currentExpense.expense_category_id.$touch())},{action:o(()=>[r(ee,{onClick:J},{default:o(()=>[r(B,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),w(" "+I(a.$t("settings.expense_category.add_new_category")),1)]),_:1})]),_:1},8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.expense_date"),error:e(l).currentExpense.expense_date.$error&&e(l).currentExpense.expense_date.$errors[0].$message,"content-loading":e(u),required:""},{default:o(()=>[r(te,{modelValue:e(t).currentExpense.expense_date,"onUpdate:modelValue":n[2]||(n[2]=s=>e(t).currentExpense.expense_date=s),"content-loading":e(u),"calendar-button":!0,invalid:e(l).currentExpense.expense_date.$error,onInput:n[3]||(n[3]=s=>e(l).currentExpense.expense_date.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.amount"),error:e(l).currentExpense.amount.$error&&e(l).currentExpense.amount.$errors[0].$message,"content-loading":e(u),required:""},{default:o(()=>[(f(),E(ne,{key:e(t).currentExpense.selectedCurrency,modelValue:R.value,"onUpdate:modelValue":n[4]||(n[4]=s=>R.value=s),class:"focus:border focus:border-solid focus:border-primary-500",invalid:e(l).currentExpense.amount.$error,currency:e(t).currentExpense.selectedCurrency,onInput:n[5]||(n[5]=s=>e(l).currentExpense.amount.$touch())},null,8,["modelValue","invalid","currency"]))]),_:1},8,["label","error","content-loading"]),r(x,{label:a.$t("expenses.currency"),"content-loading":e(u),error:e(l).currentExpense.currency_id.$error&&e(l).currentExpense.currency_id.$errors[0].$message,required:""},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.currency_id,"onUpdate:modelValue":[n[6]||(n[6]=s=>e(t).currentExpense.currency_id=s),K],"value-prop":"id",label:"name","track-by":"name","content-loading":e(u),options:e(U).currencies,searchable:"","can-deselect":!1,placeholder:a.$t("customers.select_currency"),invalid:e(l).currentExpense.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(Ie,{store:e(t),"store-prop":"currentExpense",v:e(l).currentExpense,"is-loading":e(u),"is-edit":c.value,"customer-currency":e(t).currentExpense.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"]),r(x,{"content-loading":e(u),label:a.$t("expenses.customer")},{default:o(()=>[e(u)?h("",!0):(f(),E(V,{key:0,modelValue:e(t).currentExpense.customer_id,"onUpdate:modelValue":n[7]||(n[7]=s=>e(t).currentExpense.customer_id=s),"content-loading":e(u),"value-prop":"id",label:"name","track-by":"id",options:Q,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",placeholder:a.$t("customers.select_a_customer")},null,8,["modelValue","content-loading","placeholder"]))]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(u),label:a.$t("payments.payment_mode")},{default:o(()=>[r(V,{modelValue:e(t).currentExpense.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=s=>e(t).currentExpense.payment_method_id=s),"content-loading":e(u),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(u),label:a.$t("expenses.note"),error:e(l).currentExpense.notes.$error&&e(l).currentExpense.notes.$errors[0].$message},{default:o(()=>[r(ae,{modelValue:e(t).currentExpense.notes,"onUpdate:modelValue":n[9]||(n[9]=s=>e(t).currentExpense.notes=s),"content-loading":e(u),row:4,rows:"4",onInput:n[10]||(n[10]=s=>e(l).currentExpense.notes.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label","error"]),r(x,{label:a.$t("expenses.receipt")},{default:o(()=>[r(re,{modelValue:e(t).currentExpense.receiptFiles,"onUpdate:modelValue":n[11]||(n[11]=s=>e(t).currentExpense.receiptFiles=s),accept:"image/*,.doc,.docx,.pdf,.csv,.xlsx,.xls",onChange:H,onRemove:O},null,8,["modelValue"])]),_:1},8,["label"]),r(Ve,{"is-edit":c.value,class:"col-span-2","is-loading":e(u),type:"Expense",store:e(t),"store-prop":"currentExpense","custom-field-scope":G},null,8,["is-edit","is-loading","store"]),q("div",Me,[r(M,{loading:e(g),tabindex:6,variant:"primary",type:"submit",class:"flex justify-center w-full"},{left:o(s=>[e(g)?h("",!0):(f(),E(B,{key:0,name:"SaveIcon",class:F(s.class)},null,8,["class"]))]),default:o(()=>[w(" "+I(c.value?a.$t("expenses.update_expense"):a.$t("expenses.save_expense")),1)]),_:1},8,["loading"])])]),_:1})]),_:1})],32)]),_:1})],64)}}};export{je as default}; diff --git a/public/build/assets/Create-ldI9v8mR.js b/public/build/assets/Create-ldI9v8mR.js deleted file mode 100644 index 92516674..00000000 --- a/public/build/assets/Create-ldI9v8mR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as A,L as J,e as K,E as O,f as w,k as b,g as c,h as f,j as Q,r as i,o as B,m as V,w as u,a as o,b as h,l as e,c as W,O as X,N as Y,J as Z,K as x,p as ee,t as ae,q as te,I as C,i as oe,ag as se}from"./main-WMXHPsTs.js";import{V as ne}from"./index-1C8OGUyy.js";import{u as re}from"./users-ekDlhDXB.js";const le={class:"grid grid-cols-12"},ue={class:"space-y-6"},pe={__name:"Create",setup(ie){const t=re(),{t:d}=A.useI18n(),I=J(),k=K(),S=O();let p=w(!1),r=w(!1);w([]);let q=w([]);const g=b(()=>I.name==="users.edit"),y=b(()=>g.value?d("users.edit_user"):d("users.new_user")),L=b(()=>({userData:{name:{required:c.withMessage(d("validation.required"),f),minLength:c.withMessage(d("validation.name_min_length",{count:3}),C(3))},email:{required:c.withMessage(d("validation.required"),f),email:c.withMessage(d("validation.email_incorrect"),oe)},password:{required:se(function(){return c.withMessage(d("validation.required"),f),!g.value}),minLength:c.withMessage(d("validation.password_min_length",{count:8}),C(8))},companies:{required:c.withMessage(d("validation.required"),f)}}})),N={role:{required:c.withMessage(d("validation.required"),f)}},s=Q(L,t,{$scope:!0});E(),t.resetUserData();async function E(){var l;r.value=!0;try{g.value&&await t.fetchUser(I.params.id);let a=await S.fetchUserCompanies();(l=a==null?void 0:a.data)!=null&&l.data&&(q.value=a.data.data.map(m=>(m.role=null,m)))}catch{r.value=!1}r.value=!1}async function G(){if(s.value.$touch(),s.value.$invalid)return!0;try{p.value=!0;let l={...t.userData,companies:t.userData.companies.map(m=>({role:m.role,id:m.id}))};await(g.value?t.updateUser:t.addUser)(l),k.push("/admin/users"),p.value=!1}catch{p.value=!1}}return(l,a)=>{const m=i("BaseBreadcrumbItem"),P=i("BaseBreadcrumb"),j=i("BasePageHeader"),$=i("BaseInput"),v=i("BaseInputGroup"),M=i("BaseMultiselect"),R=i("BaseInputGrid"),F=i("BaseIcon"),H=i("BaseButton"),T=i("BaseCard"),z=i("BasePage");return B(),V(z,null,{default:u(()=>[o(j,{title:y.value},{default:u(()=>[o(P,null,{default:u(()=>[o(m,{title:l.$t("general.home"),to:"dashboard"},null,8,["title"]),o(m,{title:l.$t("users.user",2),to:"/admin/users"},null,8,["title"]),o(m,{title:y.value,to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),h("form",{action:"",autocomplete:"off",onSubmit:te(G,["prevent"])},[h("div",le,[o(T,{class:"mt-6 col-span-12 md:col-span-8"},{default:u(()=>[o(R,{layout:"one-column"},{default:u(()=>[o(v,{"content-loading":e(r),label:l.$t("users.name"),error:e(s).userData.name.$error&&e(s).userData.name.$errors[0].$message,required:""},{default:u(()=>[o($,{modelValue:e(t).userData.name,"onUpdate:modelValue":a[0]||(a[0]=n=>e(t).userData.name=n),modelModifiers:{trim:!0},"content-loading":e(r),invalid:e(s).userData.name.$error,onInput:a[1]||(a[1]=n=>e(s).userData.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),o(v,{"content-loading":e(r),label:l.$t("users.email"),error:e(s).userData.email.$error&&e(s).userData.email.$errors[0].$message,required:""},{default:u(()=>[o($,{modelValue:e(t).userData.email,"onUpdate:modelValue":a[2]||(a[2]=n=>e(t).userData.email=n),modelModifiers:{trim:!0},type:"email","content-loading":e(r),invalid:e(s).userData.email.$error,onInput:a[3]||(a[3]=n=>e(s).userData.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),o(v,{"content-loading":e(r),label:l.$t("users.companies"),error:e(s).userData.companies.$error&&e(s).userData.companies.$errors[0].$message,required:""},{default:u(()=>[o(M,{modelValue:e(t).userData.companies,"onUpdate:modelValue":a[4]||(a[4]=n=>e(t).userData.companies=n),mode:"tags",object:!0,autocomplete:"new-password",label:"name",options:e(q),"value-prop":"id",invalid:e(s).userData.companies.$error,"content-loading":e(r),searchable:"","can-deselect":!1,class:"w-full","track-by":"name"},null,8,["modelValue","options","invalid","content-loading"])]),_:1},8,["content-loading","label","error"]),(B(!0),W(Y,null,X(e(t).userData.companies,(n,D)=>(B(),V(e(ne),{key:D,state:n,rules:N},{default:u(({v:_})=>[h("div",ue,[o(v,{"content-loading":e(r),label:l.$t("users.select_company_role",{company:n.name}),error:_.role.$error&&_.role.$errors[0].$message,required:""},{default:u(()=>[o(M,{modelValue:e(t).userData.companies[D].role,"onUpdate:modelValue":U=>e(t).userData.companies[D].role=U,"value-prop":"name","track-by":"id",autocomplete:"off","content-loading":e(r),label:"name",options:e(t).userData.companies[D].roles,"can-deselect":!1,invalid:_.role.$invalid,onChange:U=>_.role.$touch()},null,8,["modelValue","onUpdate:modelValue","content-loading","options","invalid","onChange"])]),_:2},1032,["content-loading","label","error"])])]),_:2},1032,["state"]))),128)),o(v,{"content-loading":e(r),label:l.$t("users.password"),error:e(s).userData.password.$error&&e(s).userData.password.$errors[0].$message,required:!g.value},{default:u(()=>[o($,{modelValue:e(t).userData.password,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).userData.password=n),name:"new-password",autocomplete:"new-password","content-loading":e(r),type:"password",invalid:e(s).userData.password.$error,onInput:a[6]||(a[6]=n=>e(s).userData.password.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error","required"]),o(v,{"content-loading":e(r),label:l.$t("users.phone")},{default:u(()=>[o($,{modelValue:e(t).userData.phone,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).userData.phone=n),modelModifiers:{trim:!0},"content-loading":e(r)},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"])]),_:1}),o(H,{"content-loading":e(r),type:"submit",loading:e(p),disabled:e(p),class:"mt-6"},{left:u(n=>[e(p)?x("",!0):(B(),V(F,{key:0,name:"SaveIcon",class:Z(n.class)},null,8,["class"]))]),default:u(()=>[ee(" "+ae(g.value?l.$t("users.update_user"):l.$t("users.save_user")),1)]),_:1},8,["content-loading","loading","disabled"])]),_:1})])],32)]),_:1})}}};export{pe as default}; diff --git a/public/build/assets/Create-xjAesJHz.js b/public/build/assets/Create-xjAesJHz.js deleted file mode 100644 index 36547b7f..00000000 --- a/public/build/assets/Create-xjAesJHz.js +++ /dev/null @@ -1 +0,0 @@ -import{L as ue,e as se,u as me,a8 as ie,ae as ce,E as de,F as ye,aq as pe,G as ve,a5 as _e,v as fe,f as w,H as Pe,k as I,j as ge,an as be,aD as $e,r as s,o as C,c as Be,a as r,w as l,b as $,l as t,m as q,J as G,K as N,p as M,t as P,q as he,N as Ie,g as B,h as k,aL as Ce,ag as Ve,X as Se}from"./main-WMXHPsTs.js";import{_ as we}from"./ExchangeRateConverter-G19_Li5d.js";import{u as qe}from"./payment-41Om6QZO.js";import{_ as Me}from"./SelectNotePopup-wzqC6aO8.js";import{_ as ke}from"./CreateCustomFields--vFU38k2.js";import{_ as Ne}from"./PaymentModeModal-VST8lRV4.js";import"./exchange-rate-dmwjabGR.js";import"./NoteModal-jScVrYU1.js";import"./dynamic-import-helper-0gtGTknh.js";const Ue={class:"absolute left-3.5"},De={class:"relative w-full"},Ae={class:"relative mt-6"},Ee={class:"z-20 float-right text-sm font-semibold leading-5 text-primary-400"},Fe={class:"mb-4 text-sm font-medium text-gray-800"},x="newEstimate",Xe={__name:"Create",setup(Ge){const i=ue(),L=se(),e=qe();me();const V=ie();ce(),de();const j=ye(),U=pe();ve();const D=_e("utils"),{t:y}=fe.useI18n();let g=w(!1),S=w(!1),p=w([]);const v=w(null),H=Pe(["customer","company","customerCustom","payment","paymentCustom"]),h=I({get:()=>e.currentPayment.amount/100,set:a=>{e.currentPayment.amount=Math.round(a*100)}}),u=I(()=>e.isFetchingInitialData),c=I(()=>i.name==="payments.edit"),A=I(()=>c.value?y("payments.edit_payment"):y("payments.new_payment")),R=I(()=>({currentPayment:{customer_id:{required:B.withMessage(y("validation.required"),k)},payment_date:{required:B.withMessage(y("validation.required"),k)},amount:{required:B.withMessage(y("validation.required"),k),between:B.withMessage(y("validation.payment_greater_than_due_amount"),Ce(0,e.currentPayment.maxPayableAmount))},exchange_rate:{required:Ve(function(){return B.withMessage(y("validation.required"),k),e.showExchangeRate}),decimal:B.withMessage(y("validation.valid_exchange_rate"),Se)}}})),m=ge(R,e,{$scope:x});be(()=>{e.currentPayment.customer_id&&X(e.currentPayment.customer_id),i.query.customer&&(e.currentPayment.customer_id=i.query.customer)}),e.resetCurrentPayment(),i.query.customer&&(e.currentPayment.customer_id=i.query.customer),e.fetchPaymentInitialData(c.value),i.params.id&&!c.value&&J();async function z(){j.openModal({title:y("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal"})}function T(a){e.currentPayment.notes=""+a.notes}async function J(){var n;let a=await U.fetchInvoice((n=i==null?void 0:i.params)==null?void 0:n.id);e.currentPayment.customer_id=a.data.data.customer.id,e.currentPayment.invoice_id=a.data.data.id}async function K(a){a&&(v.value=p.value.find(n=>n.id===a),h.value=v.value.due_amount/100,e.currentPayment.maxPayableAmount=v.value.due_amount)}function X(a){if(a){let n={customer_id:a,status:"DUE",limit:"all"};c.value&&(n.status=""),S.value=!0,Promise.all([U.fetchInvoices(n),V.fetchCustomer(a)]).then(async([d,_])=>{d&&(p.value=[...d.data.data]),_&&_.data&&(e.currentPayment.selectedCustomer=_.data.data,e.currentPayment.customer=_.data.data,e.currentPayment.currency=_.data.data.currency,c.value&&!V.editCustomer&&e.currentPayment.customer_id&&(V.editCustomer=_.data.data)),e.currentPayment.invoice_id&&(v.value=p.value.find(f=>f.id===e.currentPayment.invoice_id),e.currentPayment.maxPayableAmount=v.value.due_amount+e.currentPayment.amount,h.value===0&&(h.value=v.value.due_amount/100)),c.value&&(p.value=p.value.filter(f=>f.due_amount>0||f.id==e.currentPayment.invoice_id)),S.value=!1}).catch(d=>{S.value=!1,console.error(d,"error")})}}$e(()=>{e.resetCurrentPayment(),p.value=[],V.editCustomer=null});async function O(){if(m.value.$touch(),m.value.$invalid)return!1;g.value=!0;let a={...e.currentPayment},n=null;try{n=await(c.value?e.updatePayment:e.addPayment)(a),L.push(`/admin/payments/${n.data.data.id}/view`)}catch{g.value=!1}}function Q(a){let n={userId:a};i.params.id&&(n.model_id=i.params.id),e.currentPayment.invoice_id=v.value=null,e.currentPayment.amount=0,p.value=[],e.getNextNumber(n,!0)}return(a,n)=>{const d=s("BaseBreadcrumbItem"),_=s("BaseBreadcrumb"),f=s("BaseIcon"),E=s("BaseButton"),W=s("BasePageHeader"),Y=s("BaseDatePicker"),b=s("BaseInputGroup"),Z=s("BaseInput"),ee=s("BaseCustomerSelectInput"),F=s("BaseMultiselect"),te=s("BaseMoney"),ae=s("BaseSelectAction"),ne=s("BaseInputGrid"),oe=s("BaseCustomInput"),re=s("BaseCard"),le=s("BasePage");return C(),Be(Ie,null,[r(Ne),r(le,{class:"relative payment-create"},{default:l(()=>[$("form",{action:"",onSubmit:he(O,["prevent"])},[r(W,{title:A.value,class:"mb-5"},{actions:l(()=>[r(E,{loading:t(g),disabled:t(g),variant:"primary",type:"submit",class:"hidden sm:flex"},{left:l(o=>[t(g)?N("",!0):(C(),q(f,{key:0,name:"SaveIcon",class:G(o.class)},null,8,["class"]))]),default:l(()=>[M(" "+P(c.value?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","disabled"])]),default:l(()=>[r(_,null,{default:l(()=>[r(d,{title:a.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(d,{title:a.$t("payments.payment",2),to:"/admin/payments"},null,8,["title"]),r(d,{title:A.value,to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(re,null,{default:l(()=>[r(ne,null,{default:l(()=>[r(b,{label:a.$t("payments.date"),"content-loading":u.value,required:"",error:t(m).currentPayment.payment_date.$error&&t(m).currentPayment.payment_date.$errors[0].$message},{default:l(()=>[r(Y,{modelValue:t(e).currentPayment.payment_date,"onUpdate:modelValue":[n[0]||(n[0]=o=>t(e).currentPayment.payment_date=o),n[1]||(n[1]=o=>t(m).currentPayment.payment_date.$touch())],"content-loading":u.value,"calendar-button":!0,"calendar-button-icon":"calendar",invalid:t(m).currentPayment.payment_date.$error},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),r(b,{label:a.$t("payments.payment_number"),"content-loading":u.value,required:""},{default:l(()=>[r(Z,{modelValue:t(e).currentPayment.payment_number,"onUpdate:modelValue":n[2]||(n[2]=o=>t(e).currentPayment.payment_number=o),"content-loading":u.value},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),r(b,{label:a.$t("payments.customer"),error:t(m).currentPayment.customer_id.$error&&t(m).currentPayment.customer_id.$errors[0].$message,"content-loading":u.value,required:""},{default:l(()=>[u.value?N("",!0):(C(),q(ee,{key:0,modelValue:t(e).currentPayment.customer_id,"onUpdate:modelValue":[n[3]||(n[3]=o=>t(e).currentPayment.customer_id=o),n[4]||(n[4]=o=>Q(t(e).currentPayment.customer_id))],"content-loading":u.value,invalid:t(m).currentPayment.customer_id.$error,placeholder:a.$t("customers.select_a_customer"),"show-action":""},null,8,["modelValue","content-loading","invalid","placeholder"]))]),_:1},8,["label","error","content-loading"]),r(b,{"content-loading":u.value,label:a.$t("payments.invoice"),"help-text":v.value?`Due Amount: ${t(e).currentPayment.maxPayableAmount/100}`:""},{default:l(()=>[r(F,{modelValue:t(e).currentPayment.invoice_id,"onUpdate:modelValue":n[5]||(n[5]=o=>t(e).currentPayment.invoice_id=o),"content-loading":u.value,"value-prop":"id","track-by":"invoice_number",label:"invoice_number",options:t(p),loading:t(S),placeholder:a.$t("invoices.select_invoice"),onSelect:K},{singlelabel:l(({value:o})=>[$("div",Ue,P(o.invoice_number)+" ("+P(t(D).formatMoney(o.total,o.customer.currency))+") ",1)]),option:l(({option:o})=>[M(P(o.invoice_number)+" ("+P(t(D).formatMoney(o.total,o.customer.currency))+") ",1)]),_:1},8,["modelValue","content-loading","options","loading","placeholder"])]),_:1},8,["content-loading","label","help-text"]),r(b,{label:a.$t("payments.amount"),"content-loading":u.value,error:t(m).currentPayment.amount.$error&&t(m).currentPayment.amount.$errors[0].$message,required:""},{default:l(()=>[$("div",De,[(C(),q(te,{key:t(e).currentPayment.currency,modelValue:h.value,"onUpdate:modelValue":[n[6]||(n[6]=o=>h.value=o),n[7]||(n[7]=o=>t(m).currentPayment.amount.$touch())],currency:t(e).currentPayment.currency,"content-loading":u.value,invalid:t(m).currentPayment.amount.$error},null,8,["modelValue","currency","content-loading","invalid"]))])]),_:1},8,["label","content-loading","error"]),r(b,{"content-loading":u.value,label:a.$t("payments.payment_mode")},{default:l(()=>[r(F,{modelValue:t(e).currentPayment.payment_method_id,"onUpdate:modelValue":n[8]||(n[8]=o=>t(e).currentPayment.payment_method_id=o),"content-loading":u.value,label:"name","value-prop":"id","track-by":"name",options:t(e).paymentModes,placeholder:a.$t("payments.select_payment_mode"),searchable:""},{action:l(()=>[r(ae,{onClick:z},{default:l(()=>[r(f,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),M(" "+P(a.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(we,{store:t(e),"store-prop":"currentPayment",v:t(m).currentPayment,"is-loading":u.value,"is-edit":c.value,"customer-currency":t(e).currentPayment.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"])]),_:1}),r(ke,{type:"Payment","is-edit":c.value,"is-loading":u.value,store:t(e),"store-prop":"currentPayment","custom-field-scope":x,class:"mt-6"},null,8,["is-edit","is-loading","store"]),$("div",Ae,[$("div",Ee,[r(Me,{type:"Payment",onSelect:T})]),$("label",Fe,P(a.$t("estimates.notes")),1),r(oe,{modelValue:t(e).currentPayment.notes,"onUpdate:modelValue":n[9]||(n[9]=o=>t(e).currentPayment.notes=o),"content-loading":u.value,fields:H,class:"mt-1"},null,8,["modelValue","content-loading","fields"])]),r(E,{loading:t(g),"content-loading":u.value,variant:"primary",type:"submit",class:"flex justify-center w-full mt-4 sm:hidden md:hidden"},{left:l(o=>[t(g)?N("",!0):(C(),q(f,{key:0,name:"SaveIcon",class:G(o.class)},null,8,["class"]))]),default:l(()=>[M(" "+P(c.value?a.$t("payments.update_payment"):a.$t("payments.save_payment")),1)]),_:1},8,["loading","content-loading"])]),_:1})],32)]),_:1})],64)}}};export{Xe as default}; diff --git a/public/build/assets/CreateCustomFields--vFU38k2.js b/public/build/assets/CreateCustomFields--vFU38k2.js deleted file mode 100644 index 315bbcd7..00000000 --- a/public/build/assets/CreateCustomFields--vFU38k2.js +++ /dev/null @@ -1,7 +0,0 @@ -import{v as E,g as T,ag as g,j as P,k as _,ax as I,ay as s,r as f,o as l,m as c,w as v,a3 as D,l as m,ae as q,aE as V,z as F,c as y,a as h,N as L,O,K as S,ab as b}from"./main-WMXHPsTs.js";import{_ as x}from"./dynamic-import-helper-0gtGTknh.js";const C={__name:"CreateCustomFieldsSingle",props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const i=e,{t:o}=E.useI18n(),d={value:{required:T.withMessage(o("validation.required"),g(i.field.is_required))}},a=P(d,_(()=>i.field),{$scope:i.customFieldScope}),t=_(()=>i.field.type?I(()=>x(Object.assign({"./types/DateTimeType.vue":()=>s(()=>import("./DateTimeType-qwy7_LT1.js"),__vite__mapDeps([0,1,2])),"./types/DateType.vue":()=>s(()=>import("./DateType-mWUjtDdt.js"),__vite__mapDeps([3,1,2])),"./types/DropdownType.vue":()=>s(()=>import("./DropdownType-SV0vY1Sc.js"),__vite__mapDeps([4,1,2])),"./types/InputType.vue":()=>s(()=>import("./InputType-qZxU-Xid.js"),__vite__mapDeps([5,1,2])),"./types/NumberType.vue":()=>s(()=>import("./NumberType-8jze5LxD.js"),__vite__mapDeps([6,1,2])),"./types/PhoneType.vue":()=>s(()=>import("./PhoneType-Yi4rIspz.js"),__vite__mapDeps([7,1,2])),"./types/SwitchType.vue":()=>s(()=>import("./SwitchType-7_ZdWo64.js"),__vite__mapDeps([8,1,2])),"./types/TextAreaType.vue":()=>s(()=>import("./TextAreaType-gbitLNyC.js"),__vite__mapDeps([9,1,2])),"./types/TimeType.vue":()=>s(()=>import("./TimeType-Z-KOAcSE.js"),__vite__mapDeps([10,1,2])),"./types/UrlType.vue":()=>s(()=>import("./UrlType-eEo4kYnl.js"),__vite__mapDeps([11,1,2]))}),`./types/${i.field.type}Type.vue`)):!1);return(u,r)=>{const n=f("BaseInputGroup");return l(),c(n,{label:e.field.label,required:!!e.field.is_required,error:m(a).value.$error&&m(a).value.$errors[0].$message},{default:v(()=>[(l(),c(D(t.value),{modelValue:e.field.value,"onUpdate:modelValue":r[0]||(r[0]=p=>e.field.value=p),options:e.field.options,invalid:m(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},A={key:0},B={__name:"CreateCustomFields",props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const i=q(),o=e;a();function d(){o.isEdit&&o.store[o.storeProp].fields.forEach(t=>{const u=o.store[o.storeProp].customFields.findIndex(r=>r.id===t.custom_field_id);if(u>-1){let r=t.default_answer;r&&t.custom_field.type==="DateTime"&&(r=b(t.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),o.store[o.storeProp].customFields[u]={...t,id:t.custom_field_id,value:r,label:t.custom_field.label,options:t.custom_field.options,is_required:t.custom_field.is_required,placeholder:t.custom_field.placeholder,order:t.custom_field.order}}})}async function a(){let u=(await i.fetchCustomFields({type:o.type,limit:"all"})).data.data;u.map(r=>r.value=r.default_answer),o.store[o.storeProp].customFields=V.sortBy(u,r=>r.order),d()}return F(()=>o.store[o.storeProp].fields,t=>{d()}),(t,u)=>{const r=f("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(l(),y("div",A,[h(r,{layout:e.gridLayout},{default:v(()=>[(l(!0),y(L,null,O(e.store[e.storeProp].customFields,(n,p)=>(l(),c(C,{key:n.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:n},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):S("",!0)}}};export{B as _}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/DateTimeType-qwy7_LT1.js","assets/main-WMXHPsTs.js","assets/main-qvsb96KG.css","assets/DateType-mWUjtDdt.js","assets/DropdownType-SV0vY1Sc.js","assets/InputType-qZxU-Xid.js","assets/NumberType-8jze5LxD.js","assets/PhoneType-Yi4rIspz.js","assets/SwitchType-7_ZdWo64.js","assets/TextAreaType-gbitLNyC.js","assets/TimeType-Z-KOAcSE.js","assets/UrlType-eEo4kYnl.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} diff --git a/public/build/assets/CustomFieldsSetting--g1dwzzI.js b/public/build/assets/CustomFieldsSetting--g1dwzzI.js deleted file mode 100644 index f82a9e22..00000000 --- a/public/build/assets/CustomFieldsSetting--g1dwzzI.js +++ /dev/null @@ -1,7 +0,0 @@ -import{a7 as ae,u as ne,v as H,ae as z,L as re,M as W,F as G,a5 as Z,r as i,o as C,m as b,w as n,a as s,l as e,Q as L,p as B,t as w,K as A,f as x,c as R,aw as ue,q as ee,H as X,k as T,ax as ie,ay as F,g as q,h as M,ar as de,j as me,b as O,n as ce,N as pe,O as _e,J as j,a3 as fe,a6 as ve}from"./main-WMXHPsTs.js";import{_ as Ce}from"./dynamic-import-helper-0gtGTknh.js";const ye={__name:"CustomFieldIndexDropdown",props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(k){const p=k,t=ae();ne();const{t:u}=H.useI18n(),c=z();re();const f=W(),d=G();Z("utils");async function m(v){await c.fetchCustomField(v),d.openModal({title:u("settings.custom_fields.edit_custom_field"),componentName:"CustomFieldModal",size:"sm",data:v,refreshData:p.loadData})}async function D(v){t.openDialog({title:u("general.are_you_sure"),message:u("settings.custom_fields.custom_field_confirm_delete"),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async g=>{g&&(await c.deleteCustomFields(v),p.loadData&&p.loadData())})}return(v,g)=>{const _=i("BaseIcon"),V=i("BaseDropdownItem"),I=i("BaseDropdown");return C(),b(I,null,{activator:n(()=>[s(_,{name:"DotsHorizontalIcon",class:"h-5 text-gray-500"})]),default:n(()=>[e(f).hasAbilities(e(L).EDIT_CUSTOM_FIELDS)?(C(),b(V,{key:0,onClick:g[0]||(g[0]=o=>m(k.row.id))},{default:n(()=>[s(_,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),B(" "+w(v.$t("general.edit")),1)]),_:1})):A("",!0),e(f).hasAbilities(e(L).DELETE_CUSTOM_FIELDS)?(C(),b(V,{key:1,onClick:g[1]||(g[1]=o=>D(k.row.id))},{default:n(()=>[s(_,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),B(" "+w(v.$t("general.delete")),1)]),_:1})):A("",!0)]),_:1})}}},ge={class:"flex items-center mt-1"},Fe={__name:"OptionsCreate",emits:["onAdd"],setup(k,{emit:p}){const t=p,u=x(null);function c(){if(u.value==null||u.value==""||u.value==null)return!0;t("onAdd",u.value),u.value=null}return(f,d)=>{const m=i("BaseInput"),D=i("BaseIcon");return C(),R("div",ge,[s(m,{modelValue:u.value,"onUpdate:modelValue":d[0]||(d[0]=v=>u.value=v),type:"text",class:"w-full md:w-96",placeholder:f.$t("settings.custom_fields.press_enter_to_add"),onClick:c,onKeydown:ue(ee(c,["prevent","stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),s(D,{name:"PlusCircleIcon",class:"ml-1 text-primary-500 cursor-pointer",onClick:c})])}}},be={class:"flex justify-between w-full"},$e={class:"overflow-y-auto max-h-[550px]"},we={class:"px-4 md:px-8 py-8 overflow-y-auto sm:p-6"},Ie={class:"z-0 flex justify-end p-4 border-t border-solid border-gray-light border-modal-bg"},Te={__name:"CustomFieldModal",setup(k){const p=G(),t=z(),{t:u}=H.useI18n();let c=x(!1);const f=X(["Customer","Invoice","Estimate","Expense","Payment"]),d=X([{label:"Text",value:"Input"},{label:"Textarea",value:"TextArea"},{label:"Phone",value:"Phone"},{label:"URL",value:"Url"},{label:"Number",value:"Number"},{label:"Select Field",value:"Dropdown"},{label:"Switch Toggle",value:"Switch"},{label:"Date",value:"Date"},{label:"Time",value:"Time"},{label:"Date & Time",value:"DateTime"}]);let m=x(d[0]);const D=T(()=>p.active&&p.componentName==="CustomFieldModal"),v=T(()=>m.value&&m.value.label==="Switch Toggle"),g=T(()=>m.value&&m.value.label==="Select Field"),_=T(()=>t.currentCustomField.type?ie(()=>Ce(Object.assign({"../../custom-fields/types/DateTimeType.vue":()=>F(()=>import("./DateTimeType-qwy7_LT1.js"),__vite__mapDeps([0,1,2])),"../../custom-fields/types/DateType.vue":()=>F(()=>import("./DateType-mWUjtDdt.js"),__vite__mapDeps([3,1,2])),"../../custom-fields/types/DropdownType.vue":()=>F(()=>import("./DropdownType-SV0vY1Sc.js"),__vite__mapDeps([4,1,2])),"../../custom-fields/types/InputType.vue":()=>F(()=>import("./InputType-qZxU-Xid.js"),__vite__mapDeps([5,1,2])),"../../custom-fields/types/NumberType.vue":()=>F(()=>import("./NumberType-8jze5LxD.js"),__vite__mapDeps([6,1,2])),"../../custom-fields/types/PhoneType.vue":()=>F(()=>import("./PhoneType-Yi4rIspz.js"),__vite__mapDeps([7,1,2])),"../../custom-fields/types/SwitchType.vue":()=>F(()=>import("./SwitchType-7_ZdWo64.js"),__vite__mapDeps([8,1,2])),"../../custom-fields/types/TextAreaType.vue":()=>F(()=>import("./TextAreaType-gbitLNyC.js"),__vite__mapDeps([9,1,2])),"../../custom-fields/types/TimeType.vue":()=>F(()=>import("./TimeType-Z-KOAcSE.js"),__vite__mapDeps([10,1,2])),"../../custom-fields/types/UrlType.vue":()=>F(()=>import("./UrlType-eEo4kYnl.js"),__vite__mapDeps([11,1,2]))}),`../../custom-fields/types/${t.currentCustomField.type}Type.vue`)):!1),V=T({get:()=>t.currentCustomField.is_required===1,set:l=>{const a=l?1:0;t.currentCustomField.is_required=a}}),I=T(()=>({currentCustomField:{type:{required:q.withMessage(u("validation.required"),M)},name:{required:q.withMessage(u("validation.required"),M)},label:{required:q.withMessage(u("validation.required"),M)},model_type:{required:q.withMessage(u("validation.required"),M)},order:{required:q.withMessage(u("validation.required"),M),numeric:q.withMessage(u("validation.numbers_only"),de)},type:{required:q.withMessage(u("validation.required"),M)}}})),o=me(I,T(()=>t));function h(){t.isEdit?m.value=d.find(l=>l.value==t.currentCustomField.type):(t.currentCustomField.model_type=f[0],t.currentCustomField.type=d[0].value,m.value=d[0])}async function P(){if(o.value.currentCustomField.$touch(),o.value.currentCustomField.$invalid)return!0;c.value=!0;let l={...t.currentCustomField};if(t.currentCustomField.options&&(l.options=t.currentCustomField.options.map(S=>S.name)),l.type=="Time"&&typeof l.default_answer=="object"){let S=l&&l.default_answer&&l.default_answer.HH?l.default_answer.HH:null,E=l&&l.default_answer&&l.default_answer.mm?l.default_answer.mm:null;l&&l.default_answer&&l.default_answer.ss&&l.default_answer.ss,l.default_answer=`${S}:${E}`}await(t.isEdit?t.updateCustomField:t.addCustomField)(l),c.value=!1,p.refreshData&&p.refreshData(),N()}function U(l){t.currentCustomField.options=[{name:l},...t.currentCustomField.options]}function y(l){if(t.isEdit&&t.currentCustomField.in_use)return;t.currentCustomField.options[l].name===t.currentCustomField.default_answer&&(t.currentCustomField.default_answer=null),t.currentCustomField.options.splice(l,1)}function te(l){t.currentCustomField.type=l.value}function N(){p.closeModal(),setTimeout(()=>{t.resetCurrentCustomField(),o.value.$reset()},300)}return(l,a)=>{const S=i("BaseIcon"),E=i("BaseInput"),$=i("BaseInputGroup"),K=i("BaseMultiselect"),le=i("BaseSwitch"),se=i("BaseInputGrid"),Y=i("BaseButton"),oe=i("BaseModal");return C(),b(oe,{show:D.value,onOpen:h},{header:n(()=>[O("div",be,[B(w(e(p).title)+" ",1),s(S,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:N})])]),default:n(()=>[O("form",{action:"",onSubmit:ee(P,["prevent"])},[O("div",$e,[O("div",we,[s(se,{layout:"one-column"},{default:n(()=>[s($,{label:l.$t("settings.custom_fields.name"),required:"",error:e(o).currentCustomField.name.$error&&e(o).currentCustomField.name.$errors[0].$message},{default:n(()=>[s(E,{ref:"name",modelValue:e(t).currentCustomField.name,"onUpdate:modelValue":a[0]||(a[0]=r=>e(t).currentCustomField.name=r),invalid:e(o).currentCustomField.name.$error,onInput:a[1]||(a[1]=r=>e(o).currentCustomField.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),s($,{label:l.$t("settings.custom_fields.model"),error:e(o).currentCustomField.model_type.$error&&e(o).currentCustomField.model_type.$errors[0].$message,"help-text":e(t).currentCustomField.in_use?l.$t("settings.custom_fields.model_in_use"):"",required:""},{default:n(()=>[s(K,{modelValue:e(t).currentCustomField.model_type,"onUpdate:modelValue":a[2]||(a[2]=r=>e(t).currentCustomField.model_type=r),options:f,"can-deselect":!1,invalid:e(o).currentCustomField.model_type.$error,searchable:!0,disabled:e(t).currentCustomField.in_use,onInput:a[3]||(a[3]=r=>e(o).currentCustomField.model_type.$touch())},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),s($,{class:"flex items-center space-x-4",label:l.$t("settings.custom_fields.required")},{default:n(()=>[s(le,{modelValue:V.value,"onUpdate:modelValue":a[4]||(a[4]=r=>V.value=r)},null,8,["modelValue"])]),_:1},8,["label"]),s($,{label:l.$t("settings.custom_fields.type"),error:e(o).currentCustomField.type.$error&&e(o).currentCustomField.type.$errors[0].$message,"help-text":e(t).currentCustomField.in_use?l.$t("settings.custom_fields.type_in_use"):"",required:""},{default:n(()=>[s(K,{modelValue:e(m),"onUpdate:modelValue":[a[5]||(a[5]=r=>ce(m)?m.value=r:m=r),te],options:d,invalid:e(o).currentCustomField.type.$error,disabled:e(t).currentCustomField.in_use,searchable:!0,"can-deselect":!1,object:""},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),s($,{label:l.$t("settings.custom_fields.label"),required:"",error:e(o).currentCustomField.label.$error&&e(o).currentCustomField.label.$errors[0].$message},{default:n(()=>[s(E,{modelValue:e(t).currentCustomField.label,"onUpdate:modelValue":a[6]||(a[6]=r=>e(t).currentCustomField.label=r),invalid:e(o).currentCustomField.label.$error,onInput:a[7]||(a[7]=r=>e(o).currentCustomField.label.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),g.value?(C(),b($,{key:0,label:l.$t("settings.custom_fields.options")},{default:n(()=>[s(Fe,{onOnAdd:U}),(C(!0),R(pe,null,_e(e(t).currentCustomField.options,(r,J)=>(C(),R("div",{key:J,class:"flex items-center mt-5"},[s(E,{modelValue:r.name,"onUpdate:modelValue":Q=>r.name=Q,class:"w-64"},null,8,["modelValue","onUpdate:modelValue"]),s(S,{name:"MinusCircleIcon",class:j(["ml-1 cursor-pointer",e(t).currentCustomField.in_use?"text-gray-300":"text-red-300"]),onClick:Q=>y(J)},null,8,["class","onClick"])]))),128))]),_:1},8,["label"])):A("",!0),s($,{label:l.$t("settings.custom_fields.default_value"),class:"relative"},{default:n(()=>[(C(),b(fe(_.value),{modelValue:e(t).currentCustomField.default_answer,"onUpdate:modelValue":a[8]||(a[8]=r=>e(t).currentCustomField.default_answer=r),options:e(t).currentCustomField.options,"default-date-time":e(t).currentCustomField.dateTimeValue},null,8,["modelValue","options","default-date-time"]))]),_:1},8,["label"]),v.value?A("",!0):(C(),b($,{key:1,label:l.$t("settings.custom_fields.placeholder")},{default:n(()=>[s(E,{modelValue:e(t).currentCustomField.placeholder,"onUpdate:modelValue":a[9]||(a[9]=r=>e(t).currentCustomField.placeholder=r)},null,8,["modelValue"])]),_:1},8,["label"])),s($,{label:l.$t("settings.custom_fields.order"),error:e(o).currentCustomField.order.$error&&e(o).currentCustomField.order.$errors[0].$message,required:""},{default:n(()=>[s(E,{modelValue:e(t).currentCustomField.order,"onUpdate:modelValue":a[10]||(a[10]=r=>e(t).currentCustomField.order=r),type:"number",invalid:e(o).currentCustomField.order.$error,onInput:a[11]||(a[11]=r=>e(o).currentCustomField.order.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),_:1})])]),O("div",Ie,[s(Y,{class:"mr-3",type:"button",variant:"primary-outline",onClick:N},{default:n(()=>[B(w(l.$t("general.cancel")),1)]),_:1}),s(Y,{variant:"primary",loading:e(c),disabled:e(c),type:"submit"},{left:n(r=>[e(c)?A("",!0):(C(),b(S,{key:0,class:j(r.class),name:"SaveIcon"},null,8,["class"]))]),default:n(()=>[B(" "+w(e(t).isEdit?l.$t("general.update"):l.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],32)]),_:1},8,["show"])}}},Be={class:"text-xs text-gray-500"},he={__name:"CustomFieldsSetting",setup(k){const p=G(),t=z(),u=W(),c=Z("utils"),{t:f}=H.useI18n(),d=x(null),m=T(()=>[{key:"name",label:f("settings.custom_fields.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"model_type",label:f("settings.custom_fields.model")},{key:"type",label:f("settings.custom_fields.type")},{key:"is_required",label:f("settings.custom_fields.required")},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function D({page:_,filter:V,sort:I}){let o={orderByField:I.fieldName||"created_at",orderBy:I.order||"desc",page:_},h=await t.fetchCustomFields(o);return{data:h.data.data,pagination:{totalPages:h.data.meta.last_page,currentPage:_,limit:5,totalCount:h.data.meta.total}}}function v(){p.openModal({title:f("settings.custom_fields.add_custom_field"),componentName:"CustomFieldModal",size:"sm",refreshData:d.value&&d.value.refresh})}async function g(){d.value&&d.value.refresh()}return(_,V)=>{const I=i("BaseIcon"),o=i("BaseButton"),h=i("BaseBadge"),P=i("BaseTable"),U=i("BaseSettingCard");return C(),b(U,{title:_.$t("settings.menu_title.custom_fields"),description:_.$t("settings.custom_fields.section_description")},{action:n(()=>[e(u).hasAbilities(e(L).CREATE_CUSTOM_FIELDS)?(C(),b(o,{key:0,variant:"primary-outline",onClick:v},{left:n(y=>[s(I,{class:j(y.class),name:"PlusIcon"},null,8,["class"]),B(" "+w(_.$t("settings.custom_fields.add_custom_field")),1)]),_:1})):A("",!0)]),default:n(()=>[s(Te),s(P,{ref_key:"table",ref:d,data:D,columns:m.value,class:"mt-16"},ve({"cell-name":n(({row:y})=>[B(w(y.data.name)+" ",1),O("span",Be," ("+w(y.data.slug)+")",1)]),"cell-is_required":n(({row:y})=>[s(h,{"bg-color":e(c).getBadgeStatusColor(y.data.is_required?"YES":"NO").bgColor,color:e(c).getBadgeStatusColor(y.data.is_required?"YES":"NO").color},{default:n(()=>[B(w(y.data.is_required?_.$t("settings.custom_fields.yes"):_.$t("settings.custom_fields.no").replace("_"," ")),1)]),_:2},1032,["bg-color","color"])]),_:2},[e(u).hasAbilities([e(L).DELETE_CUSTOM_FIELDS,e(L).EDIT_CUSTOM_FIELDS])?{name:"cell-actions",fn:n(({row:y})=>[s(ye,{row:y.data,table:d.value,"load-data":g},null,8,["row","table"])]),key:"0"}:void 0]),1032,["columns"])]),_:1},8,["title","description"])}}};export{he as default}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/DateTimeType-qwy7_LT1.js","assets/main-WMXHPsTs.js","assets/main-qvsb96KG.css","assets/DateType-mWUjtDdt.js","assets/DropdownType-SV0vY1Sc.js","assets/InputType-qZxU-Xid.js","assets/NumberType-8jze5LxD.js","assets/PhoneType-Yi4rIspz.js","assets/SwitchType-7_ZdWo64.js","assets/TextAreaType-gbitLNyC.js","assets/TimeType-Z-KOAcSE.js","assets/UrlType-eEo4kYnl.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} diff --git a/public/build/assets/CustomerIndexDropdown-yAJT5lg8.js b/public/build/assets/CustomerIndexDropdown-yAJT5lg8.js deleted file mode 100644 index df305541..00000000 --- a/public/build/assets/CustomerIndexDropdown-yAJT5lg8.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as C,u as S,a7 as x,M as b,v as E,L as T,e as $,a5 as N,r as l,o as a,m as s,w as t,l as e,a as n,Q as g,p,t as _,K as w}from"./main-WMXHPsTs.js";const V={__name:"CustomerIndexDropdown",props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(i){const y=i,f=C();S();const v=x(),m=b(),{t:u}=E.useI18n(),h=T();$(),N("utils");function I(r){v.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&f.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return y.loadData&&y.loadData(),!0})})}return(r,c)=>{const o=l("BaseIcon"),B=l("BaseButton"),d=l("BaseDropdownItem"),D=l("router-link"),k=l("BaseDropdown");return a(),s(k,{"content-loading":e(f).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(B,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(D,{key:0,to:`/admin/customers/${i.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+_(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):w("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(D,{key:1,to:`customers/${i.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+_(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):w("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=O=>I(i.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+_(r.$t("general.delete")),1)]),_:1})):w("",!0)]),_:1},8,["content-loading"])}}};export{V as _}; diff --git a/public/build/assets/CustomerSettings-ESefEL3K.js b/public/build/assets/CustomerSettings-ESefEL3K.js deleted file mode 100644 index 5cfdf7fa..00000000 --- a/public/build/assets/CustomerSettings-ESefEL3K.js +++ /dev/null @@ -1 +0,0 @@ -import{L,v as A,f as p,k as h,j as D,r as v,o as c,c as G,a as u,w as i,b as I,t as C,l as e,n as _,m as y,J as P,K as j,p as O,q as z,g,h as k,I as S,i as J,a0 as K}from"./main-WMXHPsTs.js";import{a as T,u as H}from"./global-VOW0aAlU.js";import"./auth-CmUq6Ysp.js";const Q={class:"font-bold text-left"},W={class:"mt-2 text-sm leading-snug text-left text-gray-500",style:{"max-width":"680px"}},X={class:"grid gap-6 sm:grid-col-1 md:grid-cols-2 mt-6"},Y=I("span",null,null,-1),ae={__name:"CustomerSettings",setup(Z){const r=T();H(),L();const{t:m,tm:U}=A.useI18n();let f=p([]),d=p(!1),w=p(null),n=p(!1),l=p(!1);const b=p(!1);r.userForm.avatar&&f.value.push({image:r.userForm.avatar});const q=h(()=>({userForm:{name:{required:g.withMessage(m("validation.required"),k),minLength:g.withMessage(m("validation.name_min_length",{count:3}),S(3))},email:{required:g.withMessage(m("validation.required"),k),email:g.withMessage(m("validation.email_incorrect"),J)},password:{minLength:g.withMessage(m("validation.password_min_length",{count:8}),S(8))},confirm_password:{sameAsPassword:g.withMessage(m("validation.password_incorrect"),K(r.userForm.password))}}})),o=D(q,h(()=>r));function x(t,s){w.value=s}function M(){w.value=null,b.value=!0}function E(){if(o.value.userForm.$touch(),o.value.userForm.$invalid)return!0;d.value=!0;let t=new FormData;t.append("name",r.userForm.name),t.append("email",r.userForm.email),r.userForm.password!=null&&r.userForm.password!==void 0&&r.userForm.password!==""&&t.append("password",r.userForm.password),w.value&&t.append("customer_avatar",w.value),t.append("is_customer_avatar_removed",b.value),r.updateCurrentUser({data:t,message:U("settings.account_settings.updated_message")}).then(s=>{s.data.data&&(d.value=!1,r.$patch(V=>{V.userForm.password="",V.userForm.confirm_password=""}),w.value=null,b.value=!1)}).catch(s=>{d.value=!1})}return(t,s)=>{const V=v("BaseFileUploader"),F=v("BaseInputGroup"),B=v("BaseInput"),$=v("BaseIcon"),N=v("BaseButton"),R=v("BaseCard");return c(),G("form",{class:"relative h-full mt-4",onSubmit:z(E,["prevent"])},[u(R,null,{default:i(()=>[I("div",null,[I("h6",Q,C(t.$t("settings.account_settings.account_settings")),1),I("p",W,C(t.$t("settings.account_settings.section_description")),1)]),I("div",X,[u(F,{label:t.$t("settings.account_settings.profile_picture")},{default:i(()=>[u(V,{modelValue:e(f),"onUpdate:modelValue":s[0]||(s[0]=a=>_(f)?f.value=a:f=a),avatar:!0,accept:"image/*",onChange:x,onRemove:M},null,8,["modelValue"])]),_:1},8,["label"]),Y,u(F,{label:t.$t("settings.account_settings.name"),error:e(o).userForm.name.$error&&e(o).userForm.name.$errors[0].$message,required:""},{default:i(()=>[u(B,{modelValue:e(r).userForm.name,"onUpdate:modelValue":s[1]||(s[1]=a=>e(r).userForm.name=a),invalid:e(o).userForm.name.$error,onInput:s[2]||(s[2]=a=>e(o).userForm.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{label:t.$t("settings.account_settings.email"),error:e(o).userForm.email.$error&&e(o).userForm.email.$errors[0].$message,required:""},{default:i(()=>[u(B,{modelValue:e(r).userForm.email,"onUpdate:modelValue":s[3]||(s[3]=a=>e(r).userForm.email=a),invalid:e(o).userForm.email.$error,onInput:s[4]||(s[4]=a=>e(o).userForm.email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),u(F,{error:e(o).userForm.password.$error&&e(o).userForm.password.$errors[0].$message,label:t.$t("settings.account_settings.password")},{default:i(()=>[u(B,{modelValue:e(r).userForm.password,"onUpdate:modelValue":s[7]||(s[7]=a=>e(r).userForm.password=a),type:e(n)?"text":"password",invalid:e(o).userForm.password.$error,onInput:s[8]||(s[8]=a=>e(o).userForm.password.$touch())},{right:i(()=>[e(n)?(c(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[5]||(s[5]=a=>_(n)?n.value=!e(n):n=!e(n))})):(c(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[6]||(s[6]=a=>_(n)?n.value=!e(n):n=!e(n))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["error","label"]),u(F,{label:t.$t("settings.account_settings.confirm_password"),error:e(o).userForm.confirm_password.$error&&e(o).userForm.confirm_password.$errors[0].$message},{default:i(()=>[u(B,{modelValue:e(r).userForm.confirm_password,"onUpdate:modelValue":s[11]||(s[11]=a=>e(r).userForm.confirm_password=a),type:e(l)?"text":"password",invalid:e(o).userForm.confirm_password.$error,onInput:s[12]||(s[12]=a=>e(o).userForm.confirm_password.$touch())},{right:i(()=>[e(l)?(c(),y($,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[9]||(s[9]=a=>_(l)?l.value=!e(l):l=!e(l))})):(c(),y($,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:s[10]||(s[10]=a=>_(l)?l.value=!e(l):l=!e(l))}))]),_:1},8,["modelValue","type","invalid"])]),_:1},8,["label","error"])]),u(N,{loading:e(d),disabled:e(d),class:"mt-6"},{left:i(a=>[e(d)?j("",!0):(c(),y($,{key:0,name:"SaveIcon",class:P(a.class)},null,8,["class"]))]),default:i(()=>[O(" "+C(t.$t("general.save")),1)]),_:1},8,["loading","disabled"])]),_:1})],32)}}};export{ae as default}; diff --git a/public/build/assets/CustomizationSetting-Doi_CNOR.js b/public/build/assets/CustomizationSetting-Doi_CNOR.js deleted file mode 100644 index 470e5434..00000000 --- a/public/build/assets/CustomizationSetting-Doi_CNOR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as P,E as F,G as J,f as z,k as E,z as ne,ao as X,ap as ie,r as d,o as S,c as C,b as r,t as f,a as e,w as u,q as L,J as M,p as D,N as G,O as oe,m as U,l as b,K as R,aq as le,a5 as T,H as k,g as Q,ag as W,ar as Z,j as ee,as as me,at as ue,F as re,a7 as de}from"./main-WMXHPsTs.js";import{D as ce,d as _e}from"./DragIcon-5BDgiv1X.js";import{u as pe}from"./payment-41Om6QZO.js";import{_ as ge}from"./ItemUnitModal-iO02fk5D.js";const ye={class:"text-gray-900 text-lg font-medium"},fe={class:"mt-1 text-sm text-gray-500"},ve={class:"overflow-x-auto"},be={class:"w-full mt-6 table-fixed"},Se=r("colgroup",null,[r("col",{style:{width:"4%"}}),r("col",{style:{width:"45%"}}),r("col",{style:{width:"27%"}}),r("col",{style:{width:"24%"}})],-1),$e=r("thead",null,[r("tr",null,[r("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}),r("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Component "),r("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Parameter "),r("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"})])],-1),Be={class:"relative"},ze={class:"text-gray-300 cursor-move handle align-middle"},he={class:"px-5 py-4"},Ie={class:"block text-sm not-italic font-medium text-primary-800 whitespace-nowrap mr-2 min-w-[200px]"},Ve={class:"text-xs text-gray-500 mt-1"},xe={class:"px-5 py-4 text-left align-middle"},we={class:"px-5 py-4 text-right align-middle pt-10"},Ce={colspan:"2",class:"px-5 py-4"},De={class:"px-5 py-4 text-right align-middle",colspan:"2"},K={__name:"NumberCustomizer",props:{type:{type:String,required:!0},typeStore:{type:Object,required:!0},defaultSeries:{type:String,default:"INV"}},setup(h){const m=h,{t:l}=P.useI18n(),_=F(),g=J(),o=z([]),s=z(!1),i=z([{label:l("settings.customization.series"),description:l("settings.customization.series_description"),name:"SERIES",paramLabel:l("settings.customization.series_param_label"),value:m.defaultSeries,inputDisabled:!1,inputType:"text",allowMultiple:!1},{label:l("settings.customization.sequence"),description:l("settings.customization.sequence_description"),name:"SEQUENCE",paramLabel:l("settings.customization.sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:l("settings.customization.delimiter"),description:l("settings.customization.delimiter_description"),name:"DELIMITER",paramLabel:l("settings.customization.delimiter_param_label"),value:"-",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:l("settings.customization.customer_series"),description:l("settings.customization.customer_series_description"),name:"CUSTOMER_SERIES",paramLabel:"",value:"",inputDisabled:!0,inputType:"text",allowMultiple:!1},{label:l("settings.customization.customer_sequence"),description:l("settings.customization.customer_sequence_description"),name:"CUSTOMER_SEQUENCE",paramLabel:l("settings.customization.customer_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:l("settings.customization.date_format"),description:l("settings.customization.date_format_description"),name:"DATE_FORMAT",paramLabel:l("settings.customization.date_format_param_label"),value:"Y",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:l("settings.customization.random_sequence"),description:l("settings.customization.random_sequence_description"),name:"RANDOM_SEQUENCE",paramLabel:l("settings.customization.random_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1}]),t=E(()=>i.value.filter(function(y){return!o.value.some(function(I){return y.allowMultiple?!1:y.name==I.name})})),c=z(""),a=z(!1),n=z(!1),p=E(()=>{let y="";return o.value.forEach(I=>{let q=`{{${I.name}`;I.value&&(q+=`:${I.value}`),y+=`${q}}}`}),y});ne(o,y=>{N()}),$();async function $(){let y={format:_.selectedCompanySettings[`${m.type}_number_format`]};n.value=!0,(await g.fetchPlaceholders(y)).data.placeholders.forEach(q=>{let j=i.value.find(O=>O.name===q.name);const Y=q.value??"";o.value.push({...j,value:Y,id:X.raw()})}),n.value=!1,N()}function w(y){return o.value.find(I=>I.name===y.name)}function B(y){w(y)&&!y.allowMultiple||(o.value.push({...y,id:X.raw()}),N())}function v(y){o.value=o.value.filter(function(I){return y.id!==I.id})}function x(y,I){switch(I.name){case"SERIES":y.length>=6&&(y=y.substring(0,6));break;case"DELIMITER":y.length>=1&&(y=y.substring(0,1));break}setTimeout(()=>{I.value=y,N()},100)}const N=ie(()=>{H()},500);async function H(){if(!p.value){c.value="";return}let y={key:m.type,format:p.value};a.value=!0;let I=await m.typeStore.getNextNumber(y);a.value=!1,I.data&&(c.value=I.data.nextNumber)}async function te(){if(a.value||n.value)return;s.value=!0;let y={settings:{}};return y.settings[m.type+"_number_format"]=p.value,await _.updateCompanySettings({data:y,message:`settings.customization.${m.type}s.${m.type}_settings_updated`}),s.value=!1,!0}return(y,I)=>{const q=d("BaseInput"),j=d("BaseInputGroup"),Y=d("BaseIcon"),O=d("BaseButton"),se=d("BaseDropdownItem"),ae=d("BaseDropdown");return S(),C(G,null,[r("h6",ye,f(y.$t(`settings.customization.${h.type}s.${h.type}_number_format`)),1),r("p",fe,f(y.$t(`settings.customization.${h.type}s.${h.type}_number_format_description`)),1),r("div",ve,[r("table",be,[Se,$e,e(b(_e),{modelValue:o.value,"onUpdate:modelValue":I[1]||(I[1]=V=>o.value=V),class:"divide-y divide-gray-200","item-key":"id",tag:"tbody",handle:".handle",filter:".ignore-element"},{item:u(({element:V})=>[r("tr",Be,[r("td",ze,[e(ce)]),r("td",he,[r("label",Ie,f(V.label),1),r("p",Ve,f(V.description),1)]),r("td",xe,[e(j,{label:V.paramLabel,class:"lg:col-span-3",required:""},{default:u(()=>[e(q,{modelValue:V.value,"onUpdate:modelValue":[A=>V.value=A,A=>x(A,V)],disabled:V.inputDisabled,type:V.inputType},null,8,["modelValue","onUpdate:modelValue","disabled","type"])]),_:2},1032,["label"])]),r("td",we,[e(O,{variant:"white",onClick:L(A=>v(V),["prevent"])},{left:u(A=>[e(Y,{name:"XIcon",class:M(["!sm:m-0",A.class])},null,8,["class"])]),default:u(()=>[D(" Remove ")]),_:2},1032,["onClick"])])])]),footer:u(()=>[r("tr",null,[r("td",Ce,[e(j,{label:y.$t(`settings.customization.${h.type}s.preview_${h.type}_number`)},{default:u(()=>[e(q,{modelValue:c.value,"onUpdate:modelValue":I[0]||(I[0]=V=>c.value=V),disabled:"",loading:a.value},null,8,["modelValue","loading"])]),_:1},8,["label"])]),r("td",De,[e(ae,{"wrapper-class":"flex items-center justify-end mt-5"},{activator:u(()=>[e(O,{variant:"primary-outline"},{left:u(V=>[e(Y,{class:M(V.class),name:"PlusIcon"},null,8,["class"])]),default:u(()=>[D(" "+f(y.$t("settings.customization.add_new_component")),1)]),_:1})]),default:u(()=>[(S(!0),C(G,null,oe(t.value,V=>(S(),U(se,{key:V.label,onClick:L(A=>B(V),["prevent"])},{default:u(()=>[D(f(V.label),1)]),_:2},1032,["onClick"]))),128))]),_:1})])])]),_:1},8,["modelValue"])])]),e(O,{loading:s.value,disabled:s.value,variant:"primary",type:"submit",class:"mt-4",onClick:te},{left:u(V=>[s.value?R("",!0):(S(),U(Y,{key:0,class:M(V.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(y.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],64)}}},Ee={__name:"InvoicesTabInvoiceNumber",setup(h){const m=le();return(l,_)=>(S(),U(K,{type:"invoice","type-store":b(m),"default-series":"INV"},null,8,["type-store"]))}},Ue={class:"text-gray-900 text-lg font-medium"},Fe={class:"mt-1 text-sm text-gray-500"},Te={__name:"InvoicesTabRetrospective",setup(h){const{t:m,tm:l}=P.useI18n(),_=F(),g=J(),o=T("utils"),s=k({retrospective_edits:null});o.mergeSettings(s,{..._.selectedCompanySettings}),E(()=>g.config.retrospective_edits.map(t=>(t.title=m(t.key),t)));async function i(){let t={settings:{...s}};return await _.updateCompanySettings({data:t,message:"settings.customization.invoices.invoice_settings_updated"}),!0}return(t,c)=>{const a=d("BaseRadio"),n=d("BaseInputGroup");return S(),C(G,null,[r("h6",Ue,f(t.$t("settings.customization.invoices.retrospective_edits")),1),r("p",Fe,f(t.$t("settings.customization.invoices.retrospective_edits_description")),1),e(n,{required:""},{default:u(()=>[e(a,{id:"allow",modelValue:s.retrospective_edits,"onUpdate:modelValue":[c[0]||(c[0]=p=>s.retrospective_edits=p),i],label:t.$t("settings.customization.invoices.allow"),size:"sm",name:"filter",value:"allow",class:"mt-2"},null,8,["modelValue","label"]),e(a,{id:"disable_on_invoice_partial_paid",modelValue:s.retrospective_edits,"onUpdate:modelValue":[c[1]||(c[1]=p=>s.retrospective_edits=p),i],label:t.$t("settings.customization.invoices.disable_on_invoice_partial_paid"),size:"sm",name:"filter",value:"disable_on_invoice_partial_paid",class:"mt-2"},null,8,["modelValue","label"]),e(a,{id:"disable_on_invoice_paid",modelValue:s.retrospective_edits,"onUpdate:modelValue":[c[2]||(c[2]=p=>s.retrospective_edits=p),i],label:t.$t("settings.customization.invoices.disable_on_invoice_paid"),size:"sm",name:"filter",value:"disable_on_invoice_paid",class:"my-2"},null,8,["modelValue","label"]),e(a,{id:"disable_on_invoice_sent",modelValue:s.retrospective_edits,"onUpdate:modelValue":[c[3]||(c[3]=p=>s.retrospective_edits=p),i],label:t.$t("settings.customization.invoices.disable_on_invoice_sent"),size:"sm",name:"filter",value:"disable_on_invoice_sent"},null,8,["modelValue","label"])]),_:1})],64)}}},ke={class:"text-gray-900 text-lg font-medium"},Ne={class:"mt-1 text-sm text-gray-500 mb-2"},Me={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},qe={__name:"InvoicesTabDueDate",setup(h){const{t:m}=P.useI18n(),l=F(),_=T("utils");let g=z(!1);const o=k({invoice_set_due_date_automatically:null,invoice_due_date_days:null});_.mergeSettings(o,{...l.selectedCompanySettings});const s=E({get:()=>o.invoice_set_due_date_automatically==="YES",set:async a=>{const n=a?"YES":"NO";o.invoice_set_due_date_automatically=n}}),i=E(()=>({dueDateSettings:{invoice_due_date_days:{required:Q.withMessage(m("validation.required"),W(s.value)),numeric:Q.withMessage(m("validation.numbers_only"),Z)}}})),t=ee(i,{dueDateSettings:o});async function c(){if(t.value.dueDateSettings.$touch(),t.value.dueDateSettings.$invalid)return!1;g.value=!0;let a={settings:{...o}};return s.value||delete a.settings.invoice_due_date_days,await l.updateCompanySettings({data:a,message:"settings.customization.invoices.invoice_settings_updated"}),g.value=!1,!0}return(a,n)=>{const p=d("BaseSwitchSection"),$=d("BaseInput"),w=d("BaseInputGroup"),B=d("BaseIcon"),v=d("BaseButton");return S(),C("form",{onSubmit:L(c,["prevent"])},[r("h6",ke,f(a.$t("settings.customization.invoices.due_date")),1),r("p",Ne,f(a.$t("settings.customization.invoices.due_date_description")),1),e(p,{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=x=>s.value=x),title:a.$t("settings.customization.invoices.set_due_date_automatically"),description:a.$t("settings.customization.invoices.set_due_date_automatically_description")},null,8,["modelValue","title","description"]),s.value?(S(),U(w,{key:0,label:a.$t("settings.customization.invoices.due_date_days"),error:b(t).dueDateSettings.invoice_due_date_days.$error&&b(t).dueDateSettings.invoice_due_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:u(()=>[r("div",Me,[e($,{modelValue:o.invoice_due_date_days,"onUpdate:modelValue":n[1]||(n[1]=x=>o.invoice_due_date_days=x),invalid:b(t).dueDateSettings.invoice_due_date_days.$error,type:"number",onInput:n[2]||(n[2]=x=>b(t).dueDateSettings.invoice_due_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),e(v,{loading:b(g),disabled:b(g),variant:"primary",type:"submit",class:"mt-4"},{left:u(x=>[b(g)?R("",!0):(S(),U(B,{key:0,class:M(x.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(a.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],32)}}},Ge={class:"text-gray-900 text-lg font-medium"},Re={class:"mt-1 text-sm text-gray-500 mb-2"},Ae={__name:"InvoicesTabDefaultFormats",setup(h){const m=F(),l=T("utils"),_=z(["customer","customerCustom","invoice","invoiceCustom","company"]),g=z(["billing","customer","customerCustom","invoiceCustom"]),o=z(["shipping","customer","customerCustom","invoiceCustom"]),s=z(["company","invoiceCustom"]);let i=z(!1);const t=k({invoice_mail_body:null,invoice_company_address_format:null,invoice_shipping_address_format:null,invoice_billing_address_format:null});l.mergeSettings(t,{...m.selectedCompanySettings});async function c(){i.value=!0;let a={settings:{...t}};return await m.updateCompanySettings({data:a,message:"settings.customization.invoices.invoice_settings_updated"}),i.value=!1,!0}return(a,n)=>{const p=d("BaseCustomInput"),$=d("BaseInputGroup"),w=d("BaseIcon"),B=d("BaseButton");return S(),C("form",{onSubmit:L(c,["prevent"])},[r("h6",Ge,f(a.$t("settings.customization.invoices.default_formats")),1),r("p",Re,f(a.$t("settings.customization.invoices.default_formats_description")),1),e($,{label:a.$t("settings.customization.invoices.default_invoice_email_body"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.invoice_mail_body,"onUpdate:modelValue":n[0]||(n[0]=v=>t.invoice_mail_body=v),fields:_.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.invoices.company_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.invoice_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=v=>t.invoice_company_address_format=v),fields:s.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.invoices.shipping_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.invoice_shipping_address_format,"onUpdate:modelValue":n[2]||(n[2]=v=>t.invoice_shipping_address_format=v),fields:o.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.invoices.billing_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.invoice_billing_address_format,"onUpdate:modelValue":n[3]||(n[3]=v=>t.invoice_billing_address_format=v),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e(B,{loading:b(i),disabled:b(i),variant:"primary",type:"submit",class:"mt-4"},{left:u(v=>[b(i)?R("",!0):(S(),U(w,{key:0,class:M(v.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(a.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],32)}}},Le={class:"divide-y divide-gray-200"},Pe={__name:"InvoicesTab",setup(h){const m=T("utils"),l=F(),_=k({invoice_email_attachment:null});m.mergeSettings(_,{...l.selectedCompanySettings});const g=E({get:()=>_.invoice_email_attachment==="YES",set:async o=>{const s=o?"YES":"NO";let i={settings:{invoice_email_attachment:s}};_.invoice_email_attachment=s,await l.updateCompanySettings({data:i,message:"general.setting_updated"})}});return(o,s)=>{const i=d("BaseDivider"),t=d("BaseSwitchSection");return S(),C(G,null,[e(Ee),e(i,{class:"my-8"}),e(qe),e(i,{class:"my-8"}),e(Te),e(i,{class:"my-8"}),e(Ae),e(i,{class:"mt-6 mb-2"}),r("ul",Le,[e(t,{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=c=>g.value=c),title:o.$t("settings.customization.invoices.invoice_email_attachment"),description:o.$t("settings.customization.invoices.invoice_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},Ye={__name:"EstimatesTabEstimateNumber",setup(h){const m=me();return(l,_)=>(S(),U(K,{type:"estimate","type-store":b(m),"default-series":"EST"},null,8,["type-store"]))}},Oe={class:"text-gray-900 text-lg font-medium"},je={class:"mt-1 text-sm text-gray-500 mb-2"},Qe={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},He={__name:"EstimatesTabExpiryDate",setup(h){const{t:m}=P.useI18n(),l=F(),_=T("utils");let g=z(!1);const o=k({estimate_set_expiry_date_automatically:null,estimate_expiry_date_days:null});_.mergeSettings(o,{...l.selectedCompanySettings});const s=E({get:()=>o.estimate_set_expiry_date_automatically==="YES",set:async a=>{const n=a?"YES":"NO";o.estimate_set_expiry_date_automatically=n}}),i=E(()=>({expiryDateSettings:{estimate_expiry_date_days:{required:Q.withMessage(m("validation.required"),W(s.value)),numeric:Q.withMessage(m("validation.numbers_only"),Z)}}})),t=ee(i,{expiryDateSettings:o});async function c(){if(t.value.expiryDateSettings.$touch(),t.value.expiryDateSettings.$invalid)return!1;g.value=!0;let a={settings:{...o}};return s.value||delete a.settings.estimate_expiry_date_days,await l.updateCompanySettings({data:a,message:"settings.customization.estimates.estimate_settings_updated"}),g.value=!1,!0}return(a,n)=>{const p=d("BaseSwitchSection"),$=d("BaseInput"),w=d("BaseInputGroup"),B=d("BaseIcon"),v=d("BaseButton");return S(),C("form",{onSubmit:L(c,["prevent"])},[r("h6",Oe,f(a.$t("settings.customization.estimates.expiry_date")),1),r("p",je,f(a.$t("settings.customization.estimates.expiry_date_description")),1),e(p,{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=x=>s.value=x),title:a.$t("settings.customization.estimates.set_expiry_date_automatically"),description:a.$t("settings.customization.estimates.set_expiry_date_automatically_description")},null,8,["modelValue","title","description"]),s.value?(S(),U(w,{key:0,label:a.$t("settings.customization.estimates.expiry_date_days"),error:b(t).expiryDateSettings.estimate_expiry_date_days.$error&&b(t).expiryDateSettings.estimate_expiry_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:u(()=>[r("div",Qe,[e($,{modelValue:o.estimate_expiry_date_days,"onUpdate:modelValue":n[1]||(n[1]=x=>o.estimate_expiry_date_days=x),invalid:b(t).expiryDateSettings.estimate_expiry_date_days.$error,type:"number",onInput:n[2]||(n[2]=x=>b(t).expiryDateSettings.estimate_expiry_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),e(v,{loading:b(g),disabled:b(g),variant:"primary",type:"submit",class:"mt-4"},{left:u(x=>[b(g)?R("",!0):(S(),U(B,{key:0,class:M(x.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(a.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],32)}}},Je={class:"text-gray-900 text-lg font-medium"},Ke={class:"mt-1 text-sm text-gray-500 mb-2"},Xe={__name:"EstimatesTabDefaultFormats",setup(h){const m=F(),l=T("utils"),_=z(["customer","customerCustom","estimate","estimateCustom","company"]),g=z(["billing","customer","customerCustom","estimateCustom"]),o=z(["shipping","customer","customerCustom","estimateCustom"]),s=z(["company","estimateCustom"]);let i=z(!1);const t=k({estimate_mail_body:null,estimate_company_address_format:null,estimate_shipping_address_format:null,estimate_billing_address_format:null});l.mergeSettings(t,{...m.selectedCompanySettings});async function c(){i.value=!0;let a={settings:{...t}};return await m.updateCompanySettings({data:a,message:"settings.customization.estimates.estimate_settings_updated"}),i.value=!1,!0}return(a,n)=>{const p=d("BaseCustomInput"),$=d("BaseInputGroup"),w=d("BaseIcon"),B=d("BaseButton");return S(),C("form",{onSubmit:L(c,["prevent"])},[r("h6",Je,f(a.$t("settings.customization.estimates.default_formats")),1),r("p",Ke,f(a.$t("settings.customization.estimates.default_formats_description")),1),e($,{label:a.$t("settings.customization.estimates.default_estimate_email_body"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.estimate_mail_body,"onUpdate:modelValue":n[0]||(n[0]=v=>t.estimate_mail_body=v),fields:_.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.estimates.company_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.estimate_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=v=>t.estimate_company_address_format=v),fields:s.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.estimates.shipping_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.estimate_shipping_address_format,"onUpdate:modelValue":n[2]||(n[2]=v=>t.estimate_shipping_address_format=v),fields:o.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e($,{label:a.$t("settings.customization.estimates.billing_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(p,{modelValue:t.estimate_billing_address_format,"onUpdate:modelValue":n[3]||(n[3]=v=>t.estimate_billing_address_format=v),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e(B,{loading:b(i),disabled:b(i),variant:"primary",type:"submit",class:"mt-4"},{left:u(v=>[b(i)?R("",!0):(S(),U(w,{key:0,class:M(v.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(a.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],32)}}},We={class:"text-gray-900 text-lg font-medium"},Ze={class:"mt-1 text-sm text-gray-500"},et={__name:"EstimatesTabConvertEstimate",setup(h){const{t:m,tm:l}=P.useI18n(),_=F(),g=J(),o=T("utils"),s=k({estimate_convert_action:null});o.mergeSettings(s,{..._.selectedCompanySettings}),E(()=>g.config.estimate_convert_action.map(t=>(t.title=m(t.key),t)));async function i(){let t={settings:{...s}};return await _.updateCompanySettings({data:t,message:"settings.customization.estimates.estimate_settings_updated"}),!0}return(t,c)=>{const a=d("BaseRadio"),n=d("BaseInputGroup");return S(),C(G,null,[r("h6",We,f(t.$t("settings.customization.estimates.convert_estimate_options")),1),r("p",Ze,f(t.$t("settings.customization.estimates.convert_estimate_description")),1),e(n,{required:""},{default:u(()=>[e(a,{id:"no_action",modelValue:s.estimate_convert_action,"onUpdate:modelValue":[c[0]||(c[0]=p=>s.estimate_convert_action=p),i],label:t.$t("settings.customization.estimates.no_action"),size:"sm",name:"filter",value:"no_action",class:"mt-2"},null,8,["modelValue","label"]),e(a,{id:"delete_estimate",modelValue:s.estimate_convert_action,"onUpdate:modelValue":[c[1]||(c[1]=p=>s.estimate_convert_action=p),i],label:t.$t("settings.customization.estimates.delete_estimate"),size:"sm",name:"filter",value:"delete_estimate",class:"my-2"},null,8,["modelValue","label"]),e(a,{id:"mark_estimate_as_accepted",modelValue:s.estimate_convert_action,"onUpdate:modelValue":[c[2]||(c[2]=p=>s.estimate_convert_action=p),i],label:t.$t("settings.customization.estimates.mark_estimate_as_accepted"),size:"sm",name:"filter",value:"mark_estimate_as_accepted"},null,8,["modelValue","label"])]),_:1})],64)}}},tt={class:"divide-y divide-gray-200"},st={__name:"EstimatesTab",setup(h){const m=T("utils"),l=F(),_=k({estimate_email_attachment:null});m.mergeSettings(_,{...l.selectedCompanySettings});const g=E({get:()=>_.estimate_email_attachment==="YES",set:async o=>{const s=o?"YES":"NO";let i={settings:{estimate_email_attachment:s}};_.estimate_email_attachment=s,await l.updateCompanySettings({data:i,message:"general.setting_updated"})}});return(o,s)=>{const i=d("BaseDivider"),t=d("BaseSwitchSection");return S(),C(G,null,[e(Ye),e(i,{class:"my-8"}),e(He),e(i,{class:"my-8"}),e(et),e(i,{class:"my-8"}),e(Xe),e(i,{class:"mt-6 mb-2"}),r("ul",tt,[e(t,{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=c=>g.value=c),title:o.$t("settings.customization.estimates.estimate_email_attachment"),description:o.$t("settings.customization.estimates.estimate_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},at={__name:"PaymentsTabPaymentNumber",setup(h){const m=pe();return(l,_)=>(S(),U(K,{type:"payment","type-store":b(m),"default-series":"PAY"},null,8,["type-store"]))}},nt={class:"text-gray-900 text-lg font-medium"},it={class:"mt-1 text-sm text-gray-500 mb-2"},ot={__name:"PaymentsTabDefaultFormats",setup(h){const m=F(),l=T("utils"),_=z(["customer","customerCustom","company","payment","paymentCustom"]),g=z(["billing","customer","customerCustom","paymentCustom"]),o=z(["company","paymentCustom"]);let s=z(!1);const i=k({payment_mail_body:null,payment_company_address_format:null,payment_from_customer_address_format:null});l.mergeSettings(i,{...m.selectedCompanySettings});async function t(){s.value=!0;let c={settings:{...i}};return await m.updateCompanySettings({data:c,message:"settings.customization.payments.payment_settings_updated"}),s.value=!1,!0}return(c,a)=>{const n=d("BaseCustomInput"),p=d("BaseInputGroup"),$=d("BaseIcon"),w=d("BaseButton");return S(),C("form",{onSubmit:L(t,["prevent"])},[r("h6",nt,f(c.$t("settings.customization.payments.default_formats")),1),r("p",it,f(c.$t("settings.customization.payments.default_formats_description")),1),e(p,{label:c.$t("settings.customization.payments.default_payment_email_body"),class:"mt-6 mb-4"},{default:u(()=>[e(n,{modelValue:i.payment_mail_body,"onUpdate:modelValue":a[0]||(a[0]=B=>i.payment_mail_body=B),fields:_.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e(p,{label:c.$t("settings.customization.payments.company_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(n,{modelValue:i.payment_company_address_format,"onUpdate:modelValue":a[1]||(a[1]=B=>i.payment_company_address_format=B),fields:o.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e(p,{label:c.$t("settings.customization.payments.from_customer_address_format"),class:"mt-6 mb-4"},{default:u(()=>[e(n,{modelValue:i.payment_from_customer_address_format,"onUpdate:modelValue":a[2]||(a[2]=B=>i.payment_from_customer_address_format=B),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),e(w,{loading:b(s),disabled:b(s),variant:"primary",type:"submit",class:"mt-4"},{left:u(B=>[b(s)?R("",!0):(S(),U($,{key:0,class:M(B.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+f(c.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],32)}}},lt={class:"divide-y divide-gray-200"},mt={__name:"PaymentsTab",setup(h){const m=T("utils"),l=F(),_=k({payment_email_attachment:null});m.mergeSettings(_,{...l.selectedCompanySettings});const g=E({get:()=>_.payment_email_attachment==="YES",set:async o=>{const s=o?"YES":"NO";let i={settings:{payment_email_attachment:s}};_.payment_email_attachment=s,await l.updateCompanySettings({data:i,message:"general.setting_updated"})}});return(o,s)=>{const i=d("BaseDivider"),t=d("BaseSwitchSection");return S(),C(G,null,[e(at),e(i,{class:"my-8"}),e(ot),e(i,{class:"mt-6 mb-2"}),r("ul",lt,[e(t,{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=c=>g.value=c),title:o.$t("settings.customization.payments.payment_email_attachment"),description:o.$t("settings.customization.payments.payment_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ut={class:"flex flex-wrap justify-end mt-2 lg:flex-nowrap"},rt={class:"inline-block"},dt={__name:"ItemsTab",setup(h){const{t:m}=P.useI18n(),l=z(null),_=ue(),g=re(),o=de(),s=E(()=>[{key:"name",label:m("settings.customization.items.unit_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function i({page:n,filter:p,sort:$}){let w={orderByField:$.fieldName||"created_at",orderBy:$.order||"desc",page:n},B=await _.fetchItemUnits(w);return{data:B.data.data,pagination:{totalPages:B.data.meta.last_page,currentPage:n,totalCount:B.data.meta.total,limit:5}}}async function t(){g.openModal({title:m("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",refreshData:l.value.refresh,size:"sm"})}async function c(n){_.fetchItemUnit(n.data.id),g.openModal({title:m("settings.customization.items.edit_item_unit"),componentName:"ItemUnitModal",id:n.data.id,data:n.data,refreshData:l.value&&l.value.refresh})}function a(n){o.openDialog({title:m("general.are_you_sure"),message:m("settings.customization.items.item_unit_confirm_delete"),yesLabel:m("general.yes"),noLabel:m("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async p=>{p&&(await _.deleteItemUnit(n.data.id),l.value&&l.value.refresh())})}return(n,p)=>{const $=d("BaseIcon"),w=d("BaseButton"),B=d("BaseDropdownItem"),v=d("BaseDropdown"),x=d("BaseTable");return S(),C(G,null,[e(ge),r("div",ut,[e(w,{variant:"primary-outline",onClick:t},{left:u(N=>[e($,{class:M(N.class),name:"PlusIcon"},null,8,["class"])]),default:u(()=>[D(" "+f(n.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),e(x,{ref_key:"table",ref:l,class:"mt-10",data:i,columns:s.value},{"cell-actions":u(({row:N})=>[e(v,null,{activator:u(()=>[r("div",rt,[e($,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:u(()=>[e(B,{onClick:H=>c(N)},{default:u(()=>[e($,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+f(n.$t("general.edit")),1)]),_:2},1032,["onClick"]),e(B,{onClick:H=>a(N)},{default:u(()=>[e($,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+f(n.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])],64)}}},ct={class:"relative"},ft={__name:"CustomizationSetting",setup(h){return(m,l)=>{const _=d("BaseTab"),g=d("BaseTabGroup"),o=d("BaseCard");return S(),C("div",ct,[e(o,{"container-class":"px-4 py-5 sm:px-8 sm:py-2"},{default:u(()=>[e(g,null,{default:u(()=>[e(_,{"tab-panel-container":"py-4 mt-px",title:m.$t("settings.customization.invoices.title")},{default:u(()=>[e(Pe)]),_:1},8,["title"]),e(_,{"tab-panel-container":"py-4 mt-px",title:m.$t("settings.customization.estimates.title")},{default:u(()=>[e(st)]),_:1},8,["title"]),e(_,{"tab-panel-container":"py-4 mt-px",title:m.$t("settings.customization.payments.title")},{default:u(()=>[e(mt)]),_:1},8,["title"]),e(_,{"tab-panel-container":"py-4 mt-px",title:m.$t("settings.customization.items.title")},{default:u(()=>[e(dt)]),_:1},8,["title"])]),_:1})]),_:1})])}}};export{ft as default}; diff --git a/public/build/assets/Dashboard-4t0kORFb.js b/public/build/assets/Dashboard-4t0kORFb.js deleted file mode 100644 index ffbc78b8..00000000 --- a/public/build/assets/Dashboard-4t0kORFb.js +++ /dev/null @@ -1 +0,0 @@ -import{D as L,_ as H,a as M}from"./EstimateIcon-YddV57H2.js";import{o as m,c as v,J as D,b as r,s as V,Z as S,r as i,m as h,w as s,a as t,a2 as F,t as u,a3 as T,a5 as k,l,p as _,v as z,L as Z,k as $}from"./main-WMXHPsTs.js";import{u as C}from"./global-VOW0aAlU.js";import{h as A}from"./auth-CmUq6Ysp.js";import w from"./BaseTable-ePsFhhtw.js";const q=r("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),N=r("path",{d:"M17.8 17.8C17.1635 17.8 16.5531 18.0529 16.103 18.503C15.6529 18.9531 15.4 19.5635 15.4 20.2V21.4H34.6V20.2C34.6 19.5635 34.3472 18.9531 33.8971 18.503C33.447 18.0529 32.8365 17.8 32.2 17.8H17.8Z",fill:"currentColor"},null,-1),O=r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M34.6 23.8H15.4V29.8C15.4 30.4366 15.6529 31.047 16.103 31.4971C16.5531 31.9472 17.1635 32.2 17.8 32.2H32.2C32.8365 32.2 33.447 31.9472 33.8971 31.4971C34.3472 31.047 34.6 30.4366 34.6 29.8V23.8ZM17.8 28.6C17.8 28.2818 17.9265 27.9766 18.1515 27.7515C18.3765 27.5265 18.6818 27.4 19 27.4H20.2C20.5183 27.4 20.8235 27.5265 21.0486 27.7515C21.2736 27.9766 21.4 28.2818 21.4 28.6C21.4 28.9183 21.2736 29.2235 21.0486 29.4486C20.8235 29.6736 20.5183 29.8 20.2 29.8H19C18.6818 29.8 18.3765 29.6736 18.1515 29.4486C17.9265 29.2235 17.8 28.9183 17.8 28.6ZM23.8 27.4C23.4818 27.4 23.1765 27.5265 22.9515 27.7515C22.7265 27.9766 22.6 28.2818 22.6 28.6C22.6 28.9183 22.7265 29.2235 22.9515 29.4486C23.1765 29.6736 23.4818 29.8 23.8 29.8H25C25.3183 29.8 25.6235 29.6736 25.8486 29.4486C26.0736 29.2235 26.2 28.9183 26.2 28.6C26.2 28.2818 26.0736 27.9766 25.8486 27.7515C25.6235 27.5265 25.3183 27.4 25 27.4H23.8Z",fill:"currentColor"},null,-1),G=[q,N,O],J={__name:"PaymentIcon",props:{colorClass:{type:String,default:"text-primary-500"}},setup(c){return(a,o)=>(m(),v("svg",{width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:D(c.colorClass)},G,2))}},{defineStore:R}=window.pinia,P=R({id:"dashboard",state:()=>({recentInvoices:[],recentEstimates:[],invoiceCount:0,estimateCount:0,paymentCount:0,totalDueAmount:[],isDashboardDataLoaded:!1}),actions:{loadData(c){const a=C();return new Promise((o,d)=>{V.get(`/api/v1/${a.companySlug}/customer/dashboard`,{data:c}).then(e=>{this.totalDueAmount=e.data.due_amount,this.estimateCount=e.data.estimate_count,this.invoiceCount=e.data.invoice_count,this.paymentCount=e.data.payment_count,this.recentInvoices=e.data.recentInvoices,this.recentEstimates=e.data.recentEstimates,a.getDashboardDataLoaded=!0,o(e)}).catch(e=>{A(e),d(e)})})}}}),K={},Q={class:"flex items-center"};function U(c,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:s(()=>[r("div",null,[t(o,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"h-3 w-28 xl:h-4",lines:1})]),r("div",Q,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const W=S(K,[["render",U]]),X={},Y={class:"flex items-center"};function ee(c,a){const o=i("BaseContentPlaceholdersText"),d=i("BaseContentPlaceholdersBox"),e=i("BaseContentPlaceholders");return m(),h(e,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:s(()=>[r("div",null,[t(o,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),t(o,{class:"w-20 h-3 xl:h-4",lines:1})]),r("div",Y,[t(d,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const te=S(X,[["render",ee]]),ae={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},se={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},oe={class:"flex items-center"},g={__name:"DashboardStatsItem",props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:Object,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(c){return(a,o)=>{const d=i("router-link");return c.loading?c.large?(m(),h(W,{key:1})):(m(),h(te,{key:2})):(m(),h(d,{key:0,class:D(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":c.large}]),to:c.route},{default:s(()=>[r("div",null,[r("span",ae,[F(a.$slots,"default")]),r("span",se,u(c.label),1)]),r("div",oe,[(m(),h(T(c.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},ne={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},le={__name:"DashboardStats",setup(c){k("utils");const a=C(),o=P();return o.loadData(),(d,e)=>{const f=i("BaseFormatMoney");return m(),v("div",ne,[t(g,{"icon-component":L,loading:!l(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},large:!0,label:d.$t("dashboard.cards.due_amount")},{default:s(()=>[t(f,{amount:l(o).totalDueAmount,currency:l(a).currency},null,8,["amount","currency"])]),_:1},8,["loading","route","label"]),t(g,{"icon-component":H,loading:!l(a).getDashboardDataLoaded,route:{name:"invoices.dashboard"},label:d.$t("dashboard.cards.invoices")},{default:s(()=>[_(u(l(o).invoiceCount),1)]),_:1},8,["loading","route","label"]),t(g,{"icon-component":M,loading:!l(a).getDashboardDataLoaded,route:{name:"estimates.dashboard"},label:d.$t("dashboard.cards.estimates")},{default:s(()=>[_(u(l(o).estimateCount),1)]),_:1},8,["loading","route","label"]),t(g,{"icon-component":J,loading:!l(a).getDashboardDataLoaded,route:{name:"payments.dashboard"},label:d.$t("dashboard.cards.payments")},{default:s(()=>[_(u(l(o).paymentCount),1)]),_:1},8,["loading","route","label"])])}}},re={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},ce={class:"due-invoices"},de={class:"relative z-10 flex items-center justify-between mb-3"},ie={class:"mb-0 text-xl font-semibold leading-normal"},ue={class:"recent-estimates"},me={class:"relative z-10 flex items-center justify-between mb-3"},_e={class:"mb-0 text-xl font-semibold leading-normal"},he={__name:"DashboardTable",setup(c){const a=C(),o=P(),{tm:d,t:e}=z.useI18n();k("utils"),Z();const f=$(()=>[{key:"formattedDueDate",label:e("dashboard.recent_invoices_card.due_on")},{key:"invoice_number",label:e("invoices.number")},{key:"paid_status",label:e("invoices.status")},{key:"due_amount",label:e("dashboard.recent_invoices_card.amount_due")}]),E=$(()=>[{key:"formattedEstimateDate",label:e("dashboard.recent_estimate_card.date")},{key:"estimate_number",label:e("estimates.number")},{key:"status",label:e("estimates.status")},{key:"total",label:e("dashboard.recent_estimate_card.amount_due")}]);return(b,p)=>{const y=i("BaseButton"),x=i("router-link"),I=i("BasePaidStatusBadge"),B=i("BaseFormatMoney"),j=i("BaseEstimateStatusBadge");return m(),v("div",re,[r("div",ce,[r("div",de,[r("h6",ie,u(b.$t("dashboard.recent_invoices_card.title")),1),t(y,{size:"sm",variant:"primary-outline",onClick:p[0]||(p[0]=n=>b.$router.push({name:"invoices.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),t(w,{data:l(o).recentInvoices,columns:f.value,loading:!l(a).getDashboardDataLoaded},{"cell-invoice_number":s(({row:n})=>[t(x,{to:{path:`/${l(a).companySlug}/customer/invoices/${n.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(n.data.invoice_number),1)]),_:2},1032,["to"])]),"cell-paid_status":s(({row:n})=>[t(I,{status:n.data.paid_status},{default:s(()=>[_(u(n.data.paid_status),1)]),_:2},1032,["status"])]),"cell-due_amount":s(({row:n})=>[t(B,{amount:n.data.due_amount,currency:l(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])]),r("div",ue,[r("div",me,[r("h6",_e,u(b.$t("dashboard.recent_estimate_card.title")),1),t(y,{variant:"primary-outline",size:"sm",onClick:p[1]||(p[1]=n=>b.$router.push({name:"estimates.dashboard"}))},{default:s(()=>[_(u(b.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),t(w,{data:l(o).recentEstimates,columns:E.value,loading:!l(a).getDashboardDataLoaded},{"cell-estimate_number":s(({row:n})=>[t(x,{to:{path:`/${l(a).companySlug}/customer/estimates/${n.data.id}/view`},class:"font-medium text-primary-500"},{default:s(()=>[_(u(n.data.estimate_number),1)]),_:2},1032,["to"])]),"cell-status":s(({row:n})=>[t(j,{status:n.data.status,class:"px-3 py-1"},{default:s(()=>[_(u(n.data.status),1)]),_:2},1032,["status"])]),"cell-total":s(({row:n})=>[t(B,{amount:n.data.total,currency:l(a).currency},null,8,["amount","currency"])]),_:1},8,["data","columns","loading"])])])}}},Ce={__name:"Dashboard",setup(c){return(a,o)=>{const d=i("BasePage");return m(),h(d,null,{default:s(()=>[t(le),t(he)]),_:1})}}};export{Ce as default}; diff --git a/public/build/assets/Dashboard-e83T2oy4.js b/public/build/assets/Dashboard-e83T2oy4.js deleted file mode 100644 index 8b9f7889..00000000 --- a/public/build/assets/Dashboard-e83T2oy4.js +++ /dev/null @@ -1 +0,0 @@ -import{D as L,_ as F,a as R}from"./EstimateIcon-YddV57H2.js";import{o as c,c as C,J as j,b as t,Z as T,r as i,m as p,w as r,a,a2 as W,t as h,a3 as z,a4 as q,s as H,a1 as U,a5 as N,E as O,M as B,l as e,Q as m,K as v,p as y,f as E,z as Z,v as Y,k as V,a6 as M,L as J,e as K,Y as Q}from"./main-WMXHPsTs.js";import{_ as G}from"./LineChart-SqnrSwOJ.js";import{_ as X}from"./InvoiceIndexDropdown-0fSeYILf.js";import{_ as tt}from"./EstimateIndexDropdown-3kRrr45C.js";const et=t("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),at=t("path",{d:"M28.2656 23.0547C27.3021 24.0182 26.1302 24.5 24.75 24.5C23.3698 24.5 22.1849 24.0182 21.1953 23.0547C20.2318 22.0651 19.75 20.8802 19.75 19.5C19.75 18.1198 20.2318 16.9479 21.1953 15.9844C22.1849 14.9948 23.3698 14.5 24.75 14.5C26.1302 14.5 27.3021 14.9948 28.2656 15.9844C29.2552 16.9479 29.75 18.1198 29.75 19.5C29.75 20.8802 29.2552 22.0651 28.2656 23.0547ZM28.2656 25.75C29.6979 25.75 30.9219 26.2708 31.9375 27.3125C32.9792 28.3281 33.5 29.5521 33.5 30.9844V32.625C33.5 33.1458 33.3177 33.5885 32.9531 33.9531C32.5885 34.3177 32.1458 34.5 31.625 34.5H17.875C17.3542 34.5 16.9115 34.3177 16.5469 33.9531C16.1823 33.5885 16 33.1458 16 32.625V30.9844C16 29.5521 16.5078 28.3281 17.5234 27.3125C18.5651 26.2708 19.8021 25.75 21.2344 25.75H21.8984C22.8099 26.1667 23.7604 26.375 24.75 26.375C25.7396 26.375 26.6901 26.1667 27.6016 25.75H28.2656Z",fill:"currentColor"},null,-1),st=[et,at],ot={__name:"CustomerIcon",props:{colorClass:{type:String,default:"text-primary-500"}},setup(d){return(o,s)=>(c(),C("svg",{width:"50",height:"50",viewBox:"0 0 50 50",class:j(d.colorClass),fill:"none",xmlns:"http://www.w3.org/2000/svg"},st,2))}},lt={},nt={class:"flex items-center"};function ct(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:r(()=>[t("div",null,[a(s,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"h-3 w-28 xl:h-4",lines:1})]),t("div",nt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const rt=T(lt,[["render",ct]]),it={},dt={class:"flex items-center"};function ut(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:r(()=>[t("div",null,[a(s,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),a(s,{class:"w-20 h-3 xl:h-4",lines:1})]),t("div",dt,[a(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}const _t=T(it,[["render",ut]]),mt={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},ht={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},pt={class:"flex items-center"},$={__name:"DashboardStatsItem",props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:String,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(d){return(o,s)=>{const n=i("router-link");return d.loading?d.large?(c(),p(rt,{key:1})):(c(),p(_t,{key:2})):(c(),p(n,{key:0,class:j(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":d.large}]),to:d.route},{default:r(()=>[t("div",null,[t("span",mt,[W(o.$slots,"default")]),t("span",ht,h(d.label),1)]),t("div",pt,[(c(),p(z(d.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},S=(d=!1)=>(d?window.pinia.defineStore:q)({id:"dashboard",state:()=>({stats:{totalAmountDue:0,totalCustomerCount:0,totalInvoiceCount:0,totalEstimateCount:0},chartData:{months:[],invoiceTotals:[],expenseTotals:[],receiptTotals:[],netIncomeTotals:[]},totalSales:null,totalReceipts:null,totalExpenses:null,totalNetIncome:null,recentDueInvoices:[],recentEstimates:[],isDashboardDataLoaded:!1}),actions:{loadData(s){return new Promise((n,u)=>{H.get("/api/v1/dashboard",{params:s}).then(l=>{this.stats.totalAmountDue=l.data.total_amount_due,this.stats.totalCustomerCount=l.data.total_customer_count,this.stats.totalInvoiceCount=l.data.total_invoice_count,this.stats.totalEstimateCount=l.data.total_estimate_count,this.chartData&&l.data.chart_data&&(this.chartData.months=l.data.chart_data.months,this.chartData.invoiceTotals=l.data.chart_data.invoice_totals,this.chartData.expenseTotals=l.data.chart_data.expense_totals,this.chartData.receiptTotals=l.data.chart_data.receipt_totals,this.chartData.netIncomeTotals=l.data.chart_data.net_income_totals),this.totalSales=l.data.total_sales,this.totalReceipts=l.data.total_receipts,this.totalExpenses=l.data.total_expenses,this.totalNetIncome=l.data.total_net_income,this.recentDueInvoices=l.data.recent_due_invoices,this.recentEstimates=l.data.recent_estimates,this.isDashboardDataLoaded=!0,n(l)}).catch(l=>{U(l),u(l)})})}}})(),bt={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},xt={__name:"DashboardStats",setup(d){N("utils");const o=S(),s=O(),n=B();return(u,l)=>{const f=i("BaseFormatMoney");return c(),C("div",bt,[e(n).hasAbilities(e(m).VIEW_INVOICE)?(c(),p($,{key:0,"icon-component":L,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",large:!0,label:u.$t("dashboard.cards.due_amount")},{default:r(()=>[a(f,{amount:e(o).stats.totalAmountDue,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(m).VIEW_CUSTOMER)?(c(),p($,{key:1,"icon-component":ot,loading:!e(o).isDashboardDataLoaded,route:"/admin/customers",label:u.$t("dashboard.cards.customers")},{default:r(()=>[y(h(e(o).stats.totalCustomerCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(m).VIEW_INVOICE)?(c(),p($,{key:2,"icon-component":F,loading:!e(o).isDashboardDataLoaded,route:"/admin/invoices",label:u.$t("dashboard.cards.invoices")},{default:r(()=>[y(h(e(o).stats.totalInvoiceCount),1)]),_:1},8,["loading","label"])):v("",!0),e(n).hasAbilities(e(m).VIEW_ESTIMATE)?(c(),p($,{key:3,"icon-component":R,loading:!e(o).isDashboardDataLoaded,route:"/admin/estimates",label:u.$t("dashboard.cards.estimates")},{default:r(()=>[y(h(e(o).stats.totalEstimateCount),1)]),_:1},8,["loading","label"])):v("",!0)])}}},ft={},gt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-8"},yt={class:"flex items-center justify-between mb-2 xl:mb-4"},Ct={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},vt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},wt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Dt={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},$t={class:"flex flex-col items-center justify-center col-span-3 p-6 border-t border-gray-200 border-solid lg:justify-end lg:items-end lg:col-span-1"};function Et(d,o){const s=i("BaseContentPlaceholdersText"),n=i("BaseContentPlaceholdersBox"),u=i("BaseContentPlaceholders");return c(),p(u,{class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},{default:r(()=>[t("div",gt,[t("div",yt,[a(s,{class:"h-10 w-36",lines:1}),a(s,{class:"h-10 w-36 !mt-0",lines:1})]),a(n,{class:"h-80 xl:h-72 sm:w-full"})]),t("div",Ct,[t("div",vt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",wt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",Dt,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})]),t("div",$t,[a(s,{class:"h-3 w-14 xl:h-4",lines:1}),a(s,{class:"w-20 h-5 xl:h-6",lines:1})])])]),_:1})}const Bt=T(ft,[["render",Et]]),It={key:0,class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},Tt={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-6"},St={class:"flex justify-between mt-1 mb-4 flex-col md:flex-row"},kt={class:"flex items-center sw-section-title h-10"},At={class:"w-full my-2 md:m-0 md:w-40 h-10"},Pt={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Vt={class:"p-6"},Mt={class:"text-xs leading-5 lg:text-sm"},jt=t("br",null,null,-1),Nt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl"},Ot={class:"p-6"},Lt={class:"text-xs leading-5 lg:text-sm"},Ft=t("br",null,null,-1),Rt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-green-400"},Wt={class:"p-6"},zt={class:"text-xs leading-5 lg:text-sm"},qt=t("br",null,null,-1),Ht={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-red-400"},Ut={class:"col-span-3 p-6 border-t border-gray-200 border-solid lg:col-span-1"},Zt={class:"text-xs leading-5 lg:text-sm"},Yt=t("br",null,null,-1),Jt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-primary-500"},Kt={__name:"DashboardChart",setup(d){const o=S(),s=O();N("utils");const n=B(),u=E(["This year","Previous year"]),l=E("This year");Z(l,b=>{b==="Previous year"?f({previous_year:!0}):f()},{immediate:!0});async function f(b){n.hasAbilities(m.DASHBOARD)&&await o.loadData(b)}return(b,w)=>{const I=i("BaseIcon"),g=i("BaseMultiselect"),x=i("BaseFormatMoney");return c(),C("div",null,[e(o).isDashboardDataLoaded?(c(),C("div",It,[t("div",Tt,[t("div",St,[t("h6",kt,[a(I,{name:"ChartSquareBarIcon",class:"text-primary-400 mr-1"}),y(" "+h(b.$t("dashboard.monthly_chart.title")),1)]),t("div",At,[a(g,{modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=D=>l.value=D),options:u.value,"allow-empty":!1,"show-labels":!1,placeholder:b.$t("dashboard.select_year"),"can-deselect":!1},null,8,["modelValue","options","placeholder"])])]),a(G,{invoices:e(o).chartData.invoiceTotals,expenses:e(o).chartData.expenseTotals,receipts:e(o).chartData.receiptTotals,income:e(o).chartData.netIncomeTotals,labels:e(o).chartData.months,class:"sm:w-full"},null,8,["invoices","expenses","receipts","income","labels"])]),t("div",Pt,[t("div",Vt,[t("span",Mt,h(b.$t("dashboard.chart_info.total_sales")),1),jt,t("span",Nt,[a(x,{amount:e(o).totalSales,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ot,[t("span",Lt,h(b.$t("dashboard.chart_info.total_receipts")),1),Ft,t("span",Rt,[a(x,{amount:e(o).totalReceipts,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Wt,[t("span",zt,h(b.$t("dashboard.chart_info.total_expense")),1),qt,t("span",Ht,[a(x,{amount:e(o).totalExpenses,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])]),t("div",Ut,[t("span",Zt,h(b.$t("dashboard.chart_info.net_income")),1),Yt,t("span",Jt,[a(x,{amount:e(o).totalNetIncome,currency:e(s).selectedCompanyCurrency},null,8,["amount","currency"])])])])])):(c(),p(Bt,{key:1}))])}}},Qt={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},Gt={key:0,class:"due-invoices"},Xt={class:"relative z-10 flex items-center justify-between mb-3"},te={class:"mb-0 text-xl font-semibold leading-normal"},ee={key:1,class:"recent-estimates"},ae={class:"relative z-10 flex items-center justify-between mb-3"},se={class:"mb-0 text-xl font-semibold leading-normal"},oe={__name:"DashboardTable",setup(d){const o=S(),{t:s}=Y.useI18n(),n=B(),u=E(null),l=E(null),f=V(()=>[{key:"formattedDueDate",label:s("dashboard.recent_invoices_card.due_on")},{key:"user",label:s("dashboard.recent_invoices_card.customer")},{key:"due_amount",label:s("dashboard.recent_invoices_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]),b=V(()=>[{key:"formattedEstimateDate",label:s("dashboard.recent_estimate_card.date")},{key:"user",label:s("dashboard.recent_estimate_card.customer")},{key:"total",label:s("dashboard.recent_estimate_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]);function w(){return n.hasAbilities([m.DELETE_INVOICE,m.EDIT_INVOICE,m.VIEW_INVOICE,m.SEND_INVOICE])}function I(){return n.hasAbilities([m.CREATE_ESTIMATE,m.EDIT_ESTIMATE,m.VIEW_ESTIMATE,m.SEND_ESTIMATE])}return(g,x)=>{const D=i("BaseButton"),k=i("router-link"),A=i("BaseFormatMoney"),P=i("BaseTable");return c(),C("div",null,[t("div",Qt,[e(n).hasAbilities(e(m).VIEW_INVOICE)?(c(),C("div",Gt,[t("div",Xt,[t("h6",te,h(g.$t("dashboard.recent_invoices_card.title")),1),a(D,{size:"sm",variant:"primary-outline",onClick:x[0]||(x[0]=_=>g.$router.push("/admin/invoices"))},{default:r(()=>[y(h(g.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentDueInvoices,columns:f.value,loading:!e(o).isDashboardDataLoaded},M({"cell-user":r(({row:_})=>[a(k,{to:{path:`invoices/${_.data.id}/view`},class:"font-medium text-primary-500"},{default:r(()=>[y(h(_.data.customer.name),1)]),_:2},1032,["to"])]),"cell-due_amount":r(({row:_})=>[a(A,{amount:_.data.due_amount,currency:_.data.customer.currency},null,8,["amount","currency"])]),_:2},[w()?{name:"cell-actions",fn:r(({row:_})=>[a(X,{row:_.data,table:u.value},null,8,["row","table"])]),key:"0"}:void 0]),1032,["data","columns","loading"])])):v("",!0),e(n).hasAbilities(e(m).VIEW_ESTIMATE)?(c(),C("div",ee,[t("div",ae,[t("h6",se,h(g.$t("dashboard.recent_estimate_card.title")),1),a(D,{variant:"primary-outline",size:"sm",onClick:x[1]||(x[1]=_=>g.$router.push("/admin/estimates"))},{default:r(()=>[y(h(g.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),a(P,{data:e(o).recentEstimates,columns:b.value,loading:!e(o).isDashboardDataLoaded},M({"cell-user":r(({row:_})=>[a(k,{to:{path:`estimates/${_.data.id}/view`},class:"font-medium text-primary-500"},{default:r(()=>[y(h(_.data.customer.name),1)]),_:2},1032,["to"])]),"cell-total":r(({row:_})=>[a(A,{amount:_.data.total,currency:_.data.customer.currency},null,8,["amount","currency"])]),_:2},[I()?{name:"cell-actions",fn:r(({row:_})=>[a(tt,{row:_,table:l.value},null,8,["row","table"])]),key:"0"}:void 0]),1032,["data","columns","loading"])])):v("",!0)])])}}},de={__name:"Dashboard",setup(d){const o=J(),s=B(),n=K();return Q(()=>{o.meta.ability&&!s.hasAbilities(o.meta.ability)?n.push({name:"account.settings"}):o.meta.isOwner&&!s.currentUser.is_owner&&n.push({name:"account.settings"})}),(u,l)=>{const f=i("BasePage");return c(),p(f,null,{default:r(()=>[a(xt),a(Kt),a(oe)]),_:1})}}};export{de as default}; diff --git a/public/build/assets/DateTimeType-qwy7_LT1.js b/public/build/assets/DateTimeType-qwy7_LT1.js deleted file mode 100644 index 4a0f1011..00000000 --- a/public/build/assets/DateTimeType-qwy7_LT1.js +++ /dev/null @@ -1 +0,0 @@ -import{ab as p,k as r,r as d,o as c,m as i}from"./main-WMXHPsTs.js";const k={__name:"DateTimeType",props:{modelValue:{type:String,default:p().format("YYYY-MM-DD hh:MM")}},emits:["update:modelValue"],setup(o,{emit:l}){const m=o,s=l,e=r({get:()=>m.modelValue,set:t=>{s("update:modelValue",t)}});return(t,a)=>{const n=d("BaseDatePicker");return c(),i(n,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=u=>e.value=u),"enable-time":""},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DateType-mWUjtDdt.js b/public/build/assets/DateType-mWUjtDdt.js deleted file mode 100644 index df2a8f34..00000000 --- a/public/build/assets/DateType-mWUjtDdt.js +++ /dev/null @@ -1 +0,0 @@ -import{ab as p,k as r,r as d,o as c,m as i}from"./main-WMXHPsTs.js";const k={__name:"DateType",props:{modelValue:{type:[String,Date],default:p().format("YYYY-MM-DD")}},emits:["update:modelValue"],setup(o,{emit:l}){const s=o,m=l,e=r({get:()=>s.modelValue,set:t=>{m("update:modelValue",t)}});return(t,a)=>{const u=d("BaseDatePicker");return c(),i(u,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=n=>e.value=n)},null,8,["modelValue"])}}};export{k as default}; diff --git a/public/build/assets/DragIcon-5BDgiv1X.js b/public/build/assets/DragIcon-5BDgiv1X.js deleted file mode 100644 index a5e92c4b..00000000 --- a/public/build/assets/DragIcon-5BDgiv1X.js +++ /dev/null @@ -1,10 +0,0 @@ -import{aj as $r,aK as Br,al as Kr,am as Hr,Z as Wr,o as Xr,c as Yr,b as Vr}from"./main-WMXHPsTs.js";var Pr={exports:{}};/**! - * Sortable 1.14.0 - * @author RubaXa - * @author owenm - * @license MIT - */function gr(l,r){var n=Object.keys(l);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(l);r&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})),n.push.apply(n,i)}return n}function Kt(l){for(var r=1;r=0)&&(n[e]=l[e]);return n}function Zr(l,r){if(l==null)return{};var n=Jr(l,r),i,e;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);for(e=0;e=0)&&Object.prototype.propertyIsEnumerable.call(l,i)&&(n[i]=l[i])}return n}function Qr(l){return kr(l)||qr(l)||_r(l)||tn()}function kr(l){if(Array.isArray(l))return ir(l)}function qr(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function _r(l,r){if(l){if(typeof l=="string")return ir(l,r);var n=Object.prototype.toString.call(l).slice(8,-1);if(n==="Object"&&l.constructor&&(n=l.constructor.name),n==="Map"||n==="Set")return Array.from(l);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(l,r)}}function ir(l,r){(r==null||r>l.length)&&(r=l.length);for(var n=0,i=new Array(r);n"&&(r=r.substring(1)),l)try{if(l.matches)return l.matches(r);if(l.msMatchesSelector)return l.msMatchesSelector(r);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(r)}catch{return!1}return!1}}function nn(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Ut(l,r,n,i){if(l){n=n||document;do{if(r!=null&&(r[0]===">"?l.parentNode===n&&He(l,r):He(l,r))||i&&l===n)return l;if(l===n)break}while(l=nn(l))}return null}var mr=/\s+/g;function lt(l,r,n){if(l&&r)if(l.classList)l.classList[n?"add":"remove"](r);else{var i=(" "+l.className+" ").replace(mr," ").replace(" "+r+" "," ");l.className=(i+(n?" "+r:"")).replace(mr," ")}}function L(l,r,n){var i=l&&l.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(n=l.currentStyle),r===void 0?n:n[r];!(r in i)&&r.indexOf("webkit")===-1&&(r="-webkit-"+r),i[r]=n+(typeof n=="string"?"":"px")}}function ee(l,r){var n="";if(typeof l=="string")n=l;else do{var i=L(l,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!r&&(l=l.parentNode));var e=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return e&&new e(n)}function Ar(l,r,n){if(l){var i=l.getElementsByTagName(r),e=0,f=i.length;if(n)for(;e=f:t=e<=f,!t)return i;if(i===Bt())break;i=Zt(i,!1)}return!1}function se(l,r,n,i){for(var e=0,f=0,t=l.children;f2&&arguments[2]!==void 0?arguments[2]:{},e=i.evt,f=Zr(i,cn);Ce.pluginEvent.bind(K)(r,n,Kt({dragEl:A,parentEl:ut,ghostEl:z,rootEl:ot,nextEl:te,lastDownEl:Ge,cloneEl:ct,cloneHidden:Jt,dragStarted:Se,putSortable:Et,activeSortable:K.active,originalEvent:e,oldIndex:le,oldDraggableIndex:Te,newIndex:Mt,newDraggableIndex:zt,hideGhostForTarget:wr,unhideGhostForTarget:Lr,cloneNowHidden:function(){Jt=!0},cloneNowShown:function(){Jt=!1},dispatchSortableEvent:function(o){It({sortable:n,name:o,originalEvent:e})}},f))};function It(l){ye(Kt({putSortable:Et,cloneEl:ct,targetEl:A,rootEl:ot,oldIndex:le,oldDraggableIndex:Te,newIndex:Mt,newDraggableIndex:zt},l))}var A,ut,z,ot,te,Ge,ct,Jt,le,Mt,Te,zt,Me,Et,ie=!1,We=!1,Xe=[],qt,wt,_e,tr,Er,xr,Se,oe,Ie,Pe=!1,Ne=!1,$e,xt,er=[],lr=!1,Ye=[],ze=typeof document<"u",je=Dr,Or=De||Xt?"cssFloat":"float",dn=ze&&!rn&&!Dr&&"draggable"in document.createElement("div"),Nr=function(){if(ze){if(Xt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}}(),jr=function(r,n){var i=L(r),e=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),f=se(r,0,n),t=se(r,1,n),o=f&&L(f),a=t&&L(t),s=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+at(f).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+at(t).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(f&&o.float&&o.float!=="none"){var u=o.float==="left"?"left":"right";return t&&(a.clear==="both"||a.clear===u)?"vertical":"horizontal"}return f&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||s>=e&&i[Or]==="none"||t&&i[Or]==="none"&&s+c>e)?"vertical":"horizontal"},vn=function(r,n,i){var e=i?r.left:r.top,f=i?r.right:r.bottom,t=i?r.width:r.height,o=i?n.left:n.top,a=i?n.right:n.bottom,s=i?n.width:n.height;return e===o||f===a||e+t/2===o+s/2},hn=function(r,n){var i;return Xe.some(function(e){var f=e[Ot].options.emptyInsertThreshold;if(!(!f||cr(e))){var t=at(e),o=r>=t.left-f&&r<=t.right+f,a=n>=t.top-f&&n<=t.bottom+f;if(o&&a)return i=e}}),i},Fr=function(r){function n(f,t){return function(o,a,s,c){var u=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(f==null&&(t||u))return!0;if(f==null||f===!1)return!1;if(t&&f==="clone")return f;if(typeof f=="function")return n(f(o,a,s,c),t)(o,a,s,c);var d=(t?o:a).options.group.name;return f===!0||typeof f=="string"&&f===d||f.join&&f.indexOf(d)>-1}}var i={},e=r.group;(!e||Ue(e)!="object")&&(e={name:e}),i.name=e.name,i.checkPull=n(e.pull,!0),i.checkPut=n(e.put),i.revertClone=e.revertClone,r.group=i},wr=function(){!Nr&&z&&L(z,"display","none")},Lr=function(){!Nr&&z&&L(z,"display","")};ze&&document.addEventListener("click",function(l){if(We)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),We=!1,!1},!0);var _t=function(r){if(A){r=r.touches?r.touches[0]:r;var n=hn(r.clientX,r.clientY);if(n){var i={};for(var e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[Ot]._onDragOver(i)}}},gn=function(r){A&&A.parentNode[Ot]._isOutsideThisEl(r.target)};function K(l,r){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=r=jt({},r),l[Ot]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jr(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,o){t.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:K.supportPointer!==!1&&"PointerEvent"in window&&!xe,emptyInsertThreshold:5};Ce.initializePlugins(this,l,n);for(var i in n)!(i in r)&&(r[i]=n[i]);Fr(r);for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));this.nativeDraggable=r.forceFallback?!1:dn,this.nativeDraggable&&(this.options.touchStartThreshold=1),r.supportPointer?Q(l,"pointerdown",this._onTapStart):(Q(l,"mousedown",this._onTapStart),Q(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(Q(l,"dragover",this),Q(l,"dragenter",this)),Xe.push(this.el),r.store&&r.store.get&&this.sort(r.store.get(this)||[]),jt(this,sn())}K.prototype={constructor:K,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(oe=null)},_getDirection:function(r,n){return typeof this.options.direction=="function"?this.options.direction.call(this,r,n,A):this.options.direction},_onTapStart:function(r){if(r.cancelable){var n=this,i=this.el,e=this.options,f=e.preventOnFilter,t=r.type,o=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,a=(o||r).target,s=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||a,c=e.filter;if(On(i),!A&&!(/mousedown|pointerdown/.test(t)&&r.button!==0||e.disabled)&&!s.isContentEditable&&!(!this.nativeDraggable&&xe&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=Ut(a,e.draggable,i,!1),!(a&&a.animated)&&Ge!==a)){if(le=dt(a),Te=dt(a,e.draggable),typeof c=="function"){if(c.call(this,r,a,this)){It({sortable:n,rootEl:s,name:"filter",targetEl:a,toEl:i,fromEl:i}),Dt("filter",n,{evt:r}),f&&r.cancelable&&r.preventDefault();return}}else if(c&&(c=c.split(",").some(function(u){if(u=Ut(s,u.trim(),i,!1),u)return It({sortable:n,rootEl:u,name:"filter",targetEl:a,fromEl:i,toEl:i}),Dt("filter",n,{evt:r}),!0}),c)){f&&r.cancelable&&r.preventDefault();return}e.handle&&!Ut(s,e.handle,i,!1)||this._prepareDragStart(r,o,a)}}},_prepareDragStart:function(r,n,i){var e=this,f=e.el,t=e.options,o=f.ownerDocument,a;if(i&&!A&&i.parentNode===f){var s=at(i);if(ot=f,A=i,ut=A.parentNode,te=A.nextSibling,Ge=i,Me=t.group,K.dragged=A,qt={target:A,clientX:(n||r).clientX,clientY:(n||r).clientY},Er=qt.clientX-s.left,xr=qt.clientY-s.top,this._lastX=(n||r).clientX,this._lastY=(n||r).clientY,A.style["will-change"]="all",a=function(){if(Dt("delayEnded",e,{evt:r}),K.eventCanceled){e._onDrop();return}e._disableDelayedDragEvents(),!pr&&e.nativeDraggable&&(A.draggable=!0),e._triggerDragStart(r,n),It({sortable:e,name:"choose",originalEvent:r}),lt(A,t.chosenClass,!0)},t.ignore.split(",").forEach(function(c){Ar(A,c.trim(),rr)}),Q(o,"dragover",_t),Q(o,"mousemove",_t),Q(o,"touchmove",_t),Q(o,"mouseup",e._onDrop),Q(o,"touchend",e._onDrop),Q(o,"touchcancel",e._onDrop),pr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,A.draggable=!0),Dt("delayStart",this,{evt:r}),t.delay&&(!t.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(De||Xt))){if(K.eventCanceled){this._onDrop();return}Q(o,"mouseup",e._disableDelayedDrag),Q(o,"touchend",e._disableDelayedDrag),Q(o,"touchcancel",e._disableDelayedDrag),Q(o,"mousemove",e._delayedDragTouchMoveHandler),Q(o,"touchmove",e._delayedDragTouchMoveHandler),t.supportPointer&&Q(o,"pointermove",e._delayedDragTouchMoveHandler),e._dragStartTimer=setTimeout(a,t.delay)}else a()}},_delayedDragTouchMoveHandler:function(r){var n=r.touches?r.touches[0]:r;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){A&&rr(A),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;Z(r,"mouseup",this._disableDelayedDrag),Z(r,"touchend",this._disableDelayedDrag),Z(r,"touchcancel",this._disableDelayedDrag),Z(r,"mousemove",this._delayedDragTouchMoveHandler),Z(r,"touchmove",this._delayedDragTouchMoveHandler),Z(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,n){n=n||r.pointerType=="touch"&&r,!this.nativeDraggable||n?this.options.supportPointer?Q(document,"pointermove",this._onTouchMove):n?Q(document,"touchmove",this._onTouchMove):Q(document,"mousemove",this._onTouchMove):(Q(A,"dragend",this),Q(ot,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,n){if(ie=!1,ot&&A){Dt("dragStarted",this,{evt:n}),this.nativeDraggable&&Q(document,"dragover",gn);var i=this.options;!r&<(A,i.dragClass,!1),lt(A,i.ghostClass,!0),K.active=this,r&&this._appendGhost(),It({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(wt){this._lastX=wt.clientX,this._lastY=wt.clientY,wr();for(var r=document.elementFromPoint(wt.clientX,wt.clientY),n=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(wt.clientX,wt.clientY),r!==n);)n=r;if(A.parentNode[Ot]._isOutsideThisEl(r),n)do{if(n[Ot]){var i=void 0;if(i=n[Ot]._onDragOver({clientX:wt.clientX,clientY:wt.clientY,target:r,rootEl:n}),i&&!this.options.dragoverBubble)break}r=n}while(n=n.parentNode);Lr()}},_onTouchMove:function(r){if(qt){var n=this.options,i=n.fallbackTolerance,e=n.fallbackOffset,f=r.touches?r.touches[0]:r,t=z&&ee(z,!0),o=z&&t&&t.a,a=z&&t&&t.d,s=je&&xt&&Sr(xt),c=(f.clientX-qt.clientX+e.x)/(o||1)+(s?s[0]-er[0]:0)/(o||1),u=(f.clientY-qt.clientY+e.y)/(a||1)+(s?s[1]-er[1]:0)/(a||1);if(!K.active&&!ie){if(i&&Math.max(Math.abs(f.clientX-this._lastX),Math.abs(f.clientY-this._lastY))=0&&(It({rootEl:ut,name:"add",toEl:ut,fromEl:ot,originalEvent:r}),It({sortable:this,name:"remove",toEl:ut,originalEvent:r}),It({rootEl:ut,name:"sort",toEl:ut,fromEl:ot,originalEvent:r}),It({sortable:this,name:"sort",toEl:ut,originalEvent:r})),Et&&Et.save()):Mt!==le&&Mt>=0&&(It({sortable:this,name:"update",toEl:ut,originalEvent:r}),It({sortable:this,name:"sort",toEl:ut,originalEvent:r})),K.active&&((Mt==null||Mt===-1)&&(Mt=le,zt=Te),It({sortable:this,name:"end",toEl:ut,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){Dt("nulling",this),ot=A=ut=z=te=ct=Ge=Jt=qt=wt=Se=Mt=zt=le=Te=oe=Ie=Et=Me=K.dragged=K.ghost=K.clone=K.active=null,Ye.forEach(function(r){r.checked=!0}),Ye.length=_e=tr=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":A&&(this._onDragOver(r),pn(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],n,i=this.el.children,e=0,f=i.length,t=this.options;ei.right+e||l.clientX<=i.right&&l.clientY>i.bottom&&l.clientX>=i.left:l.clientX>i.right&&l.clientY>i.top||l.clientX<=i.right&&l.clientY>i.bottom+e}function bn(l,r,n,i,e,f,t,o){var a=i?l.clientY:l.clientX,s=i?n.height:n.width,c=i?n.top:n.left,u=i?n.bottom:n.right,d=!1;if(!t){if(o&&$ec+s*f/2:au-$e)return-Ie}else if(a>c+s*(1-e)/2&&au-s*f/2)?a>c+s/2?1:-1:0}function En(l){return dt(A)1&&(V.forEach(function(o){f.addAnimationState({target:o,rect:Ct?at(o):t}),ke(o),o.fromRect=t,i.removeAnimationState(o)}),Ct=!1,Cn(!this.options.removeCloneOnHide,e))},dragOverCompleted:function(n){var i=n.sortable,e=n.isOwner,f=n.insertion,t=n.activeSortable,o=n.parentEl,a=n.putSortable,s=this.options;if(f){if(e&&t._hideClone(),pe=!1,s.animation&&V.length>1&&(Ct||!e&&!t.options.sort&&!a)){var c=at(et,!1,!0,!0);V.forEach(function(d){d!==et&&(br(d,c),o.appendChild(d))}),Ct=!0}if(!e)if(Ct||Le(),V.length>1){var u=we;t._showClone(i),t.options.animation&&!we&&u&&Rt.forEach(function(d){t.addAnimationState({target:d,rect:me}),d.fromRect=me,d.thisAnimationDuration=null})}else t._showClone(i)}},dragOverAnimationCapture:function(n){var i=n.dragRect,e=n.isOwner,f=n.activeSortable;if(V.forEach(function(o){o.thisAnimationDuration=null}),f.options.animation&&!e&&f.multiDrag.isMultiDrag){me=jt({},i);var t=ee(et,!0);me.top-=t.f,me.left-=t.e}},dragOverAnimationComplete:function(){Ct&&(Ct=!1,Le())},drop:function(n){var i=n.originalEvent,e=n.rootEl,f=n.parentEl,t=n.sortable,o=n.dispatchSortableEvent,a=n.oldIndex,s=n.putSortable,c=s||this.sortable;if(i){var u=this.options,d=f.children;if(!ae)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),lt(et,u.selectedClass,!~V.indexOf(et)),~V.indexOf(et))V.splice(V.indexOf(et),1),ge=null,ye({sortable:t,rootEl:e,name:"deselect",targetEl:et,originalEvt:i});else{if(V.push(et),ye({sortable:t,rootEl:e,name:"select",targetEl:et,originalEvt:i}),i.shiftKey&&ge&&t.el.contains(ge)){var v=dt(ge),h=dt(et);if(~v&&~h&&v!==h){var g,p;for(h>v?(p=v,g=h):(p=h,g=v+1);p1){var S=at(et),b=dt(et,":not(."+this.options.selectedClass+")");if(!pe&&u.animation&&(et.thisAnimationDuration=null),c.captureAnimationState(),!pe&&(u.animation&&(et.fromRect=S,V.forEach(function(x){if(x.thisAnimationDuration=null,x!==et){var P=Ct?at(x):S;x.fromRect=P,c.addAnimationState({target:x,rect:P})}})),Le(),V.forEach(function(x){d[b]?f.insertBefore(x,d[b]):f.appendChild(x),b++}),a===dt(et))){var I=!1;V.forEach(function(x){if(x.sortableIndex!==dt(x)){I=!0;return}}),I&&o("update")}V.forEach(function(x){ke(x)}),c.animateAll()}Lt=c}(e===f||s&&s.lastPutMode!=="clone")&&Rt.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=ae=!1,Rt.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Z(document,"pointerup",this._deselectMultiDrag),Z(document,"mouseup",this._deselectMultiDrag),Z(document,"touchend",this._deselectMultiDrag),Z(document,"keydown",this._checkKeyDown),Z(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(n){if(!(typeof ae<"u"&&ae)&&Lt===this.sortable&&!(n&&Ut(n.target,this.options.draggable,this.sortable.el,!1))&&!(n&&n.button!==0))for(;V.length;){var i=V[0];lt(i,this.options.selectedClass,!1),V.shift(),ye({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvt:n})}},_checkKeyDown:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},jt(l,{pluginName:"multiDrag",utils:{select:function(n){var i=n.parentNode[Ot];!i||!i.options.multiDrag||~V.indexOf(n)||(Lt&&Lt!==i&&(Lt.multiDrag._deselectMultiDrag(),Lt=i),lt(n,i.options.selectedClass,!0),V.push(n))},deselect:function(n){var i=n.parentNode[Ot],e=V.indexOf(n);!i||!i.options.multiDrag||!~e||(lt(n,i.options.selectedClass,!1),V.splice(e,1))}},eventProperties:function(){var n=this,i=[],e=[];return V.forEach(function(f){i.push({multiDragElement:f,index:f.sortableIndex});var t;Ct&&f!==et?t=-1:Ct?t=dt(f,":not(."+n.options.selectedClass+")"):t=dt(f),e.push({multiDragElement:f,index:t})}),{items:Qr(V),clones:[].concat(Rt),oldIndicies:i,newIndicies:e}},optionListeners:{multiDragKey:function(n){return n=n.toLowerCase(),n==="ctrl"?n="Control":n.length>1&&(n=n.charAt(0).toUpperCase()+n.substr(1)),n}}})}function Cn(l,r){V.forEach(function(n,i){var e=r.children[n.sortableIndex+(l?Number(i):0)];e?r.insertBefore(n,e):r.appendChild(n)})}function Ir(l,r){Rt.forEach(function(n,i){var e=r.children[n.sortableIndex+(l?Number(i):0)];e?r.insertBefore(n,e):r.appendChild(n)})}function Le(){V.forEach(function(l){l!==et&&l.parentNode&&l.parentNode.removeChild(l)})}K.mount(new Tn);K.mount(hr,vr);const An=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:Dn,Sortable:K,Swap:In,default:K},Symbol.toStringTag,{value:"Module"})),Rn=$r(An);(function(l,r){(function(i,e){l.exports=e(Br,Rn)})(typeof self<"u"?self:Kr,function(n,i){return function(e){var f={};function t(o){if(f[o])return f[o].exports;var a=f[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=f,t.d=function(o,a,s){t.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:s})},t.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},t.t=function(o,a){if(a&1&&(o=t(o)),a&8||a&4&&typeof o=="object"&&o&&o.__esModule)return o;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var c in o)t.d(s,c,(function(u){return o[u]}).bind(null,c));return s},t.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return t.d(a,"a",a),a},t.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},t.p="",t(t.s="fb15")}({"00ee":function(e,f,t){var o=t("b622"),a=o("toStringTag"),s={};s[a]="z",e.exports=String(s)==="[object z]"},"0366":function(e,f,t){var o=t("1c0b");e.exports=function(a,s,c){if(o(a),s===void 0)return a;switch(c){case 0:return function(){return a.call(s)};case 1:return function(u){return a.call(s,u)};case 2:return function(u,d){return a.call(s,u,d)};case 3:return function(u,d,v){return a.call(s,u,d,v)}}return function(){return a.apply(s,arguments)}}},"057f":function(e,f,t){var o=t("fc6a"),a=t("241c").f,s={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(d){try{return a(d)}catch{return c.slice()}};e.exports.f=function(v){return c&&s.call(v)=="[object Window]"?u(v):a(o(v))}},"06cf":function(e,f,t){var o=t("83ab"),a=t("d1e7"),s=t("5c6c"),c=t("fc6a"),u=t("c04e"),d=t("5135"),v=t("0cfb"),h=Object.getOwnPropertyDescriptor;f.f=o?h:function(p,S){if(p=c(p),S=u(S,!0),v)try{return h(p,S)}catch{}if(d(p,S))return s(!a.f.call(p,S),p[S])}},"0cfb":function(e,f,t){var o=t("83ab"),a=t("d039"),s=t("cc12");e.exports=!o&&!a(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(e,f,t){var o=t("23e7"),a=t("d58f").left,s=t("a640"),c=t("ae40"),u=s("reduce"),d=c("reduce",{1:0});o({target:"Array",proto:!0,forced:!u||!d},{reduce:function(h){return a(this,h,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(e,f,t){var o=t("c6b6"),a=t("9263");e.exports=function(s,c){var u=s.exec;if(typeof u=="function"){var d=u.call(s,c);if(typeof d!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return d}if(o(s)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return a.call(s,c)}},"159b":function(e,f,t){var o=t("da84"),a=t("fdbc"),s=t("17c2"),c=t("9112");for(var u in a){var d=o[u],v=d&&d.prototype;if(v&&v.forEach!==s)try{c(v,"forEach",s)}catch{v.forEach=s}}},"17c2":function(e,f,t){var o=t("b727").forEach,a=t("a640"),s=t("ae40"),c=a("forEach"),u=s("forEach");e.exports=!c||!u?function(v){return o(this,v,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(e,f,t){var o=t("d066");e.exports=o("document","documentElement")},"1c0b":function(e,f){e.exports=function(t){if(typeof t!="function")throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(e,f,t){var o=t("b622"),a=o("iterator"),s=!1;try{var c=0,u={next:function(){return{done:!!c++}},return:function(){s=!0}};u[a]=function(){return this},Array.from(u,function(){throw 2})}catch{}e.exports=function(d,v){if(!v&&!s)return!1;var h=!1;try{var g={};g[a]=function(){return{next:function(){return{done:h=!0}}}},d(g)}catch{}return h}},"1d80":function(e,f){e.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}},"1dde":function(e,f,t){var o=t("d039"),a=t("b622"),s=t("2d00"),c=a("species");e.exports=function(u){return s>=51||!o(function(){var d=[],v=d.constructor={};return v[c]=function(){return{foo:1}},d[u](Boolean).foo!==1})}},"23cb":function(e,f,t){var o=t("a691"),a=Math.max,s=Math.min;e.exports=function(c,u){var d=o(c);return d<0?a(d+u,0):s(d,u)}},"23e7":function(e,f,t){var o=t("da84"),a=t("06cf").f,s=t("9112"),c=t("6eeb"),u=t("ce4e"),d=t("e893"),v=t("94ca");e.exports=function(h,g){var p=h.target,S=h.global,b=h.stat,I,x,P,O,w,U;if(S?x=o:b?x=o[p]||u(p,{}):x=(o[p]||{}).prototype,x)for(P in g){if(w=g[P],h.noTargetGet?(U=a(x,P),O=U&&U.value):O=x[P],I=v(S?P:p+(b?".":"#")+P,h.forced),!I&&O!==void 0){if(typeof w==typeof O)continue;d(w,O)}(h.sham||O&&O.sham)&&s(w,"sham",!0),c(x,P,w,h)}}},"241c":function(e,f,t){var o=t("ca84"),a=t("7839"),s=a.concat("length","prototype");f.f=Object.getOwnPropertyNames||function(u){return o(u,s)}},"25f0":function(e,f,t){var o=t("6eeb"),a=t("825a"),s=t("d039"),c=t("ad6d"),u="toString",d=RegExp.prototype,v=d[u],h=s(function(){return v.call({source:"a",flags:"b"})!="/a/b"}),g=v.name!=u;(h||g)&&o(RegExp.prototype,u,function(){var S=a(this),b=String(S.source),I=S.flags,x=String(I===void 0&&S instanceof RegExp&&!("flags"in d)?c.call(S):I);return"/"+b+"/"+x},{unsafe:!0})},"2ca0":function(e,f,t){var o=t("23e7"),a=t("06cf").f,s=t("50c4"),c=t("5a34"),u=t("1d80"),d=t("ab13"),v=t("c430"),h="".startsWith,g=Math.min,p=d("startsWith"),S=!v&&!p&&!!function(){var b=a(String.prototype,"startsWith");return b&&!b.writable}();o({target:"String",proto:!0,forced:!S&&!p},{startsWith:function(I){var x=String(u(this));c(I);var P=s(g(arguments.length>1?arguments[1]:void 0,x.length)),O=String(I);return h?h.call(x,O,P):x.slice(P,P+O.length)===O}})},"2d00":function(e,f,t){var o=t("da84"),a=t("342f"),s=o.process,c=s&&s.versions,u=c&&c.v8,d,v;u?(d=u.split("."),v=d[0]+d[1]):a&&(d=a.match(/Edge\/(\d+)/),(!d||d[1]>=74)&&(d=a.match(/Chrome\/(\d+)/),d&&(v=d[1]))),e.exports=v&&+v},"342f":function(e,f,t){var o=t("d066");e.exports=o("navigator","userAgent")||""},"35a1":function(e,f,t){var o=t("f5df"),a=t("3f8c"),s=t("b622"),c=s("iterator");e.exports=function(u){if(u!=null)return u[c]||u["@@iterator"]||a[o(u)]}},"37e8":function(e,f,t){var o=t("83ab"),a=t("9bf2"),s=t("825a"),c=t("df75");e.exports=o?Object.defineProperties:function(d,v){s(d);for(var h=c(v),g=h.length,p=0,S;g>p;)a.f(d,S=h[p++],v[S]);return d}},"3bbe":function(e,f,t){var o=t("861d");e.exports=function(a){if(!o(a)&&a!==null)throw TypeError("Can't set "+String(a)+" as a prototype");return a}},"3ca3":function(e,f,t){var o=t("6547").charAt,a=t("69f3"),s=t("7dd0"),c="String Iterator",u=a.set,d=a.getterFor(c);s(String,"String",function(v){u(this,{type:c,string:String(v),index:0})},function(){var h=d(this),g=h.string,p=h.index,S;return p>=g.length?{value:void 0,done:!0}:(S=o(g,p),h.index+=S.length,{value:S,done:!1})})},"3f8c":function(e,f){e.exports={}},4160:function(e,f,t){var o=t("23e7"),a=t("17c2");o({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},"428f":function(e,f,t){var o=t("da84");e.exports=o},"44ad":function(e,f,t){var o=t("d039"),a=t("c6b6"),s="".split;e.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(c){return a(c)=="String"?s.call(c,""):Object(c)}:Object},"44d2":function(e,f,t){var o=t("b622"),a=t("7c73"),s=t("9bf2"),c=o("unscopables"),u=Array.prototype;u[c]==null&&s.f(u,c,{configurable:!0,value:a(null)}),e.exports=function(d){u[c][d]=!0}},"44e7":function(e,f,t){var o=t("861d"),a=t("c6b6"),s=t("b622"),c=s("match");e.exports=function(u){var d;return o(u)&&((d=u[c])!==void 0?!!d:a(u)=="RegExp")}},4930:function(e,f,t){var o=t("d039");e.exports=!!Object.getOwnPropertySymbols&&!o(function(){return!String(Symbol())})},"4d64":function(e,f,t){var o=t("fc6a"),a=t("50c4"),s=t("23cb"),c=function(u){return function(d,v,h){var g=o(d),p=a(g.length),S=s(h,p),b;if(u&&v!=v){for(;p>S;)if(b=g[S++],b!=b)return!0}else for(;p>S;S++)if((u||S in g)&&g[S]===v)return u||S||0;return!u&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},"4de4":function(e,f,t){var o=t("23e7"),a=t("b727").filter,s=t("1dde"),c=t("ae40"),u=s("filter"),d=c("filter");o({target:"Array",proto:!0,forced:!u||!d},{filter:function(h){return a(this,h,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,f,t){var o=t("0366"),a=t("7b0b"),s=t("9bdd"),c=t("e95a"),u=t("50c4"),d=t("8418"),v=t("35a1");e.exports=function(g){var p=a(g),S=typeof this=="function"?this:Array,b=arguments.length,I=b>1?arguments[1]:void 0,x=I!==void 0,P=v(p),O=0,w,U,T,M,j,Y;if(x&&(I=o(I,b>2?arguments[2]:void 0,2)),P!=null&&!(S==Array&&c(P)))for(M=P.call(p),j=M.next,U=new S;!(T=j.call(M)).done;O++)Y=x?s(M,I,[T.value,O],!0):T.value,d(U,O,Y);else for(w=u(p.length),U=new S(w);w>O;O++)Y=x?I(p[O],O):p[O],d(U,O,Y);return U.length=O,U}},"4fad":function(e,f,t){var o=t("23e7"),a=t("6f53").entries;o({target:"Object",stat:!0},{entries:function(c){return a(c)}})},"50c4":function(e,f,t){var o=t("a691"),a=Math.min;e.exports=function(s){return s>0?a(o(s),9007199254740991):0}},5135:function(e,f){var t={}.hasOwnProperty;e.exports=function(o,a){return t.call(o,a)}},5319:function(e,f,t){var o=t("d784"),a=t("825a"),s=t("7b0b"),c=t("50c4"),u=t("a691"),d=t("1d80"),v=t("8aa5"),h=t("14c3"),g=Math.max,p=Math.min,S=Math.floor,b=/\$([$&'`]|\d\d?|<[^>]*>)/g,I=/\$([$&'`]|\d\d?)/g,x=function(P){return P===void 0?P:String(P)};o("replace",2,function(P,O,w,U){var T=U.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,M=U.REPLACE_KEEPS_$0,j=T?"$":"$0";return[function(R,X){var N=d(this),$=R==null?void 0:R[P];return $!==void 0?$.call(R,N,X):O.call(String(N),R,X)},function(C,R){if(!T&&M||typeof R=="string"&&R.indexOf(j)===-1){var X=w(O,C,this,R);if(X.done)return X.value}var N=a(C),$=String(this),_=typeof R=="function";_||(R=String(R));var rt=N.global;if(rt){var yt=N.unicode;N.lastIndex=0}for(var st=[];;){var ft=h(N,$);if(ft===null||(st.push(ft),!rt))break;var pt=String(ft[0]);pt===""&&(N.lastIndex=v($,c(N.lastIndex),yt))}for(var mt="",ht=0,nt=0;nt=ht&&(mt+=$.slice(ht,At)+St,ht=At+it.length)}return mt+$.slice(ht)}];function Y(C,R,X,N,$,_){var rt=X+C.length,yt=N.length,st=I;return $!==void 0&&($=s($),st=b),O.call(_,st,function(ft,pt){var mt;switch(pt.charAt(0)){case"$":return"$";case"&":return C;case"`":return R.slice(0,X);case"'":return R.slice(rt);case"<":mt=$[pt.slice(1,-1)];break;default:var ht=+pt;if(ht===0)return ft;if(ht>yt){var nt=S(ht/10);return nt===0?ft:nt<=yt?N[nt-1]===void 0?pt.charAt(1):N[nt-1]+pt.charAt(1):ft}mt=N[ht-1]}return mt===void 0?"":mt})}})},5692:function(e,f,t){var o=t("c430"),a=t("c6cd");(e.exports=function(s,c){return a[s]||(a[s]=c!==void 0?c:{})})("versions",[]).push({version:"3.6.5",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,f,t){var o=t("d066"),a=t("241c"),s=t("7418"),c=t("825a");e.exports=o("Reflect","ownKeys")||function(d){var v=a.f(c(d)),h=s.f;return h?v.concat(h(d)):v}},"5a34":function(e,f,t){var o=t("44e7");e.exports=function(a){if(o(a))throw TypeError("The method doesn't accept regular expressions");return a}},"5c6c":function(e,f){e.exports=function(t,o){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:o}}},"5db7":function(e,f,t){var o=t("23e7"),a=t("a2bf"),s=t("7b0b"),c=t("50c4"),u=t("1c0b"),d=t("65f0");o({target:"Array",proto:!0},{flatMap:function(h){var g=s(this),p=c(g.length),S;return u(h),S=d(g,0),S.length=a(S,g,g,p,0,1,h,arguments.length>1?arguments[1]:void 0),S}})},6547:function(e,f,t){var o=t("a691"),a=t("1d80"),s=function(c){return function(u,d){var v=String(a(u)),h=o(d),g=v.length,p,S;return h<0||h>=g?c?"":void 0:(p=v.charCodeAt(h),p<55296||p>56319||h+1===g||(S=v.charCodeAt(h+1))<56320||S>57343?c?v.charAt(h):p:c?v.slice(h,h+2):(p-55296<<10)+(S-56320)+65536)}};e.exports={codeAt:s(!1),charAt:s(!0)}},"65f0":function(e,f,t){var o=t("861d"),a=t("e8b5"),s=t("b622"),c=s("species");e.exports=function(u,d){var v;return a(u)&&(v=u.constructor,typeof v=="function"&&(v===Array||a(v.prototype))?v=void 0:o(v)&&(v=v[c],v===null&&(v=void 0))),new(v===void 0?Array:v)(d===0?0:d)}},"69f3":function(e,f,t){var o=t("7f9a"),a=t("da84"),s=t("861d"),c=t("9112"),u=t("5135"),d=t("f772"),v=t("d012"),h=a.WeakMap,g,p,S,b=function(T){return S(T)?p(T):g(T,{})},I=function(T){return function(M){var j;if(!s(M)||(j=p(M)).type!==T)throw TypeError("Incompatible receiver, "+T+" required");return j}};if(o){var x=new h,P=x.get,O=x.has,w=x.set;g=function(T,M){return w.call(x,T,M),M},p=function(T){return P.call(x,T)||{}},S=function(T){return O.call(x,T)}}else{var U=d("state");v[U]=!0,g=function(T,M){return c(T,U,M),M},p=function(T){return u(T,U)?T[U]:{}},S=function(T){return u(T,U)}}e.exports={set:g,get:p,has:S,enforce:b,getterFor:I}},"6eeb":function(e,f,t){var o=t("da84"),a=t("9112"),s=t("5135"),c=t("ce4e"),u=t("8925"),d=t("69f3"),v=d.get,h=d.enforce,g=String(String).split("String");(e.exports=function(p,S,b,I){var x=I?!!I.unsafe:!1,P=I?!!I.enumerable:!1,O=I?!!I.noTargetGet:!1;if(typeof b=="function"&&(typeof S=="string"&&!s(b,"name")&&a(b,"name",S),h(b).source=g.join(typeof S=="string"?S:"")),p===o){P?p[S]=b:c(S,b);return}else x?!O&&p[S]&&(P=!0):delete p[S];P?p[S]=b:a(p,S,b)})(Function.prototype,"toString",function(){return typeof this=="function"&&v(this).source||u(this)})},"6f53":function(e,f,t){var o=t("83ab"),a=t("df75"),s=t("fc6a"),c=t("d1e7").f,u=function(d){return function(v){for(var h=s(v),g=a(h),p=g.length,S=0,b=[],I;p>S;)I=g[S++],(!o||c.call(h,I))&&b.push(d?[I,h[I]]:h[I]);return b}};e.exports={entries:u(!0),values:u(!1)}},"73d9":function(e,f,t){var o=t("44d2");o("flatMap")},7418:function(e,f){f.f=Object.getOwnPropertySymbols},"746f":function(e,f,t){var o=t("428f"),a=t("5135"),s=t("e538"),c=t("9bf2").f;e.exports=function(u){var d=o.Symbol||(o.Symbol={});a(d,u)||c(d,u,{value:s.f(u)})}},7839:function(e,f){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,f,t){var o=t("1d80");e.exports=function(a){return Object(o(a))}},"7c73":function(e,f,t){var o=t("825a"),a=t("37e8"),s=t("7839"),c=t("d012"),u=t("1be4"),d=t("cc12"),v=t("f772"),h=">",g="<",p="prototype",S="script",b=v("IE_PROTO"),I=function(){},x=function(T){return g+S+h+T+g+"/"+S+h},P=function(T){T.write(x("")),T.close();var M=T.parentWindow.Object;return T=null,M},O=function(){var T=d("iframe"),M="java"+S+":",j;return T.style.display="none",u.appendChild(T),T.src=String(M),j=T.contentWindow.document,j.open(),j.write(x("document.F=Object")),j.close(),j.F},w,U=function(){try{w=document.domain&&new ActiveXObject("htmlfile")}catch{}U=w?P(w):O();for(var T=s.length;T--;)delete U[p][s[T]];return U()};c[b]=!0,e.exports=Object.create||function(M,j){var Y;return M!==null?(I[p]=o(M),Y=new I,I[p]=null,Y[b]=M):Y=U(),j===void 0?Y:a(Y,j)}},"7dd0":function(e,f,t){var o=t("23e7"),a=t("9ed3"),s=t("e163"),c=t("d2bb"),u=t("d44e"),d=t("9112"),v=t("6eeb"),h=t("b622"),g=t("c430"),p=t("3f8c"),S=t("ae93"),b=S.IteratorPrototype,I=S.BUGGY_SAFARI_ITERATORS,x=h("iterator"),P="keys",O="values",w="entries",U=function(){return this};e.exports=function(T,M,j,Y,C,R,X){a(j,M,Y);var N=function(nt){if(nt===C&&st)return st;if(!I&&nt in rt)return rt[nt];switch(nt){case P:return function(){return new j(this,nt)};case O:return function(){return new j(this,nt)};case w:return function(){return new j(this,nt)}}return function(){return new j(this)}},$=M+" Iterator",_=!1,rt=T.prototype,yt=rt[x]||rt["@@iterator"]||C&&rt[C],st=!I&&yt||N(C),ft=M=="Array"&&rt.entries||yt,pt,mt,ht;if(ft&&(pt=s(ft.call(new T)),b!==Object.prototype&&pt.next&&(!g&&s(pt)!==b&&(c?c(pt,b):typeof pt[x]!="function"&&d(pt,x,U)),u(pt,$,!0,!0),g&&(p[$]=U))),C==O&&yt&&yt.name!==O&&(_=!0,st=function(){return yt.call(this)}),(!g||X)&&rt[x]!==st&&d(rt,x,st),p[M]=st,C)if(mt={values:N(O),keys:R?st:N(P),entries:N(w)},X)for(ht in mt)(I||_||!(ht in rt))&&v(rt,ht,mt[ht]);else o({target:M,proto:!0,forced:I||_},mt);return mt}},"7f9a":function(e,f,t){var o=t("da84"),a=t("8925"),s=o.WeakMap;e.exports=typeof s=="function"&&/native code/.test(a(s))},"825a":function(e,f,t){var o=t("861d");e.exports=function(a){if(!o(a))throw TypeError(String(a)+" is not an object");return a}},"83ab":function(e,f,t){var o=t("d039");e.exports=!o(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(e,f,t){var o=t("c04e"),a=t("9bf2"),s=t("5c6c");e.exports=function(c,u,d){var v=o(u);v in c?a.f(c,v,s(0,d)):c[v]=d}},"861d":function(e,f){e.exports=function(t){return typeof t=="object"?t!==null:typeof t=="function"}},8875:function(e,f,t){var o,a,s;(function(c,u){a=[],o=u,s=typeof o=="function"?o.apply(f,a):o,s!==void 0&&(e.exports=s)})(typeof self<"u"?self:this,function(){function c(){var u=Object.getOwnPropertyDescriptor(document,"currentScript");if(!u&&"currentScript"in document&&document.currentScript||u&&u.get!==c&&document.currentScript)return document.currentScript;try{throw new Error}catch(w){var d=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,v=/@([^@]*):(\d+):(\d+)\s*$/ig,h=d.exec(w.stack)||v.exec(w.stack),g=h&&h[1]||!1,p=h&&h[2]||!1,S=document.location.href.replace(document.location.hash,""),b,I,x,P=document.getElementsByTagName("script");g===S&&(b=document.documentElement.outerHTML,I=new RegExp("(?:[^\\n]+?\\n){0,"+(p-2)+"}[^<]*