diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6f87030 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +.env \ No newline at end of file diff --git a/.env.docker b/.env.docker new file mode 100644 index 0000000..38de6e4 --- /dev/null +++ b/.env.docker @@ -0,0 +1,72 @@ +APP_NAME="Grafite Scaffold" +APP_ENV=local +APP_KEY=base64:tUx23rtiQsNZtV4aRH38ofndb8lX05LWZaSXUYe+F/4= +APP_DEBUG=true +APP_URL="https://scaffold.local.test/" + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=scaffold +DB_USERNAME=sail +DB_PASSWORD=password + +BROADCAST_DRIVER=pusher +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_CLIENT=phpredis +REDIS_HOST=redis +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=127.0.0.1 +MAIL_PORT=2525 +MAIL_USERNAME=Scaffold +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=hello@scaffold.com +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID=1160273 +PUSHER_APP_KEY=beda029944f4b5d0809b +PUSHER_APP_SECRET=89286a9097669f0c48ff +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +PLAN_MONTHLY=plan_FgRNFn5SPrDG6g +PLAN_YEARLY=plan_Gb9YKx6eWjjApR + +STRIPE_KEY=pk_test_zVmnUpEu5wX5bi3e9HETz4Zn +STRIPE_SECRET=sk_test_k446eRvPjUZHNUIELSMyNS3t +CASHIER_PAYMENT_NOTIFICATION=Laravel\Cashier\Notifications\ConfirmPayment + +HONEYPOT_NAME=my_email +SANCTUM_STATEFUL_DOMAINS="scaffold.local.test,localhost,127.0.0.1,127.0.0.1:8000,::1" +SESSION_DOMAIN="scaffold.local.test" + +MISSION_CONTROL_URL='https://missioncontrol.test' +MISSION_CONTROL_USER_TOKEN="6|SDYLxDrSdt8S16gTRuumdbkE5Isle43rlkoPo6UB" +MISSION_CONTROL_PROJECT_KEY="37deb93ec12fe69e5cb0c55dc4d5f544" +MISSION_CONTROL_PROJECT_UUID="fee11c7f-316e-4288-9cf3-3167b43c80fc" + +REGISTRATION=true + +APP_PORT=48080 +FORWARD_DB_PORT=43306 +FORWARD_REDIS_PORT=46379 +FORWARD_MEILISEARCH_PORT=47700 +FORWARD_MAILHOG_PORT=41025 +FORWARD_MAILHOG_DASHBOARD_PORT=48025 diff --git a/.gitignore b/.gitignore index 4c5bc56..466b5d2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /storage/*.key /vendor .env +.env.docker .phpunit.result.cache /.phpunit.cache /.phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index e6f441d..450c0d1 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":1,"defects":{"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testCreate":5,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testIndex":5,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testDestroy":5,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testFileUpload":8,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testCreateSubsciption":1,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testUpdatePaymentMethod":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingSubscribe":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingGetDetails":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingPaymentMethod":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingCoupon":1,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testTwoFactorEmail":8,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testGoogleTwoFactor":5,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testGetTwoFactorPage":5,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testVerifyTwoFactorEmail":7,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testCreate":7,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testIndex":5,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testDestroy":5,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testAuthenticatorTwoFactor":7,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testPostRegistration":7,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testVerifyRecovery":7,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testImageUpload":7,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testLeaveTeam":5,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testRemoveTeamMember":5,"Tests\\Feature\\Controllers\\TeamsControllerTest::testDelete":5,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testAccept":7,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testSecurity":8,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testUpdatePassword":7},"times":{"Tests\\Unit\\ActivityServiceTest::testLog":0.004,"Tests\\Unit\\InviteServiceTest::testCreate":0.014,"Tests\\Unit\\InviteServiceTest::testValidateInvitation":0.002,"Tests\\Unit\\TeamServiceTest::testCreate":0.001,"Tests\\Unit\\TeamServiceTest::testUpdate":0.002,"Tests\\Unit\\TeamServiceTest::testInvite":0.002,"Tests\\Unit\\TeamServiceTest::testLeaveTeam":0.003,"Tests\\Unit\\TeamServiceTest::testRemoveMember":0.004,"Tests\\Unit\\TeamServiceTest::testDeleteTeam":0.004,"Tests\\Feature\\Controllers\\Admin\\DashboardControllerTest::testIndex":0.072,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testIndex":0.035,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testCreate":0.034,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testStore":0.013,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testEdit":0.038,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testUpdate":0.005,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testDelete":0.005,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testIndex":0.036,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testSearch":0.035,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testGetInvite":0.032,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testPostInvite":0.09,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testEdit":0.036,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testUpdate":0.006,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testLoginAsUser":0.006,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testReturnToLoginFromUser":0.008,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testDelete":0.004,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testCreate":0.008,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testIndex":0.001,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testDestroy":0.001,"Tests\\Feature\\Controllers\\Ajax\\CookiePolicyControllerTest::testAccept":0.004,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testFileUpload":0.014,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testCreateSubsciption":0.003,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testUpdatePaymentMethod":0.001,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMe":0.026,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMeWithBearerToken":0.012,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testUpdate":0.007,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testDestroy":0.003,"Tests\\Feature\\Controllers\\Auth\\ConfirmsPasswordControllerTest::testGetConfirmPasswordPage":0.029,"Tests\\Feature\\Controllers\\Auth\\ForgotPasswordControllerTest::testGetForgotPassword":0.014,"Tests\\Feature\\Controllers\\Auth\\LoginControllerTest::testGetLoginPage":0.018,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testGetRegistration":0.016,"Tests\\Feature\\Controllers\\Auth\\ResetPasswordControllerTest::testGetResetPasswordPage":0.013,"Tests\\Feature\\Controllers\\Auth\\VerificationControllerTest::testGetVerificationPage":0.003,"Tests\\Feature\\Controllers\\DashboardControllerTest::testDashboard":0.036,"Tests\\Feature\\Controllers\\InvitesControllerTest::testResend":0.007,"Tests\\Feature\\Controllers\\InvitesControllerTest::testRevoke":0.005,"Tests\\Feature\\Controllers\\PagesControllerTest::testHome":0.016,"Tests\\Feature\\Controllers\\PagesControllerTest::testSupport":0.028,"Tests\\Feature\\Controllers\\PagesControllerTest::testPrivacyPolicy":0.027,"Tests\\Feature\\Controllers\\PagesControllerTest::testTermsOfService":0.025,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testShow":0.038,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testEditMember":0.035,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testUpdateMember":0.009,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testInviteMember":0.007,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testLeaveTeam":0.006,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testRemoveTeamMember":0.006,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndex":0.03,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndexWithSubcription":0.03,"Tests\\Feature\\Controllers\\TeamsControllerTest::testCreate":0.031,"Tests\\Feature\\Controllers\\TeamsControllerTest::testStore":0.006,"Tests\\Feature\\Controllers\\TeamsControllerTest::testEdit":0.04,"Tests\\Feature\\Controllers\\TeamsControllerTest::testUpdate":0.007,"Tests\\Feature\\Controllers\\TeamsControllerTest::testDelete":0.008,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingSubscribe":0.002,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingGetDetails":0.001,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingPaymentMethod":0.001,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingCoupon":0.001,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testSecurity":0.036,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testUpdatePassword":0.097,"Tests\\Feature\\Controllers\\User\\DestroyControllerTest::testDestroy":0.028,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testIndex":0.028,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testAccept":0.006,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testReject":0.028,"Tests\\Feature\\Controllers\\User\\LogoutSessionsControllerTest::testSessionLogout":0.007,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testIndex":0.029,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testMarkAsRead":0.005,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDelete":0.004,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDeleteAll":0.005,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testSettings":0.033,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateSettings":0.005,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateUserAvatar":0.006,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testTwoFactorEmail":0.005,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testGoogleTwoFactor":0,"Tests\\Feature\\Helpers\\ActivityHelperTest::testActivityLog":0.001,"Tests\\Feature\\Helpers\\NotificationHelperTest::testAppNotify":0,"Tests\\Feature\\Helpers\\NotificationHelperTest::testEmailNotifyDisabled":0.001,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherGeneral":0.002,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherUser":0.001,"Tests\\Feature\\Resources\\UserResourceTest::testUserResource":0,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testGetTwoFactorPage":0.021,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testVerifyTwoFactorEmail":0.005,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testGetRecoveryPage":0.017,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testCreate":0.005,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testIndex":0.04,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testDestroy":0.008,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testAuthenticatorTwoFactor":0.005,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testPostRegistration":0.01,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testVerifyRecovery":0.015,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testImageUpload":0.004}} \ No newline at end of file +{"version":1,"defects":{"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testCreate":5,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testIndex":5,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testDestroy":5,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testFileUpload":8,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testCreateSubsciption":1,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testUpdatePaymentMethod":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingSubscribe":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingGetDetails":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingPaymentMethod":1,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingCoupon":1,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testTwoFactorEmail":8,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testGoogleTwoFactor":5,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testGetTwoFactorPage":8,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testVerifyTwoFactorEmail":8,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testCreate":8,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testDestroy":8,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testAuthenticatorTwoFactor":8,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testPostRegistration":8,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testVerifyRecovery":8,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testImageUpload":8,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testLeaveTeam":8,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testRemoveTeamMember":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testDelete":8,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testAccept":8,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testSecurity":8,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testUpdatePassword":8,"Tests\\Unit\\InviteServiceTest::testValidateInvitation":8,"Tests\\Feature\\Controllers\\InvitesControllerTest::testResend":8,"Tests\\Feature\\Controllers\\InvitesControllerTest::testRevoke":8,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testShow":7,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testEditMember":7,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testUpdateMember":7,"Tests\\Unit\\ActivityServiceTest::testLog":8,"Tests\\Unit\\InviteServiceTest::testCreate":8,"Tests\\Unit\\TeamServiceTest::testCreate":8,"Tests\\Unit\\TeamServiceTest::testUpdate":8,"Tests\\Unit\\TeamServiceTest::testInvite":8,"Tests\\Unit\\TeamServiceTest::testLeaveTeam":8,"Tests\\Unit\\TeamServiceTest::testRemoveMember":8,"Tests\\Unit\\TeamServiceTest::testDeleteTeam":8,"Tests\\Feature\\Controllers\\Admin\\DashboardControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testCreate":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testStore":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testEdit":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testUpdate":8,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testDelete":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testSearch":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testGetInvite":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testPostInvite":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testEdit":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testUpdate":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testLoginAsUser":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testReturnToLoginFromUser":8,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testDelete":8,"Tests\\Feature\\Controllers\\Ajax\\CookiePolicyControllerTest::testAccept":8,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMe":8,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMeWithBearerToken":8,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testUpdate":8,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testDestroy":8,"Tests\\Feature\\Controllers\\Auth\\ConfirmsPasswordControllerTest::testGetConfirmPasswordPage":8,"Tests\\Feature\\Controllers\\Auth\\ForgotPasswordControllerTest::testGetForgotPassword":8,"Tests\\Feature\\Controllers\\Auth\\LoginControllerTest::testGetLoginPage":8,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testGetRecoveryPage":8,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testGetRegistration":8,"Tests\\Feature\\Controllers\\Auth\\ResetPasswordControllerTest::testGetResetPasswordPage":8,"Tests\\Feature\\Controllers\\Auth\\VerificationControllerTest::testGetVerificationPage":8,"Tests\\Feature\\Controllers\\DashboardControllerTest::testDashboard":8,"Tests\\Feature\\Controllers\\PagesControllerTest::testHome":8,"Tests\\Feature\\Controllers\\PagesControllerTest::testSupport":8,"Tests\\Feature\\Controllers\\PagesControllerTest::testPrivacyPolicy":8,"Tests\\Feature\\Controllers\\PagesControllerTest::testTermsOfService":8,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testInviteMember":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndexWithSubcription":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testCreate":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testStore":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testEdit":8,"Tests\\Feature\\Controllers\\TeamsControllerTest::testUpdate":8,"Tests\\Feature\\Controllers\\User\\DestroyControllerTest::testDestroy":8,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testReject":8,"Tests\\Feature\\Controllers\\User\\LogoutSessionsControllerTest::testSessionLogout":8,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testIndex":8,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testMarkAsRead":8,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDelete":8,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDeleteAll":8,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testSettings":8,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateSettings":8,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateUserAvatar":8,"Tests\\Feature\\Helpers\\ActivityHelperTest::testActivityLog":8,"Tests\\Feature\\Helpers\\NotificationHelperTest::testAppNotify":8,"Tests\\Feature\\Helpers\\NotificationHelperTest::testEmailNotifyDisabled":8,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherGeneral":8,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherUser":8,"Tests\\Feature\\Resources\\UserResourceTest::testUserResource":8},"times":{"Tests\\Unit\\ActivityServiceTest::testLog":0.007,"Tests\\Unit\\InviteServiceTest::testCreate":0.014,"Tests\\Unit\\InviteServiceTest::testValidateInvitation":0.002,"Tests\\Unit\\TeamServiceTest::testCreate":0.001,"Tests\\Unit\\TeamServiceTest::testUpdate":0.001,"Tests\\Unit\\TeamServiceTest::testInvite":0.003,"Tests\\Unit\\TeamServiceTest::testLeaveTeam":0.003,"Tests\\Unit\\TeamServiceTest::testRemoveMember":0.003,"Tests\\Unit\\TeamServiceTest::testDeleteTeam":0.004,"Tests\\Feature\\Controllers\\Admin\\DashboardControllerTest::testIndex":0.082,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testIndex":0.033,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testCreate":0.034,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testStore":0.013,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testEdit":0.035,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testUpdate":0.005,"Tests\\Feature\\Controllers\\Admin\\RoleControllerTest::testDelete":0.004,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testIndex":0.036,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testSearch":0.037,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testGetInvite":0.031,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testPostInvite":0.084,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testEdit":0.036,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testUpdate":0.006,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testLoginAsUser":0.007,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testReturnToLoginFromUser":0.008,"Tests\\Feature\\Controllers\\Admin\\UserControllerTest::testDelete":0.004,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testCreate":0.008,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testIndex":0.001,"Tests\\Feature\\Controllers\\Ajax\\ApiTokenControllerTest::testDestroy":0.001,"Tests\\Feature\\Controllers\\Ajax\\CookiePolicyControllerTest::testAccept":0.004,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testFileUpload":0.015,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testCreateSubsciption":0.003,"Tests\\Feature\\Controllers\\Ajax\\SubscriptionControllerTest::testUpdatePaymentMethod":0.001,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMe":0.023,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testMeWithBearerToken":0.009,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testUpdate":0.006,"Tests\\Feature\\Controllers\\Api\\UsersControllerTest::testDestroy":0.004,"Tests\\Feature\\Controllers\\Auth\\ConfirmsPasswordControllerTest::testGetConfirmPasswordPage":0.028,"Tests\\Feature\\Controllers\\Auth\\ForgotPasswordControllerTest::testGetForgotPassword":0.017,"Tests\\Feature\\Controllers\\Auth\\LoginControllerTest::testGetLoginPage":0.018,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testGetRegistration":0.016,"Tests\\Feature\\Controllers\\Auth\\ResetPasswordControllerTest::testGetResetPasswordPage":0.014,"Tests\\Feature\\Controllers\\Auth\\VerificationControllerTest::testGetVerificationPage":0.003,"Tests\\Feature\\Controllers\\DashboardControllerTest::testDashboard":0.036,"Tests\\Feature\\Controllers\\InvitesControllerTest::testResend":0.005,"Tests\\Feature\\Controllers\\InvitesControllerTest::testRevoke":0.005,"Tests\\Feature\\Controllers\\PagesControllerTest::testHome":0.017,"Tests\\Feature\\Controllers\\PagesControllerTest::testSupport":0.027,"Tests\\Feature\\Controllers\\PagesControllerTest::testPrivacyPolicy":0.026,"Tests\\Feature\\Controllers\\PagesControllerTest::testTermsOfService":0.025,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testShow":0.04,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testEditMember":0.037,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testUpdateMember":0.01,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testInviteMember":0.007,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testLeaveTeam":0.006,"Tests\\Feature\\Controllers\\TeamMembersControllerTest::testRemoveTeamMember":0.006,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndex":0.027,"Tests\\Feature\\Controllers\\TeamsControllerTest::testIndexWithSubcription":0.029,"Tests\\Feature\\Controllers\\TeamsControllerTest::testCreate":0.032,"Tests\\Feature\\Controllers\\TeamsControllerTest::testStore":0.006,"Tests\\Feature\\Controllers\\TeamsControllerTest::testEdit":0.036,"Tests\\Feature\\Controllers\\TeamsControllerTest::testUpdate":0.007,"Tests\\Feature\\Controllers\\TeamsControllerTest::testDelete":0.008,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingSubscribe":0.003,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingGetDetails":0.001,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingPaymentMethod":0.001,"Tests\\Feature\\Controllers\\User\\BillingControllerTest::testBillingCoupon":0.001,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testSecurity":0.035,"Tests\\Feature\\Controllers\\User\\ChangePasswordControllerTest::testUpdatePassword":0.134,"Tests\\Feature\\Controllers\\User\\DestroyControllerTest::testDestroy":0.026,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testIndex":0.028,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testAccept":0.006,"Tests\\Feature\\Controllers\\User\\InvitesControllerTest::testReject":0.029,"Tests\\Feature\\Controllers\\User\\LogoutSessionsControllerTest::testSessionLogout":0.006,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testIndex":0.029,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testMarkAsRead":0.006,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDelete":0.004,"Tests\\Feature\\Controllers\\User\\NotificationControllerTest::testDeleteAll":0.005,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testSettings":0.033,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateSettings":0.006,"Tests\\Feature\\Controllers\\User\\SettingsControllerTest::testUpdateUserAvatar":0.006,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testTwoFactorEmail":0.005,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testGoogleTwoFactor":0,"Tests\\Feature\\Helpers\\ActivityHelperTest::testActivityLog":0.001,"Tests\\Feature\\Helpers\\NotificationHelperTest::testAppNotify":0,"Tests\\Feature\\Helpers\\NotificationHelperTest::testEmailNotifyDisabled":0.003,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherGeneral":0.002,"Tests\\Feature\\Helpers\\NotificationHelperTest::testPusherUser":0.001,"Tests\\Feature\\Resources\\UserResourceTest::testUserResource":0,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testGetTwoFactorPage":0.02,"Tests\\Feature\\Controllers\\Auth\\TwoFactorControllerTest::testVerifyTwoFactorEmail":0.005,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testGetRecoveryPage":0.018,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testCreate":0.005,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testIndex":0.04,"Tests\\Feature\\Controllers\\User\\ApiTokenControllerTest::testDestroy":0.008,"Tests\\Feature\\Controllers\\User\\UserTwoFactorTest::testAuthenticatorTwoFactor":0.005,"Tests\\Feature\\Controllers\\Auth\\RegistrationControllerTest::testPostRegistration":0.009,"Tests\\Feature\\Controllers\\Auth\\RecoveryControllerTest::testVerifyRecovery":0.011,"Tests\\Feature\\Controllers\\Ajax\\FileUploadControllerTest::testImageUpload":0.005}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fed2959..d618757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ---- +## [v2.19.0] - 2024-04-24 + +### Added +- Laravel 11 support + +### Changed +- Some minor ajax stuff +- Improved security headers +- Started dockerizing + ## [v2.18.0] - 2024-01-08 ### Changed diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1fd8b91 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM composer:2.0 as build +COPY . /app/ +RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction + +FROM php:8.1-apache-buster as production + +ENV APP_ENV=production +ENV APP_DEBUG=false + +RUN docker-php-ext-configure opcache --enable-opcache && \ + docker-php-ext-install pdo pdo_mysql +COPY docker/php/conf.d/opcache.ini /usr/local/etc/php/conf.d/opcache.ini + +COPY --from=build /app /var/www/html +COPY docker/000-default.conf /etc/apache2/sites-available/000-default.conf +COPY .env.prod /var/www/html/.env + +RUN php artisan config:cache && \ + php artisan route:cache && \ + chmod 777 -R /var/www/html/storage/ && \ + chown -R www-data:www-data /var/www/ && \ + a2enmod rewrite \ No newline at end of file diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index afcdfb0..3218042 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -23,7 +23,8 @@ protected function schedule(Schedule $schedule) ->runInBackground() ->after(function () { mission_control_notify('Emptied the Failed Jobs table', 'maintenance'); - }); + }) + ->onOneServer(); $schedule->command('maintenance:gzip-purge')->monthlyOn(4, '4:45') ->runInBackground() @@ -35,14 +36,16 @@ protected function schedule(Schedule $schedule) ->monthlyOn(4, '4:45') ->after(function (Stringable $output) { mission_control_notify('PHP Outdated Parsing', 'maintenance', $output); - }); + }) + ->onOneServer(); $schedule->command('maintenance:js-outdated') ->monthlyOn(4, '4:45') ->runInBackground() ->after(function (Stringable $output) { mission_control_notify('JS Outdated Parsing', 'maintenance', $output); - }); + }) + ->onOneServer(); } /** diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 8ff6fde..2eb83cd 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -6,14 +6,14 @@ class ApiController extends Controller { - public $user; - - public function __construct() + public function user() { - $this->user = auth('sanctum')->user(); + $user = auth('sanctum')->user(); - if (is_null($this->user) && ! app()->runningInConsole()) { + if (is_null($user) && ! app()->runningInConsole()) { abort(401, 'Unauthorized.'); } + + return $user; } } diff --git a/app/Http/Controllers/Api/ApiDeviceLoginController.php b/app/Http/Controllers/Api/ApiDeviceLoginController.php index 5f72736..0de88bf 100644 --- a/app/Http/Controllers/Api/ApiDeviceLoginController.php +++ b/app/Http/Controllers/Api/ApiDeviceLoginController.php @@ -10,6 +10,14 @@ class ApiDeviceLoginController extends Controller { + /** + * Device Login + * + * Create a new device token for the user. + * Otherwise we fall back to sanctum's default auth methodology. + * + * @return \Illuminate\Http\JsonResponse + */ public function create(Request $request) { $request->validate([ diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 18565a7..9090f93 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -18,7 +18,7 @@ class UsersController extends ApiController public function me() { return response()->json([ - 'data' => new UserResource($this->user), + 'data' => new UserResource($this->user()), ]); } @@ -30,13 +30,13 @@ public function me() public function update(ApiUserUpdateRequest $request) { if ( - $this->user->update([ + $this->user()->update([ 'email' => $request->json('email'), 'name' => $request->json('name'), ]) ) { return response()->json([ - 'data' => new UserResource($this->user), + 'data' => new UserResource($this->user()), 'status' => 'Profile updated', ]); } @@ -53,17 +53,17 @@ public function update(ApiUserUpdateRequest $request) */ public function destroy() { - if ($this->user->avatar) { - Storage::delete($this->user->avatar); + if ($this->user()->avatar) { + Storage::delete($this->user()->avatar); } $subject = 'Account Deletion.'; $message = 'Your account has been deleted.'; - Notification::route('mail', $this->user->email) - ->notify(new StandardEmail($this->user->name, $subject, $message)); + Notification::route('mail', $this->user()->email) + ->notify(new StandardEmail($this->user()->name, $subject, $message)); - $this->user->delete(); + $this->user()->delete(); return response()->json([ 'status' => 'Profile deleted', diff --git a/app/Models/User.php b/app/Models/User.php index 32b1afa..34415e6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\Http\Forms\UserForm; use App\Models\Concerns\DatabaseSearchable; use App\Models\Concerns\HasActivity; use App\Models\Concerns\HasAvatar; @@ -14,6 +13,7 @@ use App\Models\Concerns\HasTeams; use App\Models\Concerns\HasTwoFactor; use App\Notifications\ResetPassword; +use App\View\Forms\UserForm; use Grafite\Forms\Traits\HasForm; use Grafite\Support\Models\Concerns\CanAccessFeatures; use Grafite\Support\Models\Concerns\HasJavascriptData; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a509f93..7a07957 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,10 +3,13 @@ namespace App\Providers; use App\Models\User; +use Dedoc\Scramble\Scramble; use Illuminate\Pagination\Paginator; +use Illuminate\Routing\Route; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Str; use Illuminate\Validation\Rules\Password; use Laravel\Cashier\Cashier; @@ -40,6 +43,14 @@ public function boot() { Paginator::useBootstrap(); + Scramble::routes(function (Route $route) { + return Str::startsWith($route->uri, 'api/'); + }); + + // Gate::define('viewApiDocs', function (User $user) { + // return in_array($user->email, ['admin@app.com']); + // }); + Blade::if('permission', function ($value) { return request()->user()->hasPermission($value); }); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index ef94e90..de9929d 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -77,7 +77,7 @@ public function boot() // Gateway for determining subscribers Gate::define('subscribed', function ($user) { - return $user->hasActiveSubscription() || $user->onTrial(); + return $user->hasActiveSubscription() || $user->onTrial() || $user->hasRole('admin'); }); // Gateway for determining not cancelled subscribers diff --git a/app/Services/ActivityService.php b/app/Services/ActivityService.php index 463d72d..0d28630 100755 --- a/app/Services/ActivityService.php +++ b/app/Services/ActivityService.php @@ -17,7 +17,7 @@ public function __construct(Activity $model) * Create an activity record. * * @param string $description - * @return \App\Models\Activity + * @return \App\Models\Activity */ public function log($description = '') { diff --git a/app/View/Forms/AdminUserForm.php b/app/View/Forms/AdminUserForm.php index d4822ac..df2211d 100644 --- a/app/View/Forms/AdminUserForm.php +++ b/app/View/Forms/AdminUserForm.php @@ -6,7 +6,6 @@ use App\Models\User; use Grafite\Forms\Fields\Bootstrap\HasOne; use Grafite\Forms\Fields\Email; -use Grafite\Forms\Fields\Hidden; use Grafite\Forms\Fields\Text; use Grafite\Forms\Forms\ModelForm; @@ -55,9 +54,6 @@ public function fields() 'sortable' => true, 'table_class' => 'd-none d-sm-table-cell', ]), - Hidden::make('role', [ - 'table_class' => 'd-none d-sm-table-cell', - ]), HasOne::make('role', [ 'required' => true, 'visible' => false, diff --git a/app/View/Forms/UserForm.php b/app/View/Forms/UserForm.php index 30cc5a4..566f91f 100644 --- a/app/View/Forms/UserForm.php +++ b/app/View/Forms/UserForm.php @@ -3,14 +3,11 @@ namespace App\View\Forms; use App\Models\User; -use Grafite\Forms\Fields\Country; use Grafite\Forms\Fields\Email; use Grafite\Forms\Fields\FileWithPreview; use Grafite\Forms\Fields\Text; use Grafite\Forms\Fields\Toggled; use Grafite\Forms\Forms\ModelForm; -use Grafite\Forms\Html\Heading; -use Grafite\Forms\Html\HrTag; class UserForm extends ModelForm { @@ -37,7 +34,7 @@ class UserForm extends ModelForm public function fields() { - return array_merge([ + return [ Text::make('name', [ 'required' => true, ]), @@ -52,31 +49,6 @@ public function fields() 'preview_identifier' => '.avatar', 'preview_as_background_image' => true, ]), - ]); - } - - public function billingColumns() - { - return [ - Heading::make([ - 'class' => 'mt-4 mb-1', - 'content' => 'Billing Details', - 'level' => 4, - ]), - HrTag::make(), - Email::make('billing_email', [ - 'label' => 'Email', - 'required' => auth()->user()->hasActiveSubscription(), - ]), - Text::make('state', [ - 'label' => 'State', - 'required' => auth()->user()->hasActiveSubscription(), - ]), - Country::make('country', [ - 'label' => 'Country', - 'required' => auth()->user()->hasActiveSubscription(), - 'data-size' => 5, - ]), ]; } } diff --git a/composer.json b/composer.json index d26e7f7..dd10754 100644 --- a/composer.json +++ b/composer.json @@ -9,27 +9,28 @@ ], "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.2", "aws/aws-sdk-php": "^3.192", "bacon/bacon-qr-code": "^2.0", "barryvdh/laravel-debugbar": "^3.6", "bepsvpt/secure-headers": "^7.2", + "dedoc/scramble": "^0.9.0", "grafite/auth": "^1.0", "grafite/blacksmith": "^1.0", "grafite/charts": "^2.0", "grafite/database": "^2.5.2", "grafite/forms": "^6.2", "grafite/html": "^1.0", - "grafite/maintenance": "^0.3.1", - "grafite/mission-control-laravel": "^2.0", + "grafite/maintenance": "^0.4.0", + "grafite/mission-control-laravel": "^3.4", "grafite/support": "^1.1", "guzzlehttp/guzzle": "^7.2", "hisorange/browser-detect": "^4.5", "intervention/image": "^2.5", - "laravel/cashier": "^14.0", - "laravel/framework": "^10.0", + "laravel/cashier": "^15.0", + "laravel/framework": "^11.0", "laravel/helpers": "^1.1", - "laravel/sanctum": "^3.0", + "laravel/sanctum": "^4.0", "lasserafn/php-initial-avatar-generator": "^4.0", "livewire/livewire": "^3.0", "pragmarx/google2fa-laravel": "^2.0", @@ -42,9 +43,9 @@ }, "require-dev": { "brianium/paratest": "^7.0", - "codedungeon/phpunit-result-printer": "^0.31.0", "fakerphp/faker": "^1.10", - "laravel/dusk": "^7.0", + "laravel/dusk": "^8.0", + "laravel/sail": "^1.14", "laravel/pint": "^1.10", "mockery/mockery": "^1.3", "phpunit/phpunit": "^10.0", diff --git a/composer.lock b/composer.lock index 2c93342..beebe24 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24b7fda98dadeaa14d67c216e1f827d7", + "content-hash": "c0dfe7056097e488bc2a95d2fa3e3c7b", "packages": [ { "name": "aws/aws-crt-php", - "version": "v1.2.4", + "version": "v1.2.5", "source": { "type": "git", "url": "https://github.com/awslabs/aws-crt-php.git", - "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2" + "reference": "0ea1f04ec5aa9f049f97e012d1ed63b76834a31b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/eb0c6e4e142224a10b08f49ebf87f32611d162b2", - "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/0ea1f04ec5aa9f049f97e012d1ed63b76834a31b", + "reference": "0ea1f04ec5aa9f049f97e012d1ed63b76834a31b", "shasum": "" }, "require": { @@ -56,22 +56,22 @@ ], "support": { "issues": "https://github.com/awslabs/aws-crt-php/issues", - "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.4" + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.5" }, - "time": "2023-11-08T00:42:13+00:00" + "time": "2024-04-19T21:30:56+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.293.10", + "version": "3.305.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "9ae3bfd036190847dd0a5c3cdc4681dbb0994f5a" + "reference": "c553a07fab74348517e72a0ccc02a612cbf4688b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9ae3bfd036190847dd0a5c3cdc4681dbb0994f5a", - "reference": "9ae3bfd036190847dd0a5c3cdc4681dbb0994f5a", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c553a07fab74348517e72a0ccc02a612cbf4688b", + "reference": "c553a07fab74348517e72a0ccc02a612cbf4688b", "shasum": "" }, "require": { @@ -151,9 +151,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.293.10" + "source": "https://github.com/aws/aws-sdk-php/tree/3.305.2" }, - "time": "2023-12-13T19:41:27+00:00" + "time": "2024-04-24T18:07:47+00:00" }, { "name": "bacon/bacon-qr-code", @@ -211,36 +211,36 @@ }, { "name": "barryvdh/laravel-debugbar", - "version": "v3.9.2", + "version": "v3.13.4", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1" + "reference": "00201bcd1eaf9b1d3debddcdc13c219e4835fb61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/bfd0131c146973cab164e50f5cdd8a67cc60cab1", - "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/00201bcd1eaf9b1d3debddcdc13c219e4835fb61", + "reference": "00201bcd1eaf9b1d3debddcdc13c219e4835fb61", "shasum": "" }, "require": { - "illuminate/routing": "^9|^10", - "illuminate/session": "^9|^10", - "illuminate/support": "^9|^10", - "maximebf/debugbar": "^1.18.2", + "illuminate/routing": "^9|^10|^11", + "illuminate/session": "^9|^10|^11", + "illuminate/support": "^9|^10|^11", + "maximebf/debugbar": "~1.22.0", "php": "^8.0", - "symfony/finder": "^6" + "symfony/finder": "^6|^7" }, "require-dev": { "mockery/mockery": "^1.3.3", - "orchestra/testbench-dusk": "^5|^6|^7|^8", - "phpunit/phpunit": "^8.5.30|^9.0", + "orchestra/testbench-dusk": "^5|^6|^7|^8|^9", + "phpunit/phpunit": "^9.6|^10.5", "squizlabs/php_codesniffer": "^3.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.8-dev" + "dev-master": "3.13-dev" }, "laravel": { "providers": [ @@ -279,7 +279,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.9.2" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.13.4" }, "funding": [ { @@ -291,33 +291,33 @@ "type": "github" } ], - "time": "2023-08-25T18:43:57+00:00" + "time": "2024-04-10T09:15:45+00:00" }, { "name": "bepsvpt/secure-headers", - "version": "7.4.0", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/bepsvpt/secure-headers.git", - "reference": "639e99c72bdfe3d6f933f0a1e0abe1ca722e2e67" + "reference": "946c4050bae960ccc50579dd2d24a2ca3cb7cdf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bepsvpt/secure-headers/zipball/639e99c72bdfe3d6f933f0a1e0abe1ca722e2e67", - "reference": "639e99c72bdfe3d6f933f0a1e0abe1ca722e2e67", + "url": "https://api.github.com/repos/bepsvpt/secure-headers/zipball/946c4050bae960ccc50579dd2d24a2ca3cb7cdf9", + "reference": "946c4050bae960ccc50579dd2d24a2ca3cb7cdf9", "shasum": "" }, "require": { "php": "^7.0 || ^8.0" }, "require-dev": { - "ergebnis/composer-normalize": "~2.29", + "ergebnis/composer-normalize": "^2.42", "ext-json": "*", "ext-xdebug": "*", - "laravel/pint": "~1.4", - "orchestra/testbench": "~3.1 || ~4.18 || ~5.20 || ~6.25 || ~7.19 || ~8.0", - "phpstan/phpstan": "~1.9", - "phpunit/phpunit": "~5.7 || ~6.5 || ~7.5 || ~8.5 || ~9.5 || ~10.0" + "laravel/pint": "^1.14", + "orchestra/testbench": "^3.1 || ^4.18 || ^5.20 || ^6.43 || ^7.41 || ^8.22 || ^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.5 || ^9.6 || ^10.5" }, "type": "library", "extra": { @@ -361,7 +361,7 @@ ], "support": { "issues": "https://github.com/bepsvpt/secure-headers/issues", - "source": "https://github.com/bepsvpt/secure-headers/tree/7.4.0" + "source": "https://github.com/bepsvpt/secure-headers/tree/7.5.0" }, "funding": [ { @@ -369,7 +369,7 @@ "type": "open_collective" } ], - "time": "2023-02-06T13:24:48+00:00" + "time": "2024-03-14T01:20:05+00:00" }, { "name": "brick/math", @@ -497,28 +497,28 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.7", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan": "^1.10", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -553,7 +553,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + "source": "https://github.com/composer/ca-bundle/tree/1.5.0" }, "funding": [ { @@ -569,7 +569,7 @@ "type": "tidelift" } ], - "time": "2023-08-30T09:31:38+00:00" + "time": "2024-03-15T14:00:32+00:00" }, { "name": "dasprid/enum", @@ -621,6 +621,80 @@ }, "time": "2023-08-25T16:18:39+00:00" }, + { + "name": "dedoc/scramble", + "version": "v0.9.0", + "source": { + "type": "git", + "url": "https://github.com/dedoc/scramble.git", + "reference": "6280da6809eecaa03243d726b957cc174b1ccb70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dedoc/scramble/zipball/6280da6809eecaa03243d726b957cc174b1ccb70", + "reference": "6280da6809eecaa03243d726b957cc174b1ccb70", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^10.0|^11.0", + "nikic/php-parser": "^5.0", + "php": "^8.1", + "phpstan/phpdoc-parser": "^1.0", + "spatie/laravel-package-tools": "^1.9.2" + }, + "require-dev": { + "laravel/pint": "^v1.1.0", + "nunomaduro/collision": "^7.0|^8.0", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.34", + "pestphp/pest-plugin-laravel": "^2.3", + "phpunit/phpunit": "^10.5", + "spatie/pest-plugin-snapshots": "^2.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Dedoc\\Scramble\\ScrambleServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Dedoc\\Scramble\\": "src", + "Dedoc\\Scramble\\Database\\Factories\\": "database/factories" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Lytvynenko", + "email": "litvinenko95@gmail.com", + "role": "Developer" + } + ], + "description": "Automatic generation of API documentation for Laravel applications.", + "homepage": "https://github.com/dedoc/scramble", + "keywords": [ + "documentation", + "laravel", + "openapi" + ], + "support": { + "issues": "https://github.com/dedoc/scramble/issues", + "source": "https://github.com/dedoc/scramble/tree/v0.9.0" + }, + "funding": [ + { + "url": "https://github.com/romalytvynenko", + "type": "github" + } + ], + "time": "2024-03-11T19:27:28+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -843,16 +917,16 @@ }, { "name": "doctrine/dbal", - "version": "3.7.2", + "version": "3.8.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "0ac3c270590e54910715e9a1a044cc368df282b2" + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/0ac3c270590e54910715e9a1a044cc368df282b2", - "reference": "0ac3c270590e54910715e9a1a044cc368df282b2", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c", + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c", "shasum": "" }, "require": { @@ -868,14 +942,14 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.42", + "phpstan/phpstan": "1.10.58", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.13", + "phpunit/phpunit": "9.6.16", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", - "squizlabs/php_codesniffer": "3.7.2", - "symfony/cache": "^5.4|^6.0", - "symfony/console": "^4.4|^5.4|^6.0", + "squizlabs/php_codesniffer": "3.9.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", "vimeo/psalm": "4.30.0" }, "suggest": { @@ -936,7 +1010,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.7.2" + "source": "https://github.com/doctrine/dbal/tree/3.8.3" }, "funding": [ { @@ -952,20 +1026,20 @@ "type": "tidelift" } ], - "time": "2023-11-19T08:06:58+00:00" + "time": "2024-03-03T15:55:06+00:00" }, { "name": "doctrine/deprecations", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", "shasum": "" }, "require": { @@ -997,9 +1071,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" }, - "time": "2023-09-27T20:04:15+00:00" + "time": "2024-01-30T19:34:25+00:00" }, { "name": "doctrine/event-manager", @@ -1094,16 +1168,16 @@ }, { "name": "doctrine/inflector", - "version": "2.0.8", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", - "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { @@ -1165,7 +1239,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.8" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -1181,31 +1255,31 @@ "type": "tidelift" } ], - "time": "2023-06-16T13:40:37+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/lexer", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", "shasum": "" }, "require": { "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" + "vimeo/psalm": "^5.21" }, "type": "library", "autoload": { @@ -1242,7 +1316,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" + "source": "https://github.com/doctrine/lexer/tree/3.0.1" }, "funding": [ { @@ -1258,7 +1332,7 @@ "type": "tidelift" } ], - "time": "2022-12-15T16:57:16+00:00" + "time": "2024-02-05T11:56:58+00:00" }, { "name": "donatello-za/rake-php-plus", @@ -1521,26 +1595,26 @@ }, { "name": "grafite/auth", - "version": "v1.0.3", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Auth.git", - "reference": "6aa3a1becfbc68dc99653c2c01f9a7d7c91cd814" + "reference": "4b8b7c42cc7d57b47b0b5bb233a0f95bcc3279e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Auth/zipball/6aa3a1becfbc68dc99653c2c01f9a7d7c91cd814", - "reference": "6aa3a1becfbc68dc99653c2c01f9a7d7c91cd814", + "url": "https://api.github.com/repos/GrafiteInc/Auth/zipball/4b8b7c42cc7d57b47b0b5bb233a0f95bcc3279e0", + "reference": "4b8b7c42cc7d57b47b0b5bb233a0f95bcc3279e0", "shasum": "" }, "require": { - "illuminate/console": "^7.0|^8.0|^9.0|^10.0", - "illuminate/filesystem": "^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", - "php": "^7.2.5|^8.0" + "illuminate/console": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/filesystem": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0", + "php": "^7.2.5|^8.0|^8.2" }, "require-dev": { - "orchestra/testbench": "^6.23|^7.0|^8.0", + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", "phpunit/phpunit": "^9.5.10" }, "type": "library", @@ -1572,27 +1646,27 @@ "description": "Auth backend and Controller stubs for the Laravel Framework from Laravel UI", "support": { "issues": "https://github.com/GrafiteInc/Auth/issues", - "source": "https://github.com/GrafiteInc/Auth/tree/v1.0.3" + "source": "https://github.com/GrafiteInc/Auth/tree/v1.1.0" }, - "time": "2023-08-03T20:13:08+00:00" + "time": "2024-03-12T14:13:11+00:00" }, { "name": "grafite/blacksmith", - "version": "v1.0.0", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Blacksmith.git", - "reference": "bc99a80c804df86336426b4de5338ea555e026ef" + "reference": "46bb6d6be9b586968b8893a052846641d8c3c1af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Blacksmith/zipball/bc99a80c804df86336426b4de5338ea555e026ef", - "reference": "bc99a80c804df86336426b4de5338ea555e026ef", + "url": "https://api.github.com/repos/GrafiteInc/Blacksmith/zipball/46bb6d6be9b586968b8893a052846641d8c3c1af", + "reference": "46bb6d6be9b586968b8893a052846641d8c3c1af", "shasum": "" }, "require": { - "illuminate/collections": "^9.0|^10.0", - "illuminate/support": "^9.0|^10.0", + "illuminate/collections": "^9.0|^10.0|^11.0", + "illuminate/support": "^9.0|^10.0|^11.0", "laravel/forge-sdk": "^3.14", "league/flysystem-aws-s3-v3": "^3.0", "php": "^8.0" @@ -1600,7 +1674,7 @@ "require-dev": { "laravel/pint": "^1.10", "mockery/mockery": "^1.0", - "orchestra/testbench": "^8.0", + "orchestra/testbench": "^8.0|^9.0", "phpunit/phpunit": "^10.0" }, "type": "library", @@ -1633,33 +1707,33 @@ ], "support": { "issues": "https://github.com/GrafiteInc/Blacksmith/issues", - "source": "https://github.com/GrafiteInc/Blacksmith/tree/v1.0.0" + "source": "https://github.com/GrafiteInc/Blacksmith/tree/v1.1.0" }, - "time": "2023-12-13T21:14:59+00:00" + "time": "2024-03-12T14:19:56+00:00" }, { "name": "grafite/charts", - "version": "v2.6.1", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Charts.git", - "reference": "a1d7b1226652581b80a500f41e2a4ba3570ecebc" + "reference": "ccd1af21b29d01d739b35be198f647a09aa053ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Charts/zipball/a1d7b1226652581b80a500f41e2a4ba3570ecebc", - "reference": "a1d7b1226652581b80a500f41e2a4ba3570ecebc", + "url": "https://api.github.com/repos/GrafiteInc/Charts/zipball/ccd1af21b29d01d739b35be198f647a09aa053ca", + "reference": "ccd1af21b29d01d739b35be198f647a09aa053ca", "shasum": "" }, "require": { - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0", "matthiasmullie/minify": "^1.3", "php": ">=7.3|>=8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.5.10" + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.6.0" }, "type": "library", "extra": { @@ -1687,33 +1761,33 @@ "description": "An easy way to integrate Charts in Laravel", "support": { "issues": "https://github.com/GrafiteInc/Charts/issues", - "source": "https://github.com/GrafiteInc/Charts/tree/v2.6.1" + "source": "https://github.com/GrafiteInc/Charts/tree/v2.7.0" }, - "time": "2023-10-06T13:07:43+00:00" + "time": "2024-03-12T14:24:01+00:00" }, { "name": "grafite/database", - "version": "v2.8.1", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Database.git", - "reference": "c0fd738e754fba3844cad1cae018c03a6e24b989" + "reference": "140817ac09be1320abb48b4de58760e67eb3b57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Database/zipball/c0fd738e754fba3844cad1cae018c03a6e24b989", - "reference": "c0fd738e754fba3844cad1cae018c03a6e24b989", + "url": "https://api.github.com/repos/GrafiteInc/Database/zipball/140817ac09be1320abb48b4de58760e67eb3b57d", + "reference": "140817ac09be1320abb48b4de58760e67eb3b57d", "shasum": "" }, "require": { - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "php": ">=7.2", "spatie/db-dumper": "^2.15|^3.2" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/database": "^5.0|^6.0|^7.0|^8.0", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", + "orchestra/database": "^5.0|^6.0|^7.0|^8.0|^9.0", + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0", "phpunit/phpunit": "^9.6" }, "type": "library", @@ -1742,28 +1816,28 @@ "description": "A handy set of commands for MySQL databases", "support": { "issues": "https://github.com/GrafiteInc/Database/issues", - "source": "https://github.com/GrafiteInc/Database/tree/v2.8.1" + "source": "https://github.com/GrafiteInc/Database/tree/v2.9.0" }, - "time": "2023-10-05T16:16:15+00:00" + "time": "2024-03-12T14:27:44+00:00" }, { "name": "grafite/forms", - "version": "v6.23.1", + "version": "v6.25.2", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Forms.git", - "reference": "4cab0dbef290d07610959f2b613add18106e2981" + "reference": "aac3d964874a9e00bc2c3249dda7674a0e77629a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Forms/zipball/4cab0dbef290d07610959f2b613add18106e2981", - "reference": "4cab0dbef290d07610959f2b613add18106e2981", + "url": "https://api.github.com/repos/GrafiteInc/Forms/zipball/aac3d964874a9e00bc2c3249dda7674a0e77629a", + "reference": "aac3d964874a9e00bc2c3249dda7674a0e77629a", "shasum": "" }, "require": { "doctrine/dbal": "^2.5|^3.0", - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", - "illuminate/view": "^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/view": "^7.0|^8.0|^9.0|^10.0|^11.0", "matthiasmullie/minify": "^1.3", "php": ">=7.3|>=8.0" }, @@ -1772,8 +1846,8 @@ "mockery/mockery": "^1.0", "nunomaduro/collision": "^5.10|^6.0", "nunomaduro/phpinsights": "^2.0", - "orchestra/database": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", + "orchestra/database": "^5.0|^6.0", + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0", "phpunit/phpunit": "^9.5.10" }, "suggest": { @@ -1814,39 +1888,39 @@ ], "support": { "issues": "https://github.com/GrafiteInc/Forms/issues", - "source": "https://github.com/GrafiteInc/Forms/tree/v6.23.1" + "source": "https://github.com/GrafiteInc/Forms/tree/v6.25.2" }, - "time": "2023-11-09T20:52:53+00:00" + "time": "2024-04-24T02:53:34+00:00" }, { "name": "grafite/html", - "version": "v1.10.12", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Html.git", - "reference": "ec4e1c8a7407983947eab167c7159c2da14a447f" + "reference": "13523c9cf39331b9e5f9a32b06b5a75edadd65af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Html/zipball/ec4e1c8a7407983947eab167c7159c2da14a447f", - "reference": "ec4e1c8a7407983947eab167c7159c2da14a447f", + "url": "https://api.github.com/repos/GrafiteInc/Html/zipball/13523c9cf39331b9e5f9a32b06b5a75edadd65af", + "reference": "13523c9cf39331b9e5f9a32b06b5a75edadd65af", "shasum": "" }, "require": { "doctrine/dbal": "^2.5|^3.0", - "illuminate/collections": "^8.78|^9.0|^10.0", - "illuminate/database": "^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", - "illuminate/view": "^7.0|^8.0|^9.0|^10.0", + "illuminate/collections": "^8.78|^9.0|^10.0|^11.0", + "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/view": "^7.0|^8.0|^9.0|^10.0|^11.0", "matthiasmullie/minify": "^1.3", "php": ">=7.3|>=8.0" }, "require-dev": { "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.0", - "nunomaduro/collision": "^5.10|^6.0|^7.0", + "nunomaduro/collision": "^5.10|^6.0|^7.0|^8.0", "nunomaduro/phpinsights": "^2.0", - "orchestra/testbench": "^5.0|^6.0|7.0|^8.0", + "orchestra/testbench": "^5.0|^6.0|7.0|^8.0|^9.0", "phpunit/phpunit": "^9.5.10" }, "type": "library", @@ -1880,33 +1954,33 @@ ], "support": { "issues": "https://github.com/GrafiteInc/Html/issues", - "source": "https://github.com/GrafiteInc/Html/tree/v1.10.12" + "source": "https://github.com/GrafiteInc/Html/tree/v1.12.0" }, - "time": "2023-09-06T00:54:20+00:00" + "time": "2024-03-12T14:29:15+00:00" }, { "name": "grafite/maintenance", - "version": "v0.3.1", + "version": "v0.4.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Maintenance.git", - "reference": "ff24ceb19b7e8d4f2e1fb26b4dee3de3688ebb9f" + "reference": "1c9397c1d8e44e5370488da8784b25d9ceed307d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Maintenance/zipball/ff24ceb19b7e8d4f2e1fb26b4dee3de3688ebb9f", - "reference": "ff24ceb19b7e8d4f2e1fb26b4dee3de3688ebb9f", + "url": "https://api.github.com/repos/GrafiteInc/Maintenance/zipball/1c9397c1d8e44e5370488da8784b25d9ceed307d", + "reference": "1c9397c1d8e44e5370488da8784b25d9ceed307d", "shasum": "" }, "require": { - "illuminate/support": "^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0", "mikehaertl/php-shellcommand": "^1.6", "php": ">=7.3|>=8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.0" + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.6" }, "type": "library", "extra": { @@ -1934,38 +2008,38 @@ "description": "A handy set of commands for app maintenance", "support": { "issues": "https://github.com/GrafiteInc/Maintenance/issues", - "source": "https://github.com/GrafiteInc/Maintenance/tree/v0.3.1" + "source": "https://github.com/GrafiteInc/Maintenance/tree/v0.4.0" }, - "time": "2023-03-07T13:50:25+00:00" + "time": "2024-03-12T14:34:46+00:00" }, { "name": "grafite/mission-control", - "version": "v2.12.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Mission-Control-Package.git", - "reference": "00ac167acb5b67ba1b667aef3118e1613c01531e" + "reference": "80fae22e1c399f274a78e9a4cd26d6cbe9e12841" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Mission-Control-Package/zipball/00ac167acb5b67ba1b667aef3118e1613c01531e", - "reference": "00ac167acb5b67ba1b667aef3118e1613c01531e", + "url": "https://api.github.com/repos/GrafiteInc/Mission-Control-Package/zipball/80fae22e1c399f274a78e9a4cd26d6cbe9e12841", + "reference": "80fae22e1c399f274a78e9a4cd26d6cbe9e12841", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^7.5", - "illuminate/support": "^9.0|^10.2", + "illuminate/collections": "^10.|^11.0", + "illuminate/support": "^9.0|^10.2|^11", "kassner/log-parser": "^1.5", "nesbot/carbon": "^1.25|^2.16", - "php": ">=7.3|>=8.0", - "tightenco/collect": "^9.6" + "php": ">=7.3|>=8.0" }, "require-dev": { "fakerphp/faker": "^1.10", "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.0", - "orchestra/testbench": "^8.0", - "phpunit/phpunit": "^9.0" + "orchestra/testbench": "^8.0|^9.0", + "phpunit/phpunit": "^10.0" }, "bin": [ "bin/performance", @@ -1990,32 +2064,33 @@ "description": "The PHP agnostic package for Mission Control (Grafite Inc)", "support": { "issues": "https://github.com/GrafiteInc/Mission-Control-Package/issues", - "source": "https://github.com/GrafiteInc/Mission-Control-Package/tree/v2.12.0" + "source": "https://github.com/GrafiteInc/Mission-Control-Package/tree/v3.2.0" }, - "time": "2023-03-06T15:20:50+00:00" + "time": "2024-03-12T14:56:16+00:00" }, { "name": "grafite/mission-control-laravel", - "version": "v2.4.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Mission-Control-Laravel-Package.git", - "reference": "ccb229c472df105dfdcc79811a42b92481ef131e" + "reference": "15caf77df2f190749ee953a0cbcf3d219a691547" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Mission-Control-Laravel-Package/zipball/ccb229c472df105dfdcc79811a42b92481ef131e", - "reference": "ccb229c472df105dfdcc79811a42b92481ef131e", + "url": "https://api.github.com/repos/GrafiteInc/Mission-Control-Laravel-Package/zipball/15caf77df2f190749ee953a0cbcf3d219a691547", + "reference": "15caf77df2f190749ee953a0cbcf3d219a691547", "shasum": "" }, "require": { - "grafite/mission-control": "^2.4", + "grafite/mission-control": "^3.0", + "illuminate/support": "^10.0|^11.0", "matthiasmullie/minify": "^1.3", "php": ">=7.3|>=8.0" }, "require-dev": { "mockery/mockery": "^1.3", - "orchestra/testbench": "^6.0", + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", "phpunit/phpunit": "^9.0" }, "bin": [ @@ -2050,31 +2125,31 @@ "description": "The Laravel package for Mission Control (Grafite Inc)", "support": { "issues": "https://github.com/GrafiteInc/Mission-Control-Laravel-Package/issues", - "source": "https://github.com/GrafiteInc/Mission-Control-Laravel-Package/tree/v2.4.0" + "source": "https://github.com/GrafiteInc/Mission-Control-Laravel-Package/tree/v3.4.0" }, - "time": "2023-03-04T03:59:25+00:00" + "time": "2024-03-12T14:42:36+00:00" }, { "name": "grafite/support", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/GrafiteInc/Support.git", - "reference": "6e4c1c2dadd45743f58db8c8c08215454e9f7173" + "reference": "55b16e00f1395f9e9513cfc493b96d3e517ee6b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrafiteInc/Support/zipball/6e4c1c2dadd45743f58db8c8c08215454e9f7173", - "reference": "6e4c1c2dadd45743f58db8c8c08215454e9f7173", + "url": "https://api.github.com/repos/GrafiteInc/Support/zipball/55b16e00f1395f9e9513cfc493b96d3e517ee6b4", + "reference": "55b16e00f1395f9e9513cfc493b96d3e517ee6b4", "shasum": "" }, "require": { "divineomega/php-summary": "^3.0", "donatello-za/rake-php-plus": "^1.0", "hallindavid/manny": "^1.02", - "illuminate/collections": "^9.0|^10.0", - "illuminate/support": "^9.0|^10.0", - "illuminate/view": "^9.0|^10.0", + "illuminate/collections": "^9.0|^10.0|^11.0", + "illuminate/support": "^9.0|^10.0|^11.0", + "illuminate/view": "^9.0|^10.0|^11.0", "nojimage/twitter-text-php": "^3.3", "nxp/math-executor": "^2.3", "php": "^8.1" @@ -2082,7 +2157,7 @@ "require-dev": { "laravel/pint": "^1.10", "mockery/mockery": "^1.0", - "orchestra/testbench": "^8.0", + "orchestra/testbench": "^8.0|^9.0", "phpunit/phpunit": "^10.0" }, "type": "library", @@ -2118,9 +2193,9 @@ ], "support": { "issues": "https://github.com/GrafiteInc/Support/issues", - "source": "https://github.com/GrafiteInc/Support/tree/v1.2.0" + "source": "https://github.com/GrafiteInc/Support/tree/v1.3.0" }, - "time": "2023-12-13T04:07:09+00:00" + "time": "2024-03-12T14:31:50+00:00" }, { "name": "graham-campbell/result-type", @@ -2818,16 +2893,16 @@ }, { "name": "jaybizzle/crawler-detect", - "version": "v1.2.116", + "version": "v1.2.118", "source": { "type": "git", "url": "https://github.com/JayBizzle/Crawler-Detect.git", - "reference": "97e9fe30219e60092e107651abb379a38b342921" + "reference": "9b8912ac5b78b780a0ead552b4c3dc9ddfdea4fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/97e9fe30219e60092e107651abb379a38b342921", - "reference": "97e9fe30219e60092e107651abb379a38b342921", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/9b8912ac5b78b780a0ead552b4c3dc9ddfdea4fd", + "reference": "9b8912ac5b78b780a0ead552b4c3dc9ddfdea4fd", "shasum": "" }, "require": { @@ -2864,9 +2939,9 @@ ], "support": { "issues": "https://github.com/JayBizzle/Crawler-Detect/issues", - "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.116" + "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.118" }, - "time": "2023-07-21T15:49:49+00:00" + "time": "2024-04-23T17:07:05+00:00" }, { "name": "kassner/log-parser", @@ -2927,43 +3002,44 @@ }, { "name": "laravel/cashier", - "version": "v14.14.0", + "version": "v15.3.2", "source": { "type": "git", "url": "https://github.com/laravel/cashier-stripe.git", - "reference": "46d8139cc4c4a53c70a56cbc8605c4503a429f4c" + "reference": "f468fb187b2229a0f1b7d20e2a619369eb4a36e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/cashier-stripe/zipball/46d8139cc4c4a53c70a56cbc8605c4503a429f4c", - "reference": "46d8139cc4c4a53c70a56cbc8605c4503a429f4c", + "url": "https://api.github.com/repos/laravel/cashier-stripe/zipball/f468fb187b2229a0f1b7d20e2a619369eb4a36e7", + "reference": "f468fb187b2229a0f1b7d20e2a619369eb4a36e7", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/console": "^9.21|^10.0", - "illuminate/contracts": "^9.21|^10.0", - "illuminate/database": "^9.21|^10.0", - "illuminate/http": "^9.21|^10.0", - "illuminate/log": "^9.21|^10.0", - "illuminate/notifications": "^9.21|^10.0", - "illuminate/pagination": "^9.21|^10.0", - "illuminate/routing": "^9.21|^10.0", - "illuminate/support": "^9.21|^10.0", - "illuminate/view": "^9.21|^10.0", + "illuminate/console": "^10.0|^11.0", + "illuminate/contracts": "^10.0|^11.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/http": "^10.0|^11.0", + "illuminate/log": "^10.0|^11.0", + "illuminate/notifications": "^10.0|^11.0", + "illuminate/pagination": "^10.0|^11.0", + "illuminate/routing": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/view": "^10.0|^11.0", "moneyphp/money": "^4.0", - "nesbot/carbon": "^2.0", - "php": "^8.0", - "stripe/stripe-php": "^7.39|^8.0|^9.0|^10.0", - "symfony/http-kernel": "^6.0", + "nesbot/carbon": "^2.0|^3.0", + "php": "^8.1", + "stripe/stripe-php": "^13.0", + "symfony/console": "^6.0|^7.0", + "symfony/http-kernel": "^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.22.1" }, "require-dev": { "dompdf/dompdf": "^2.0", "mockery/mockery": "^1.0", - "orchestra/testbench": "^7.0|^8.0", + "orchestra/testbench": "^8.18|^9.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^10.4" }, "suggest": { "dompdf/dompdf": "Required when generating and downloading invoice PDF's using Dompdf (^1.0.1|^2.0).", @@ -2972,7 +3048,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "14.x-dev" + "dev-master": "15.x-dev" }, "laravel": { "providers": [ @@ -3010,20 +3086,20 @@ "issues": "https://github.com/laravel/cashier/issues", "source": "https://github.com/laravel/cashier" }, - "time": "2023-11-21T15:08:38+00:00" + "time": "2024-04-12T09:45:48+00:00" }, { "name": "laravel/forge-sdk", - "version": "v3.14.0", + "version": "v3.14.3", "source": { "type": "git", "url": "https://github.com/laravel/forge-sdk.git", - "reference": "af92308b144f060c6059e04c5c1180243fa843bd" + "reference": "6815b83c8459b579520216d0a99f2cde1508b58d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/forge-sdk/zipball/af92308b144f060c6059e04c5c1180243fa843bd", - "reference": "af92308b144f060c6059e04c5c1180243fa843bd", + "url": "https://api.github.com/repos/laravel/forge-sdk/zipball/6815b83c8459b579520216d0a99f2cde1508b58d", + "reference": "6815b83c8459b579520216d0a99f2cde1508b58d", "shasum": "" }, "require": { @@ -3034,7 +3110,7 @@ "require-dev": { "mockery/mockery": "^1.3.1", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.4|^9.0" + "phpunit/phpunit": "^8.4|^9.0|^10.4" }, "type": "library", "extra": { @@ -3078,24 +3154,24 @@ "issues": "https://github.com/laravel/forge-sdk/issues", "source": "https://github.com/laravel/forge-sdk" }, - "time": "2023-09-25T08:22:20+00:00" + "time": "2024-01-23T12:59:57+00:00" }, { "name": "laravel/framework", - "version": "v10.37.3", + "version": "v11.5.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc" + "reference": "e3c24268f1404805e15099b9f035fe310cb30753" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/996375dd61f8c6e4ac262b57ed485655d71fcbdc", - "reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc", + "url": "https://api.github.com/repos/laravel/framework/zipball/e3c24268f1404805e15099b9f035fe310cb30753", + "reference": "e3c24268f1404805e15099b9f035fe310cb30753", "shasum": "" }, "require": { - "brick/math": "^0.9.3|^0.10.2|^0.11", + "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12", "composer-runtime-api": "^2.2", "doctrine/inflector": "^2.0.5", "dragonmantank/cron-expression": "^3.3.2", @@ -3107,36 +3183,39 @@ "ext-openssl": "*", "ext-session": "*", "ext-tokenizer": "*", - "fruitcake/php-cors": "^1.2", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8", "guzzlehttp/uri-template": "^1.0", - "laravel/prompts": "^0.1.9", + "laravel/prompts": "^0.1.18", "laravel/serializable-closure": "^1.3", "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^3.0", - "nesbot/carbon": "^2.67", - "nunomaduro/termwind": "^1.13", - "php": "^8.1", + "nesbot/carbon": "^2.72.2|^3.0", + "nunomaduro/termwind": "^2.0", + "php": "^8.2", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "ramsey/uuid": "^4.7", - "symfony/console": "^6.2", - "symfony/error-handler": "^6.2", - "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.4", - "symfony/http-kernel": "^6.2", - "symfony/mailer": "^6.2", - "symfony/mime": "^6.2", - "symfony/process": "^6.2", - "symfony/routing": "^6.2", - "symfony/uid": "^6.2", - "symfony/var-dumper": "^6.2", + "symfony/console": "^7.0", + "symfony/error-handler": "^7.0", + "symfony/finder": "^7.0", + "symfony/http-foundation": "^7.0", + "symfony/http-kernel": "^7.0", + "symfony/mailer": "^7.0", + "symfony/mime": "^7.0", + "symfony/polyfill-php83": "^1.28", + "symfony/process": "^7.0", + "symfony/routing": "^7.0", + "symfony/uid": "^7.0", + "symfony/var-dumper": "^7.0", "tijsverkoyen/css-to-inline-styles": "^2.2.5", "vlucas/phpdotenv": "^5.4.1", "voku/portable-ascii": "^2.0" }, "conflict": { + "mockery/mockery": "1.6.8", "tightenco/collect": "<5.5.33" }, "provide": { @@ -3176,36 +3255,35 @@ "illuminate/testing": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "spatie/once": "*" }, "require-dev": { "ably/ably-php": "^1.0", "aws/aws-sdk-php": "^3.235.5", - "doctrine/dbal": "^3.5.1", "ext-gmp": "*", - "fakerphp/faker": "^1.21", - "guzzlehttp/guzzle": "^7.5", + "fakerphp/faker": "^1.23", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", "league/flysystem-path-prefixing": "^3.3", "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", - "mockery/mockery": "^1.5.1", + "mockery/mockery": "^1.6", "nyholm/psr7": "^1.2", - "orchestra/testbench-core": "^8.15.1", - "pda/pheanstalk": "^4.0", + "orchestra/testbench-core": "^9.0.6", + "pda/pheanstalk": "^5.0", "phpstan/phpstan": "^1.4.7", - "phpunit/phpunit": "^10.0.7", + "phpunit/phpunit": "^10.5|^11.0", "predis/predis": "^2.0.2", - "symfony/cache": "^6.2", - "symfony/http-client": "^6.2.4", - "symfony/psr-http-message-bridge": "^2.0" + "resend/resend-php": "^0.10.0", + "symfony/cache": "^7.0", + "symfony/http-client": "^7.0", + "symfony/psr-http-message-bridge": "^7.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).", + "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).", "ext-apcu": "Required to use the APC cache driver.", "ext-fileinfo": "Required to use the Filesystem class.", "ext-ftp": "Required to use the Flysystem FTP driver.", @@ -3217,37 +3295,38 @@ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "filp/whoops": "Required for friendly error pages in development (^2.14.3).", - "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", "league/flysystem-read-only": "Required to use read-only disks (^3.3)", "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", - "mockery/mockery": "Required to use mocking (^1.5.1).", + "mockery/mockery": "Required to use mocking (^1.6).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8|^10.0.7).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", + "phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0).", "predis/predis": "Required to use the predis connector (^2.0.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^6.2).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.2).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.2).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.2).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "10.x-dev" + "dev-master": "11.x-dev" } }, "autoload": { "files": [ "src/Illuminate/Collections/helpers.php", "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], @@ -3280,7 +3359,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-12-13T20:10:58+00:00" + "time": "2024-04-23T15:11:31+00:00" }, { "name": "laravel/helpers", @@ -3341,16 +3420,16 @@ }, { "name": "laravel/prompts", - "version": "v0.1.13", + "version": "v0.1.20", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "e1379d8ead15edd6cc4369c22274345982edc95a" + "reference": "bf9a360c484976692de0f3792f30066f4f4b34a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/e1379d8ead15edd6cc4369c22274345982edc95a", - "reference": "e1379d8ead15edd6cc4369c22274345982edc95a", + "url": "https://api.github.com/repos/laravel/prompts/zipball/bf9a360c484976692de0f3792f30066f4f4b34a2", + "reference": "bf9a360c484976692de0f3792f30066f4f4b34a2", "shasum": "" }, "require": { @@ -3366,7 +3445,7 @@ "require-dev": { "mockery/mockery": "^1.5", "pestphp/pest": "^2.3", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^1.11", "phpstan/phpstan-mockery": "^1.1" }, "suggest": { @@ -3392,43 +3471,41 @@ ], "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.13" + "source": "https://github.com/laravel/prompts/tree/v0.1.20" }, - "time": "2023-10-27T13:53:59+00:00" + "time": "2024-04-18T00:45:25+00:00" }, { "name": "laravel/sanctum", - "version": "v3.3.2", + "version": "v4.0.2", "source": { "type": "git", "url": "https://github.com/laravel/sanctum.git", - "reference": "e1a272893bec13cf135627f7e156030b3afe1e60" + "reference": "9cfc0ce80cabad5334efff73ec856339e8ec1ac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/e1a272893bec13cf135627f7e156030b3afe1e60", - "reference": "e1a272893bec13cf135627f7e156030b3afe1e60", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/9cfc0ce80cabad5334efff73ec856339e8ec1ac1", + "reference": "9cfc0ce80cabad5334efff73ec856339e8ec1ac1", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/console": "^9.21|^10.0", - "illuminate/contracts": "^9.21|^10.0", - "illuminate/database": "^9.21|^10.0", - "illuminate/support": "^9.21|^10.0", - "php": "^8.0.2" + "illuminate/console": "^11.0", + "illuminate/contracts": "^11.0", + "illuminate/database": "^11.0", + "illuminate/support": "^11.0", + "php": "^8.2", + "symfony/console": "^7.0" }, "require-dev": { - "mockery/mockery": "^1.0", - "orchestra/testbench": "^7.28.2|^8.8.3", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^9.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - }, "laravel": { "providers": [ "Laravel\\Sanctum\\SanctumServiceProvider" @@ -3460,7 +3537,7 @@ "issues": "https://github.com/laravel/sanctum/issues", "source": "https://github.com/laravel/sanctum" }, - "time": "2023-11-03T13:42:14+00:00" + "time": "2024-04-10T19:39:58+00:00" }, { "name": "laravel/serializable-closure", @@ -3685,16 +3762,16 @@ }, { "name": "league/commonmark", - "version": "2.4.1", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5" + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5", - "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/91c24291965bd6d7c46c46a12ba7492f83b1cadf", + "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf", "shasum": "" }, "require": { @@ -3707,7 +3784,7 @@ }, "require-dev": { "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.0", + "commonmark/cmark": "0.30.3", "commonmark/commonmark.js": "0.30.0", "composer/package-versions-deprecated": "^1.8", "embed/embed": "^4.4", @@ -3717,10 +3794,10 @@ "michelf/php-markdown": "^1.4 || ^2.0", "nyholm/psr7": "^1.5", "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.21", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", + "symfony/finder": "^5.3 | ^6.0 || ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0", "unleashedtech/php-coding-standard": "^3.1.1", "vimeo/psalm": "^4.24.0 || ^5.0.0" }, @@ -3787,7 +3864,7 @@ "type": "tidelift" } ], - "time": "2023-08-30T16:55:00+00:00" + "time": "2024-02-02T11:59:32+00:00" }, { "name": "league/config", @@ -3873,16 +3950,16 @@ }, { "name": "league/flysystem", - "version": "3.23.0", + "version": "3.27.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc" + "reference": "4729745b1ab737908c7d055148c9a6b3e959832f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", - "reference": "d4ad81e2b67396e33dc9d7e54ec74ccf73151dcc", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4729745b1ab737908c7d055148c9a6b3e959832f", + "reference": "4729745b1ab737908c7d055148c9a6b3e959832f", "shasum": "" }, "require": { @@ -3902,7 +3979,7 @@ "require-dev": { "async-aws/s3": "^1.5 || ^2.0", "async-aws/simple-s3": "^1.1 || ^2.0", - "aws/aws-sdk-php": "^3.220.0", + "aws/aws-sdk-php": "^3.295.10", "composer/semver": "^3.0", "ext-fileinfo": "*", "ext-ftp": "*", @@ -3910,10 +3987,10 @@ "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.34", + "phpseclib/phpseclib": "^3.0.36", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", - "sabre/dav": "^4.3.1" + "sabre/dav": "^4.6.0" }, "type": "library", "autoload": { @@ -3947,7 +4024,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.23.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.27.0" }, "funding": [ { @@ -3959,24 +4036,24 @@ "type": "github" } ], - "time": "2023-12-04T10:16:17+00:00" + "time": "2024-04-07T19:17:50+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.22.0", + "version": "3.27.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "9808919ee5d819730d9582d4e1673e8d195c38d8" + "reference": "3e6ce2f972f1470db779f04d29c289dcd2c32837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/9808919ee5d819730d9582d4e1673e8d195c38d8", - "reference": "9808919ee5d819730d9582d4e1673e8d195c38d8", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/3e6ce2f972f1470db779f04d29c289dcd2c32837", + "reference": "3e6ce2f972f1470db779f04d29c289dcd2c32837", "shasum": "" }, "require": { - "aws/aws-sdk-php": "^3.220.0", + "aws/aws-sdk-php": "^3.295.10", "league/flysystem": "^3.10.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" @@ -4012,8 +4089,7 @@ "storage" ], "support": { - "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.22.0" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.27.0" }, "funding": [ { @@ -4025,20 +4101,20 @@ "type": "github" } ], - "time": "2023-11-18T14:03:37+00:00" + "time": "2024-04-07T19:16:54+00:00" }, { "name": "league/flysystem-local", - "version": "3.23.0", + "version": "3.25.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "5cf046ba5f059460e86a997c504dd781a39a109b" + "reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/5cf046ba5f059460e86a997c504dd781a39a109b", - "reference": "5cf046ba5f059460e86a997c504dd781a39a109b", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/61a6a90d6e999e4ddd9ce5adb356de0939060b92", + "reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92", "shasum": "" }, "require": { @@ -4072,8 +4148,7 @@ "local" ], "support": { - "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.23.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.25.1" }, "funding": [ { @@ -4085,20 +4160,20 @@ "type": "github" } ], - "time": "2023-12-04T10:14:46+00:00" + "time": "2024-03-15T19:58:44+00:00" }, { "name": "league/mime-type-detection", - "version": "1.14.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", - "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { @@ -4129,7 +4204,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" }, "funding": [ { @@ -4141,7 +4216,7 @@ "type": "tidelift" } ], - "time": "2023-10-17T14:13:20+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { "name": "league/pipeline", @@ -4202,35 +4277,37 @@ }, { "name": "livewire/livewire", - "version": "v3.3.0", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "7c1f609515e74ef1197c08e56a5606571b3ec1d9" + "reference": "8a78d0c3ae9b4c96a2d8932ea4ac0dc782325de0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/7c1f609515e74ef1197c08e56a5606571b3ec1d9", - "reference": "7c1f609515e74ef1197c08e56a5606571b3ec1d9", + "url": "https://api.github.com/repos/livewire/livewire/zipball/8a78d0c3ae9b4c96a2d8932ea4ac0dc782325de0", + "reference": "8a78d0c3ae9b4c96a2d8932ea4ac0dc782325de0", "shasum": "" }, "require": { - "illuminate/database": "^10.0", - "illuminate/support": "^10.0", - "illuminate/validation": "^10.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/routing": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/validation": "^10.0|^11.0", "league/mime-type-detection": "^1.9", "php": "^8.1", - "symfony/http-kernel": "^6.2" + "symfony/console": "^6.0|^7.0", + "symfony/http-kernel": "^6.2|^7.0" }, "require-dev": { "calebporzio/sushi": "^2.1", - "laravel/framework": "^10.0", + "laravel/framework": "^10.0|^11.0", "laravel/prompts": "^0.1.6", "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^8.0", - "orchestra/testbench-dusk": "^8.0", - "phpunit/phpunit": "^9.0", - "psy/psysh": "@stable" + "orchestra/testbench": "^8.21.0|^9.0", + "orchestra/testbench-dusk": "^8.24|^9.1", + "phpunit/phpunit": "^10.4", + "psy/psysh": "^0.11.22|^0.12" }, "type": "library", "extra": { @@ -4264,7 +4341,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.3.0" + "source": "https://github.com/livewire/livewire/tree/v3.4.11" }, "funding": [ { @@ -4272,20 +4349,20 @@ "type": "github" } ], - "time": "2023-12-11T18:04:00+00:00" + "time": "2024-04-24T12:14:15+00:00" }, { "name": "matomo/device-detector", - "version": "6.2.0", + "version": "6.3.1", "source": { "type": "git", "url": "https://github.com/matomo-org/device-detector.git", - "reference": "3577abbfea71eaf88d4cd432274428c39601754f" + "reference": "8096093346917ee2477d802ab3b00c4c091c5cee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/3577abbfea71eaf88d4cd432274428c39601754f", - "reference": "3577abbfea71eaf88d4cd432274428c39601754f", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/8096093346917ee2477d802ab3b00c4c091c5cee", + "reference": "8096093346917ee2477d802ab3b00c4c091c5cee", "shasum": "" }, "require": { @@ -4297,8 +4374,8 @@ }, "require-dev": { "matthiasmullie/scrapbook": "^1.4.7", - "mayflower/mo4-coding-standard": "^v8.0.0", - "phpstan/phpstan": "^0.12.52", + "mayflower/mo4-coding-standard": "^v9.0.0", + "phpstan/phpstan": "^1.10.44", "phpunit/phpunit": "^8.5.8", "psr/cache": "^1.0.1", "psr/simple-cache": "^1.0.1", @@ -4341,20 +4418,20 @@ "source": "https://github.com/matomo-org/matomo", "wiki": "https://dev.matomo.org/" }, - "time": "2023-11-15T09:44:42+00:00" + "time": "2024-04-12T12:16:21+00:00" }, { "name": "matthiasmullie/minify", - "version": "1.3.71", + "version": "1.3.73", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "ae42a47d7fecc1fbb7277b2f2d84c37a33edc3b1" + "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/ae42a47d7fecc1fbb7277b2f2d84c37a33edc3b1", - "reference": "ae42a47d7fecc1fbb7277b2f2d84c37a33edc3b1", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/cb7a9297b4ab070909cefade30ee95054d4ae87a", + "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a", "shasum": "" }, "require": { @@ -4404,7 +4481,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.71" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.73" }, "funding": [ { @@ -4412,7 +4489,7 @@ "type": "github" } ], - "time": "2023-04-25T20:33:03+00:00" + "time": "2024-03-15T10:27:10+00:00" }, { "name": "matthiasmullie/path-converter", @@ -4469,25 +4546,27 @@ }, { "name": "maximebf/debugbar", - "version": "v1.19.1", + "version": "v1.22.3", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523" + "reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/03dd40a1826f4d585ef93ef83afa2a9874a00523", - "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96", + "reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96", "shasum": "" }, "require": { - "php": "^7.1|^8", + "php": "^7.2|^8", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4|^5|^6" + "symfony/var-dumper": "^4|^5|^6|^7" }, "require-dev": { - "phpunit/phpunit": ">=7.5.20 <10.0", + "dbrekelmans/bdi": "^1", + "phpunit/phpunit": "^8|^9", + "symfony/panther": "^1|^2.1", "twig/twig": "^1.38|^2.7|^3.0" }, "suggest": { @@ -4498,7 +4577,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-master": "1.22-dev" } }, "autoload": { @@ -4529,9 +4608,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.19.1" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.22.3" }, - "time": "2023-10-12T08:10:52+00:00" + "time": "2024-04-03T19:39:26+00:00" }, { "name": "meyfa/php-svg", @@ -4693,41 +4772,41 @@ }, { "name": "moneyphp/money", - "version": "v4.3.0", + "version": "v4.5.0", "source": { "type": "git", "url": "https://github.com/moneyphp/money.git", - "reference": "50ddfd15b2be01d4bed3bcb0c975a6af5f78a183" + "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moneyphp/money/zipball/50ddfd15b2be01d4bed3bcb0c975a6af5f78a183", - "reference": "50ddfd15b2be01d4bed3bcb0c975a6af5f78a183", + "url": "https://api.github.com/repos/moneyphp/money/zipball/a1daa7daf159b4044e3d0c34c41fe2be5860e850", + "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850", "shasum": "" }, "require": { "ext-bcmath": "*", "ext-filter": "*", "ext-json": "*", - "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { "cache/taggable-cache": "^1.1.0", - "doctrine/coding-standard": "^9.0", - "doctrine/instantiator": "^1.4.0", + "doctrine/coding-standard": "^12.0", + "doctrine/instantiator": "^1.5.0 || ^2.0", "ext-gmp": "*", "ext-intl": "*", - "florianv/exchanger": "^2.6.3", + "florianv/exchanger": "^2.8.1", "florianv/swap": "^4.3.0", - "moneyphp/crypto-currencies": "^1.0.0", - "moneyphp/iso-currencies": "^3.2.1", - "php-http/message": "^1.11.0", - "php-http/mock-client": "^1.4.1", + "moneyphp/crypto-currencies": "^1.1.0", + "moneyphp/iso-currencies": "^3.4", + "php-http/message": "^1.16.0", + "php-http/mock-client": "^1.6.0", "phpbench/phpbench": "^1.2.5", - "phpunit/phpunit": "^9.5.4", + "phpunit/phpunit": "^10.5.9", "psalm/plugin-phpunit": "^0.18.4", - "psr/cache": "^1.0.1", - "vimeo/psalm": "~5.15.0" + "psr/cache": "^1.0.1 || ^2.0 || ^3.0", + "vimeo/psalm": "~5.20.0" }, "suggest": { "ext-gmp": "Calculate without integer limits", @@ -4775,22 +4854,22 @@ ], "support": { "issues": "https://github.com/moneyphp/money/issues", - "source": "https://github.com/moneyphp/money/tree/v4.3.0" + "source": "https://github.com/moneyphp/money/tree/v4.5.0" }, - "time": "2023-11-22T09:46:30+00:00" + "time": "2024-02-15T19:47:21+00:00" }, { "name": "monolog/monolog", - "version": "3.5.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" + "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", - "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", + "reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654", "shasum": "" }, "require": { @@ -4813,7 +4892,7 @@ "phpstan/phpstan": "^1.9", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.5.17", "predis/predis": "^1.1 || ^2", "ruflin/elastica": "^7", "symfony/mailer": "^5.4 || ^6", @@ -4866,7 +4945,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.5.0" + "source": "https://github.com/Seldaek/monolog/tree/3.6.0" }, "funding": [ { @@ -4878,7 +4957,7 @@ "type": "tidelift" } ], - "time": "2023-10-27T15:32:31+00:00" + "time": "2024-04-12T21:02:21+00:00" }, { "name": "mtdowling/jmespath.php", @@ -4951,7 +5030,7 @@ "version": "0.6.3", "source": { "type": "git", - "url": "git@github.com:mustangostang/spyc.git", + "url": "https://github.com/mustangostang/spyc.git", "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" }, "dist": { @@ -4994,20 +5073,24 @@ "yaml", "yml" ], + "support": { + "issues": "https://github.com/mustangostang/spyc/issues", + "source": "https://github.com/mustangostang/spyc/tree/0.6.3" + }, "time": "2019-09-10T13:16:29+00:00" }, { "name": "nesbot/carbon", - "version": "2.72.1", + "version": "2.72.3", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78" + "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", - "reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0c6fd108360c562f6e4fd1dedb8233b423e91c83", + "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83", "shasum": "" }, "require": { @@ -5101,35 +5184,35 @@ "type": "tidelift" } ], - "time": "2023-12-08T23:47:49+00:00" + "time": "2024-01-25T10:35:09+00:00" }, { "name": "nette/schema", - "version": "v1.2.5", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a" + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a", - "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a", + "url": "https://api.github.com/repos/nette/schema/zipball/a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", + "reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": "7.1 - 8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.3" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", + "nette/tester": "^2.4", "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" + "tracy/tracy": "^2.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -5161,22 +5244,22 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.5" + "source": "https://github.com/nette/schema/tree/v1.3.0" }, - "time": "2023-10-05T20:37:59+00:00" + "time": "2023-12-11T11:54:22+00:00" }, { "name": "nette/utils", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015" + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015", - "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015", + "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218", "shasum": "" }, "require": { @@ -5247,9 +5330,67 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.3" + "source": "https://github.com/nette/utils/tree/v4.0.4" + }, + "time": "2024-01-17T16:50:36+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.0.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-10-29T21:02:13+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "nojimage/twitter-text-php", @@ -5323,33 +5464,32 @@ }, { "name": "nunomaduro/termwind", - "version": "v1.15.1", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/nunomaduro/termwind.git", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc" + "reference": "58c4c58cf23df7f498daeb97092e34f5259feb6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/58c4c58cf23df7f498daeb97092e34f5259feb6a", + "reference": "58c4c58cf23df7f498daeb97092e34f5259feb6a", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": "^8.0", - "symfony/console": "^5.3.0|^6.0.0" - }, - "require-dev": { - "ergebnis/phpstan-rules": "^1.0.", - "illuminate/console": "^8.0|^9.0", - "illuminate/support": "^8.0|^9.0", - "laravel/pint": "^1.0.0", - "pestphp/pest": "^1.21.0", - "pestphp/pest-plugin-mock": "^1.0", - "phpstan/phpstan": "^1.4.6", - "phpstan/phpstan-strict-rules": "^1.1.0", - "symfony/var-dumper": "^5.2.7|^6.0.0", + "php": "^8.2", + "symfony/console": "^7.0.4" + }, + "require-dev": { + "ergebnis/phpstan-rules": "^2.2.0", + "illuminate/console": "^11.0.0", + "laravel/pint": "^1.14.0", + "mockery/mockery": "^1.6.7", + "pestphp/pest": "^2.34.1", + "phpstan/phpstan": "^1.10.59", + "phpstan/phpstan-strict-rules": "^1.5.2", + "symfony/var-dumper": "^7.0.4", "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", @@ -5358,6 +5498,9 @@ "providers": [ "Termwind\\Laravel\\TermwindServiceProvider" ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -5389,7 +5532,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1" + "source": "https://github.com/nunomaduro/termwind/tree/v2.0.1" }, "funding": [ { @@ -5405,20 +5548,20 @@ "type": "github" } ], - "time": "2023-02-08T01:06:31+00:00" + "time": "2024-03-06T16:17:14+00:00" }, { "name": "nxp/math-executor", - "version": "v2.3.5", + "version": "v2.3.6", "source": { "type": "git", "url": "https://github.com/neonxp/MathExecutor.git", - "reference": "a1f86abc0b4896f287f7851573e5965682b1f2ab" + "reference": "dca855e25f8ba6ab019c2fe9bd8065d4713d00de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neonxp/MathExecutor/zipball/a1f86abc0b4896f287f7851573e5965682b1f2ab", - "reference": "a1f86abc0b4896f287f7851573e5965682b1f2ab", + "url": "https://api.github.com/repos/neonxp/MathExecutor/zipball/dca855e25f8ba6ab019c2fe9bd8065d4713d00de", + "reference": "dca855e25f8ba6ab019c2fe9bd8065d4713d00de", "shasum": "" }, "require": { @@ -5461,9 +5604,9 @@ ], "support": { "issues": "https://github.com/neonxp/MathExecutor/issues", - "source": "https://github.com/neonxp/MathExecutor/tree/v2.3.5" + "source": "https://github.com/neonxp/MathExecutor/tree/v2.3.6" }, - "time": "2023-11-23T15:38:20+00:00" + "time": "2024-02-15T22:51:27+00:00" }, { "name": "overtrue/pinyin", @@ -5657,16 +5800,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.20.0", + "version": "v1.21.1", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "e592a3e06d1fa0d43988c7c7d9948ca836f644b6" + "reference": "bb312875dcdd20680419564fe42ba1d9564b9e37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/e592a3e06d1fa0d43988c7c7d9948ca836f644b6", - "reference": "e592a3e06d1fa0d43988c7c7d9948ca836f644b6", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bb312875dcdd20680419564fe42ba1d9564b9e37", + "reference": "bb312875dcdd20680419564fe42ba1d9564b9e37", "shasum": "" }, "require": { @@ -5737,9 +5880,9 @@ ], "support": { "issues": "https://github.com/paragonie/sodium_compat/issues", - "source": "https://github.com/paragonie/sodium_compat/tree/v1.20.0" + "source": "https://github.com/paragonie/sodium_compat/tree/v1.21.1" }, - "time": "2023-04-30T00:54:53+00:00" + "time": "2024-04-22T22:05:04+00:00" }, { "name": "phpoption/phpoption", @@ -5816,6 +5959,53 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.28.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" + }, + "time": "2024-04-03T18:51:33+00:00" + }, { "name": "pragmarx/google2fa", "version": "v8.0.1", @@ -5870,27 +6060,27 @@ }, { "name": "pragmarx/google2fa-laravel", - "version": "v2.1.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa-laravel.git", - "reference": "035b799d6ea080d07722012c926c15c9dde66fd7" + "reference": "0c3f5ee764d86fbb0af9f662d6ab927162199fc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa-laravel/zipball/035b799d6ea080d07722012c926c15c9dde66fd7", - "reference": "035b799d6ea080d07722012c926c15c9dde66fd7", + "url": "https://api.github.com/repos/antonioribeiro/google2fa-laravel/zipball/0c3f5ee764d86fbb0af9f662d6ab927162199fc1", + "reference": "0c3f5ee764d86fbb0af9f662d6ab927162199fc1", "shasum": "" }, "require": { - "laravel/framework": "^5.4.36|^6.0|^7.0|^8.0|^9.0|^10.0", + "laravel/framework": "^5.4.36|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "php": ">=7.0", "pragmarx/google2fa-qrcode": "^1.0|^2.0|^3.0" }, "require-dev": { "bacon/bacon-qr-code": "^2.0", - "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*|7.*|8.*", - "phpunit/phpunit": "~5|~6|~7|~8|~9" + "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*|7.*|8.*|9.*", + "phpunit/phpunit": "~5|~6|~7|~8|~9|~10" }, "suggest": { "bacon/bacon-qr-code": "Required to generate inline QR Codes.", @@ -5940,9 +6130,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa-laravel/issues", - "source": "https://github.com/antonioribeiro/google2fa-laravel/tree/v2.1.1" + "source": "https://github.com/antonioribeiro/google2fa-laravel/tree/v2.2.0" }, - "time": "2023-02-26T09:41:06+00:00" + "time": "2024-03-26T22:27:18+00:00" }, { "name": "pragmarx/google2fa-qrcode", @@ -6609,16 +6799,16 @@ }, { "name": "pusher/pusher-php-server", - "version": "7.2.3", + "version": "7.2.4", "source": { "type": "git", "url": "https://github.com/pusher/pusher-http-php.git", - "reference": "416e68dd5f640175ad5982131c42a7a666d1d8e9" + "reference": "de2f72296808f9cafa6a4462b15a768ff130cddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/416e68dd5f640175ad5982131c42a7a666d1d8e9", - "reference": "416e68dd5f640175ad5982131c42a7a666d1d8e9", + "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/de2f72296808f9cafa6a4462b15a768ff130cddb", + "reference": "de2f72296808f9cafa6a4462b15a768ff130cddb", "shasum": "" }, "require": { @@ -6664,9 +6854,9 @@ ], "support": { "issues": "https://github.com/pusher/pusher-http-php/issues", - "source": "https://github.com/pusher/pusher-http-php/tree/7.2.3" + "source": "https://github.com/pusher/pusher-http-php/tree/7.2.4" }, - "time": "2023-05-17T16:00:06+00:00" + "time": "2023-12-15T10:58:53+00:00" }, { "name": "ralouphie/getallheaders", @@ -7014,21 +7204,21 @@ }, { "name": "spatie/db-dumper", - "version": "3.4.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/spatie/db-dumper.git", - "reference": "bbd5ae0f331d47e6534eb307e256c11a65c8e24a" + "reference": "faca5056830bccea04eadf07e8074669cb9e905e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/db-dumper/zipball/bbd5ae0f331d47e6534eb307e256c11a65c8e24a", - "reference": "bbd5ae0f331d47e6534eb307e256c11a65c8e24a", + "url": "https://api.github.com/repos/spatie/db-dumper/zipball/faca5056830bccea04eadf07e8074669cb9e905e", + "reference": "faca5056830bccea04eadf07e8074669cb9e905e", "shasum": "" }, "require": { "php": "^8.0", - "symfony/process": "^5.0|^6.0" + "symfony/process": "^5.0|^6.0|^7.0" }, "require-dev": { "pestphp/pest": "^1.22" @@ -7061,7 +7251,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/db-dumper/tree/3.4.0" + "source": "https://github.com/spatie/db-dumper/tree/3.6.0" }, "funding": [ { @@ -7073,40 +7263,40 @@ "type": "github" } ], - "time": "2023-06-27T08:34:52+00:00" + "time": "2024-04-24T14:54:13+00:00" }, { "name": "spatie/laravel-honeypot", - "version": "4.4.0", + "version": "4.5.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-honeypot.git", - "reference": "85728128acb3ff53ffb23c86b9cc2c3d58355050" + "reference": "83036d9eedfd5687ab62cd1b7b29170b41bd7cb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-honeypot/zipball/85728128acb3ff53ffb23c86b9cc2c3d58355050", - "reference": "85728128acb3ff53ffb23c86b9cc2c3d58355050", + "url": "https://api.github.com/repos/spatie/laravel-honeypot/zipball/83036d9eedfd5687ab62cd1b7b29170b41bd7cb4", + "reference": "83036d9eedfd5687ab62cd1b7b29170b41bd7cb4", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0|^9.0|^10.0", - "illuminate/encryption": "^8.0|^9.0|^10.0", - "illuminate/http": "^8.0|^9.0|^10.0", - "illuminate/support": "^8.0|^9.0|^10.0", - "illuminate/validation": "^8.0|^9.0|^10.0", - "nesbot/carbon": "^2.0", + "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0", + "illuminate/encryption": "^8.0|^9.0|^10.0|^11.0", + "illuminate/http": "^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "illuminate/validation": "^8.0|^9.0|^10.0|^11.0", + "nesbot/carbon": "^2.0|^3.0", "php": "^8.0", "spatie/laravel-package-tools": "^1.9", - "symfony/http-foundation": "^5.1.2|^6.0" + "symfony/http-foundation": "^5.1.2|^6.0|^7.0" }, "require-dev": { - "livewire/livewire": "^2.10", - "orchestra/testbench": "^6.23|^7.0|^8.0", - "pestphp/pest-plugin-livewire": "^1.0", - "phpunit/phpunit": "^9.4", - "spatie/pest-plugin-snapshots": "^1.1", - "spatie/phpunit-snapshot-assertions": "^4.2", + "livewire/livewire": "^2.10|^3.0", + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", + "pestphp/pest-plugin-livewire": "^1.0|^2.1", + "phpunit/phpunit": "^9.6|^10.5", + "spatie/pest-plugin-snapshots": "^1.1|^2.1", + "spatie/phpunit-snapshot-assertions": "^4.2|^5.1", "spatie/test-time": "^1.2.1" }, "type": "library", @@ -7141,7 +7331,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-honeypot/tree/4.4.0" + "source": "https://github.com/spatie/laravel-honeypot/tree/4.5.2" }, "funding": [ { @@ -7149,24 +7339,24 @@ "type": "custom" } ], - "time": "2023-12-01T10:30:39+00:00" + "time": "2024-04-15T13:09:07+00:00" }, { "name": "spatie/laravel-package-tools", - "version": "1.16.1", + "version": "1.16.4", "source": { "type": "git", "url": "https://github.com/spatie/laravel-package-tools.git", - "reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d" + "reference": "ddf678e78d7f8b17e5cdd99c0c3413a4a6592e53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/cc7c991555a37f9fa6b814aa03af73f88026a83d", - "reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/ddf678e78d7f8b17e5cdd99c0c3413a4a6592e53", + "reference": "ddf678e78d7f8b17e5cdd99c0c3413a4a6592e53", "shasum": "" }, "require": { - "illuminate/contracts": "^9.28|^10.0", + "illuminate/contracts": "^9.28|^10.0|^11.0", "php": "^8.0" }, "require-dev": { @@ -7201,7 +7391,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-package-tools/issues", - "source": "https://github.com/spatie/laravel-package-tools/tree/1.16.1" + "source": "https://github.com/spatie/laravel-package-tools/tree/1.16.4" }, "funding": [ { @@ -7209,20 +7399,20 @@ "type": "github" } ], - "time": "2023-08-23T09:04:39+00:00" + "time": "2024-03-20T07:29:11+00:00" }, { "name": "stripe/stripe-php", - "version": "v10.21.0", + "version": "v13.18.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "b4ab319731958077227fad1874a3671458c5d593" + "reference": "02abb043b103766f4ed920642ae56ffdc58c7467" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/b4ab319731958077227fad1874a3671458c5d593", - "reference": "b4ab319731958077227fad1874a3671458c5d593", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/02abb043b103766f4ed920642ae56ffdc58c7467", + "reference": "02abb043b103766f4ed920642ae56ffdc58c7467", "shasum": "" }, "require": { @@ -7233,10 +7423,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", - "php-coveralls/php-coveralls": "^2.5", "phpstan/phpstan": "^1.2", - "phpunit/phpunit": "^5.7 || ^9.0", - "squizlabs/php_codesniffer": "^3.3" + "phpunit/phpunit": "^5.7 || ^9.0" }, "type": "library", "extra": { @@ -7268,53 +7456,52 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v10.21.0" + "source": "https://github.com/stripe/stripe-php/tree/v13.18.0" }, - "time": "2023-08-11T00:23:24+00:00" + "time": "2024-04-09T21:08:04+00:00" }, { "name": "symfony/console", - "version": "v6.4.1", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd" + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a550a7c99daeedef3f9d23fb82e3531525ff11fd", - "reference": "a550a7c99daeedef3f9d23fb82e3531525ff11fd", + "url": "https://api.github.com/repos/symfony/console/zipball/fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7348,7 +7535,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.1" + "source": "https://github.com/symfony/console/tree/v7.0.6" }, "funding": [ { @@ -7364,20 +7551,20 @@ "type": "tidelift" } ], - "time": "2023-11-30T10:54:28+00:00" + "time": "2024-04-01T11:04:53+00:00" }, { "name": "symfony/css-selector", - "version": "v7.0.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "bb51d46e53ef8d50d523f0c5faedba056a27943e" + "reference": "ec60a4edf94e63b0556b6a0888548bb400a3a3be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/bb51d46e53ef8d50d523f0c5faedba056a27943e", - "reference": "bb51d46e53ef8d50d523f0c5faedba056a27943e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ec60a4edf94e63b0556b6a0888548bb400a3a3be", + "reference": "ec60a4edf94e63b0556b6a0888548bb400a3a3be", "shasum": "" }, "require": { @@ -7413,7 +7600,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v7.0.0" + "source": "https://github.com/symfony/css-selector/tree/v7.0.3" }, "funding": [ { @@ -7429,7 +7616,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T17:59:56+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7500,22 +7687,22 @@ }, { "name": "symfony/error-handler", - "version": "v6.4.0", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "c873490a1c97b3a0a4838afc36ff36c112d02788" + "reference": "46a4cc138f799886d4bd70477c55c699d3e9dfc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/c873490a1c97b3a0a4838afc36ff36c112d02788", - "reference": "c873490a1c97b3a0a4838afc36ff36c112d02788", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/46a4cc138f799886d4bd70477c55c699d3e9dfc8", + "reference": "46a4cc138f799886d4bd70477c55c699d3e9dfc8", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0" }, "conflict": { "symfony/deprecation-contracts": "<2.5", @@ -7524,7 +7711,7 @@ "require-dev": { "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-kernel": "^6.4|^7.0", - "symfony/serializer": "^5.4|^6.0|^7.0" + "symfony/serializer": "^6.4|^7.0" }, "bin": [ "Resources/bin/patch-type-declarations" @@ -7555,7 +7742,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.0" + "source": "https://github.com/symfony/error-handler/tree/v7.0.6" }, "funding": [ { @@ -7571,20 +7758,20 @@ "type": "tidelift" } ], - "time": "2023-10-18T09:43:34+00:00" + "time": "2024-03-19T11:57:22+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.0.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e" + "reference": "834c28d533dd0636f910909d01b9ff45cc094b5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e", - "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/834c28d533dd0636f910909d01b9ff45cc094b5e", + "reference": "834c28d533dd0636f910909d01b9ff45cc094b5e", "shasum": "" }, "require": { @@ -7635,7 +7822,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.3" }, "funding": [ { @@ -7651,20 +7838,20 @@ "type": "tidelift" } ], - "time": "2023-07-27T16:29:09+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + "reference": "4e64b49bf370ade88e567de29465762e316e4224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4e64b49bf370ade88e567de29465762e316e4224", + "reference": "4e64b49bf370ade88e567de29465762e316e4224", "shasum": "" }, "require": { @@ -7711,7 +7898,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.2" }, "funding": [ { @@ -7727,27 +7914,27 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/finder", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0|^7.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7775,7 +7962,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.0" + "source": "https://github.com/symfony/finder/tree/v7.0.0" }, "funding": [ { @@ -7791,40 +7978,40 @@ "type": "tidelift" } ], - "time": "2023-10-31T17:30:12+00:00" + "time": "2023-10-31T17:59:56+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.4.0", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "44a6d39a9cc11e154547d882d5aac1e014440771" + "reference": "8789625dcf36e5fbf753014678a1e090f1bc759c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/44a6d39a9cc11e154547d882d5aac1e014440771", - "reference": "44a6d39a9cc11e154547d882d5aac1e014440771", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8789625dcf36e5fbf753014678a1e090f1bc759c", + "reference": "8789625dcf36e5fbf753014678a1e090f1bc759c", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.1", "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.3" + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.3|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", - "symfony/mime": "^5.4|^6.0|^7.0", - "symfony/rate-limiter": "^5.4|^6.0|^7.0" + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -7852,7 +8039,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.0" + "source": "https://github.com/symfony/http-foundation/tree/v7.0.6" }, "funding": [ { @@ -7868,76 +8055,75 @@ "type": "tidelift" } ], - "time": "2023-11-20T16:41:16+00:00" + "time": "2024-03-19T11:46:48+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.1", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2953274c16a229b3933ef73a6898e18388e12e1b" + "reference": "34c872391046d59af804af62d4573b829cfe4824" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2953274c16a229b3933ef73a6898e18388e12e1b", - "reference": "2953274c16a229b3933ef73a6898e18388e12e1b", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/34c872391046d59af804af62d4573b829cfe4824", + "reference": "34c872391046d59af804af62d4573b829cfe4824", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<6.1", - "symfony/console": "<5.4", + "symfony/browser-kit": "<6.4", + "symfony/cache": "<6.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", "symfony/dependency-injection": "<6.4", - "symfony/doctrine-bridge": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<5.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/translation": "<6.4", "symfony/translation-contracts": "<2.5", - "symfony/twig-bridge": "<5.4", + "symfony/twig-bridge": "<6.4", "symfony/validator": "<6.4", - "symfony/var-dumper": "<6.3", - "twig/twig": "<2.13" + "symfony/var-dumper": "<6.4", + "twig/twig": "<3.0.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0|^7.0", - "symfony/clock": "^6.2|^7.0", - "symfony/config": "^6.1|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/browser-kit": "^6.4|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", "symfony/dependency-injection": "^6.4|^7.0", - "symfony/dom-crawler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/property-access": "^5.4.5|^6.0.5|^7.0", - "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/serializer": "^6.3|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/translation": "^5.4|^6.0|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/uid": "^6.4|^7.0", "symfony/validator": "^6.4|^7.0", - "symfony/var-exporter": "^6.2|^7.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/var-exporter": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "type": "library", "autoload": { @@ -7965,7 +8151,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.1" + "source": "https://github.com/symfony/http-kernel/tree/v7.0.6" }, "funding": [ { @@ -7981,43 +8167,43 @@ "type": "tidelift" } ], - "time": "2023-12-01T17:02:02+00:00" + "time": "2024-04-03T06:12:25+00:00" }, { "name": "symfony/mailer", - "version": "v6.4.0", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "ca8dcf8892cdc5b4358ecf2528429bb5e706f7ba" + "reference": "eb0c3187c7ddfde12d8aa0e1fa5fb29e730a41e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/ca8dcf8892cdc5b4358ecf2528429bb5e706f7ba", - "reference": "ca8dcf8892cdc5b4358ecf2528429bb5e706f7ba", + "url": "https://api.github.com/repos/symfony/mailer/zipball/eb0c3187c7ddfde12d8aa0e1fa5fb29e730a41e0", + "reference": "eb0c3187c7ddfde12d8aa0e1fa5fb29e730a41e0", "shasum": "" }, "require": { "egulias/email-validator": "^2.1.10|^3|^4", - "php": ">=8.1", + "php": ">=8.2", "psr/event-dispatcher": "^1", "psr/log": "^1|^2|^3", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/mime": "^6.2|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "symfony/http-client-contracts": "<2.5", - "symfony/http-kernel": "<5.4", - "symfony/messenger": "<6.2", - "symfony/mime": "<6.2", - "symfony/twig-bridge": "<6.2.1" + "symfony/http-kernel": "<6.4", + "symfony/messenger": "<6.4", + "symfony/mime": "<6.4", + "symfony/twig-bridge": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/messenger": "^6.2|^7.0", - "symfony/twig-bridge": "^6.2|^7.0" + "symfony/console": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/twig-bridge": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8045,7 +8231,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.4.0" + "source": "https://github.com/symfony/mailer/tree/v7.0.6" }, "funding": [ { @@ -8061,25 +8247,24 @@ "type": "tidelift" } ], - "time": "2023-11-12T18:02:22+00:00" + "time": "2024-03-28T09:20:36+00:00" }, { "name": "symfony/mime", - "version": "v6.4.0", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ca4f58b2ef4baa8f6cecbeca2573f88cd577d205" + "reference": "99362408c9abdf8c7cadcf0529b6fc8b16f5ace2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ca4f58b2ef4baa8f6cecbeca2573f88cd577d205", - "reference": "ca4f58b2ef4baa8f6cecbeca2573f88cd577d205", + "url": "https://api.github.com/repos/symfony/mime/zipball/99362408c9abdf8c7cadcf0529b6fc8b16f5ace2", + "reference": "99362408c9abdf8c7cadcf0529b6fc8b16f5ace2", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -8087,17 +8272,18 @@ "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4", - "symfony/serializer": "<6.3.2" + "symfony/mailer": "<6.4", + "symfony/serializer": "<6.4" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/property-access": "^5.4|^6.0|^7.0", - "symfony/property-info": "^5.4|^6.0|^7.0", - "symfony/serializer": "^6.3.2|^7.0" + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8129,7 +8315,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.0" + "source": "https://github.com/symfony/mime/tree/v7.0.6" }, "funding": [ { @@ -8145,20 +8331,20 @@ "type": "tidelift" } ], - "time": "2023-10-17T11:49:05+00:00" + "time": "2024-03-21T19:37:36+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -8172,9 +8358,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8211,7 +8394,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -8227,20 +8410,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -8251,9 +8434,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8292,7 +8472,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -8308,20 +8488,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "e46b4da57951a16053cd751f63f4a24292788157" + "reference": "07094a28851a49107f3ab4f9120ca2975a64b6e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/e46b4da57951a16053cd751f63f4a24292788157", - "reference": "e46b4da57951a16053cd751f63f4a24292788157", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/07094a28851a49107f3ab4f9120ca2975a64b6e1", + "reference": "07094a28851a49107f3ab4f9120ca2975a64b6e1", "shasum": "" }, "require": { @@ -8332,9 +8512,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8379,7 +8556,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.29.0" }, "funding": [ { @@ -8395,20 +8572,20 @@ "type": "tidelift" } ], - "time": "2023-03-21T17:27:24+00:00" + "time": "2024-01-29T20:12:16+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", - "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", "shasum": "" }, "require": { @@ -8421,9 +8598,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8466,7 +8640,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0" }, "funding": [ { @@ -8482,20 +8656,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:30:37+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -8506,9 +8680,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8550,7 +8721,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -8566,20 +8737,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -8593,9 +8764,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8633,7 +8801,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -8649,20 +8817,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", "shasum": "" }, "require": { @@ -8670,9 +8838,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8709,7 +8874,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" }, "funding": [ { @@ -8725,20 +8890,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -8746,9 +8911,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8792,7 +8954,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -8808,20 +8970,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11" + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", - "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", "shasum": "" }, "require": { @@ -8830,9 +8992,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8872,7 +9031,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" }, "funding": [ { @@ -8888,20 +9047,20 @@ "type": "tidelift" } ], - "time": "2023-08-16T06:22:46+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e" + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9c44518a5aff8da565c8a55dbe85d2769e6f630e", - "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853", "shasum": "" }, "require": { @@ -8915,9 +9074,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -8954,7 +9110,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.29.0" }, "funding": [ { @@ -8970,24 +9126,24 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", - "version": "v6.4.0", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "191703b1566d97a5425dc969e4350d32b8ef17aa" + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/191703b1566d97a5425dc969e4350d32b8ef17aa", - "reference": "191703b1566d97a5425dc969e4350d32b8ef17aa", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -9015,7 +9171,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.0" + "source": "https://github.com/symfony/process/tree/v7.0.4" }, "funding": [ { @@ -9031,40 +9187,38 @@ "type": "tidelift" } ], - "time": "2023-11-17T21:06:49+00:00" + "time": "2024-02-22T20:27:20+00:00" }, { "name": "symfony/routing", - "version": "v6.4.1", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "0c95c164fdba18b12523b75e64199ca3503e6d40" + "reference": "cded64e5bbf9f31786f1055fcc76718fdd77519c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/0c95c164fdba18b12523b75e64199ca3503e6d40", - "reference": "0c95c164fdba18b12523b75e64199ca3503e6d40", + "url": "https://api.github.com/repos/symfony/routing/zipball/cded64e5bbf9f31786f1055fcc76718fdd77519c", + "reference": "cded64e5bbf9f31786f1055fcc76718fdd77519c", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<6.2", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/yaml": "<6.4" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", - "symfony/config": "^6.2|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -9098,7 +9252,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.1" + "source": "https://github.com/symfony/routing/tree/v7.0.6" }, "funding": [ { @@ -9114,25 +9268,25 @@ "type": "tidelift" } ], - "time": "2023-12-01T14:54:37+00:00" + "time": "2024-03-28T21:02:11+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", - "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -9180,7 +9334,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.2" }, "funding": [ { @@ -9196,20 +9350,20 @@ "type": "tidelift" } ], - "time": "2023-07-30T20:28:31+00:00" + "time": "2023-12-19T21:51:00+00:00" }, { "name": "symfony/string", - "version": "v7.0.0", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620" + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620", - "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "url": "https://api.github.com/repos/symfony/string/zipball/f5832521b998b0bec40bee688ad5de98d4cf111b", + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b", "shasum": "" }, "require": { @@ -9266,7 +9420,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.0" + "source": "https://github.com/symfony/string/tree/v7.0.4" }, "funding": [ { @@ -9282,20 +9436,20 @@ "type": "tidelift" } ], - "time": "2023-11-29T08:40:23+00:00" + "time": "2024-02-01T13:17:36+00:00" }, { "name": "symfony/translation", - "version": "v6.4.0", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37" + "reference": "bce6a5a78e94566641b2594d17e48b0da3184a8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37", - "reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37", + "url": "https://api.github.com/repos/symfony/translation/zipball/bce6a5a78e94566641b2594d17e48b0da3184a8e", + "reference": "bce6a5a78e94566641b2594d17e48b0da3184a8e", "shasum": "" }, "require": { @@ -9318,7 +9472,7 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", "symfony/config": "^5.4|^6.0|^7.0", "symfony/console": "^5.4|^6.0|^7.0", @@ -9361,7 +9515,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.0" + "source": "https://github.com/symfony/translation/tree/v6.4.4" }, "funding": [ { @@ -9377,20 +9531,20 @@ "type": "tidelift" } ], - "time": "2023-11-29T08:14:36+00:00" + "time": "2024-02-20T13:16:58+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5" + "reference": "43810bdb2ddb5400e5c5e778e27b210a0ca83b6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dee0c6e5b4c07ce851b462530088e64b255ac9c5", - "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/43810bdb2ddb5400e5c5e778e27b210a0ca83b6b", + "reference": "43810bdb2ddb5400e5c5e778e27b210a0ca83b6b", "shasum": "" }, "require": { @@ -9439,7 +9593,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.4.2" }, "funding": [ { @@ -9455,28 +9609,28 @@ "type": "tidelift" } ], - "time": "2023-07-25T15:08:44+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/uid", - "version": "v6.4.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "8092dd1b1a41372110d06374f99ee62f7f0b9a92" + "reference": "87cedaf3fabd7b733859d4d77aa4ca598259054b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/8092dd1b1a41372110d06374f99ee62f7f0b9a92", - "reference": "8092dd1b1a41372110d06374f99ee62f7f0b9a92", + "url": "https://api.github.com/repos/symfony/uid/zipball/87cedaf3fabd7b733859d4d77aa4ca598259054b", + "reference": "87cedaf3fabd7b733859d4d77aa4ca598259054b", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -9513,7 +9667,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v6.4.0" + "source": "https://github.com/symfony/uid/tree/v7.0.3" }, "funding": [ { @@ -9529,38 +9683,36 @@ "type": "tidelift" } ], - "time": "2023-10-31T08:18:17+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.0", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6" + "reference": "66d13dc207d5dab6b4f4c2b5460efe1bea29dbfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c40f7d17e91d8b407582ed51a2bbf83c52c367f6", - "reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/66d13dc207d5dab6b4f4c2b5460efe1bea29dbfb", + "reference": "66d13dc207d5dab6b4f4c2b5460efe1bea29dbfb", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<6.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^6.3|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/uid": "^5.4|^6.0|^7.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/console": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/uid": "^6.4|^7.0", + "twig/twig": "^3.0.4" }, "bin": [ "Resources/bin/var-dump-server" @@ -9598,7 +9750,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.0" + "source": "https://github.com/symfony/var-dumper/tree/v7.0.6" }, "funding": [ { @@ -9614,74 +9766,20 @@ "type": "tidelift" } ], - "time": "2023-11-09T08:28:32+00:00" - }, - { - "name": "tightenco/collect", - "version": "v9.52.7", - "source": { - "type": "git", - "url": "https://github.com/tighten/collect.git", - "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tighten/collect/zipball/b15143cd11fe01a700fcc449df61adc64452fa6d", - "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d", - "shasum": "" - }, - "require": { - "php": "^8.0", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "nesbot/carbon": "^2.23.0", - "phpunit/phpunit": "^8.3" - }, - "type": "library", - "autoload": { - "files": [ - "src/Collect/Support/helpers.php", - "src/Collect/Support/alias.php" - ], - "psr-4": { - "Tightenco\\Collect\\": "src/Collect" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "Collect - Illuminate Collections as a separate package.", - "keywords": [ - "collection", - "laravel" - ], - "support": { - "issues": "https://github.com/tighten/collect/issues", - "source": "https://github.com/tighten/collect/tree/v9.52.7" - }, - "time": "2023-04-14T21:51:36+00:00" + "time": "2024-03-19T11:57:22+00:00" }, { "name": "tightenco/ziggy", - "version": "v1.8.1", + "version": "v1.8.2", "source": { "type": "git", "url": "https://github.com/tighten/ziggy.git", - "reference": "22dafc51f3f5ae5ed51f7cb6b566e6b9537f6937" + "reference": "939576ad0f3d3e633a9401c8c377bc7bc873ff35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/ziggy/zipball/22dafc51f3f5ae5ed51f7cb6b566e6b9537f6937", - "reference": "22dafc51f3f5ae5ed51f7cb6b566e6b9537f6937", + "url": "https://api.github.com/repos/tighten/ziggy/zipball/939576ad0f3d3e633a9401c8c377bc7bc873ff35", + "reference": "939576ad0f3d3e633a9401c8c377bc7bc873ff35", "shasum": "" }, "require": { @@ -9689,8 +9787,8 @@ "laravel/framework": ">=5.4@dev" }, "require-dev": { - "orchestra/testbench": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0", - "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0" + "orchestra/testbench": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" }, "type": "library", "extra": { @@ -9733,9 +9831,9 @@ ], "support": { "issues": "https://github.com/tighten/ziggy/issues", - "source": "https://github.com/tighten/ziggy/tree/v1.8.1" + "source": "https://github.com/tighten/ziggy/tree/v1.8.2" }, - "time": "2023-10-12T18:31:26+00:00" + "time": "2024-02-20T19:56:04+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -10071,67 +10169,18 @@ } ], "packages-dev": [ - { - "name": "2bj/phanybar", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/2bj/Phanybar.git", - "reference": "88ff671e18f30c2047a34f8cf2465a7ff93c819b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/2bj/Phanybar/zipball/88ff671e18f30c2047a34f8cf2465a7ff93c819b", - "reference": "88ff671e18f30c2047a34f8cf2465a7ff93c819b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "bin": [ - "bin/phanybar" - ], - "type": "library", - "autoload": { - "psr-4": { - "Bakyt\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bakyt Turgumbaev", - "email": "dev2bj@gmail.com" - } - ], - "description": "Control AnyBar from your php", - "keywords": [ - "anybar", - "phanybar" - ], - "support": { - "issues": "https://github.com/2bj/Phanybar/issues", - "source": "https://github.com/2bj/Phanybar/tree/master" - }, - "time": "2015-03-06T12:14:28+00:00" - }, { "name": "brianium/paratest", - "version": "v7.3.1", + "version": "v7.4.3", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "551f46f52a93177d873f3be08a1649ae886b4a30" + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/551f46f52a93177d873f3be08a1649ae886b4a30", - "reference": "551f46f52a93177d873f3be08a1649ae886b4a30", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", + "reference": "64fcfd0e28a6b8078a19dbf9127be2ee645b92ec", "shasum": "" }, "require": { @@ -10139,28 +10188,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.5.1 || ^1.0.0", + "fidry/cpu-core-counter": "^1.1.0", "jean85/pretty-package-versions": "^2.0.5", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "phpunit/php-code-coverage": "^10.1.7", - "phpunit/php-file-iterator": "^4.1.0", - "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.4.2", - "sebastian/environment": "^6.0.1", - "symfony/console": "^6.3.4 || ^7.0.0", - "symfony/process": "^6.3.4 || ^7.0.0" + "php": "~8.2.0 || ~8.3.0", + "phpunit/php-code-coverage": "^10.1.11 || ^11.0.0", + "phpunit/php-file-iterator": "^4.1.0 || ^5.0.0", + "phpunit/php-timer": "^6.0.0 || ^7.0.0", + "phpunit/phpunit": "^10.5.9 || ^11.0.3", + "sebastian/environment": "^6.0.1 || ^7.0.0", + "symfony/console": "^6.4.3 || ^7.0.3", + "symfony/process": "^6.4.3 || ^7.0.3" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.27.6", - "phpstan/phpstan": "^1.10.40", + "phpstan/phpstan": "^1.10.58", "phpstan/phpstan-deprecation-rules": "^1.1.4", "phpstan/phpstan-phpunit": "^1.3.15", "phpstan/phpstan-strict-rules": "^1.5.2", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.3.1 || ^7.0.0" + "squizlabs/php_codesniffer": "^3.9.0", + "symfony/filesystem": "^6.4.3 || ^7.0.3" }, "bin": [ "bin/paratest", @@ -10201,7 +10249,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.3.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.3" }, "funding": [ { @@ -10213,124 +10261,20 @@ "type": "paypal" } ], - "time": "2023-10-31T09:24:17+00:00" - }, - { - "name": "codedungeon/php-cli-colors", - "version": "1.12.2", - "source": { - "type": "git", - "url": "https://github.com/mikeerickson/php-cli-colors.git", - "reference": "e346156f75717140a3dd622124d2ec686aa7ff8e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikeerickson/php-cli-colors/zipball/e346156f75717140a3dd622124d2ec686aa7ff8e", - "reference": "e346156f75717140a3dd622124d2ec686aa7ff8e", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": ">=5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codedungeon\\PHPCliColors\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike Erickson", - "email": "codedungeon@gmail.com" - } - ], - "description": "Liven up you PHP Console Apps with standard colors", - "homepage": "https://github.com/mikeerickson/php-cli-colors", - "keywords": [ - "color", - "colors", - "composer", - "package", - "php" - ], - "support": { - "issues": "https://github.com/mikeerickson/php-cli-colors/issues", - "source": "https://github.com/mikeerickson/php-cli-colors/tree/1.12.2" - }, - "time": "2021-01-05T04:48:27+00:00" - }, - { - "name": "codedungeon/phpunit-result-printer", - "version": "0.31.0", - "source": { - "type": "git", - "url": "https://github.com/mikeerickson/phpunit-pretty-result-printer.git", - "reference": "b04ebbc920062e29578ce34ac73b87f99190e65a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikeerickson/phpunit-pretty-result-printer/zipball/b04ebbc920062e29578ce34ac73b87f99190e65a", - "reference": "b04ebbc920062e29578ce34ac73b87f99190e65a", - "shasum": "" - }, - "require": { - "2bj/phanybar": "^1.0", - "codedungeon/php-cli-colors": "^1.10.2", - "hassankhan/config": "^0.11.2|^1.0|^2.0", - "php": "^7.1 | ^8.0", - "symfony/yaml": "^2.7|^3.0|^4.0|^5.0" - }, - "require-dev": { - "spatie/phpunit-watcher": "^1.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codedungeon\\PHPUnitPrettyResultPrinter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike Erickson", - "email": "codedungeon@gmail.com" - } - ], - "description": "PHPUnit Pretty Result Printer", - "keywords": [ - "TDD", - "composer", - "package", - "phpunit", - "printer", - "result-printer", - "testing" - ], - "support": { - "issues": "https://github.com/mikeerickson/phpunit-pretty-result-printer/issues", - "source": "https://github.com/mikeerickson/phpunit-pretty-result-printer/tree/0.31.0" - }, - "time": "2021-07-28T16:51:01+00:00" + "time": "2024-02-20T07:24:02+00:00" }, { "name": "fakerphp/faker", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01" + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", - "reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", "shasum": "" }, "require": { @@ -10356,11 +10300,6 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -10383,22 +10322,22 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.23.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" }, - "time": "2023-06-12T08:44:38+00:00" + "time": "2024-01-02T13:46:09+00:00" }, { "name": "fidry/cpu-core-counter", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077" + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/85193c0b0cb5c47894b5eaec906e946f054e7077", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", "shasum": "" }, "require": { @@ -10438,7 +10377,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.0.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" }, "funding": [ { @@ -10446,7 +10385,7 @@ "type": "github" } ], - "time": "2023-09-17T21:38:23+00:00" + "time": "2024-02-07T09:43:46+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -10499,80 +10438,18 @@ }, "time": "2020-07-09T08:09:16+00:00" }, - { - "name": "hassankhan/config", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/hassankhan/config.git", - "reference": "62b0fd17540136efa94ab6b39f04044c6dc5e4a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hassankhan/config/zipball/62b0fd17540136efa94ab6b39f04044c6dc5e4a7", - "reference": "62b0fd17540136efa94ab6b39f04044c6dc5e4a7", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.36 || ~5.7 || ~6.5 || ~7.5", - "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.2", - "symfony/yaml": "~3.4" - }, - "suggest": { - "symfony/yaml": "~3.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Noodlehaus\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Hassan Khan", - "homepage": "http://hassankhan.me/", - "role": "Developer" - } - ], - "description": "Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files", - "homepage": "http://hassankhan.me/config/", - "keywords": [ - "config", - "configuration", - "ini", - "json", - "microphp", - "unframework", - "xml", - "yaml", - "yml" - ], - "support": { - "issues": "https://github.com/hassankhan/config/issues", - "source": "https://github.com/hassankhan/config/tree/2.2.0" - }, - "time": "2020-12-07T16:04:15+00:00" - }, { "name": "jean85/pretty-package-versions", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", "shasum": "" }, "require": { @@ -10580,9 +10457,9 @@ "php": "^7.1|^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", + "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^7.5|^8.5|^9.4", "vimeo/psalm": "^4.3" }, @@ -10616,53 +10493,49 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" }, - "time": "2021-10-08T21:21:46+00:00" + "time": "2024-03-08T09:58:59+00:00" }, { "name": "laravel/dusk", - "version": "v7.12.0", + "version": "v8.2.0", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "94534fa924600e7a103f177d41b74e9b94f0994d" + "reference": "773a12dfbd3f84174b0f26fbc2807a414a379a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/94534fa924600e7a103f177d41b74e9b94f0994d", - "reference": "94534fa924600e7a103f177d41b74e9b94f0994d", + "url": "https://api.github.com/repos/laravel/dusk/zipball/773a12dfbd3f84174b0f26fbc2807a414a379a66", + "reference": "773a12dfbd3f84174b0f26fbc2807a414a379a66", "shasum": "" }, "require": { "ext-json": "*", "ext-zip": "*", - "guzzlehttp/guzzle": "^7.2", - "illuminate/console": "^9.0|^10.0", - "illuminate/support": "^9.0|^10.0", - "nesbot/carbon": "^2.0", - "php": "^8.0", + "guzzlehttp/guzzle": "^7.5", + "illuminate/console": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "php": "^8.1", "php-webdriver/webdriver": "^1.9.0", - "symfony/console": "^6.0", - "symfony/finder": "^6.0", - "symfony/process": "^6.0", + "symfony/console": "^6.2|^7.0", + "symfony/finder": "^6.2|^7.0", + "symfony/process": "^6.2|^7.0", "vlucas/phpdotenv": "^5.2" }, "require-dev": { - "mockery/mockery": "^1.4.2", - "orchestra/testbench": "^7.33|^8.13", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.19|^9.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.5.10|^10.0.1", - "psy/psysh": "^0.11.12" + "phpunit/phpunit": "^10.1|^11.0", + "psy/psysh": "^0.11.12|^0.12" }, "suggest": { "ext-pcntl": "Used to gracefully terminate Dusk when tests are running." }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.x-dev" - }, "laravel": { "providers": [ "Laravel\\Dusk\\DuskServiceProvider" @@ -10692,22 +10565,22 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v7.12.0" + "source": "https://github.com/laravel/dusk/tree/v8.2.0" }, - "time": "2023-12-05T15:05:04+00:00" + "time": "2024-04-16T15:51:19+00:00" }, { "name": "laravel/pint", - "version": "v1.13.7", + "version": "v1.15.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "4157768980dbd977f1c4b4cc94997416d8b30ece" + "reference": "2c9f8004899815f3f0ee3cb28ef7281e2b589134" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/4157768980dbd977f1c4b4cc94997416d8b30ece", - "reference": "4157768980dbd977f1c4b4cc94997416d8b30ece", + "url": "https://api.github.com/repos/laravel/pint/zipball/2c9f8004899815f3f0ee3cb28ef7281e2b589134", + "reference": "2c9f8004899815f3f0ee3cb28ef7281e2b589134", "shasum": "" }, "require": { @@ -10718,13 +10591,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.38.0", - "illuminate/view": "^10.30.1", + "friendsofphp/php-cs-fixer": "^3.54.0", + "illuminate/view": "^10.48.8", + "larastan/larastan": "^2.9.5", "laravel-zero/framework": "^10.3.0", - "mockery/mockery": "^1.6.6", - "nunomaduro/larastan": "^2.6.4", + "mockery/mockery": "^1.6.11", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.24.2" + "pestphp/pest": "^2.34.7" }, "bin": [ "builds/pint" @@ -10760,20 +10633,83 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2023-12-05T19:43:12+00:00" + "time": "2024-04-23T15:42:34+00:00" + }, + { + "name": "laravel/sail", + "version": "v1.29.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/8be4a31150eab3b46af11a2e7b2c4632eefaad7e", + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e", + "shasum": "" + }, + "require": { + "illuminate/console": "^9.52.16|^10.0|^11.0", + "illuminate/contracts": "^9.52.16|^10.0|^11.0", + "illuminate/support": "^9.52.16|^10.0|^11.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0", + "symfony/yaml": "^6.0|^7.0" + }, + "require-dev": { + "orchestra/testbench": "^7.0|^8.0|^9.0", + "phpstan/phpstan": "^1.10" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2024-03-20T20:09:31+00:00" }, { "name": "mockery/mockery", - "version": "1.6.7", + "version": "1.6.11", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06" + "reference": "81a161d0b135df89951abd52296adf97deb0723d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "url": "https://api.github.com/repos/mockery/mockery/zipball/81a161d0b135df89951abd52296adf97deb0723d", + "reference": "81a161d0b135df89951abd52296adf97deb0723d", "shasum": "" }, "require": { @@ -10785,8 +10721,8 @@ "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.6.10", - "symplify/easy-coding-standard": "^12.0.8" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "type": "library", "autoload": { @@ -10843,7 +10779,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2023-12-10T02:24:34+00:00" + "time": "2024-03-21T18:34:15+00:00" }, { "name": "myclabs/deep-copy", @@ -10904,78 +10840,23 @@ ], "time": "2023-03-08T13:26:56+00:00" }, - { - "name": "nikic/php-parser", - "version": "v4.18.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" - }, - "time": "2023-12-10T21:03:43+00:00" - }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -11016,9 +10897,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -11139,23 +11026,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.10", + "version": "10.1.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "599109c8ca6bae97b23482d557d2874c25a65e59" + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/599109c8ca6bae97b23482d557d2874c25a65e59", - "reference": "599109c8ca6bae97b23482d557d2874c25a65e59", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-text-template": "^3.0", @@ -11205,7 +11092,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.10" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" }, "funding": [ { @@ -11213,7 +11100,7 @@ "type": "github" } ], - "time": "2023-12-11T06:28:43+00:00" + "time": "2024-03-12T15:33:41+00:00" }, { "name": "phpunit/php-file-iterator", @@ -11460,16 +11347,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.3", + "version": "10.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19" + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6fce887c71076a73f32fd3e0774a6833fc5c7f19", - "reference": "6fce887c71076a73f32fd3e0774a6833fc5c7f19", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/547d314dc24ec1e177720d45c6263fb226cc2ae3", + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3", "shasum": "" }, "require": { @@ -11541,7 +11428,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.20" }, "funding": [ { @@ -11557,20 +11444,20 @@ "type": "tidelift" } ], - "time": "2023-12-13T07:25:23+00:00" + "time": "2024-04-24T06:32:35+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -11605,7 +11492,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -11613,7 +11501,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -11805,20 +11693,20 @@ }, { "name": "sebastian/complexity", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68cfb347a44871f01e33ab0ef8215966432f6957", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -11827,7 +11715,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -11851,7 +11739,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -11859,20 +11747,20 @@ "type": "github" } ], - "time": "2023-09-28T11:50:59+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.3", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -11880,12 +11768,12 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -11918,7 +11806,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -11926,20 +11814,20 @@ "type": "github" } ], - "time": "2023-05-01T07:48:21+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "6.0.1", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -11954,7 +11842,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -11982,7 +11870,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -11990,20 +11878,20 @@ "type": "github" } ], - "time": "2023-04-11T05:39:26+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -12060,7 +11948,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -12068,20 +11956,20 @@ "type": "github" } ], - "time": "2023-09-24T13:22:09+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -12115,14 +12003,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -12130,24 +12018,24 @@ "type": "github" } ], - "time": "2023-07-19T07:19:23+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -12180,7 +12068,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -12188,7 +12076,7 @@ "type": "github" } ], - "time": "2023-08-31T09:25:50+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -12476,16 +12364,16 @@ }, { "name": "spatie/backtrace", - "version": "1.5.3", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab" + "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/483f76a82964a0431aa836b6ed0edde0c248e3ab", - "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/8373b9d51638292e3bfd736a9c19a654111b4a23", + "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23", "shasum": "" }, "require": { @@ -12493,6 +12381,7 @@ }, "require-dev": { "ext-json": "*", + "laravel/serializable-closure": "^1.3", "phpunit/phpunit": "^9.3", "spatie/phpunit-snapshot-assertions": "^4.2", "symfony/var-dumper": "^5.1" @@ -12522,7 +12411,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.5.3" + "source": "https://github.com/spatie/backtrace/tree/1.6.1" }, "funding": [ { @@ -12534,25 +12423,24 @@ "type": "other" } ], - "time": "2023-06-28T12:59:17+00:00" + "time": "2024-04-24T13:22:11+00:00" }, { "name": "spatie/flare-client-php", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/spatie/flare-client-php.git", - "reference": "5db2fdd743c3ede33f2a5367d89ec1a7c9c1d1ec" + "reference": "17082e780752d346c2db12ef5d6bee8e835e399c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/5db2fdd743c3ede33f2a5367d89ec1a7c9c1d1ec", - "reference": "5db2fdd743c3ede33f2a5367d89ec1a7c9c1d1ec", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/17082e780752d346c2db12ef5d6bee8e835e399c", + "reference": "17082e780752d346c2db12ef5d6bee8e835e399c", "shasum": "" }, "require": { "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0", - "nesbot/carbon": "^2.62.1", "php": "^8.0", "spatie/backtrace": "^1.5.2", "symfony/http-foundation": "^5.2|^6.0|^7.0", @@ -12596,7 +12484,7 @@ ], "support": { "issues": "https://github.com/spatie/flare-client-php/issues", - "source": "https://github.com/spatie/flare-client-php/tree/1.4.3" + "source": "https://github.com/spatie/flare-client-php/tree/1.4.4" }, "funding": [ { @@ -12604,20 +12492,20 @@ "type": "github" } ], - "time": "2023-10-17T15:54:07+00:00" + "time": "2024-01-31T14:18:45+00:00" }, { "name": "spatie/ignition", - "version": "1.11.3", + "version": "1.13.2", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "3d886de644ff7a5b42e4d27c1e1f67c8b5f00044" + "reference": "952798e239d9969e4e694b124c2cc222798dbb28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/3d886de644ff7a5b42e4d27c1e1f67c8b5f00044", - "reference": "3d886de644ff7a5b42e4d27c1e1f67c8b5f00044", + "url": "https://api.github.com/repos/spatie/ignition/zipball/952798e239d9969e4e694b124c2cc222798dbb28", + "reference": "952798e239d9969e4e694b124c2cc222798dbb28", "shasum": "" }, "require": { @@ -12687,39 +12575,39 @@ "type": "github" } ], - "time": "2023-10-18T14:09:40+00:00" + "time": "2024-04-16T08:49:17+00:00" }, { "name": "spatie/laravel-ignition", - "version": "2.3.1", + "version": "2.5.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "bf21cd15aa47fa4ec5d73bbc932005c70261efc8" + "reference": "c93fcadcc4629775c839ac9a90916f07a660266f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/bf21cd15aa47fa4ec5d73bbc932005c70261efc8", - "reference": "bf21cd15aa47fa4ec5d73bbc932005c70261efc8", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/c93fcadcc4629775c839ac9a90916f07a660266f", + "reference": "c93fcadcc4629775c839ac9a90916f07a660266f", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "illuminate/support": "^10.0", + "illuminate/support": "^10.0|^11.0", "php": "^8.1", "spatie/flare-client-php": "^1.3.5", - "spatie/ignition": "^1.9", - "symfony/console": "^6.2.3", - "symfony/var-dumper": "^6.2.3" + "spatie/ignition": "^1.13.2", + "symfony/console": "^6.2.3|^7.0", + "symfony/var-dumper": "^6.2.3|^7.0" }, "require-dev": { - "livewire/livewire": "^2.11", + "livewire/livewire": "^2.11|^3.3.5", "mockery/mockery": "^1.5.1", - "openai-php/client": "^0.3.4", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^1.22.3", + "openai-php/client": "^0.8.1", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.30", "phpstan/extension-installer": "^1.2", "phpstan/phpstan-deprecation-rules": "^1.1.1", "phpstan/phpstan-phpunit": "^1.3.3", @@ -12779,35 +12667,31 @@ "type": "github" } ], - "time": "2023-10-09T12:55:26+00:00" + "time": "2024-04-16T08:57:16+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.31", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563" + "reference": "2d4fca631c00700597e9442a0b2451ce234513d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f387675d7f5fc4231f7554baa70681f222f73563", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2d4fca631c00700597e9442a0b2451ce234513d3", + "reference": "2d4fca631c00700597e9442a0b2451ce234513d3", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.3" + "symfony/console": "<6.4" }, "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "symfony/console": "^6.4|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -12838,7 +12722,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.31" + "source": "https://github.com/symfony/yaml/tree/v7.0.3" }, "funding": [ { @@ -12854,20 +12738,20 @@ "type": "tidelift" } ], - "time": "2023-11-03T14:41:28+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -12896,7 +12780,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -12904,7 +12788,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -12913,7 +12797,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.0" + "php": "^8.2" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/config/cors.php b/config/cors.php index cc4ab03..49e34d6 100644 --- a/config/cors.php +++ b/config/cors.php @@ -16,6 +16,7 @@ 'paths' => [ 'api/*', + 'sanctum/csrf-cookie', ], 'allowed_methods' => ['*'], diff --git a/config/scramble.php b/config/scramble.php new file mode 100644 index 0000000..637559f --- /dev/null +++ b/config/scramble.php @@ -0,0 +1,83 @@ + 'api', + + /* + * Your API domain. By default, app domain is used. This is also a part of the default API routes + * matcher, so when implementing your own, make sure you use this config if needed. + */ + 'api_domain' => null, + + /** + * The path where your OpenAPI specification will be exported. + */ + 'export_path' => 'api.json', + + /* + * Define the theme of the documentation. + * Available options are `light` and `dark`. + */ + 'theme' => 'light', + + 'info' => [ + /* + * API version. + */ + 'version' => env('API_VERSION', '0.0.1'), + + /* + * Description rendered on the home page of the API documentation (`/docs/api`). + */ + 'description' => '', + ], + + /* + * Customize Stoplight Elements UI + */ + 'ui' => [ + /* + * Hide the `Try It` feature. Enabled by default. + */ + 'hide_try_it' => false, + + /* + * URL to an image that displays as a small square logo next to the title, above the table of contents. + */ + 'logo' => '', + + /* + * Use to fetch the credential policy for the Try It feature. Options are: omit, include (default), and same-origin + */ + 'try_it_credentials_policy' => 'include', + ], + + /* + * The list of servers of the API. By default, when `null`, server URL will be created from + * `scramble.api_path` and `scramble.api_domain` config variables. When providing an array, you + * will need to specify the local server URL manually (if needed). + * + * Example of non-default config (final URLs are generated using Laravel `url` helper): + * + * ```php + * 'servers' => [ + * 'Live' => 'api', + * 'Prod' => 'https://scramble.dedoc.co/api', + * ], + * ``` + */ + 'servers' => null, + + 'middleware' => [ + 'web', + RestrictedDocsAccess::class, + ], + + 'extensions' => [], +]; diff --git a/config/secure-headers.php b/config/secure-headers.php index b9c9bdf..de2b81c 100644 --- a/config/secure-headers.php +++ b/config/secure-headers.php @@ -109,7 +109,7 @@ */ 'hsts' => [ - 'enable' => false, + 'enable' => true, 'max-age' => 31536000, @@ -156,15 +156,15 @@ ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/ambient-light-sensor - 'ambient-light-sensor' => [ - 'none' => false, + // 'ambient-light-sensor' => [ + // 'none' => false, - '*' => false, + // '*' => false, - 'self' => true, + // 'self' => true, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/autoplay 'autoplay' => [ @@ -178,15 +178,15 @@ ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/battery - 'battery' => [ - 'none' => false, + // 'battery' => [ + // 'none' => false, - '*' => false, + // '*' => false, - 'self' => true, + // 'self' => true, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/camera 'camera' => [ @@ -222,15 +222,15 @@ ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/document-domain - 'document-domain' => [ - 'none' => false, + // 'document-domain' => [ + // 'none' => false, - '*' => true, + // '*' => true, - 'self' => false, + // 'self' => false, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/encrypted-media 'encrypted-media' => [ @@ -244,26 +244,26 @@ ], // https://wicg.github.io/page-lifecycle/#execution-while-not-rendered - 'execution-while-not-rendered' => [ - 'none' => false, + // 'execution-while-not-rendered' => [ + // 'none' => false, - '*' => true, + // '*' => true, - 'self' => false, + // 'self' => false, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://wicg.github.io/page-lifecycle/#execution-while-out-of-viewport - 'execution-while-out-of-viewport' => [ - 'none' => false, + // 'execution-while-out-of-viewport' => [ + // 'none' => false, - '*' => true, + // '*' => true, - 'self' => false, + // 'self' => false, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/fullscreen 'fullscreen' => [ @@ -332,15 +332,15 @@ ], // https://drafts.csswg.org/css-nav-1/ - 'navigation-override' => [ - 'none' => false, + // 'navigation-override' => [ + // 'none' => false, - '*' => false, + // '*' => false, - 'self' => true, + // 'self' => true, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/payment 'payment' => [ @@ -409,15 +409,15 @@ ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/web-share - 'web-share' => [ - 'none' => false, + // 'web-share' => [ + // 'none' => false, - '*' => false, + // '*' => false, - 'self' => true, + // 'self' => true, - 'origins' => [], - ], + // 'origins' => [], + // ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking 'xr-spatial-tracking' => [ @@ -559,12 +559,19 @@ 'script-src' => [ 'none' => false, - 'self' => false, + 'self' => true, 'report-sample' => false, 'allow' => [ - // 'url', + 'cdn.quilljs.com', + 'cdnjs.cloudflare.com', + 'unpkg.com', + 'cdn.jsdelivr.net', + 'kit.fontawesome.com', + 'code.jquery.com', + 'js.pusher.com', + 'cdn.usefathom.com', ], 'schemes' => [ @@ -574,9 +581,9 @@ // followings are only work for `script` and `style` related directives - 'unsafe-inline' => false, + 'unsafe-inline' => true, - 'unsafe-eval' => false, + 'unsafe-eval' => true, // https://www.w3.org/TR/CSP3/#unsafe-hashes-usage 'unsafe-hashes' => false, @@ -607,10 +614,17 @@ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem 'script-src-elem' => [ + 'cdn.quilljs.com', + 'cdnjs.cloudflare.com', + 'unpkg.com', + 'cdn.jsdelivr.net', + 'kit.fontawesome.com', + 'code.jquery.com', ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src 'style-src' => [ + // 'unsafe-inline', ], // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src-attr diff --git a/database/migrations/2019_05_03_000001_create_customer_columns.php b/database/migrations/2019_05_03_000001_create_customer_columns.php index 10cd03e..9ab4174 100644 --- a/database/migrations/2019_05_03_000001_create_customer_columns.php +++ b/database/migrations/2019_05_03_000001_create_customer_columns.php @@ -14,7 +14,7 @@ class CreateCustomerColumns extends Migration public function up() { Schema::table('users', function (Blueprint $table) { - $table->string('stripe_id')->nullable()->after('remember_token')->collation('utf8mb4_bin')->index(); + $table->string('stripe_id')->nullable()->after('remember_token')->index(); $table->string('pm_type')->nullable()->after('stripe_id'); $table->string('pm_last_four', 4)->nullable()->after('pm_type'); $table->timestamp('trial_ends_at')->nullable()->after('pm_last_four'); diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 0000000..6556eff --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,67 @@ +# For more information: https://laravel.com/docs/sail +version: '3' +services: + scaffold.test: + build: + context: ./vendor/laravel/sail/runtimes/8.1 + dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' + image: sail-8.1/app + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - '${APP_PORT:-80}:80' + - '${HMR_PORT:-8080}:8080' + environment: + WWWUSER: '${WWWUSER}' + LARAVEL_SAIL: 1 + XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' + XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' + volumes: + - '.:/var/www/html' + networks: + - sail + depends_on: + - mysql + - redis + mysql: + image: 'mysql/mysql-server:8.0' + ports: + - '${FORWARD_DB_PORT:-3306}:3306' + environment: + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' + MYSQL_ROOT_HOST: "%" + MYSQL_DATABASE: '${DB_DATABASE}' + MYSQL_USER: '${DB_USERNAME}' + MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + volumes: + - 'sail-mysql:/var/lib/mysql' + - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' + networks: + - sail + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"] + retries: 3 + timeout: 5s + redis: + image: 'redis:alpine' + ports: + - '${FORWARD_REDIS_PORT:-6379}:6379' + volumes: + - 'sail-redis:/data' + networks: + - sail + healthcheck: + test: ["CMD", "redis-cli", "ping"] + retries: 3 + timeout: 5s +networks: + sail: + driver: bridge +volumes: + sail-mysql: + driver: local + sail-redis: + driver: local diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e5951a8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' +services: + app: + build: + context: ./ + volumes: + - .:/var/www/html + ports: + - "80:80" + environment: + - APP_ENV=local + - APP_DEBUG=true diff --git a/docker/php/conf.d/opcache.ini b/docker/php/conf.d/opcache.ini new file mode 100644 index 0000000..fa1dfd4 --- /dev/null +++ b/docker/php/conf.d/opcache.ini @@ -0,0 +1,9 @@ +[opcache] +opcache.enable=1 +opcache.revalidate_freq=0 +opcache.validate_timestamps=0 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=192 +opcache.max_wasted_percentage=10 +opcache.interned_strings_buffer=16 +opcache.jit_buffer_size=100M \ No newline at end of file diff --git a/docs/blueprint.md b/docs/blueprint.md new file mode 100644 index 0000000..fc1afad --- /dev/null +++ b/docs/blueprint.md @@ -0,0 +1,4 @@ +#### Application +#### API +#### Infrastructure +#### External Dependencies \ No newline at end of file diff --git a/docs/manual.md b/docs/manual.md new file mode 100644 index 0000000..9b5cb56 --- /dev/null +++ b/docs/manual.md @@ -0,0 +1,7 @@ +#### Maintenance + +##### How to update/upgrade + +##### Code Dependencies +- update all dependencies +- upgrade yearly \ No newline at end of file diff --git a/public/css/app.css b/public/css/app.css index 8beef37..4436f25 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -2,7 +2,7 @@ @charset "UTF-8"; /*! purgecss start ignore */ /*! - * Bootstrap v5.3.1 (https://getbootstrap.com/) + * Bootstrap v5.3.2 (https://getbootstrap.com/) * Copyright 2011-2023 The Bootstrap Authors * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ @@ -101,6 +101,7 @@ --bs-link-hover-color: #13967d; --bs-link-hover-color-rgb: 19, 150, 125; --bs-code-color: #e83e8c; + --bs-highlight-color: #212529; --bs-highlight-bg: #fdebd0; --bs-border-width: 1px; --bs-border-style: solid; @@ -173,6 +174,8 @@ --bs-link-color-rgb: 163, 112, 247; --bs-link-hover-color-rgb: 181, 141, 249; --bs-code-color: #f18bba; + --bs-highlight-color: #dee2e6; + --bs-highlight-bg: #613e07; --bs-border-color: #7b8a8b; --bs-border-color-translucent: rgba(255, 255, 255, 0.15); --bs-form-valid-color: #74d7c4; @@ -328,6 +331,7 @@ small, .small { mark, .mark { padding: 0.1875em; + color: var(--bs-highlight-color); background-color: var(--bs-highlight-bg); } @@ -817,7 +821,7 @@ progress { .row-cols-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-4 > * { @@ -832,7 +836,7 @@ progress { .row-cols-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-auto { @@ -1026,7 +1030,7 @@ progress { .row-cols-sm-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-sm-4 > * { @@ -1041,7 +1045,7 @@ progress { .row-cols-sm-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-sm-auto { @@ -1239,7 +1243,7 @@ progress { .row-cols-md-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-md-4 > * { @@ -1254,7 +1258,7 @@ progress { .row-cols-md-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-md-auto { @@ -1452,7 +1456,7 @@ progress { .row-cols-lg-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-lg-4 > * { @@ -1467,7 +1471,7 @@ progress { .row-cols-lg-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-lg-auto { @@ -1665,7 +1669,7 @@ progress { .row-cols-xl-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-xl-4 > * { @@ -1680,7 +1684,7 @@ progress { .row-cols-xl-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-xl-auto { @@ -1878,7 +1882,7 @@ progress { .row-cols-xxl-3 > * { flex: 0 0 auto; - width: 33.3333333333%; + width: 33.33333333%; } .row-cols-xxl-4 > * { @@ -1893,7 +1897,7 @@ progress { .row-cols-xxl-6 > * { flex: 0 0 auto; - width: 16.6666666667%; + width: 16.66666667%; } .col-xxl-auto { @@ -2074,16 +2078,16 @@ progress { --bs-table-bg-type: initial; --bs-table-color-state: initial; --bs-table-bg-state: initial; - --bs-table-color: var(--bs-body-color); + --bs-table-color: var(--bs-emphasis-color); --bs-table-bg: var(--bs-body-bg); --bs-table-border-color: var(--bs-border-color); --bs-table-accent-bg: transparent; - --bs-table-striped-color: var(--bs-body-color); - --bs-table-striped-bg: rgba(0, 0, 0, 0.05); - --bs-table-active-color: var(--bs-body-color); - --bs-table-active-bg: rgba(0, 0, 0, 0.1); - --bs-table-hover-color: var(--bs-body-color); - --bs-table-hover-bg: rgba(0, 0, 0, 0.075); + --bs-table-striped-color: var(--bs-emphasis-color); + --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05); + --bs-table-active-color: var(--bs-emphasis-color); + --bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1); + --bs-table-hover-color: var(--bs-emphasis-color); + --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075); width: 100%; margin-bottom: 1rem; vertical-align: top; @@ -2152,7 +2156,7 @@ progress { .table-primary { --bs-table-color: #fff; --bs-table-bg: #6610f2; - --bs-table-border-color: #7528f3; + --bs-table-border-color: #8540f5; --bs-table-striped-bg: #6e1cf3; --bs-table-striped-color: #fff; --bs-table-active-bg: #7528f3; @@ -2166,7 +2170,7 @@ progress { .table-secondary { --bs-table-color: #fff; --bs-table-bg: #95a5a6; - --bs-table-border-color: #a0aeaf; + --bs-table-border-color: #aab7b8; --bs-table-striped-bg: #9aaaaa; --bs-table-striped-color: #fff; --bs-table-active-bg: #a0aeaf; @@ -2180,7 +2184,7 @@ progress { .table-success { --bs-table-color: #fff; --bs-table-bg: #18bc9c; - --bs-table-border-color: #2fc3a6; + --bs-table-border-color: #46c9b0; --bs-table-striped-bg: #24bfa1; --bs-table-striped-color: #fff; --bs-table-active-bg: #2fc3a6; @@ -2194,7 +2198,7 @@ progress { .table-info { --bs-table-color: #fff; --bs-table-bg: #3498db; - --bs-table-border-color: #48a2df; + --bs-table-border-color: #5dade2; --bs-table-striped-bg: #3e9ddd; --bs-table-striped-color: #fff; --bs-table-active-bg: #48a2df; @@ -2208,7 +2212,7 @@ progress { .table-warning { --bs-table-color: #fff; --bs-table-bg: #f39c12; - --bs-table-border-color: #f4a62a; + --bs-table-border-color: #f5b041; --bs-table-striped-bg: #f4a11e; --bs-table-striped-color: #fff; --bs-table-active-bg: #f4a62a; @@ -2222,7 +2226,7 @@ progress { .table-danger { --bs-table-color: #fff; --bs-table-bg: #e74c3c; - --bs-table-border-color: #e95e50; + --bs-table-border-color: #ec7063; --bs-table-striped-bg: #e85546; --bs-table-striped-color: #fff; --bs-table-active-bg: #e95e50; @@ -2236,7 +2240,7 @@ progress { .table-light { --bs-table-color: #000; --bs-table-bg: #ecf0f1; - --bs-table-border-color: #d4d8d9; + --bs-table-border-color: #bdc0c1; --bs-table-striped-bg: #e0e4e5; --bs-table-striped-color: #000; --bs-table-active-bg: #d4d8d9; @@ -2250,7 +2254,7 @@ progress { .table-dark { --bs-table-color: #fff; --bs-table-bg: #7b8a8b; - --bs-table-border-color: #889697; + --bs-table-border-color: #95a1a2; --bs-table-striped-bg: #829091; --bs-table-striped-color: #fff; --bs-table-active-bg: #889697; @@ -2569,6 +2573,7 @@ textarea.form-control-lg { .form-check-input { --bs-form-check-bg: var(--bs-body-bg); + flex-shrink: 0; width: 1em; height: 1em; margin-top: 0.25em; @@ -2725,7 +2730,7 @@ textarea.form-control-lg { height: 0.5rem; color: transparent; cursor: pointer; - background-color: var(--bs-tertiary-bg); + background-color: var(--bs-secondary-bg); border-color: transparent; border-radius: 1rem; } @@ -2754,7 +2759,7 @@ textarea.form-control-lg { height: 0.5rem; color: transparent; cursor: pointer; - background-color: var(--bs-tertiary-bg); + background-color: var(--bs-secondary-bg); border-color: transparent; border-radius: 1rem; } @@ -3612,7 +3617,7 @@ textarea.form-control-lg { --bs-dropdown-inner-border-radius: calc(var(--bs-border-radius) - var(--bs-border-width)); --bs-dropdown-divider-bg: var(--bs-border-color-translucent); --bs-dropdown-divider-margin-y: 0.5rem; - --bs-dropdown-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); + --bs-dropdown-box-shadow: var(--bs-box-shadow); --bs-dropdown-link-color: #7b8a8b; --bs-dropdown-link-hover-color: #fff; --bs-dropdown-link-hover-bg: #6610f2; @@ -5661,7 +5666,7 @@ textarea.form-control-lg { --bs-modal-border-color: var(--bs-border-color-translucent); --bs-modal-border-width: var(--bs-border-width); --bs-modal-border-radius: var(--bs-border-radius-lg); - --bs-modal-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); + --bs-modal-box-shadow: var(--bs-box-shadow-sm); --bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - (var(--bs-border-width))); --bs-modal-header-padding-x: 1rem; --bs-modal-header-padding-y: 1rem; @@ -5802,7 +5807,7 @@ textarea.form-control-lg { @media (min-width: 576px) { .modal { --bs-modal-margin: 1.75rem; - --bs-modal-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); + --bs-modal-box-shadow: var(--bs-box-shadow); } .modal-dialog { @@ -6056,7 +6061,7 @@ textarea.form-control-lg { --bs-popover-border-color: var(--bs-border-color-translucent); --bs-popover-border-radius: var(--bs-border-radius-lg); --bs-popover-inner-border-radius: calc(var(--bs-border-radius-lg) - var(--bs-border-width)); - --bs-popover-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); + --bs-popover-box-shadow: var(--bs-box-shadow); --bs-popover-header-padding-x: 1rem; --bs-popover-header-padding-y: 0.5rem; --bs-popover-header-font-size: 1rem; @@ -6490,7 +6495,7 @@ textarea.form-control-lg { --bs-offcanvas-bg: var(--bs-body-bg); --bs-offcanvas-border-width: var(--bs-border-width); --bs-offcanvas-border-color: var(--bs-border-color-translucent); - --bs-offcanvas-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); + --bs-offcanvas-box-shadow: var(--bs-box-shadow-sm); --bs-offcanvas-transition: transform 0.3s ease-in-out; --bs-offcanvas-title-line-height: 1.5; } @@ -7592,15 +7597,15 @@ textarea.form-control-lg { } .shadow { - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; + box-shadow: var(--bs-box-shadow) !important; } .shadow-sm { - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; + box-shadow: var(--bs-box-shadow-sm) !important; } .shadow-lg { - box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; + box-shadow: var(--bs-box-shadow-lg) !important; } .shadow-none { @@ -13484,6 +13489,11 @@ input[type=file].form-control { --bs-btn-color: none; } +pre { + background-color: var(--bs-tertiary-bg); + white-space: pre-wrap; +} + /* |-------------------------------------------------------------------------- | Large Screen @@ -13649,6 +13659,7 @@ input[type=file].form-control { --bmx-animation-delay: 0s; --bmx-bg-opacity: 1; --bmx-text-opacity: 1; + --bmx-transition-duration: 500ms; } .bmx-pointer { @@ -14859,10 +14870,18 @@ input[type=file].form-control { height: 36rem; } +.bmx-vh-20 { + height: 20vh; +} + .bmx-vh-25 { height: 25vh; } +.bmx-vh-30 { + height: 30vh; +} + .bmx-vh-50 { height: 50vh; } @@ -14871,6 +14890,10 @@ input[type=file].form-control { height: 75vh; } +.bmx-vh-80 { + height: 80vh; +} + .bmx-vh-100 { height: 100vh; } @@ -15019,10 +15042,18 @@ input[type=file].form-control { min-height: 36rem; } +.bmx-min-vh-20 { + min-height: 20vh; +} + .bmx-min-vh-25 { min-height: 25vh; } +.bmx-min-vh-30 { + min-height: 30vh; +} + .bmx-min-vh-50 { min-height: 50vh; } @@ -15031,6 +15062,10 @@ input[type=file].form-control { min-height: 75vh; } +.bmx-min-vh-80 { + min-height: 80vh; +} + .bmx-min-vh-100 { min-height: 100vh; } @@ -18698,6 +18733,14 @@ input[type=file].form-control { text-decoration-color: rgba(52, 152, 219, var(--bmx-bg-opacity)); } } +.bmx-z-n2 { + z-index: -10; +} + +.bmx-z-n1 { + z-index: -1; +} + .bmx-z-0 { z-index: 0; } @@ -18706,6 +18749,10 @@ input[type=file].form-control { z-index: 10; } +.bmx-z-2 { + z-index: 100; +} + .bmx-z-3 { z-index: 1000; } @@ -18714,6 +18761,10 @@ input[type=file].form-control { z-index: 10000; } +.bmx-z-5 { + z-index: 20000; +} + .bmx-btn-white { --bs-btn-color: #000; --bs-btn-bg: #fff; @@ -28439,6 +28490,7 @@ input[type=file].form-control { } .table-carded tr { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); + border-radius: 4px; } .table-carded tr td:first-child { padding-left: 1rem; @@ -28460,6 +28512,70 @@ input[type=file].form-control { border-right: 1px solid #dee2e6; } +.bmx-transition-duration-200 { + --bmx-transition-duration: 200ms; +} + +.bmx-transition-duration-500 { + --bmx-transition-duration: 500ms; +} + +.bmx-transition-duration-1 { + --bmx-transition-duration: 1s; +} + +.bmx-transition-duration-2 { + --bmx-transition-duration: 2s; +} + +.bmx-transition-duration-3 { + --bmx-transition-duration: 3s; +} + +.bmx-transition-duration-4 { + --bmx-transition-duration: 4s; +} + +.bmx-transition-duration-5 { + --bmx-transition-duration: 5s; +} + +.bmx-transition-duration-6 { + --bmx-transition-duration: 6s; +} + +.bmx-transition-duration-7 { + --bmx-transition-duration: 7s; +} + +.bmx-transition-duration-8 { + --bmx-transition-duration: 8s; +} + +.bmx-transition-duration-9 { + --bmx-transition-duration: 9s; +} + +.bmx-transition-duration-10 { + --bmx-transition-duration: 10s; +} + +.ease-out-effect { + transition: all var(--bmx-transition-duration) ease-out; +} + +.ease-in-effect { + transition: all var(--bmx-transition-duration) ease-in; +} + +.ease-in-out-effect { + transition: all var(--bmx-transition-duration) ease-in-out; +} + +.ease-linear-effect { + transition: all var(--bmx-transition-duration) linear; +} + .bmx-animation-duration-200 { --bmx-animation-duration: 200ms; } diff --git a/public/js/app.js b/public/js/app.js index b703e54..13d65fe 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -3021,6 +3021,7 @@ function withinMaxClamp(min, value, max) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BASE_TRANSITION: () => (/* binding */ BASE_TRANSITION), +/* harmony export */ BindingTypes: () => (/* binding */ BindingTypes), /* harmony export */ CAMELIZE: () => (/* binding */ CAMELIZE), /* harmony export */ CAPITALIZE: () => (/* binding */ CAPITALIZE), /* harmony export */ CREATE_BLOCK: () => (/* binding */ CREATE_BLOCK), @@ -3031,6 +3032,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ CREATE_STATIC: () => (/* binding */ CREATE_STATIC), /* harmony export */ CREATE_TEXT: () => (/* binding */ CREATE_TEXT), /* harmony export */ CREATE_VNODE: () => (/* binding */ CREATE_VNODE), +/* harmony export */ CompilerDeprecationTypes: () => (/* binding */ CompilerDeprecationTypes), +/* harmony export */ ConstantTypes: () => (/* binding */ ConstantTypes), +/* harmony export */ ElementTypes: () => (/* binding */ ElementTypes), +/* harmony export */ ErrorCodes: () => (/* binding */ ErrorCodes), /* harmony export */ FRAGMENT: () => (/* binding */ FRAGMENT), /* harmony export */ GUARD_REACTIVE_PROPS: () => (/* binding */ GUARD_REACTIVE_PROPS), /* harmony export */ IS_MEMO_SAME: () => (/* binding */ IS_MEMO_SAME), @@ -3040,6 +3045,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ NORMALIZE_CLASS: () => (/* binding */ NORMALIZE_CLASS), /* harmony export */ NORMALIZE_PROPS: () => (/* binding */ NORMALIZE_PROPS), /* harmony export */ NORMALIZE_STYLE: () => (/* binding */ NORMALIZE_STYLE), +/* harmony export */ Namespaces: () => (/* binding */ Namespaces), +/* harmony export */ NodeTypes: () => (/* binding */ NodeTypes), /* harmony export */ OPEN_BLOCK: () => (/* binding */ OPEN_BLOCK), /* harmony export */ POP_SCOPE_ID: () => (/* binding */ POP_SCOPE_ID), /* harmony export */ PUSH_SCOPE_ID: () => (/* binding */ PUSH_SCOPE_ID), @@ -3092,14 +3099,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ createTemplateLiteral: () => (/* binding */ createTemplateLiteral), /* harmony export */ createTransformContext: () => (/* binding */ createTransformContext), /* harmony export */ createVNodeCall: () => (/* binding */ createVNodeCall), +/* harmony export */ errorMessages: () => (/* binding */ errorMessages), /* harmony export */ extractIdentifiers: () => (/* binding */ extractIdentifiers), /* harmony export */ findDir: () => (/* binding */ findDir), /* harmony export */ findProp: () => (/* binding */ findProp), +/* harmony export */ forAliasRE: () => (/* binding */ forAliasRE), /* harmony export */ generate: () => (/* binding */ generate), /* harmony export */ generateCodeFrame: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_0__.generateCodeFrame), /* harmony export */ getBaseTransformPreset: () => (/* binding */ getBaseTransformPreset), /* harmony export */ getConstantType: () => (/* binding */ getConstantType), -/* harmony export */ getInnerRange: () => (/* binding */ getInnerRange), /* harmony export */ getMemoedVNodeCall: () => (/* binding */ getMemoedVNodeCall), /* harmony export */ getVNodeBlockHelper: () => (/* binding */ getVNodeBlockHelper), /* harmony export */ getVNodeHelper: () => (/* binding */ getVNodeHelper), @@ -3107,10 +3115,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ hasScopeRef: () => (/* binding */ hasScopeRef), /* harmony export */ helperNameMap: () => (/* binding */ helperNameMap), /* harmony export */ injectProp: () => (/* binding */ injectProp), -/* harmony export */ isBuiltInType: () => (/* binding */ isBuiltInType), /* harmony export */ isCoreComponent: () => (/* binding */ isCoreComponent), /* harmony export */ isFunctionType: () => (/* binding */ isFunctionType), /* harmony export */ isInDestructureAssignment: () => (/* binding */ isInDestructureAssignment), +/* harmony export */ isInNewExpression: () => (/* binding */ isInNewExpression), /* harmony export */ isMemberExpression: () => (/* binding */ isMemberExpression), /* harmony export */ isMemberExpressionBrowser: () => (/* binding */ isMemberExpressionBrowser), /* harmony export */ isMemberExpressionNode: () => (/* binding */ isMemberExpressionNode), @@ -3143,6 +3151,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ transformModel: () => (/* binding */ transformModel), /* harmony export */ transformOn: () => (/* binding */ transformOn), /* harmony export */ traverseNode: () => (/* binding */ traverseNode), +/* harmony export */ unwrapTSNode: () => (/* binding */ unwrapTSNode), /* harmony export */ walkBlockDeclarations: () => (/* binding */ walkBlockDeclarations), /* harmony export */ walkFunctionParams: () => (/* binding */ walkFunctionParams), /* harmony export */ walkIdentifiers: () => (/* binding */ walkIdentifiers), @@ -3152,83 +3161,6 @@ __webpack_require__.r(__webpack_exports__); -function defaultOnError(error) { - throw error; -} -function defaultOnWarn(msg) { - true && console.warn(`[Vue warn] ${msg.message}`); -} -function createCompilerError(code, loc, messages, additionalMessage) { - const msg = true ? (messages || errorMessages)[code] + (additionalMessage || ``) : 0; - const error = new SyntaxError(String(msg)); - error.code = code; - error.loc = loc; - return error; -} -const errorMessages = { - // parse errors - [0]: "Illegal comment.", - [1]: "CDATA section is allowed only in XML context.", - [2]: "Duplicate attribute.", - [3]: "End tag cannot have attributes.", - [4]: "Illegal '/' in tags.", - [5]: "Unexpected EOF in tag.", - [6]: "Unexpected EOF in CDATA section.", - [7]: "Unexpected EOF in comment.", - [8]: "Unexpected EOF in script.", - [9]: "Unexpected EOF in tag.", - [10]: "Incorrectly closed comment.", - [11]: "Incorrectly opened comment.", - [12]: "Illegal tag name. Use '<' to print '<'.", - [13]: "Attribute value was expected.", - [14]: "End tag name was expected.", - [15]: "Whitespace was expected.", - [16]: "Unexpected '` + ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), + // `<\/script` + StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), + // `= 0; i--) { + const newlineIndex = this.newlines[i]; + if (index > newlineIndex) { + line = i + 2; + column = index - newlineIndex; break; - case 1 /* inBrackets */: - if (char === `'` || char === `"` || char === "`") { - stateStack.push(state); - state = 3 /* inString */; - currentStringType = char; - } else if (char === `[`) { - currentOpenBracketCount++; - } else if (char === `]`) { - if (!--currentOpenBracketCount) { - state = stateStack.pop(); - } + } + } + return { + column, + line, + offset: index + }; + } + peek() { + return this.buffer.charCodeAt(this.index + 1); + } + stateText(c) { + if (c === 60) { + if (this.index > this.sectionStart) { + this.cbs.ontext(this.sectionStart, this.index); + } + this.state = 5; + this.sectionStart = this.index; + } else if (!this.inVPre && c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); + } + } + stateInterpolationOpen(c) { + if (c === this.delimiterOpen[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterOpen.length - 1) { + const start = this.index + 1 - this.delimiterOpen.length; + if (start > this.sectionStart) { + this.cbs.ontext(this.sectionStart, start); } - break; - case 2 /* inParens */: - if (char === `'` || char === `"` || char === "`") { - stateStack.push(state); - state = 3 /* inString */; - currentStringType = char; - } else if (char === `(`) { - currentOpenParensCount++; - } else if (char === `)`) { - if (i === path.length - 1) { - return false; - } - if (!--currentOpenParensCount) { - state = stateStack.pop(); - } + this.state = 3; + this.sectionStart = start; + } else { + this.delimiterIndex++; + } + } else if (this.inRCDATA) { + this.state = 32; + this.stateInRCDATA(c); + } else { + this.state = 1; + this.stateText(c); + } + } + stateInterpolation(c) { + if (c === this.delimiterClose[0]) { + this.state = 4; + this.delimiterIndex = 0; + this.stateInterpolationClose(c); + } + } + stateInterpolationClose(c) { + if (c === this.delimiterClose[this.delimiterIndex]) { + if (this.delimiterIndex === this.delimiterClose.length - 1) { + this.cbs.oninterpolation(this.sectionStart, this.index + 1); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; } - break; - case 3 /* inString */: - if (char === currentStringType) { - state = stateStack.pop(); - currentStringType = null; + this.sectionStart = this.index + 1; + } else { + this.delimiterIndex++; + } + } else { + this.state = 3; + this.stateInterpolation(c); + } + } + stateSpecialStartSequence(c) { + const isEnd = this.sequenceIndex === this.currentSequence.length; + const isMatch = isEnd ? ( + // If we are at the end of the sequence, make sure the tag name has ended + isEndOfTagSection(c) + ) : ( + // Otherwise, do a case-insensitive comparison + (c | 32) === this.currentSequence[this.sequenceIndex] + ); + if (!isMatch) { + this.inRCDATA = false; + } else if (!isEnd) { + this.sequenceIndex++; + return; + } + this.sequenceIndex = 0; + this.state = 6; + this.stateInTagName(c); + } + /** Look for an end tag. For and <textarea>, also decode entities. */ + stateInRCDATA(c) { + if (this.sequenceIndex === this.currentSequence.length) { + if (c === 62 || isWhitespace(c)) { + const endOfText = this.index - this.currentSequence.length; + if (this.sectionStart < endOfText) { + const actualIndex = this.index; + this.index = endOfText; + this.cbs.ontext(this.sectionStart, endOfText); + this.index = actualIndex; + } + this.sectionStart = endOfText + 2; + this.stateInClosingTagName(c); + this.inRCDATA = false; + return; + } + this.sequenceIndex = 0; + } + if ((c | 32) === this.currentSequence[this.sequenceIndex]) { + this.sequenceIndex += 1; + } else if (this.sequenceIndex === 0) { + if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { + if (c === this.delimiterOpen[0]) { + this.state = 2; + this.delimiterIndex = 0; + this.stateInterpolationOpen(c); } - break; + } else if (this.fastForwardTo(60)) { + this.sequenceIndex = 1; + } + } else { + this.sequenceIndex = Number(c === 60); } } - return !currentOpenBracketCount && !currentOpenParensCount; -}; -const isMemberExpressionNode = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP ; -const isMemberExpression = isMemberExpressionBrowser ; -function getInnerRange(loc, offset, length) { - const source = loc.source.slice(offset, offset + length); - const newLoc = { - source, - start: advancePositionWithClone(loc.start, loc.source, offset), - end: loc.end - }; - if (length != null) { - newLoc.end = advancePositionWithClone( - loc.start, - loc.source, - offset + length - ); + stateCDATASequence(c) { + if (c === Sequences.Cdata[this.sequenceIndex]) { + if (++this.sequenceIndex === Sequences.Cdata.length) { + this.state = 28; + this.currentSequence = Sequences.CdataEnd; + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + } + } else { + this.sequenceIndex = 0; + this.state = 23; + this.stateInDeclaration(c); + } } - return newLoc; -} -function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { - return advancePositionWithMutation( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, pos), - source, - numberOfCharacters - ); -} -function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { - let linesCount = 0; - let lastNewLinePos = -1; - for (let i = 0; i < numberOfCharacters; i++) { - if (source.charCodeAt(i) === 10) { - linesCount++; - lastNewLinePos = i; + /** + * When we wait for one specific character, we can speed things up + * by skipping through the buffer until we find it. + * + * @returns Whether the character was found. + */ + fastForwardTo(c) { + while (++this.index < this.buffer.length) { + const cc = this.buffer.charCodeAt(this.index); + if (cc === 10) { + this.newlines.push(this.index); + } + if (cc === c) { + return true; + } } + this.index = this.buffer.length - 1; + return false; } - pos.offset += numberOfCharacters; - pos.line += linesCount; - pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; - return pos; -} -function assert(condition, msg) { - if (!condition) { - throw new Error(msg || `unexpected compiler condition`); + /** + * Comments and CDATA end with `-->` and `]]>`. + * + * Their common qualities are: + * - Their end sequences have a distinct character they start with. + * - That character is then repeated, so we have to check multiple repeats. + * - All characters but the start character of the sequence can be skipped. + */ + stateInCommentLike(c) { + if (c === this.currentSequence[this.sequenceIndex]) { + if (++this.sequenceIndex === this.currentSequence.length) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, this.index - 2); + } else { + this.cbs.oncomment(this.sectionStart, this.index - 2); + } + this.sequenceIndex = 0; + this.sectionStart = this.index + 1; + this.state = 1; + } + } else if (this.sequenceIndex === 0) { + if (this.fastForwardTo(this.currentSequence[0])) { + this.sequenceIndex = 1; + } + } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { + this.sequenceIndex = 0; + } + } + startSpecial(sequence, offset) { + this.enterRCDATA(sequence, offset); + this.state = 31; + } + enterRCDATA(sequence, offset) { + this.inRCDATA = true; + this.currentSequence = sequence; + this.sequenceIndex = offset; + } + stateBeforeTagName(c) { + if (c === 33) { + this.state = 22; + this.sectionStart = this.index + 1; + } else if (c === 63) { + this.state = 24; + this.sectionStart = this.index + 1; + } else if (isTagStartChar(c)) { + this.sectionStart = this.index; + if (this.mode === 0) { + this.state = 6; + } else if (this.inSFCRoot) { + this.state = 34; + } else if (!this.inXML) { + const lower = c | 32; + if (lower === 116) { + this.state = 30; + } else { + this.state = lower === 115 ? 29 : 6; + } + } else { + this.state = 6; + } + } else if (c === 47) { + this.state = 8; + } else { + this.state = 1; + this.stateText(c); + } } -} -function findDir(node, name, allowEmpty = false) { - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 7 && (allowEmpty || p.exp) && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? p.name === name : name.test(p.name))) { - return p; + stateInTagName(c) { + if (isEndOfTagSection(c)) { + this.handleTagName(c); } } -} -function findProp(node, name, dynamicOnly = false, allowEmpty = false) { - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 6) { - if (dynamicOnly) - continue; - if (p.name === name && (p.value || allowEmpty)) { - return p; + stateInSFCRootTagName(c) { + if (isEndOfTagSection(c)) { + const tag = this.buffer.slice(this.sectionStart, this.index); + if (tag !== "template") { + this.enterRCDATA(toCharCodes(`</` + tag), 0); } - } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { - return p; + this.handleTagName(c); } } -} -function isStaticArgOf(arg, name) { - return !!(arg && isStaticExp(arg) && arg.content === name); -} -function hasDynamicKeyVBind(node) { - return node.props.some( - (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" - p.arg.type !== 4 || // v-bind:[_ctx.foo] - !p.arg.isStatic) - // v-bind:[foo] - ); -} -function isText$1(node) { - return node.type === 5 || node.type === 2; -} -function isVSlot(p) { - return p.type === 7 && p.name === "slot"; -} -function isTemplateNode(node) { - return node.type === 1 && node.tagType === 3; -} -function isSlotOutlet(node) { - return node.type === 1 && node.tagType === 2; -} -const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); -function getUnnormalizedProps(props, callPath = []) { - if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { - const callee = props.callee; - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(callee) && propsHelperSet.has(callee)) { - return getUnnormalizedProps( - props.arguments[0], - callPath.concat(props) - ); + handleTagName(c) { + this.cbs.onopentagname(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } + stateBeforeClosingTagName(c) { + if (isWhitespace(c)) ; else if (c === 62) { + if (true) { + this.cbs.onerr(14, this.index); + } + this.state = 1; + this.sectionStart = this.index + 1; + } else { + this.state = isTagStartChar(c) ? 9 : 27; + this.sectionStart = this.index; } } - return [props, callPath]; -} -function injectProp(node, prop, context) { - let propsWithInjection; - let props = node.type === 13 ? node.props : node.arguments[2]; - let callPath = []; - let parentCall; - if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { - const ret = getUnnormalizedProps(props); - props = ret[0]; - callPath = ret[1]; - parentCall = callPath[callPath.length - 1]; + stateInClosingTagName(c) { + if (c === 62 || isWhitespace(c)) { + this.cbs.onclosetag(this.sectionStart, this.index); + this.sectionStart = -1; + this.state = 10; + this.stateAfterClosingTagName(c); + } } - if (props == null || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props)) { - propsWithInjection = createObjectExpression([prop]); - } else if (props.type === 14) { - const first = props.arguments[0]; - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(first) && first.type === 15) { - if (!hasProp(prop, first)) { - first.properties.unshift(prop); + stateAfterClosingTagName(c) { + if (c === 62) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeAttrName(c) { + if (c === 62) { + this.cbs.onopentagend(this.index); + if (this.inRCDATA) { + this.state = 32; + } else { + this.state = 1; + } + this.sectionStart = this.index + 1; + } else if (c === 47) { + this.state = 7; + if (( true) && this.peek() !== 62) { + this.cbs.onerr(22, this.index); + } + } else if (c === 60 && this.peek() === 47) { + this.cbs.onopentagend(this.index); + this.state = 5; + this.sectionStart = this.index; + } else if (!isWhitespace(c)) { + if (( true) && c === 61) { + this.cbs.onerr( + 19, + this.index + ); } + this.handleAttrStart(c); + } + } + handleAttrStart(c) { + if (c === 118 && this.peek() === 45) { + this.state = 13; + this.sectionStart = this.index; + } else if (c === 46 || c === 58 || c === 64 || c === 35) { + this.cbs.ondirname(this.index, this.index + 1); + this.state = 14; + this.sectionStart = this.index + 1; } else { - if (props.callee === TO_HANDLERS) { - propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ - createObjectExpression([prop]), - props - ]); - } else { - props.arguments.unshift(createObjectExpression([prop])); + this.state = 12; + this.sectionStart = this.index; + } + } + stateInSelfClosingTag(c) { + if (c === 62) { + this.cbs.onselfclosingtag(this.index); + this.state = 1; + this.sectionStart = this.index + 1; + this.inRCDATA = false; + } else if (!isWhitespace(c)) { + this.state = 11; + this.stateBeforeAttrName(c); + } + } + stateInAttrName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.onattribname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (( true) && (c === 34 || c === 39 || c === 60)) { + this.cbs.onerr( + 17, + this.index + ); + } + } + stateInDirName(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirname(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 58) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 14; + this.sectionStart = this.index + 1; + } else if (c === 46) { + this.cbs.ondirname(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDirArg(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 91) { + this.state = 15; + } else if (c === 46) { + this.cbs.ondirarg(this.sectionStart, this.index); + this.state = 16; + this.sectionStart = this.index + 1; + } + } + stateInDynamicDirArg(c) { + if (c === 93) { + this.state = 14; + } else if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirarg(this.sectionStart, this.index + 1); + this.handleAttrNameEnd(c); + if (true) { + this.cbs.onerr( + 27, + this.index + ); } } - !propsWithInjection && (propsWithInjection = props); - } else if (props.type === 15) { - if (!hasProp(prop, props)) { - props.properties.unshift(prop); + } + stateInDirModifier(c) { + if (c === 61 || isEndOfTagSection(c)) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.handleAttrNameEnd(c); + } else if (c === 46) { + this.cbs.ondirmodifier(this.sectionStart, this.index); + this.sectionStart = this.index + 1; + } + } + handleAttrNameEnd(c) { + this.sectionStart = this.index; + this.state = 17; + this.cbs.onattribnameend(this.index); + this.stateAfterAttrName(c); + } + stateAfterAttrName(c) { + if (c === 61) { + this.state = 18; + } else if (c === 47 || c === 62) { + this.cbs.onattribend(0, this.sectionStart); + this.sectionStart = -1; + this.state = 11; + this.stateBeforeAttrName(c); + } else if (!isWhitespace(c)) { + this.cbs.onattribend(0, this.sectionStart); + this.handleAttrStart(c); + } + } + stateBeforeAttrValue(c) { + if (c === 34) { + this.state = 19; + this.sectionStart = this.index + 1; + } else if (c === 39) { + this.state = 20; + this.sectionStart = this.index + 1; + } else if (!isWhitespace(c)) { + this.sectionStart = this.index; + this.state = 21; + this.stateInAttrValueNoQuotes(c); + } + } + handleInAttrValue(c, quote) { + if (c === quote || this.fastForwardTo(quote)) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend( + quote === 34 ? 3 : 2, + this.index + 1 + ); + this.state = 11; } - propsWithInjection = props; - } else { - propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ - createObjectExpression([prop]), - props - ]); - if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { - parentCall = callPath[callPath.length - 2]; + } + stateInAttrValueDoubleQuotes(c) { + this.handleInAttrValue(c, 34); + } + stateInAttrValueSingleQuotes(c) { + this.handleInAttrValue(c, 39); + } + stateInAttrValueNoQuotes(c) { + if (isWhitespace(c) || c === 62) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = -1; + this.cbs.onattribend(1, this.index); + this.state = 11; + this.stateBeforeAttrName(c); + } else if (( true) && c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { + this.cbs.onerr( + 18, + this.index + ); + } else ; + } + stateBeforeDeclaration(c) { + if (c === 91) { + this.state = 26; + this.sequenceIndex = 0; + } else { + this.state = c === 45 ? 25 : 23; } } - if (node.type === 13) { - if (parentCall) { - parentCall.arguments[0] = propsWithInjection; + stateInDeclaration(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateInProcessingInstruction(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.onprocessinginstruction(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeComment(c) { + if (c === 45) { + this.state = 28; + this.currentSequence = Sequences.CommentEnd; + this.sequenceIndex = 2; + this.sectionStart = this.index + 1; } else { - node.props = propsWithInjection; + this.state = 23; } - } else { - if (parentCall) { - parentCall.arguments[0] = propsWithInjection; + } + stateInSpecialComment(c) { + if (c === 62 || this.fastForwardTo(62)) { + this.cbs.oncomment(this.sectionStart, this.index); + this.state = 1; + this.sectionStart = this.index + 1; + } + } + stateBeforeSpecialS(c) { + const lower = c | 32; + if (lower === Sequences.ScriptEnd[3]) { + this.startSpecial(Sequences.ScriptEnd, 4); + } else if (lower === Sequences.StyleEnd[3]) { + this.startSpecial(Sequences.StyleEnd, 4); } else { - node.arguments[2] = propsWithInjection; + this.state = 6; + this.stateInTagName(c); } } -} -function hasProp(prop, props) { - let result = false; - if (prop.key.type === 4) { - const propKeyName = prop.key.content; - result = props.properties.some( - (p) => p.key.type === 4 && p.key.content === propKeyName - ); + stateBeforeSpecialT(c) { + const lower = c | 32; + if (lower === Sequences.TitleEnd[3]) { + this.startSpecial(Sequences.TitleEnd, 4); + } else if (lower === Sequences.TextareaEnd[3]) { + this.startSpecial(Sequences.TextareaEnd, 4); + } else { + this.state = 6; + this.stateInTagName(c); + } } - return result; -} -function toValidAssetId(name, type) { - return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { - return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); - })}`; -} -function hasScopeRef(node, ids) { - if (!node || Object.keys(ids).length === 0) { - return false; + startEntity() { } - switch (node.type) { - case 1: - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { - return true; + stateInEntity() { + } + /** + * Iterates through the buffer, calling the function corresponding to the current state. + * + * States that are more likely to be hit are higher up, as a performance improvement. + */ + parse(input) { + this.buffer = input; + while (this.index < this.buffer.length) { + const c = this.buffer.charCodeAt(this.index); + if (c === 10) { + this.newlines.push(this.index); + } + switch (this.state) { + case 1: { + this.stateText(c); + break; + } + case 2: { + this.stateInterpolationOpen(c); + break; + } + case 3: { + this.stateInterpolation(c); + break; + } + case 4: { + this.stateInterpolationClose(c); + break; + } + case 31: { + this.stateSpecialStartSequence(c); + break; + } + case 32: { + this.stateInRCDATA(c); + break; + } + case 26: { + this.stateCDATASequence(c); + break; + } + case 19: { + this.stateInAttrValueDoubleQuotes(c); + break; + } + case 12: { + this.stateInAttrName(c); + break; + } + case 13: { + this.stateInDirName(c); + break; + } + case 14: { + this.stateInDirArg(c); + break; + } + case 15: { + this.stateInDynamicDirArg(c); + break; + } + case 16: { + this.stateInDirModifier(c); + break; + } + case 28: { + this.stateInCommentLike(c); + break; + } + case 27: { + this.stateInSpecialComment(c); + break; + } + case 11: { + this.stateBeforeAttrName(c); + break; + } + case 6: { + this.stateInTagName(c); + break; + } + case 34: { + this.stateInSFCRootTagName(c); + break; + } + case 9: { + this.stateInClosingTagName(c); + break; + } + case 5: { + this.stateBeforeTagName(c); + break; + } + case 17: { + this.stateAfterAttrName(c); + break; + } + case 20: { + this.stateInAttrValueSingleQuotes(c); + break; + } + case 18: { + this.stateBeforeAttrValue(c); + break; + } + case 8: { + this.stateBeforeClosingTagName(c); + break; + } + case 10: { + this.stateAfterClosingTagName(c); + break; + } + case 29: { + this.stateBeforeSpecialS(c); + break; + } + case 30: { + this.stateBeforeSpecialT(c); + break; + } + case 21: { + this.stateInAttrValueNoQuotes(c); + break; + } + case 7: { + this.stateInSelfClosingTag(c); + break; + } + case 23: { + this.stateInDeclaration(c); + break; + } + case 22: { + this.stateBeforeDeclaration(c); + break; + } + case 25: { + this.stateBeforeComment(c); + break; + } + case 24: { + this.stateInProcessingInstruction(c); + break; + } + case 33: { + this.stateInEntity(); + break; } } - return node.children.some((c) => hasScopeRef(c, ids)); - case 11: - if (hasScopeRef(node.source, ids)) { - return true; + this.index++; + } + this.cleanup(); + this.finish(); + } + /** + * Remove data that has already been consumed from the buffer. + */ + cleanup() { + if (this.sectionStart !== this.index) { + if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { + this.cbs.ontext(this.sectionStart, this.index); + this.sectionStart = this.index; + } else if (this.state === 19 || this.state === 20 || this.state === 21) { + this.cbs.onattribdata(this.sectionStart, this.index); + this.sectionStart = this.index; } - return node.children.some((c) => hasScopeRef(c, ids)); - case 9: - return node.branches.some((b) => hasScopeRef(b, ids)); - case 10: - if (hasScopeRef(node.condition, ids)) { - return true; + } + } + finish() { + this.handleTrailingData(); + this.cbs.onend(); + } + /** Handle any trailing data. */ + handleTrailingData() { + const endIndex = this.buffer.length; + if (this.sectionStart >= endIndex) { + return; + } + if (this.state === 28) { + if (this.currentSequence === Sequences.CdataEnd) { + this.cbs.oncdata(this.sectionStart, endIndex); + } else { + this.cbs.oncomment(this.sectionStart, endIndex); } - return node.children.some((c) => hasScopeRef(c, ids)); - case 4: - return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; - case 8: - return node.children.some((c) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(c) && hasScopeRef(c, ids)); - case 5: - case 12: - return hasScopeRef(node.content, ids); - case 2: - case 3: - return false; - default: - if (true) ; - return false; + } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { + this.cbs.ontext(this.sectionStart, endIndex); + } } -} -function getMemoedVNodeCall(node) { - if (node.type === 14 && node.callee === WITH_MEMO) { - return node.arguments[1].returns; - } else { - return node; + emitCodePoint(cp, consumed) { } } +const CompilerDeprecationTypes = { + "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", + "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", + "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", + "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", + "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", + "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", + "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", + "COMPILER_FILTERS": "COMPILER_FILTERS" +}; const deprecationData = { ["COMPILER_IS_ON_ELEMENT"]: { message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, @@ -3817,9 +4348,6 @@ const deprecationData = { message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` }, - ["COMPILER_V_BIND_PROP"]: { - message: `.prop modifier for v-bind has been removed and no longer necessary. Vue 3 will automatically set a binding as DOM property when appropriate.` - }, ["COMPILER_V_BIND_OBJECT_ORDER"]: { message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` @@ -3839,14 +4367,13 @@ const deprecationData = { message: `"inline-template" has been removed in Vue 3.`, link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` }, - ["COMPILER_FILTER"]: { + ["COMPILER_FILTERS"]: { message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` } }; -function getCompatValue(key, context) { - const config = context.options ? context.options.compatConfig : context.compatConfig; - const value = config && config[key]; +function getCompatValue(key, { compatConfig }) { + const value = compatConfig && compatConfig[key]; if (key === "MODE") { return value || 3; } else { @@ -3880,8749 +4407,7628 @@ function warnDeprecation(key, context, loc, ...args) { context.onWarn(err); } -const decodeRE = /&(gt|lt|amp|apos|quot);/g; -const decodeMap = { - gt: ">", - lt: "<", - amp: "&", - apos: "'", - quot: '"' -}; -const defaultParserOptions = { - delimiters: [`{{`, `}}`], - getNamespace: () => 0, - getTextMode: () => 0, - isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, - isPreTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, - isCustomElement: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, - decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]), - onError: defaultOnError, - onWarn: defaultOnWarn, - comments: !!("development" !== "production") -}; -function baseParse(content, options = {}) { - const context = createParserContext(content, options); - const start = getCursor(context); - return createRoot( - parseChildren(context, 0, []), - getSelection(context, start) - ); +function defaultOnError(error) { + throw error; } -function createParserContext(content, rawOptions) { - const options = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, defaultParserOptions); - let key; - for (key in rawOptions) { - options[key] = rawOptions[key] === void 0 ? defaultParserOptions[key] : rawOptions[key]; - } - return { - options, - column: 1, - line: 1, - offset: 0, - originalSource: content, - source: content, - inPre: false, - inVPre: false, - onWarn: options.onWarn - }; +function defaultOnWarn(msg) { + true && console.warn(`[Vue warn] ${msg.message}`); } -function parseChildren(context, mode, ancestors) { - const parent = last(ancestors); - const ns = parent ? parent.ns : 0; - const nodes = []; - while (!isEnd(context, mode, ancestors)) { - const s = context.source; - let node = void 0; - if (mode === 0 || mode === 1) { - if (!context.inVPre && startsWith(s, context.options.delimiters[0])) { - node = parseInterpolation(context, mode); - } else if (mode === 0 && s[0] === "<") { - if (s.length === 1) { - emitError(context, 5, 1); - } else if (s[1] === "!") { - if (startsWith(s, "<!--")) { - node = parseComment(context); - } else if (startsWith(s, "<!DOCTYPE")) { - node = parseBogusComment(context); - } else if (startsWith(s, "<![CDATA[")) { - if (ns !== 0) { - node = parseCDATA(context, ancestors); - } else { - emitError(context, 1); - node = parseBogusComment(context); - } - } else { - emitError(context, 11); - node = parseBogusComment(context); - } - } else if (s[1] === "/") { - if (s.length === 2) { - emitError(context, 5, 2); - } else if (s[2] === ">") { - emitError(context, 14, 2); - advanceBy(context, 3); - continue; - } else if (/[a-z]/i.test(s[2])) { - emitError(context, 23); - parseTag(context, TagType.End, parent); - continue; - } else { - emitError( - context, - 12, - 2 - ); - node = parseBogusComment(context); - } - } else if (/[a-z]/i.test(s[1])) { - node = parseElement(context, ancestors); - if (isCompatEnabled( - "COMPILER_NATIVE_TEMPLATE", - context - ) && node && node.tag === "template" && !node.props.some( - (p) => p.type === 7 && isSpecialTemplateDirective(p.name) - )) { - true && warnDeprecation( - "COMPILER_NATIVE_TEMPLATE", - context, - node.loc - ); - node = node.children; - } - } else if (s[1] === "?") { - emitError( - context, - 21, - 1 - ); - node = parseBogusComment(context); - } else { - emitError(context, 12, 1); - } - } - } - if (!node) { - node = parseText(context, mode); - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node)) { - for (let i = 0; i < node.length; i++) { - pushNode(nodes, node[i]); - } - } else { - pushNode(nodes, node); - } - } - let removedWhitespace = false; - if (mode !== 2 && mode !== 1) { - const shouldCondense = context.options.whitespace !== "preserve"; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (node.type === 2) { - if (!context.inPre) { - if (!/[^\t\r\n\f ]/.test(node.content)) { - const prev = nodes[i - 1]; - const next = nodes[i + 1]; - if (!prev || !next || shouldCondense && (prev.type === 3 && next.type === 3 || prev.type === 3 && next.type === 1 || prev.type === 1 && next.type === 3 || prev.type === 1 && next.type === 1 && /[\r\n]/.test(node.content))) { - removedWhitespace = true; - nodes[i] = null; - } else { - node.content = " "; - } - } else if (shouldCondense) { - node.content = node.content.replace(/[\t\r\n\f ]+/g, " "); - } - } else { - node.content = node.content.replace(/\r\n/g, "\n"); - } - } else if (node.type === 3 && !context.options.comments) { - removedWhitespace = true; - nodes[i] = null; - } - } - if (context.inPre && parent && context.options.isPreTag(parent.tag)) { - const first = nodes[0]; - if (first && first.type === 2) { - first.content = first.content.replace(/^\r?\n/, ""); - } - } - } - return removedWhitespace ? nodes.filter(Boolean) : nodes; +function createCompilerError(code, loc, messages, additionalMessage) { + const msg = true ? (messages || errorMessages)[code] + (additionalMessage || ``) : 0; + const error = new SyntaxError(String(msg)); + error.code = code; + error.loc = loc; + return error; } -function pushNode(nodes, node) { - if (node.type === 2) { - const prev = last(nodes); - if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) { - prev.content += node.content; - prev.loc.end = node.loc.end; - prev.loc.source += node.loc.source; - return; - } +const ErrorCodes = { + "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, + "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", + "CDATA_IN_HTML_CONTENT": 1, + "1": "CDATA_IN_HTML_CONTENT", + "DUPLICATE_ATTRIBUTE": 2, + "2": "DUPLICATE_ATTRIBUTE", + "END_TAG_WITH_ATTRIBUTES": 3, + "3": "END_TAG_WITH_ATTRIBUTES", + "END_TAG_WITH_TRAILING_SOLIDUS": 4, + "4": "END_TAG_WITH_TRAILING_SOLIDUS", + "EOF_BEFORE_TAG_NAME": 5, + "5": "EOF_BEFORE_TAG_NAME", + "EOF_IN_CDATA": 6, + "6": "EOF_IN_CDATA", + "EOF_IN_COMMENT": 7, + "7": "EOF_IN_COMMENT", + "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, + "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", + "EOF_IN_TAG": 9, + "9": "EOF_IN_TAG", + "INCORRECTLY_CLOSED_COMMENT": 10, + "10": "INCORRECTLY_CLOSED_COMMENT", + "INCORRECTLY_OPENED_COMMENT": 11, + "11": "INCORRECTLY_OPENED_COMMENT", + "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, + "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", + "MISSING_ATTRIBUTE_VALUE": 13, + "13": "MISSING_ATTRIBUTE_VALUE", + "MISSING_END_TAG_NAME": 14, + "14": "MISSING_END_TAG_NAME", + "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, + "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", + "NESTED_COMMENT": 16, + "16": "NESTED_COMMENT", + "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, + "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", + "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, + "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", + "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, + "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", + "UNEXPECTED_NULL_CHARACTER": 20, + "20": "UNEXPECTED_NULL_CHARACTER", + "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, + "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", + "UNEXPECTED_SOLIDUS_IN_TAG": 22, + "22": "UNEXPECTED_SOLIDUS_IN_TAG", + "X_INVALID_END_TAG": 23, + "23": "X_INVALID_END_TAG", + "X_MISSING_END_TAG": 24, + "24": "X_MISSING_END_TAG", + "X_MISSING_INTERPOLATION_END": 25, + "25": "X_MISSING_INTERPOLATION_END", + "X_MISSING_DIRECTIVE_NAME": 26, + "26": "X_MISSING_DIRECTIVE_NAME", + "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, + "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", + "X_V_IF_NO_EXPRESSION": 28, + "28": "X_V_IF_NO_EXPRESSION", + "X_V_IF_SAME_KEY": 29, + "29": "X_V_IF_SAME_KEY", + "X_V_ELSE_NO_ADJACENT_IF": 30, + "30": "X_V_ELSE_NO_ADJACENT_IF", + "X_V_FOR_NO_EXPRESSION": 31, + "31": "X_V_FOR_NO_EXPRESSION", + "X_V_FOR_MALFORMED_EXPRESSION": 32, + "32": "X_V_FOR_MALFORMED_EXPRESSION", + "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, + "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", + "X_V_BIND_NO_EXPRESSION": 34, + "34": "X_V_BIND_NO_EXPRESSION", + "X_V_ON_NO_EXPRESSION": 35, + "35": "X_V_ON_NO_EXPRESSION", + "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, + "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", + "X_V_SLOT_MIXED_SLOT_USAGE": 37, + "37": "X_V_SLOT_MIXED_SLOT_USAGE", + "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, + "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", + "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, + "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", + "X_V_SLOT_MISPLACED": 40, + "40": "X_V_SLOT_MISPLACED", + "X_V_MODEL_NO_EXPRESSION": 41, + "41": "X_V_MODEL_NO_EXPRESSION", + "X_V_MODEL_MALFORMED_EXPRESSION": 42, + "42": "X_V_MODEL_MALFORMED_EXPRESSION", + "X_V_MODEL_ON_SCOPE_VARIABLE": 43, + "43": "X_V_MODEL_ON_SCOPE_VARIABLE", + "X_V_MODEL_ON_PROPS": 44, + "44": "X_V_MODEL_ON_PROPS", + "X_INVALID_EXPRESSION": 45, + "45": "X_INVALID_EXPRESSION", + "X_KEEP_ALIVE_INVALID_CHILDREN": 46, + "46": "X_KEEP_ALIVE_INVALID_CHILDREN", + "X_PREFIX_ID_NOT_SUPPORTED": 47, + "47": "X_PREFIX_ID_NOT_SUPPORTED", + "X_MODULE_MODE_NOT_SUPPORTED": 48, + "48": "X_MODULE_MODE_NOT_SUPPORTED", + "X_CACHE_HANDLER_NOT_SUPPORTED": 49, + "49": "X_CACHE_HANDLER_NOT_SUPPORTED", + "X_SCOPE_ID_NOT_SUPPORTED": 50, + "50": "X_SCOPE_ID_NOT_SUPPORTED", + "X_VNODE_HOOKS": 51, + "51": "X_VNODE_HOOKS", + "__EXTEND_POINT__": 52, + "52": "__EXTEND_POINT__" +}; +const errorMessages = { + // parse errors + [0]: "Illegal comment.", + [1]: "CDATA section is allowed only in XML context.", + [2]: "Duplicate attribute.", + [3]: "End tag cannot have attributes.", + [4]: "Illegal '/' in tags.", + [5]: "Unexpected EOF in tag.", + [6]: "Unexpected EOF in CDATA section.", + [7]: "Unexpected EOF in comment.", + [8]: "Unexpected EOF in script.", + [9]: "Unexpected EOF in tag.", + [10]: "Incorrectly closed comment.", + [11]: "Incorrectly opened comment.", + [12]: "Illegal tag name. Use '<' to print '<'.", + [13]: "Attribute value was expected.", + [14]: "End tag name was expected.", + [15]: "Whitespace was expected.", + [16]: "Unexpected '<!--' in comment.", + [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, + [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", + [19]: "Attribute name cannot start with '='.", + [21]: "'<?' is allowed only in XML context.", + [20]: `Unexpected null character.`, + [22]: "Illegal '/' in tags.", + // Vue-specific parse errors + [23]: "Invalid end tag.", + [24]: "Element is missing end tag.", + [25]: "Interpolation end sign was not found.", + [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", + [26]: "Legal directive name was expected.", + // transform errors + [28]: `v-if/v-else-if is missing expression.`, + [29]: `v-if/else branches must use unique keys.`, + [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, + [31]: `v-for is missing expression.`, + [32]: `v-for has invalid expression.`, + [33]: `<template v-for> key should be placed on the <template> tag.`, + [34]: `v-bind is missing expression.`, + [35]: `v-on is missing expression.`, + [36]: `Unexpected custom directive on <slot> outlet.`, + [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, + [38]: `Duplicate slot names found. `, + [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, + [40]: `v-slot can only be used on components or <template> tags.`, + [41]: `v-model is missing expression.`, + [42]: `v-model value must be a valid JavaScript member expression.`, + [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, + [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. +Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, + [45]: `Error parsing JavaScript expression: `, + [46]: `<KeepAlive> expects exactly one child component.`, + [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, + // generic errors + [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, + [48]: `ES module mode is not supported in this build of compiler.`, + [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, + [50]: `"scopeId" option is only supported in module mode.`, + // just to fulfill types + [52]: `` +}; + +function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { + { + return; } - nodes.push(node); } -function parseCDATA(context, ancestors) { - advanceBy(context, 9); - const nodes = parseChildren(context, 3, ancestors); - if (context.source.length === 0) { - emitError(context, 6); - } else { - advanceBy(context, 3); +function isReferencedIdentifier(id, parent, parentStack) { + { + return false; } - return nodes; } -function parseComment(context) { - const start = getCursor(context); - let content; - const match = /--(\!)?>/.exec(context.source); - if (!match) { - content = context.source.slice(4); - advanceBy(context, context.source.length); - emitError(context, 7); - } else { - if (match.index <= 3) { - emitError(context, 0); - } - if (match[1]) { - emitError(context, 10); - } - content = context.source.slice(4, match.index); - const s = context.source.slice(0, match.index); - let prevIndex = 1, nestedIndex = 0; - while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) { - advanceBy(context, nestedIndex - prevIndex + 1); - if (nestedIndex + 4 < s.length) { - emitError(context, 16); +function isInDestructureAssignment(parent, parentStack) { + if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "AssignmentExpression") { + return true; + } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { + break; } - prevIndex = nestedIndex + 1; } - advanceBy(context, match.index + match[0].length - prevIndex + 1); - } - return { - type: 3, - content, - loc: getSelection(context, start) - }; -} -function parseBogusComment(context) { - const start = getCursor(context); - const contentStart = context.source[1] === "?" ? 1 : 2; - let content; - const closeIndex = context.source.indexOf(">"); - if (closeIndex === -1) { - content = context.source.slice(contentStart); - advanceBy(context, context.source.length); - } else { - content = context.source.slice(contentStart, closeIndex); - advanceBy(context, closeIndex + 1); } - return { - type: 3, - content, - loc: getSelection(context, start) - }; + return false; } -function parseElement(context, ancestors) { - const wasInPre = context.inPre; - const wasInVPre = context.inVPre; - const parent = last(ancestors); - const element = parseTag(context, TagType.Start, parent); - const isPreBoundary = context.inPre && !wasInPre; - const isVPreBoundary = context.inVPre && !wasInVPre; - if (element.isSelfClosing || context.options.isVoidTag(element.tag)) { - if (isPreBoundary) { - context.inPre = false; - } - if (isVPreBoundary) { - context.inVPre = false; - } - return element; - } - ancestors.push(element); - const mode = context.options.getTextMode(element, parent); - const children = parseChildren(context, mode, ancestors); - ancestors.pop(); - { - const inlineTemplateProp = element.props.find( - (p) => p.type === 6 && p.name === "inline-template" - ); - if (inlineTemplateProp && checkCompatEnabled( - "COMPILER_INLINE_TEMPLATE", - context, - inlineTemplateProp.loc - )) { - const loc = getSelection(context, element.loc.end); - inlineTemplateProp.value = { - type: 2, - content: loc.source, - loc - }; - } - } - element.children = children; - if (startsWithEndTagOpen(context.source, element.tag)) { - parseTag(context, TagType.End, parent); - } else { - emitError(context, 24, 0, element.loc.start); - if (context.source.length === 0 && element.tag.toLowerCase() === "script") { - const first = children[0]; - if (first && startsWith(first.loc.source, "<!--")) { - emitError(context, 8); - } +function isInNewExpression(parentStack) { + let i = parentStack.length; + while (i--) { + const p = parentStack[i]; + if (p.type === "NewExpression") { + return true; + } else if (p.type !== "MemberExpression") { + break; } } - element.loc = getSelection(context, element.loc.start); - if (isPreBoundary) { - context.inPre = false; - } - if (isVPreBoundary) { - context.inVPre = false; - } - return element; + return false; } -var TagType = /* @__PURE__ */ ((TagType2) => { - TagType2[TagType2["Start"] = 0] = "Start"; - TagType2[TagType2["End"] = 1] = "End"; - return TagType2; -})(TagType || {}); -const isSpecialTemplateDirective = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.makeMap)( - `if,else,else-if,for,slot` -); -function parseTag(context, type, parent) { - const start = getCursor(context); - const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source); - const tag = match[1]; - const ns = context.options.getNamespace(tag, parent); - advanceBy(context, match[0].length); - advanceSpaces(context); - const cursor = getCursor(context); - const currentSource = context.source; - if (context.options.isPreTag(tag)) { - context.inPre = true; - } - let props = parseAttributes(context, type); - if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) { - context.inVPre = true; - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)(context, cursor); - context.source = currentSource; - props = parseAttributes(context, type).filter((p) => p.name !== "v-pre"); - } - let isSelfClosing = false; - if (context.source.length === 0) { - emitError(context, 9); - } else { - isSelfClosing = startsWith(context.source, "/>"); - if (type === 1 /* End */ && isSelfClosing) { - emitError(context, 4); +function walkFunctionParams(node, onIdent) { + for (const p of node.params) { + for (const id of extractIdentifiers(p)) { + onIdent(id); } - advanceBy(context, isSelfClosing ? 2 : 1); - } - if (type === 1 /* End */) { - return; } - if ( true && isCompatEnabled( - "COMPILER_V_IF_V_FOR_PRECEDENCE", - context - )) { - let hasIf = false; - let hasFor = false; - for (let i = 0; i < props.length; i++) { - const p = props[i]; - if (p.type === 7) { - if (p.name === "if") { - hasIf = true; - } else if (p.name === "for") { - hasFor = true; +} +function walkBlockDeclarations(block, onIdent) { + for (const stmt of block.body) { + if (stmt.type === "VariableDeclaration") { + if (stmt.declare) + continue; + for (const decl of stmt.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); } } - if (hasIf && hasFor) { - warnDeprecation( - "COMPILER_V_IF_V_FOR_PRECEDENCE", - context, - getSelection(context, start) - ); - break; + } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { + if (stmt.declare || !stmt.id) + continue; + onIdent(stmt.id); + } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") { + const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; + if (variable && variable.type === "VariableDeclaration") { + for (const decl of variable.declarations) { + for (const id of extractIdentifiers(decl.id)) { + onIdent(id); + } + } } } } - let tagType = 0; - if (!context.inVPre) { - if (tag === "slot") { - tagType = 2; - } else if (tag === "template") { - if (props.some( - (p) => p.type === 7 && isSpecialTemplateDirective(p.name) - )) { - tagType = 3; +} +function extractIdentifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; } - } else if (isComponent(tag, props, context)) { - tagType = 1; - } + nodes.push(object); + break; + case "ObjectPattern": + for (const prop of param.properties) { + if (prop.type === "RestElement") { + extractIdentifiers(prop.argument, nodes); + } else { + extractIdentifiers(prop.value, nodes); + } + } + break; + case "ArrayPattern": + param.elements.forEach((element) => { + if (element) + extractIdentifiers(element, nodes); + }); + break; + case "RestElement": + extractIdentifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extractIdentifiers(param.left, nodes); + break; } - return { - type: 1, - ns, - tag, - tagType, - props, - isSelfClosing, - children: [], - loc: getSelection(context, start), - codegenNode: void 0 - // to be created during transform phase - }; + return nodes; } -function isComponent(tag, props, context) { - const options = context.options; - if (options.isCustomElement(tag)) { - return false; - } - if (tag === "component" || /^[A-Z]/.test(tag) || isCoreComponent(tag) || options.isBuiltInComponent && options.isBuiltInComponent(tag) || options.isNativeTag && !options.isNativeTag(tag)) { - return true; - } - for (let i = 0; i < props.length; i++) { - const p = props[i]; - if (p.type === 6) { - if (p.name === "is" && p.value) { - if (p.value.content.startsWith("vue:")) { - return true; - } else if (checkCompatEnabled( - "COMPILER_IS_ON_ELEMENT", - context, - p.loc - )) { - return true; - } - } - } else { - if (p.name === "is") { - return true; - } else if ( - // :is on plain element - only treat as component in compat mode - p.name === "bind" && isStaticArgOf(p.arg, "is") && true && checkCompatEnabled( - "COMPILER_IS_ON_ELEMENT", - context, - p.loc - ) - ) { - return true; - } - } +const isFunctionType = (node) => { + return /Function(?:Expression|Declaration)$|Method$/.test(node.type); +}; +const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; +const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; +const TS_NODE_TYPES = [ + "TSAsExpression", + // foo as number + "TSTypeAssertion", + // (<number>foo) + "TSNonNullExpression", + // foo! + "TSInstantiationExpression", + // foo<string> + "TSSatisfiesExpression" + // foo satisfies T +]; +function unwrapTSNode(node) { + if (TS_NODE_TYPES.includes(node.type)) { + return unwrapTSNode(node.expression); + } else { + return node; } } -function parseAttributes(context, type) { - const props = []; - const attributeNames = /* @__PURE__ */ new Set(); - while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) { - if (startsWith(context.source, "/")) { - emitError(context, 22); - advanceBy(context, 1); - advanceSpaces(context); - continue; - } - if (type === 1 /* End */) { - emitError(context, 3); - } - const attr = parseAttribute(context, attributeNames); - if (attr.type === 6 && attr.value && attr.name === "class") { - attr.value.content = attr.value.content.replace(/\s+/g, " ").trim(); - } - if (type === 0 /* Start */) { - props.push(attr); - } - if (/^[^\t\r\n\f />]/.test(context.source)) { - emitError(context, 15); - } - advanceSpaces(context); + +const isStaticExp = (p) => p.type === 4 && p.isStatic; +function isCoreComponent(tag) { + switch (tag) { + case "Teleport": + case "teleport": + return TELEPORT; + case "Suspense": + case "suspense": + return SUSPENSE; + case "KeepAlive": + case "keep-alive": + return KEEP_ALIVE; + case "BaseTransition": + case "base-transition": + return BASE_TRANSITION; } - return props; } -function parseAttribute(context, nameSet) { - var _a; - const start = getCursor(context); - const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source); - const name = match[0]; - if (nameSet.has(name)) { - emitError(context, 2); - } - nameSet.add(name); - if (name[0] === "=") { - emitError(context, 19); - } - { - const pattern = /["'<]/g; - let m; - while (m = pattern.exec(name)) { - emitError( - context, - 17, - m.index - ); - } - } - advanceBy(context, name.length); - let value = void 0; - if (/^[\t\r\n\f ]*=/.test(context.source)) { - advanceSpaces(context); - advanceBy(context, 1); - advanceSpaces(context); - value = parseAttributeValue(context); - if (!value) { - emitError(context, 13); - } - } - const loc = getSelection(context, start); - if (!context.inVPre && /^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(name)) { - const match2 = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec( - name - ); - let isPropShorthand = startsWith(name, "."); - let dirName = match2[1] || (isPropShorthand || startsWith(name, ":") ? "bind" : startsWith(name, "@") ? "on" : "slot"); - let arg; - if (match2[2]) { - const isSlot = dirName === "slot"; - const startOffset = name.lastIndexOf( - match2[2], - name.length - (((_a = match2[3]) == null ? void 0 : _a.length) || 0) - ); - const loc2 = getSelection( - context, - getNewPosition(context, start, startOffset), - getNewPosition( - context, - start, - startOffset + match2[2].length + (isSlot && match2[3] || "").length - ) - ); - let content = match2[2]; - let isStatic = true; - if (content.startsWith("[")) { - isStatic = false; - if (!content.endsWith("]")) { - emitError( - context, - 27 - ); - content = content.slice(1); - } else { - content = content.slice(1, content.length - 1); +const nonIdentifierRE = /^\d|[^\$\w]/; +const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); +const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; +const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; +const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; +const isMemberExpressionBrowser = (path) => { + path = path.trim().replace(whitespaceRE, (s) => s.trim()); + let state = 0 /* inMemberExp */; + let stateStack = []; + let currentOpenBracketCount = 0; + let currentOpenParensCount = 0; + let currentStringType = null; + for (let i = 0; i < path.length; i++) { + const char = path.charAt(i); + switch (state) { + case 0 /* inMemberExp */: + if (char === "[") { + stateStack.push(state); + state = 1 /* inBrackets */; + currentOpenBracketCount++; + } else if (char === "(") { + stateStack.push(state); + state = 2 /* inParens */; + currentOpenParensCount++; + } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { + return false; } - } else if (isSlot) { - content += match2[3] || ""; - } - arg = { - type: 4, - content, - isStatic, - constType: isStatic ? 3 : 0, - loc: loc2 - }; - } - if (value && value.isQuoted) { - const valueLoc = value.loc; - valueLoc.start.offset++; - valueLoc.start.column++; - valueLoc.end = advancePositionWithClone(valueLoc.start, value.content); - valueLoc.source = valueLoc.source.slice(1, -1); - } - const modifiers = match2[3] ? match2[3].slice(1).split(".") : []; - if (isPropShorthand) - modifiers.push("prop"); - if (dirName === "bind" && arg) { - if (modifiers.includes("sync") && checkCompatEnabled( - "COMPILER_V_BIND_SYNC", - context, - loc, - arg.loc.source - )) { - dirName = "model"; - modifiers.splice(modifiers.indexOf("sync"), 1); - } - if ( true && modifiers.includes("prop")) { - checkCompatEnabled( - "COMPILER_V_BIND_PROP", - context, - loc - ); - } + break; + case 1 /* inBrackets */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `[`) { + currentOpenBracketCount++; + } else if (char === `]`) { + if (!--currentOpenBracketCount) { + state = stateStack.pop(); + } + } + break; + case 2 /* inParens */: + if (char === `'` || char === `"` || char === "`") { + stateStack.push(state); + state = 3 /* inString */; + currentStringType = char; + } else if (char === `(`) { + currentOpenParensCount++; + } else if (char === `)`) { + if (i === path.length - 1) { + return false; + } + if (!--currentOpenParensCount) { + state = stateStack.pop(); + } + } + break; + case 3 /* inString */: + if (char === currentStringType) { + state = stateStack.pop(); + currentStringType = null; + } + break; } - return { - type: 7, - name: dirName, - exp: value && { - type: 4, - content: value.content, - isStatic: false, - // Treat as non-constant by default. This can be potentially set to - // other values by `transformExpression` to make it eligible for hoisting. - constType: 0, - loc: value.loc - }, - arg, - modifiers, - loc - }; } - if (!context.inVPre && startsWith(name, "v-")) { - emitError(context, 26); - } - return { - type: 6, - name, - value: value && { - type: 2, - content: value.content, - loc: value.loc - }, - loc - }; -} -function parseAttributeValue(context) { - const start = getCursor(context); - let content; - const quote = context.source[0]; - const isQuoted = quote === `"` || quote === `'`; - if (isQuoted) { - advanceBy(context, 1); - const endIndex = context.source.indexOf(quote); - if (endIndex === -1) { - content = parseTextData( - context, - context.source.length, - 4 - ); - } else { - content = parseTextData(context, endIndex, 4); - advanceBy(context, 1); - } - } else { - const match = /^[^\t\r\n\f >]+/.exec(context.source); - if (!match) { - return void 0; - } - const unexpectedChars = /["'<=`]/g; - let m; - while (m = unexpectedChars.exec(match[0])) { - emitError( - context, - 18, - m.index - ); - } - content = parseTextData(context, match[0].length, 4); - } - return { content, isQuoted, loc: getSelection(context, start) }; -} -function parseInterpolation(context, mode) { - const [open, close] = context.options.delimiters; - const closeIndex = context.source.indexOf(close, open.length); - if (closeIndex === -1) { - emitError(context, 25); - return void 0; - } - const start = getCursor(context); - advanceBy(context, open.length); - const innerStart = getCursor(context); - const innerEnd = getCursor(context); - const rawContentLength = closeIndex - open.length; - const rawContent = context.source.slice(0, rawContentLength); - const preTrimContent = parseTextData(context, rawContentLength, mode); - const content = preTrimContent.trim(); - const startOffset = preTrimContent.indexOf(content); - if (startOffset > 0) { - advancePositionWithMutation(innerStart, rawContent, startOffset); - } - const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset); - advancePositionWithMutation(innerEnd, rawContent, endOffset); - advanceBy(context, close.length); - return { - type: 5, - content: { - type: 4, - isStatic: false, - // Set `isConstant` to false by default and will decide in transformExpression - constType: 0, - content, - loc: getSelection(context, innerStart, innerEnd) + return !currentOpenBracketCount && !currentOpenParensCount; +}; +const isMemberExpressionNode = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP ; +const isMemberExpression = isMemberExpressionBrowser ; +function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { + return advancePositionWithMutation( + { + offset: pos.offset, + line: pos.line, + column: pos.column }, - loc: getSelection(context, start) - }; + source, + numberOfCharacters + ); } -function parseText(context, mode) { - const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]]; - let endIndex = context.source.length; - for (let i = 0; i < endTokens.length; i++) { - const index = context.source.indexOf(endTokens[i], 1); - if (index !== -1 && endIndex > index) { - endIndex = index; +function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { + let linesCount = 0; + let lastNewLinePos = -1; + for (let i = 0; i < numberOfCharacters; i++) { + if (source.charCodeAt(i) === 10) { + linesCount++; + lastNewLinePos = i; } } - const start = getCursor(context); - const content = parseTextData(context, endIndex, mode); - return { - type: 2, - content, - loc: getSelection(context, start) - }; -} -function parseTextData(context, length, mode) { - const rawText = context.source.slice(0, length); - advanceBy(context, length); - if (mode === 2 || mode === 3 || !rawText.includes("&")) { - return rawText; - } else { - return context.options.decodeEntities( - rawText, - mode === 4 - ); - } -} -function getCursor(context) { - const { column, line, offset } = context; - return { column, line, offset }; -} -function getSelection(context, start, end) { - end = end || getCursor(context); - return { - start, - end, - source: context.originalSource.slice(start.offset, end.offset) - }; -} -function last(xs) { - return xs[xs.length - 1]; -} -function startsWith(source, searchString) { - return source.startsWith(searchString); -} -function advanceBy(context, numberOfCharacters) { - const { source } = context; - advancePositionWithMutation(context, source, numberOfCharacters); - context.source = source.slice(numberOfCharacters); + pos.offset += numberOfCharacters; + pos.line += linesCount; + pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; + return pos; } -function advanceSpaces(context) { - const match = /^[\t\r\n\f ]+/.exec(context.source); - if (match) { - advanceBy(context, match[0].length); +function assert(condition, msg) { + if (!condition) { + throw new Error(msg || `unexpected compiler condition`); } } -function getNewPosition(context, start, numberOfCharacters) { - return advancePositionWithClone( - start, - context.originalSource.slice(start.offset, numberOfCharacters), - numberOfCharacters - ); -} -function emitError(context, code, offset, loc = getCursor(context)) { - if (offset) { - loc.offset += offset; - loc.column += offset; +function findDir(node, name, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (allowEmpty || p.exp) && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? p.name === name : name.test(p.name))) { + return p; + } } - context.options.onError( - createCompilerError(code, { - start: loc, - end: loc, - source: "" - }) - ); } -function isEnd(context, mode, ancestors) { - const s = context.source; - switch (mode) { - case 0: - if (startsWith(s, "</")) { - for (let i = ancestors.length - 1; i >= 0; --i) { - if (startsWithEndTagOpen(s, ancestors[i].tag)) { - return true; - } - } - } - break; - case 1: - case 2: { - const parent = last(ancestors); - if (parent && startsWithEndTagOpen(s, parent.tag)) { - return true; +function findProp(node, name, dynamicOnly = false, allowEmpty = false) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (dynamicOnly) + continue; + if (p.name === name && (p.value || allowEmpty)) { + return p; } - break; + } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { + return p; } - case 3: - if (startsWith(s, "]]>")) { - return true; - } - break; } - return !s; } -function startsWithEndTagOpen(source, tag) { - return startsWith(source, "</") && source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() && /[\t\r\n\f />]/.test(source[2 + tag.length] || ">"); +function isStaticArgOf(arg, name) { + return !!(arg && isStaticExp(arg) && arg.content === name); } - -function hoistStatic(root, context) { - walk( - root, - context, - // Root node is unfortunately non-hoistable due to potential parent - // fallthrough attributes. - isSingleElementRoot(root, root.children[0]) +function hasDynamicKeyVBind(node) { + return node.props.some( + (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" + p.arg.type !== 4 || // v-bind:[_ctx.foo] + !p.arg.isStatic) + // v-bind:[foo] ); } -function isSingleElementRoot(root, child) { - const { children } = root; - return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +function isText$1(node) { + return node.type === 5 || node.type === 2; } -function walk(node, context, doNotHoistNode = false) { - const { children } = node; - const originalCount = children.length; - let hoistedCount = 0; - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (child.type === 1 && child.tagType === 0) { - const constantType = doNotHoistNode ? 0 : getConstantType(child, context); - if (constantType > 0) { - if (constantType >= 2) { - child.codegenNode.patchFlag = -1 + ( true ? ` /* HOISTED */` : 0); - child.codegenNode = context.hoist(child.codegenNode); - hoistedCount++; - continue; - } - } else { - const codegenNode = child.codegenNode; - if (codegenNode.type === 13) { - const flag = getPatchFlag(codegenNode); - if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { - const props = getNodeProps(child); - if (props) { - codegenNode.props = context.hoist(props); - } - } - if (codegenNode.dynamicProps) { - codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); - } - } - } +function isVSlot(p) { + return p.type === 7 && p.name === "slot"; +} +function isTemplateNode(node) { + return node.type === 1 && node.tagType === 3; +} +function isSlotOutlet(node) { + return node.type === 1 && node.tagType === 2; +} +const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); +function getUnnormalizedProps(props, callPath = []) { + if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { + const callee = props.callee; + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(callee) && propsHelperSet.has(callee)) { + return getUnnormalizedProps( + props.arguments[0], + callPath.concat(props) + ); } - if (child.type === 1) { - const isComponent = child.tagType === 1; - if (isComponent) { - context.scopes.vSlot++; - } - walk(child, context); - if (isComponent) { - context.scopes.vSlot--; + } + return [props, callPath]; +} +function injectProp(node, prop, context) { + let propsWithInjection; + let props = node.type === 13 ? node.props : node.arguments[2]; + let callPath = []; + let parentCall; + if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props) && props.type === 14) { + const ret = getUnnormalizedProps(props); + props = ret[0]; + callPath = ret[1]; + parentCall = callPath[callPath.length - 1]; + } + if (props == null || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(props)) { + propsWithInjection = createObjectExpression([prop]); + } else if (props.type === 14) { + const first = props.arguments[0]; + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(first) && first.type === 15) { + if (!hasProp(prop, first)) { + first.properties.unshift(prop); } - } else if (child.type === 11) { - walk(child, context, child.children.length === 1); - } else if (child.type === 9) { - for (let i2 = 0; i2 < child.branches.length; i2++) { - walk( - child.branches[i2], - context, - child.branches[i2].children.length === 1 - ); + } else { + if (props.callee === TO_HANDLERS) { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + } else { + props.arguments.unshift(createObjectExpression([prop])); } } + !propsWithInjection && (propsWithInjection = props); + } else if (props.type === 15) { + if (!hasProp(prop, props)) { + props.properties.unshift(prop); + } + propsWithInjection = props; + } else { + propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ + createObjectExpression([prop]), + props + ]); + if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { + parentCall = callPath[callPath.length - 2]; + } } - if (hoistedCount && context.transformHoist) { - context.transformHoist(children, context, node); + if (node.type === 13) { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.props = propsWithInjection; + } + } else { + if (parentCall) { + parentCall.arguments[0] = propsWithInjection; + } else { + node.arguments[2] = propsWithInjection; + } } - if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node.codegenNode.children)) { - node.codegenNode.children = context.hoist( - createArrayExpression(node.codegenNode.children) +} +function hasProp(prop, props) { + let result = false; + if (prop.key.type === 4) { + const propKeyName = prop.key.content; + result = props.properties.some( + (p) => p.key.type === 4 && p.key.content === propKeyName ); } + return result; } -function getConstantType(node, context) { - const { constantCache } = context; +function toValidAssetId(name, type) { + return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { + return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); + })}`; +} +function hasScopeRef(node, ids) { + if (!node || Object.keys(ids).length === 0) { + return false; + } switch (node.type) { case 1: - if (node.tagType !== 0) { - return 0; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { + return true; + } } - const cached = constantCache.get(node); - if (cached !== void 0) { - return cached; + return node.children.some((c) => hasScopeRef(c, ids)); + case 11: + if (hasScopeRef(node.source, ids)) { + return true; } - const codegenNode = node.codegenNode; - if (codegenNode.type !== 13) { - return 0; + return node.children.some((c) => hasScopeRef(c, ids)); + case 9: + return node.branches.some((b) => hasScopeRef(b, ids)); + case 10: + if (hasScopeRef(node.condition, ids)) { + return true; } - if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") { - return 0; + return node.children.some((c) => hasScopeRef(c, ids)); + case 4: + return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; + case 8: + return node.children.some((c) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(c) && hasScopeRef(c, ids)); + case 5: + case 12: + return hasScopeRef(node.content, ids); + case 2: + case 3: + return false; + default: + if (true) ; + return false; + } +} +function getMemoedVNodeCall(node) { + if (node.type === 14 && node.callee === WITH_MEMO) { + return node.arguments[1].returns; + } else { + return node; + } +} +const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; + +const defaultParserOptions = { + parseMode: "base", + ns: 0, + delimiters: [`{{`, `}}`], + getNamespace: () => 0, + isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, + isPreTag: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, + isCustomElement: _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NO, + onError: defaultOnError, + onWarn: defaultOnWarn, + comments: !!("development" !== "production"), + prefixIdentifiers: false +}; +let currentOptions = defaultParserOptions; +let currentRoot = null; +let currentInput = ""; +let currentOpenTag = null; +let currentProp = null; +let currentAttrValue = ""; +let currentAttrStartIndex = -1; +let currentAttrEndIndex = -1; +let inPre = 0; +let inVPre = false; +let currentVPreBoundary = null; +const stack = []; +const tokenizer = new Tokenizer(stack, { + onerr: emitError, + ontext(start, end) { + onText(getSlice(start, end), start, end); + }, + ontextentity(char, start, end) { + onText(char, start, end); + }, + oninterpolation(start, end) { + if (inVPre) { + return onText(getSlice(start, end), start, end); + } + let innerStart = start + tokenizer.delimiterOpen.length; + let innerEnd = end - tokenizer.delimiterClose.length; + while (isWhitespace(currentInput.charCodeAt(innerStart))) { + innerStart++; + } + while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { + innerEnd--; + } + let exp = getSlice(innerStart, innerEnd); + if (exp.includes("&")) { + { + exp = currentOptions.decodeEntities(exp, false); } - const flag = getPatchFlag(codegenNode); - if (!flag) { - let returnType2 = 3; - const generatedPropsType = getGeneratedPropsConstantType(node, context); - if (generatedPropsType === 0) { - constantCache.set(node, 0); - return 0; - } - if (generatedPropsType < returnType2) { - returnType2 = generatedPropsType; - } - for (let i = 0; i < node.children.length; i++) { - const childType = getConstantType(node.children[i], context); - if (childType === 0) { - constantCache.set(node, 0); - return 0; + } + addNode({ + type: 5, + content: createExp(exp, false, getLoc(innerStart, innerEnd)), + loc: getLoc(start, end) + }); + }, + onopentagname(start, end) { + const name = getSlice(start, end); + currentOpenTag = { + type: 1, + tag: name, + ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), + tagType: 0, + // will be refined on tag close + props: [], + children: [], + loc: getLoc(start - 1, end), + codegenNode: void 0 + }; + }, + onopentagend(end) { + endOpenTag(end); + }, + onclosetag(start, end) { + const name = getSlice(start, end); + if (!currentOptions.isVoidTag(name)) { + let found = false; + for (let i = 0; i < stack.length; i++) { + const e = stack[i]; + if (e.tag.toLowerCase() === name.toLowerCase()) { + found = true; + if (i > 0) { + emitError(24, stack[0].loc.start.offset); } - if (childType < returnType2) { - returnType2 = childType; + for (let j = 0; j <= i; j++) { + const el = stack.shift(); + onCloseTag(el, end, j < i); } + break; } - if (returnType2 > 1) { - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 7 && p.name === "bind" && p.exp) { - const expType = getConstantType(p.exp, context); - if (expType === 0) { - constantCache.set(node, 0); - return 0; - } - if (expType < returnType2) { - returnType2 = expType; - } - } + } + if (!found) { + emitError(23, backTrack(start, 60)); + } + } + }, + onselfclosingtag(end) { + var _a; + const name = currentOpenTag.tag; + currentOpenTag.isSelfClosing = true; + endOpenTag(end); + if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) { + onCloseTag(stack.shift(), end); + } + }, + onattribname(start, end) { + currentProp = { + type: 6, + name: getSlice(start, end), + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + }, + ondirname(start, end) { + const raw = getSlice(start, end); + const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); + if (!inVPre && name === "") { + emitError(26, start); + } + if (inVPre || name === "") { + currentProp = { + type: 6, + name: raw, + nameLoc: getLoc(start, end), + value: void 0, + loc: getLoc(start) + }; + } else { + currentProp = { + type: 7, + name, + rawName: raw, + exp: void 0, + arg: void 0, + modifiers: raw === "." ? ["prop"] : [], + loc: getLoc(start) + }; + if (name === "pre") { + inVPre = tokenizer.inVPre = true; + currentVPreBoundary = currentOpenTag; + const props = currentOpenTag.props; + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7) { + props[i] = dirToAttr(props[i]); } } - if (codegenNode.isBlock) { - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 7) { - constantCache.set(node, 0); - return 0; - } + } + } + }, + ondirarg(start, end) { + if (start === end) + return; + const arg = getSlice(start, end); + if (inVPre) { + currentProp.name += arg; + setLocEnd(currentProp.nameLoc, end); + } else { + const isStatic = arg[0] !== `[`; + currentProp.arg = createExp( + isStatic ? arg : arg.slice(1, -1), + isStatic, + getLoc(start, end), + isStatic ? 3 : 0 + ); + } + }, + ondirmodifier(start, end) { + const mod = getSlice(start, end); + if (inVPre) { + currentProp.name += "." + mod; + setLocEnd(currentProp.nameLoc, end); + } else if (currentProp.name === "slot") { + const arg = currentProp.arg; + if (arg) { + arg.content += "." + mod; + setLocEnd(arg.loc, end); + } + } else { + currentProp.modifiers.push(mod); + } + }, + onattribdata(start, end) { + currentAttrValue += getSlice(start, end); + if (currentAttrStartIndex < 0) + currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribentity(char, start, end) { + currentAttrValue += char; + if (currentAttrStartIndex < 0) + currentAttrStartIndex = start; + currentAttrEndIndex = end; + }, + onattribnameend(end) { + const start = currentProp.loc.start.offset; + const name = getSlice(start, end); + if (currentProp.type === 7) { + currentProp.rawName = name; + } + if (currentOpenTag.props.some( + (p) => (p.type === 7 ? p.rawName : p.name) === name + )) { + emitError(2, start); + } + }, + onattribend(quote, end) { + if (currentOpenTag && currentProp) { + setLocEnd(currentProp.loc, end); + if (quote !== 0) { + if (currentAttrValue.includes("&")) { + currentAttrValue = currentOptions.decodeEntities( + currentAttrValue, + true + ); + } + if (currentProp.type === 6) { + if (currentProp.name === "class") { + currentAttrValue = condense(currentAttrValue).trim(); } - context.removeHelper(OPEN_BLOCK); - context.removeHelper( - getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + if (quote === 1 && !currentAttrValue) { + emitError(13, end); + } + currentProp.value = { + type: 2, + content: currentAttrValue, + loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) + }; + if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { + tokenizer.enterRCDATA(toCharCodes(`</template`), 0); + } + } else { + let expParseMode = 0 /* Normal */; + currentProp.exp = createExp( + currentAttrValue, + false, + getLoc(currentAttrStartIndex, currentAttrEndIndex), + 0, + expParseMode ); - codegenNode.isBlock = false; - context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + if (currentProp.name === "for") { + currentProp.forParseResult = parseForExpression(currentProp.exp); + } + let syncIndex = -1; + if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.indexOf("sync")) > -1 && checkCompatEnabled( + "COMPILER_V_BIND_SYNC", + currentOptions, + currentProp.loc, + currentProp.rawName + )) { + currentProp.name = "model"; + currentProp.modifiers.splice(syncIndex, 1); + } } - constantCache.set(node, returnType2); - return returnType2; - } else { - constantCache.set(node, 0); - return 0; } - case 2: - case 3: - return 3; - case 9: - case 11: - case 10: - return 0; - case 5: - case 12: - return getConstantType(node.content, context); - case 4: - return node.constType; - case 8: - let returnType = 3; - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(child)) { - continue; - } - const childType = getConstantType(child, context); - if (childType === 0) { - return 0; - } else if (childType < returnType) { - returnType = childType; - } + if (currentProp.type !== 7 || currentProp.name !== "pre") { + currentOpenTag.props.push(currentProp); } - return returnType; - default: - if (true) ; - return 0; + } + currentAttrValue = ""; + currentAttrStartIndex = currentAttrEndIndex = -1; + }, + oncomment(start, end) { + if (currentOptions.comments) { + addNode({ + type: 3, + content: getSlice(start, end), + loc: getLoc(start - 4, end + 3) + }); + } + }, + onend() { + const end = currentInput.length; + if (( true) && tokenizer.state !== 1) { + switch (tokenizer.state) { + case 5: + case 8: + emitError(5, end); + break; + case 3: + case 4: + emitError( + 25, + tokenizer.sectionStart + ); + break; + case 28: + if (tokenizer.currentSequence === Sequences.CdataEnd) { + emitError(6, end); + } else { + emitError(7, end); + } + break; + case 6: + case 7: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + emitError(9, end); + break; + } + } + for (let index = 0; index < stack.length; index++) { + onCloseTag(stack[index], end - 1); + emitError(24, stack[index].loc.start.offset); + } + }, + oncdata(start, end) { + if (stack[0].ns !== 0) { + onText(getSlice(start, end), start, end); + } else { + emitError(1, start - 9); + } + }, + onprocessinginstruction(start) { + if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + emitError( + 21, + start - 1 + ); + } + } +}); +const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +const stripParensRE = /^\(|\)$/g; +function parseForExpression(input) { + const loc = input.loc; + const exp = input.content; + const inMatch = exp.match(forAliasRE); + if (!inMatch) + return; + const [, LHS, RHS] = inMatch; + const createAliasExpression = (content, offset, asParam = false) => { + const start = loc.start.offset + offset; + const end = start + content.length; + return createExp( + content, + false, + getLoc(start, end), + 0, + asParam ? 1 /* Params */ : 0 /* Normal */ + ); + }; + const result = { + source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), + value: void 0, + key: void 0, + index: void 0, + finalized: false + }; + let valueContent = LHS.trim().replace(stripParensRE, "").trim(); + const trimmedOffset = LHS.indexOf(valueContent); + const iteratorMatch = valueContent.match(forIteratorRE); + if (iteratorMatch) { + valueContent = valueContent.replace(forIteratorRE, "").trim(); + const keyContent = iteratorMatch[1].trim(); + let keyOffset; + if (keyContent) { + keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); + result.key = createAliasExpression(keyContent, keyOffset, true); + } + if (iteratorMatch[2]) { + const indexContent = iteratorMatch[2].trim(); + if (indexContent) { + result.index = createAliasExpression( + indexContent, + exp.indexOf( + indexContent, + result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length + ), + true + ); + } + } } + if (valueContent) { + result.value = createAliasExpression(valueContent, trimmedOffset, true); + } + return result; } -const allowHoistedHelperSet = /* @__PURE__ */ new Set([ - NORMALIZE_CLASS, - NORMALIZE_STYLE, - NORMALIZE_PROPS, - GUARD_REACTIVE_PROPS -]); -function getConstantTypeOfHelperCall(value, context) { - if (value.type === 14 && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(value.callee) && allowHoistedHelperSet.has(value.callee)) { - const arg = value.arguments[0]; - if (arg.type === 4) { - return getConstantType(arg, context); - } else if (arg.type === 14) { - return getConstantTypeOfHelperCall(arg, context); +function getSlice(start, end) { + return currentInput.slice(start, end); +} +function endOpenTag(end) { + if (tokenizer.inSFCRoot) { + currentOpenTag.innerLoc = getLoc(end + 1, end + 1); + } + addNode(currentOpenTag); + const { tag, ns } = currentOpenTag; + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre++; + } + if (currentOptions.isVoidTag(tag)) { + onCloseTag(currentOpenTag, end); + } else { + stack.unshift(currentOpenTag); + if (ns === 1 || ns === 2) { + tokenizer.inXML = true; } } - return 0; + currentOpenTag = null; } -function getGeneratedPropsConstantType(node, context) { - let returnType = 3; - const props = getNodeProps(node); - if (props && props.type === 15) { - const { properties } = props; - for (let i = 0; i < properties.length; i++) { - const { key, value } = properties[i]; - const keyType = getConstantType(key, context); - if (keyType === 0) { - return keyType; - } - if (keyType < returnType) { - returnType = keyType; - } - let valueType; - if (value.type === 4) { - valueType = getConstantType(value, context); - } else if (value.type === 14) { - valueType = getConstantTypeOfHelperCall(value, context); - } else { - valueType = 0; - } - if (valueType === 0) { - return valueType; - } - if (valueType < returnType) { - returnType = valueType; - } +function onText(content, start, end) { + var _a; + { + const tag = (_a = stack[0]) == null ? void 0 : _a.tag; + if (tag !== "script" && tag !== "style" && content.includes("&")) { + content = currentOptions.decodeEntities(content, false); } } - return returnType; + const parent = stack[0] || currentRoot; + const lastNode = parent.children[parent.children.length - 1]; + if ((lastNode == null ? void 0 : lastNode.type) === 2) { + lastNode.content += content; + setLocEnd(lastNode.loc, end); + } else { + parent.children.push({ + type: 2, + content, + loc: getLoc(start, end) + }); + } } -function getNodeProps(node) { - const codegenNode = node.codegenNode; - if (codegenNode.type === 13) { - return codegenNode.props; +function onCloseTag(el, end, isImplied = false) { + if (isImplied) { + setLocEnd(el.loc, backTrack(end, 60)); + } else { + setLocEnd(el.loc, end + 1); + } + if (tokenizer.inSFCRoot) { + if (el.children.length) { + el.innerLoc.end = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, el.children[el.children.length - 1].loc.end); + } else { + el.innerLoc.end = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, el.innerLoc.start); + } + el.innerLoc.source = getSlice( + el.innerLoc.start.offset, + el.innerLoc.end.offset + ); + } + const { tag, ns } = el; + if (!inVPre) { + if (tag === "slot") { + el.tagType = 2; + } else if (isFragmentTemplate(el)) { + el.tagType = 3; + } else if (isComponent(el)) { + el.tagType = 1; + } + } + if (!tokenizer.inRCDATA) { + el.children = condenseWhitespace(el.children, el.tag); + } + if (ns === 0 && currentOptions.isPreTag(tag)) { + inPre--; + } + if (currentVPreBoundary === el) { + inVPre = tokenizer.inVPre = false; + currentVPreBoundary = null; + } + if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { + tokenizer.inXML = false; + } + { + const props = el.props; + if ( true && isCompatEnabled( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions + )) { + let hasIf = false; + let hasFor = false; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 7) { + if (p.name === "if") { + hasIf = true; + } else if (p.name === "for") { + hasFor = true; + } + } + if (hasIf && hasFor) { + warnDeprecation( + "COMPILER_V_IF_V_FOR_PRECEDENCE", + currentOptions, + el.loc + ); + break; + } + } + } + if (isCompatEnabled( + "COMPILER_NATIVE_TEMPLATE", + currentOptions + ) && el.tag === "template" && !isFragmentTemplate(el)) { + true && warnDeprecation( + "COMPILER_NATIVE_TEMPLATE", + currentOptions, + el.loc + ); + const parent = stack[0] || currentRoot; + const index = parent.children.indexOf(el); + parent.children.splice(index, 1, ...el.children); + } + const inlineTemplateProp = props.find( + (p) => p.type === 6 && p.name === "inline-template" + ); + if (inlineTemplateProp && checkCompatEnabled( + "COMPILER_INLINE_TEMPLATE", + currentOptions, + inlineTemplateProp.loc + ) && el.children.length) { + inlineTemplateProp.value = { + type: 2, + content: getSlice( + el.children[0].loc.start.offset, + el.children[el.children.length - 1].loc.end.offset + ), + loc: inlineTemplateProp.loc + }; + } } } -function getPatchFlag(node) { - const flag = node.patchFlag; - return flag ? parseInt(flag, 10) : void 0; +function backTrack(index, c) { + let i = index; + while (currentInput.charCodeAt(i) !== c && i >= 0) + i--; + return i; } - -function createTransformContext(root, { - filename = "", - prefixIdentifiers = false, - hoistStatic: hoistStatic2 = false, - cacheHandlers = false, - nodeTransforms = [], - directiveTransforms = {}, - transformHoist = null, - isBuiltInComponent = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, - isCustomElement = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, - expressionPlugins = [], - scopeId = null, - slotted = true, - ssr = false, - inSSR = false, - ssrCssVars = ``, - bindingMetadata = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ, - inline = false, - isTS = false, - onError = defaultOnError, - onWarn = defaultOnWarn, - compatConfig -}) { - const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); - const context = { - // options - selfName: nameMatch && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(nameMatch[1])), - prefixIdentifiers, - hoistStatic: hoistStatic2, - cacheHandlers, - nodeTransforms, - directiveTransforms, - transformHoist, - isBuiltInComponent, - isCustomElement, - expressionPlugins, - scopeId, - slotted, - ssr, - inSSR, - ssrCssVars, - bindingMetadata, - inline, - isTS, - onError, - onWarn, - compatConfig, - // state - root, - helpers: /* @__PURE__ */ new Map(), - components: /* @__PURE__ */ new Set(), - directives: /* @__PURE__ */ new Set(), - hoists: [], - imports: [], - constantCache: /* @__PURE__ */ new Map(), - temps: 0, - cached: 0, - identifiers: /* @__PURE__ */ Object.create(null), - scopes: { - vFor: 0, - vSlot: 0, - vPre: 0, - vOnce: 0 - }, - parent: null, - currentNode: root, - childIndex: 0, - inVOnce: false, - // methods - helper(name) { - const count = context.helpers.get(name) || 0; - context.helpers.set(name, count + 1); - return name; - }, - removeHelper(name) { - const count = context.helpers.get(name); - if (count) { - const currentCount = count - 1; - if (!currentCount) { - context.helpers.delete(name); - } else { - context.helpers.set(name, currentCount); - } - } - }, - helperString(name) { - return `_${helperNameMap[context.helper(name)]}`; - }, - replaceNode(node) { - if (true) { - if (!context.currentNode) { - throw new Error(`Node being replaced is already removed.`); - } - if (!context.parent) { - throw new Error(`Cannot replace root node.`); - } - } - context.parent.children[context.childIndex] = context.currentNode = node; - }, - removeNode(node) { - if ( true && !context.parent) { - throw new Error(`Cannot remove root node.`); - } - const list = context.parent.children; - const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; - if ( true && removalIndex < 0) { - throw new Error(`node being removed is not a child of current parent`); - } - if (!node || node === context.currentNode) { - context.currentNode = null; - context.onNodeRemoved(); - } else { - if (context.childIndex > removalIndex) { - context.childIndex--; - context.onNodeRemoved(); - } +const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); +function isFragmentTemplate({ tag, props }) { + if (tag === "template") { + for (let i = 0; i < props.length; i++) { + if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { + return true; } - context.parent.children.splice(removalIndex, 1); - }, - onNodeRemoved: () => { - }, - addIdentifiers(exp) { - }, - removeIdentifiers(exp) { - }, - hoist(exp) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) - exp = createSimpleExpression(exp); - context.hoists.push(exp); - const identifier = createSimpleExpression( - `_hoisted_${context.hoists.length}`, - false, - exp.loc, - 2 - ); - identifier.hoisted = exp; - return identifier; - }, - cache(exp, isVNode = false) { - return createCacheExpression(context.cached++, exp, isVNode); } - }; - { - context.filters = /* @__PURE__ */ new Set(); } - return context; + return false; } -function transform(root, options) { - const context = createTransformContext(root, options); - traverseNode(root, context); - if (options.hoistStatic) { - hoistStatic(root, context); +function isComponent({ tag, props }) { + var _a; + if (currentOptions.isCustomElement(tag)) { + return false; } - if (!options.ssr) { - createRootCodegen(root, context); + if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { + return true; } - root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); - root.components = [...context.components]; - root.directives = [...context.directives]; - root.imports = context.imports; - root.hoists = context.hoists; - root.temps = context.temps; - root.cached = context.cached; - { - root.filters = [...context.filters]; + for (let i = 0; i < props.length; i++) { + const p = props[i]; + if (p.type === 6) { + if (p.name === "is" && p.value) { + if (p.value.content.startsWith("vue:")) { + return true; + } else if (checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } + } + } else if (// :is on plain element - only treat as component in compat mode + p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + currentOptions, + p.loc + )) { + return true; + } } + return false; } -function createRootCodegen(root, context) { - const { helper } = context; - const { children } = root; - if (children.length === 1) { - const child = children[0]; - if (isSingleElementRoot(root, child) && child.codegenNode) { - const codegenNode = child.codegenNode; - if (codegenNode.type === 13) { - convertToBlock(codegenNode, context); +function isUpperCase(c) { + return c > 64 && c < 91; +} +const windowsNewlineRE = /\r\n/g; +function condenseWhitespace(nodes, tag) { + var _a, _b; + const shouldCondense = currentOptions.whitespace !== "preserve"; + let removedWhitespace = false; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 2) { + if (!inPre) { + if (isAllWhitespace(node.content)) { + const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type; + const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type; + if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { + removedWhitespace = true; + nodes[i] = null; + } else { + node.content = " "; + } + } else if (shouldCondense) { + node.content = condense(node.content); + } + } else { + node.content = node.content.replace(windowsNewlineRE, "\n"); } - root.codegenNode = codegenNode; - } else { - root.codegenNode = child; } - } else if (children.length > 1) { - let patchFlag = 64; - let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; - if ( true && children.filter((c) => c.type !== 3).length === 1) { - patchFlag |= 2048; - patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; + } + if (inPre && tag && currentOptions.isPreTag(tag)) { + const first = nodes[0]; + if (first && first.type === 2) { + first.content = first.content.replace(/^\r?\n/, ""); } - root.codegenNode = createVNodeCall( - context, - helper(FRAGMENT), - void 0, - root.children, - patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), - void 0, - void 0, - true, - void 0, - false - /* isComponent */ - ); - } else ; + } + return removedWhitespace ? nodes.filter(Boolean) : nodes; } -function traverseChildren(parent, context) { - let i = 0; - const nodeRemoved = () => { - i--; - }; - for (; i < parent.children.length; i++) { - const child = parent.children[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) - continue; - context.parent = parent; - context.childIndex = i; - context.onNodeRemoved = nodeRemoved; - traverseNode(child, context); +function isAllWhitespace(str) { + for (let i = 0; i < str.length; i++) { + if (!isWhitespace(str.charCodeAt(i))) { + return false; + } } + return true; } -function traverseNode(node, context) { - context.currentNode = node; - const { nodeTransforms } = context; - const exitFns = []; - for (let i2 = 0; i2 < nodeTransforms.length; i2++) { - const onExit = nodeTransforms[i2](node, context); - if (onExit) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(onExit)) { - exitFns.push(...onExit); - } else { - exitFns.push(onExit); - } +function hasNewlineChar(str) { + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c === 10 || c === 13) { + return true; } - if (!context.currentNode) { - return; + } + return false; +} +function condense(str) { + let ret = ""; + let prevCharIsWhitespace = false; + for (let i = 0; i < str.length; i++) { + if (isWhitespace(str.charCodeAt(i))) { + if (!prevCharIsWhitespace) { + ret += " "; + prevCharIsWhitespace = true; + } } else { - node = context.currentNode; + ret += str[i]; + prevCharIsWhitespace = false; } } - switch (node.type) { - case 3: - if (!context.ssr) { - context.helper(CREATE_COMMENT); - } - break; - case 5: - if (!context.ssr) { - context.helper(TO_DISPLAY_STRING); - } - break; - case 9: - for (let i2 = 0; i2 < node.branches.length; i2++) { - traverseNode(node.branches[i2], context); - } - break; - case 10: - case 11: - case 1: - case 0: - traverseChildren(node, context); - break; - } - context.currentNode = node; - let i = exitFns.length; - while (i--) { - exitFns[i](); - } + return ret; } -function createStructuralDirectiveTransform(name, fn) { - const matches = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? (n) => n === name : (n) => name.test(n); - return (node, context) => { - if (node.type === 1) { - const { props } = node; - if (node.tagType === 3 && props.some(isVSlot)) { - return; - } - const exitFns = []; - for (let i = 0; i < props.length; i++) { - const prop = props[i]; - if (prop.type === 7 && matches(prop.name)) { - props.splice(i, 1); - i--; - const onExit = fn(node, prop, context); - if (onExit) - exitFns.push(onExit); - } - } - return exitFns; - } +function addNode(node) { + (stack[0] || currentRoot).children.push(node); +} +function getLoc(start, end) { + return { + start: tokenizer.getPos(start), + // @ts-expect-error allow late attachment + end: end == null ? end : tokenizer.getPos(end), + // @ts-expect-error allow late attachment + source: end == null ? end : getSlice(start, end) }; } - -const PURE_ANNOTATION = `/*#__PURE__*/`; -const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; -function createCodegenContext(ast, { - mode = "function", - prefixIdentifiers = mode === "module", - sourceMap = false, - filename = `template.vue.html`, - scopeId = null, - optimizeImports = false, - runtimeGlobalName = `Vue`, - runtimeModuleName = `vue`, - ssrRuntimeModuleName = "vue/server-renderer", - ssr = false, - isTS = false, - inSSR = false -}) { - const context = { - mode, - prefixIdentifiers, - sourceMap, - filename, - scopeId, - optimizeImports, - runtimeGlobalName, - runtimeModuleName, - ssrRuntimeModuleName, - ssr, - isTS, - inSSR, - source: ast.loc.source, - code: ``, - column: 1, - line: 1, - offset: 0, - indentLevel: 0, - pure: false, - map: void 0, - helper(key) { - return `_${helperNameMap[key]}`; - }, - push(code, node) { - context.code += code; - }, - indent() { - newline(++context.indentLevel); - }, - deindent(withoutNewLine = false) { - if (withoutNewLine) { - --context.indentLevel; - } else { - newline(--context.indentLevel); - } - }, - newline() { - newline(context.indentLevel); - } +function setLocEnd(loc, end) { + loc.end = tokenizer.getPos(end); + loc.source = getSlice(loc.start.offset, end); +} +function dirToAttr(dir) { + const attr = { + type: 6, + name: dir.rawName, + nameLoc: getLoc( + dir.loc.start.offset, + dir.loc.start.offset + dir.rawName.length + ), + value: void 0, + loc: dir.loc }; - function newline(n) { - context.push("\n" + ` `.repeat(n)); + if (dir.exp) { + const loc = dir.exp.loc; + if (loc.end.offset < dir.loc.end.offset) { + loc.start.offset--; + loc.start.column--; + loc.end.offset++; + loc.end.column++; + } + attr.value = { + type: 2, + content: dir.exp.content, + loc + }; } - return context; + return attr; } -function generate(ast, options = {}) { - const context = createCodegenContext(ast, options); - if (options.onContextCreated) - options.onContextCreated(context); - const { - mode, - push, - prefixIdentifiers, - indent, - deindent, - newline, - scopeId, - ssr - } = context; - const helpers = Array.from(ast.helpers); - const hasHelpers = helpers.length > 0; - const useWithBlock = !prefixIdentifiers && mode !== "module"; - const isSetupInlined = false; - const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; - { - genFunctionPreamble(ast, preambleContext); - } - const functionName = ssr ? `ssrRender` : `render`; - const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; - const signature = args.join(", "); - { - push(`function ${functionName}(${signature}) {`); - } - indent(); - if (useWithBlock) { - push(`with (_ctx) {`); - indent(); - if (hasHelpers) { - push(`const { ${helpers.map(aliasHelper).join(", ")} } = _Vue`); - push(` -`); - newline(); - } - } - if (ast.components.length) { - genAssets(ast.components, "component", context); - if (ast.directives.length || ast.temps > 0) { - newline(); +function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { + const exp = createSimpleExpression(content, isStatic, loc, constType); + return exp; +} +function emitError(code, index, message) { + currentOptions.onError( + createCompilerError(code, getLoc(index, index), void 0, message) + ); +} +function reset() { + tokenizer.reset(); + currentOpenTag = null; + currentProp = null; + currentAttrValue = ""; + currentAttrStartIndex = -1; + currentAttrEndIndex = -1; + stack.length = 0; +} +function baseParse(input, options) { + reset(); + currentInput = input; + currentOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, defaultParserOptions); + if (options) { + let key; + for (key in options) { + if (options[key] != null) { + currentOptions[key] = options[key]; + } } } - if (ast.directives.length) { - genAssets(ast.directives, "directive", context); - if (ast.temps > 0) { - newline(); + if (true) { + if (!currentOptions.decodeEntities) { + throw new Error( + `[@vue/compiler-core] decodeEntities option is required in browser builds.` + ); } } - if (ast.filters && ast.filters.length) { - newline(); - genAssets(ast.filters, "filter", context); - newline(); + tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; + tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; + const delimiters = options == null ? void 0 : options.delimiters; + if (delimiters) { + tokenizer.delimiterOpen = toCharCodes(delimiters[0]); + tokenizer.delimiterClose = toCharCodes(delimiters[1]); } - if (ast.temps > 0) { - push(`let `); - for (let i = 0; i < ast.temps; i++) { - push(`${i > 0 ? `, ` : ``}_temp${i}`); + const root = currentRoot = createRoot([], input); + tokenizer.parse(currentInput); + root.loc = getLoc(0, input.length); + root.children = condenseWhitespace(root.children); + currentRoot = null; + return root; +} + +function hoistStatic(root, context) { + walk( + root, + context, + // Root node is unfortunately non-hoistable due to potential parent + // fallthrough attributes. + isSingleElementRoot(root, root.children[0]) + ); +} +function isSingleElementRoot(root, child) { + const { children } = root; + return children.length === 1 && child.type === 1 && !isSlotOutlet(child); +} +function walk(node, context, doNotHoistNode = false) { + const { children } = node; + const originalCount = children.length; + let hoistedCount = 0; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.type === 1 && child.tagType === 0) { + const constantType = doNotHoistNode ? 0 : getConstantType(child, context); + if (constantType > 0) { + if (constantType >= 2) { + child.codegenNode.patchFlag = -1 + ( true ? ` /* HOISTED */` : 0); + child.codegenNode = context.hoist(child.codegenNode); + hoistedCount++; + continue; + } + } else { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + const flag = getPatchFlag(codegenNode); + if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { + const props = getNodeProps(child); + if (props) { + codegenNode.props = context.hoist(props); + } + } + if (codegenNode.dynamicProps) { + codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); + } + } + } + } + if (child.type === 1) { + const isComponent = child.tagType === 1; + if (isComponent) { + context.scopes.vSlot++; + } + walk(child, context); + if (isComponent) { + context.scopes.vSlot--; + } + } else if (child.type === 11) { + walk(child, context, child.children.length === 1); + } else if (child.type === 9) { + for (let i2 = 0; i2 < child.branches.length; i2++) { + walk( + child.branches[i2], + context, + child.branches[i2].children.length === 1 + ); + } } } - if (ast.components.length || ast.directives.length || ast.temps) { - push(` -`); - newline(); - } - if (!ssr) { - push(`return `); - } - if (ast.codegenNode) { - genNode(ast.codegenNode, context); - } else { - push(`null`); + if (hoistedCount && context.transformHoist) { + context.transformHoist(children, context, node); } - if (useWithBlock) { - deindent(); - push(`}`); + if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node.codegenNode.children)) { + const hoisted = context.hoist( + createArrayExpression(node.codegenNode.children) + ); + if (context.hmr) { + hoisted.content = `[...${hoisted.content}]`; + } + node.codegenNode.children = hoisted; } - deindent(); - push(`}`); - return { - ast, - code: context.code, - preamble: isSetupInlined ? preambleContext.code : ``, - // SourceMapGenerator does have toJSON() method but it's not in the types - map: context.map ? context.map.toJSON() : void 0 - }; } -function genFunctionPreamble(ast, context) { - const { - ssr, - prefixIdentifiers, - push, - newline, - runtimeModuleName, - runtimeGlobalName, - ssrRuntimeModuleName - } = context; - const VueBinding = runtimeGlobalName; - const helpers = Array.from(ast.helpers); - if (helpers.length > 0) { - { - push(`const _Vue = ${VueBinding} -`); - if (ast.hoists.length) { - const staticHelpers = [ - CREATE_VNODE, - CREATE_ELEMENT_VNODE, - CREATE_COMMENT, - CREATE_TEXT, - CREATE_STATIC - ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); - push(`const { ${staticHelpers} } = _Vue -`); +function getConstantType(node, context) { + const { constantCache } = context; + switch (node.type) { + case 1: + if (node.tagType !== 0) { + return 0; } - } - } - genHoists(ast.hoists, context); - newline(); - push(`return `); -} -function genAssets(assets, type, { helper, push, newline, isTS }) { - const resolver = helper( - type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE - ); - for (let i = 0; i < assets.length; i++) { - let id = assets[i]; - const maybeSelfReference = id.endsWith("__self"); - if (maybeSelfReference) { - id = id.slice(0, -6); - } - push( - `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` - ); - if (i < assets.length - 1) { - newline(); - } + const cached = constantCache.get(node); + if (cached !== void 0) { + return cached; + } + const codegenNode = node.codegenNode; + if (codegenNode.type !== 13) { + return 0; + } + if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") { + return 0; + } + const flag = getPatchFlag(codegenNode); + if (!flag) { + let returnType2 = 3; + const generatedPropsType = getGeneratedPropsConstantType(node, context); + if (generatedPropsType === 0) { + constantCache.set(node, 0); + return 0; + } + if (generatedPropsType < returnType2) { + returnType2 = generatedPropsType; + } + for (let i = 0; i < node.children.length; i++) { + const childType = getConstantType(node.children[i], context); + if (childType === 0) { + constantCache.set(node, 0); + return 0; + } + if (childType < returnType2) { + returnType2 = childType; + } + } + if (returnType2 > 1) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7 && p.name === "bind" && p.exp) { + const expType = getConstantType(p.exp, context); + if (expType === 0) { + constantCache.set(node, 0); + return 0; + } + if (expType < returnType2) { + returnType2 = expType; + } + } + } + } + if (codegenNode.isBlock) { + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 7) { + constantCache.set(node, 0); + return 0; + } + } + context.removeHelper(OPEN_BLOCK); + context.removeHelper( + getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) + ); + codegenNode.isBlock = false; + context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); + } + constantCache.set(node, returnType2); + return returnType2; + } else { + constantCache.set(node, 0); + return 0; + } + case 2: + case 3: + return 3; + case 9: + case 11: + case 10: + return 0; + case 5: + case 12: + return getConstantType(node.content, context); + case 4: + return node.constType; + case 8: + let returnType = 3; + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(child)) { + continue; + } + const childType = getConstantType(child, context); + if (childType === 0) { + return 0; + } else if (childType < returnType) { + returnType = childType; + } + } + return returnType; + default: + if (true) ; + return 0; } } -function genHoists(hoists, context) { - if (!hoists.length) { - return; - } - context.pure = true; - const { push, newline, helper, scopeId, mode } = context; - newline(); - for (let i = 0; i < hoists.length; i++) { - const exp = hoists[i]; - if (exp) { - push( - `const _hoisted_${i + 1} = ${``}` - ); - genNode(exp, context); - newline(); +const allowHoistedHelperSet = /* @__PURE__ */ new Set([ + NORMALIZE_CLASS, + NORMALIZE_STYLE, + NORMALIZE_PROPS, + GUARD_REACTIVE_PROPS +]); +function getConstantTypeOfHelperCall(value, context) { + if (value.type === 14 && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(value.callee) && allowHoistedHelperSet.has(value.callee)) { + const arg = value.arguments[0]; + if (arg.type === 4) { + return getConstantType(arg, context); + } else if (arg.type === 14) { + return getConstantTypeOfHelperCall(arg, context); } } - context.pure = false; -} -function isText(n) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; -} -function genNodeListAsArray(nodes, context) { - const multilines = nodes.length > 3 || true && nodes.some((n) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(n) || !isText(n)); - context.push(`[`); - multilines && context.indent(); - genNodeList(nodes, context, multilines); - multilines && context.deindent(); - context.push(`]`); + return 0; } -function genNodeList(nodes, context, multilines = false, comma = true) { - const { push, newline } = context; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { - push(node); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node)) { - genNodeListAsArray(node, context); - } else { - genNode(node, context); - } - if (i < nodes.length - 1) { - if (multilines) { - comma && push(","); - newline(); +function getGeneratedPropsConstantType(node, context) { + let returnType = 3; + const props = getNodeProps(node); + if (props && props.type === 15) { + const { properties } = props; + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + const keyType = getConstantType(key, context); + if (keyType === 0) { + return keyType; + } + if (keyType < returnType) { + returnType = keyType; + } + let valueType; + if (value.type === 4) { + valueType = getConstantType(value, context); + } else if (value.type === 14) { + valueType = getConstantTypeOfHelperCall(value, context); } else { - comma && push(", "); + valueType = 0; + } + if (valueType === 0) { + return valueType; + } + if (valueType < returnType) { + returnType = valueType; } } } + return returnType; } -function genNode(node, context) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { - context.push(node); - return; - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(node)) { - context.push(context.helper(node)); - return; +function getNodeProps(node) { + const codegenNode = node.codegenNode; + if (codegenNode.type === 13) { + return codegenNode.props; } - switch (node.type) { - case 1: - case 9: - case 11: - true && assert( - node.codegenNode != null, - `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` - ); - genNode(node.codegenNode, context); - break; - case 2: - genText(node, context); - break; - case 4: - genExpression(node, context); - break; - case 5: - genInterpolation(node, context); - break; - case 12: - genNode(node.codegenNode, context); - break; - case 8: - genCompoundExpression(node, context); - break; - case 3: - genComment(node, context); - break; - case 13: - genVNodeCall(node, context); - break; - case 14: - genCallExpression(node, context); - break; - case 15: - genObjectExpression(node, context); - break; - case 17: - genArrayExpression(node, context); - break; - case 18: - genFunctionExpression(node, context); - break; - case 19: - genConditionalExpression(node, context); - break; - case 20: - genCacheExpression(node, context); - break; - case 21: - genNodeList(node.body, context, true, false); - break; - case 22: - break; - case 23: - break; - case 24: - break; - case 25: - break; - case 26: - break; - case 10: - break; - default: - if (true) { - assert(false, `unhandled codegen node type: ${node.type}`); - const exhaustiveCheck = node; - return exhaustiveCheck; - } - } -} -function genText(node, context) { - context.push(JSON.stringify(node.content), node); } -function genExpression(node, context) { - const { content, isStatic } = node; - context.push(isStatic ? JSON.stringify(content) : content, node); -} -function genInterpolation(node, context) { - const { push, helper, pure } = context; - if (pure) - push(PURE_ANNOTATION); - push(`${helper(TO_DISPLAY_STRING)}(`); - genNode(node.content, context); - push(`)`); +function getPatchFlag(node) { + const flag = node.patchFlag; + return flag ? parseInt(flag, 10) : void 0; } -function genCompoundExpression(node, context) { - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) { - context.push(child); - } else { - genNode(child, context); + +function createTransformContext(root, { + filename = "", + prefixIdentifiers = false, + hoistStatic: hoistStatic2 = false, + hmr = false, + cacheHandlers = false, + nodeTransforms = [], + directiveTransforms = {}, + transformHoist = null, + isBuiltInComponent = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, + isCustomElement = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, + expressionPlugins = [], + scopeId = null, + slotted = true, + ssr = false, + inSSR = false, + ssrCssVars = ``, + bindingMetadata = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ, + inline = false, + isTS = false, + onError = defaultOnError, + onWarn = defaultOnWarn, + compatConfig +}) { + const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); + const context = { + // options + filename, + selfName: nameMatch && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(nameMatch[1])), + prefixIdentifiers, + hoistStatic: hoistStatic2, + hmr, + cacheHandlers, + nodeTransforms, + directiveTransforms, + transformHoist, + isBuiltInComponent, + isCustomElement, + expressionPlugins, + scopeId, + slotted, + ssr, + inSSR, + ssrCssVars, + bindingMetadata, + inline, + isTS, + onError, + onWarn, + compatConfig, + // state + root, + helpers: /* @__PURE__ */ new Map(), + components: /* @__PURE__ */ new Set(), + directives: /* @__PURE__ */ new Set(), + hoists: [], + imports: [], + constantCache: /* @__PURE__ */ new WeakMap(), + temps: 0, + cached: 0, + identifiers: /* @__PURE__ */ Object.create(null), + scopes: { + vFor: 0, + vSlot: 0, + vPre: 0, + vOnce: 0 + }, + parent: null, + currentNode: root, + childIndex: 0, + inVOnce: false, + // methods + helper(name) { + const count = context.helpers.get(name) || 0; + context.helpers.set(name, count + 1); + return name; + }, + removeHelper(name) { + const count = context.helpers.get(name); + if (count) { + const currentCount = count - 1; + if (!currentCount) { + context.helpers.delete(name); + } else { + context.helpers.set(name, currentCount); + } + } + }, + helperString(name) { + return `_${helperNameMap[context.helper(name)]}`; + }, + replaceNode(node) { + if (true) { + if (!context.currentNode) { + throw new Error(`Node being replaced is already removed.`); + } + if (!context.parent) { + throw new Error(`Cannot replace root node.`); + } + } + context.parent.children[context.childIndex] = context.currentNode = node; + }, + removeNode(node) { + if ( true && !context.parent) { + throw new Error(`Cannot remove root node.`); + } + const list = context.parent.children; + const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; + if ( true && removalIndex < 0) { + throw new Error(`node being removed is not a child of current parent`); + } + if (!node || node === context.currentNode) { + context.currentNode = null; + context.onNodeRemoved(); + } else { + if (context.childIndex > removalIndex) { + context.childIndex--; + context.onNodeRemoved(); + } + } + context.parent.children.splice(removalIndex, 1); + }, + onNodeRemoved: () => { + }, + addIdentifiers(exp) { + }, + removeIdentifiers(exp) { + }, + hoist(exp) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) + exp = createSimpleExpression(exp); + context.hoists.push(exp); + const identifier = createSimpleExpression( + `_hoisted_${context.hoists.length}`, + false, + exp.loc, + 2 + ); + identifier.hoisted = exp; + return identifier; + }, + cache(exp, isVNode = false) { + return createCacheExpression(context.cached++, exp, isVNode); } + }; + { + context.filters = /* @__PURE__ */ new Set(); } + return context; } -function genExpressionAsPropertyKey(node, context) { - const { push } = context; - if (node.type === 8) { - push(`[`); - genCompoundExpression(node, context); - push(`]`); - } else if (node.isStatic) { - const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); - push(text, node); - } else { - push(`[${node.content}]`, node); +function transform(root, options) { + const context = createTransformContext(root, options); + traverseNode(root, context); + if (options.hoistStatic) { + hoistStatic(root, context); } -} -function genComment(node, context) { - const { push, helper, pure } = context; - if (pure) { - push(PURE_ANNOTATION); + if (!options.ssr) { + createRootCodegen(root, context); } - push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node); -} -function genVNodeCall(node, context) { - const { push, helper, pure } = context; - const { - tag, - props, - children, - patchFlag, - dynamicProps, - directives, - isBlock, - disableTracking, - isComponent - } = node; - if (directives) { - push(helper(WITH_DIRECTIVES) + `(`); - } - if (isBlock) { - push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); - } - if (pure) { - push(PURE_ANNOTATION); - } - const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); - push(helper(callHelper) + `(`, node); - genNodeList( - genNullableArgs([tag, props, children, patchFlag, dynamicProps]), - context - ); - push(`)`); - if (isBlock) { - push(`)`); - } - if (directives) { - push(`, `); - genNode(directives, context); - push(`)`); - } -} -function genNullableArgs(args) { - let i = args.length; - while (i--) { - if (args[i] != null) - break; - } - return args.slice(0, i + 1).map((arg) => arg || `null`); -} -function genCallExpression(node, context) { - const { push, helper, pure } = context; - const callee = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node.callee) ? node.callee : helper(node.callee); - if (pure) { - push(PURE_ANNOTATION); + root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); + root.components = [...context.components]; + root.directives = [...context.directives]; + root.imports = context.imports; + root.hoists = context.hoists; + root.temps = context.temps; + root.cached = context.cached; + root.transformed = true; + { + root.filters = [...context.filters]; } - push(callee + `(`, node); - genNodeList(node.arguments, context); - push(`)`); } -function genObjectExpression(node, context) { - const { push, indent, deindent, newline } = context; - const { properties } = node; - if (!properties.length) { - push(`{}`, node); - return; - } - const multilines = properties.length > 1 || true && properties.some((p) => p.value.type !== 4); - push(multilines ? `{` : `{ `); - multilines && indent(); - for (let i = 0; i < properties.length; i++) { - const { key, value } = properties[i]; - genExpressionAsPropertyKey(key, context); - push(`: `); - genNode(value, context); - if (i < properties.length - 1) { - push(`,`); - newline(); +function createRootCodegen(root, context) { + const { helper } = context; + const { children } = root; + if (children.length === 1) { + const child = children[0]; + if (isSingleElementRoot(root, child) && child.codegenNode) { + const codegenNode = child.codegenNode; + if (codegenNode.type === 13) { + convertToBlock(codegenNode, context); + } + root.codegenNode = codegenNode; + } else { + root.codegenNode = child; } - } - multilines && deindent(); - push(multilines ? `}` : ` }`); -} -function genArrayExpression(node, context) { - genNodeListAsArray(node.elements, context); + } else if (children.length > 1) { + let patchFlag = 64; + let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; + if ( true && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; + } + root.codegenNode = createVNodeCall( + context, + helper(FRAGMENT), + void 0, + root.children, + patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), + void 0, + void 0, + true, + void 0, + false + ); + } else ; } -function genFunctionExpression(node, context) { - const { push, indent, deindent } = context; - const { params, returns, body, newline, isSlot } = node; - if (isSlot) { - push(`_${helperNameMap[WITH_CTX]}(`); - } - push(`(`, node); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(params)) { - genNodeList(params, context); - } else if (params) { - genNode(params, context); - } - push(`) => `); - if (newline || body) { - push(`{`); - indent(); +function traverseChildren(parent, context) { + let i = 0; + const nodeRemoved = () => { + i--; + }; + for (; i < parent.children.length; i++) { + const child = parent.children[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) + continue; + context.parent = parent; + context.childIndex = i; + context.onNodeRemoved = nodeRemoved; + traverseNode(child, context); } - if (returns) { - if (newline) { - push(`return `); +} +function traverseNode(node, context) { + context.currentNode = node; + const { nodeTransforms } = context; + const exitFns = []; + for (let i2 = 0; i2 < nodeTransforms.length; i2++) { + const onExit = nodeTransforms[i2](node, context); + if (onExit) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(onExit)) { + exitFns.push(...onExit); + } else { + exitFns.push(onExit); + } } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(returns)) { - genNodeListAsArray(returns, context); + if (!context.currentNode) { + return; } else { - genNode(returns, context); + node = context.currentNode; } - } else if (body) { - genNode(body, context); } - if (newline || body) { - deindent(); - push(`}`); + switch (node.type) { + case 3: + if (!context.ssr) { + context.helper(CREATE_COMMENT); + } + break; + case 5: + if (!context.ssr) { + context.helper(TO_DISPLAY_STRING); + } + break; + case 9: + for (let i2 = 0; i2 < node.branches.length; i2++) { + traverseNode(node.branches[i2], context); + } + break; + case 10: + case 11: + case 1: + case 0: + traverseChildren(node, context); + break; } - if (isSlot) { - if (node.isNonScopedSlot) { - push(`, undefined, true`); - } - push(`)`); + context.currentNode = node; + let i = exitFns.length; + while (i--) { + exitFns[i](); } } -function genConditionalExpression(node, context) { - const { test, consequent, alternate, newline: needNewline } = node; - const { push, indent, deindent, newline } = context; - if (test.type === 4) { - const needsParens = !isSimpleIdentifier(test.content); - needsParens && push(`(`); - genExpression(test, context); - needsParens && push(`)`); - } else { - push(`(`); - genNode(test, context); - push(`)`); - } - needNewline && indent(); - context.indentLevel++; - needNewline || push(` `); - push(`? `); - genNode(consequent, context); - context.indentLevel--; - needNewline && newline(); - needNewline || push(` `); - push(`: `); - const isNested = alternate.type === 19; - if (!isNested) { - context.indentLevel++; - } - genNode(alternate, context); - if (!isNested) { - context.indentLevel--; - } - needNewline && deindent( - true - /* without newline */ - ); +function createStructuralDirectiveTransform(name, fn) { + const matches = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(name) ? (n) => n === name : (n) => name.test(n); + return (node, context) => { + if (node.type === 1) { + const { props } = node; + if (node.tagType === 3 && props.some(isVSlot)) { + return; + } + const exitFns = []; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 7 && matches(prop.name)) { + props.splice(i, 1); + i--; + const onExit = fn(node, prop, context); + if (onExit) + exitFns.push(onExit); + } + } + return exitFns; + } + }; } -function genCacheExpression(node, context) { - const { push, helper, indent, deindent, newline } = context; - push(`_cache[${node.index}] || (`); - if (node.isVNode) { + +const PURE_ANNOTATION = `/*#__PURE__*/`; +const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; +function createCodegenContext(ast, { + mode = "function", + prefixIdentifiers = mode === "module", + sourceMap = false, + filename = `template.vue.html`, + scopeId = null, + optimizeImports = false, + runtimeGlobalName = `Vue`, + runtimeModuleName = `vue`, + ssrRuntimeModuleName = "vue/server-renderer", + ssr = false, + isTS = false, + inSSR = false +}) { + const context = { + mode, + prefixIdentifiers, + sourceMap, + filename, + scopeId, + optimizeImports, + runtimeGlobalName, + runtimeModuleName, + ssrRuntimeModuleName, + ssr, + isTS, + inSSR, + source: ast.source, + code: ``, + column: 1, + line: 1, + offset: 0, + indentLevel: 0, + pure: false, + map: void 0, + helper(key) { + return `_${helperNameMap[key]}`; + }, + push(code, newlineIndex = -2 /* None */, node) { + context.code += code; + }, + indent() { + newline(++context.indentLevel); + }, + deindent(withoutNewLine = false) { + if (withoutNewLine) { + --context.indentLevel; + } else { + newline(--context.indentLevel); + } + }, + newline() { + newline(context.indentLevel); + } + }; + function newline(n) { + context.push("\n" + ` `.repeat(n), 0 /* Start */); + } + return context; +} +function generate(ast, options = {}) { + const context = createCodegenContext(ast, options); + if (options.onContextCreated) + options.onContextCreated(context); + const { + mode, + push, + prefixIdentifiers, + indent, + deindent, + newline, + scopeId, + ssr + } = context; + const helpers = Array.from(ast.helpers); + const hasHelpers = helpers.length > 0; + const useWithBlock = !prefixIdentifiers && mode !== "module"; + const isSetupInlined = false; + const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; + { + genFunctionPreamble(ast, preambleContext); + } + const functionName = ssr ? `ssrRender` : `render`; + const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; + const signature = args.join(", "); + { + push(`function ${functionName}(${signature}) {`); + } + indent(); + if (useWithBlock) { + push(`with (_ctx) {`); indent(); - push(`${helper(SET_BLOCK_TRACKING)}(-1),`); - newline(); + if (hasHelpers) { + push( + `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue +`, + -1 /* End */ + ); + newline(); + } } - push(`_cache[${node.index}] = `); - genNode(node.value, context); - if (node.isVNode) { - push(`,`); + if (ast.components.length) { + genAssets(ast.components, "component", context); + if (ast.directives.length || ast.temps > 0) { + newline(); + } + } + if (ast.directives.length) { + genAssets(ast.directives, "directive", context); + if (ast.temps > 0) { + newline(); + } + } + if (ast.filters && ast.filters.length) { newline(); - push(`${helper(SET_BLOCK_TRACKING)}(1),`); + genAssets(ast.filters, "filter", context); newline(); - push(`_cache[${node.index}]`); - deindent(); } - push(`)`); -} - -function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { - { - return; + if (ast.temps > 0) { + push(`let `); + for (let i = 0; i < ast.temps; i++) { + push(`${i > 0 ? `, ` : ``}_temp${i}`); + } } -} -function isReferencedIdentifier(id, parent, parentStack) { - { - return false; + if (ast.components.length || ast.directives.length || ast.temps) { + push(` +`, 0 /* Start */); + newline(); + } + if (!ssr) { + push(`return `); + } + if (ast.codegenNode) { + genNode(ast.codegenNode, context); + } else { + push(`null`); + } + if (useWithBlock) { + deindent(); + push(`}`); } + deindent(); + push(`}`); + return { + ast, + code: context.code, + preamble: isSetupInlined ? preambleContext.code : ``, + map: context.map ? context.map.toJSON() : void 0 + }; } -function isInDestructureAssignment(parent, parentStack) { - if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { - let i = parentStack.length; - while (i--) { - const p = parentStack[i]; - if (p.type === "AssignmentExpression") { - return true; - } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { - break; +function genFunctionPreamble(ast, context) { + const { + ssr, + prefixIdentifiers, + push, + newline, + runtimeModuleName, + runtimeGlobalName, + ssrRuntimeModuleName + } = context; + const VueBinding = runtimeGlobalName; + const helpers = Array.from(ast.helpers); + if (helpers.length > 0) { + { + push(`const _Vue = ${VueBinding} +`, -1 /* End */); + if (ast.hoists.length) { + const staticHelpers = [ + CREATE_VNODE, + CREATE_ELEMENT_VNODE, + CREATE_COMMENT, + CREATE_TEXT, + CREATE_STATIC + ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); + push(`const { ${staticHelpers} } = _Vue +`, -1 /* End */); } } } - return false; + genHoists(ast.hoists, context); + newline(); + push(`return `); } -function walkFunctionParams(node, onIdent) { - for (const p of node.params) { - for (const id of extractIdentifiers(p)) { - onIdent(id); +function genAssets(assets, type, { helper, push, newline, isTS }) { + const resolver = helper( + type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE + ); + for (let i = 0; i < assets.length; i++) { + let id = assets[i]; + const maybeSelfReference = id.endsWith("__self"); + if (maybeSelfReference) { + id = id.slice(0, -6); + } + push( + `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` + ); + if (i < assets.length - 1) { + newline(); } } } -function walkBlockDeclarations(block, onIdent) { - for (const stmt of block.body) { - if (stmt.type === "VariableDeclaration") { - if (stmt.declare) - continue; - for (const decl of stmt.declarations) { - for (const id of extractIdentifiers(decl.id)) { - onIdent(id); - } - } - } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { - if (stmt.declare || !stmt.id) - continue; - onIdent(stmt.id); +function genHoists(hoists, context) { + if (!hoists.length) { + return; + } + context.pure = true; + const { push, newline, helper, scopeId, mode } = context; + newline(); + for (let i = 0; i < hoists.length; i++) { + const exp = hoists[i]; + if (exp) { + push( + `const _hoisted_${i + 1} = ${``}` + ); + genNode(exp, context); + newline(); } } + context.pure = false; } -function extractIdentifiers(param, nodes = []) { - switch (param.type) { - case "Identifier": - nodes.push(param); - break; - case "MemberExpression": - let object = param; - while (object.type === "MemberExpression") { - object = object.object; - } - nodes.push(object); - break; - case "ObjectPattern": - for (const prop of param.properties) { - if (prop.type === "RestElement") { - extractIdentifiers(prop.argument, nodes); - } else { - extractIdentifiers(prop.value, nodes); - } +function isText(n) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; +} +function genNodeListAsArray(nodes, context) { + const multilines = nodes.length > 3 || true && nodes.some((n) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(n) || !isText(n)); + context.push(`[`); + multilines && context.indent(); + genNodeList(nodes, context, multilines); + multilines && context.deindent(); + context.push(`]`); +} +function genNodeList(nodes, context, multilines = false, comma = true) { + const { push, newline } = context; + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { + push(node, -3 /* Unknown */); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(node)) { + genNodeListAsArray(node, context); + } else { + genNode(node, context); + } + if (i < nodes.length - 1) { + if (multilines) { + comma && push(","); + newline(); + } else { + comma && push(", "); } - break; - case "ArrayPattern": - param.elements.forEach((element) => { - if (element) - extractIdentifiers(element, nodes); - }); - break; - case "RestElement": - extractIdentifiers(param.argument, nodes); - break; - case "AssignmentPattern": - extractIdentifiers(param.left, nodes); - break; + } } - return nodes; } -const isFunctionType = (node) => { - return /Function(?:Expression|Declaration)$|Method$/.test(node.type); -}; -const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; -const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; -const TS_NODE_TYPES = [ - "TSAsExpression", - // foo as number - "TSTypeAssertion", - // (<number>foo) - "TSNonNullExpression", - // foo! - "TSInstantiationExpression", - // foo<string> - "TSSatisfiesExpression" - // foo satisfies T -]; - -const prohibitedKeywordRE = new RegExp( - "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" -); -const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; -function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { - const exp = node.content; - if (!exp.trim()) { +function genNode(node, context) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node)) { + context.push(node, -3 /* Unknown */); return; } - try { - new Function( - asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` - ); - } catch (e) { - let message = e.message; - const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); - if (keywordMatch) { - message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; - } - context.onError( - createCompilerError( - 45, - node.loc, - void 0, - message - ) - ); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(node)) { + context.push(context.helper(node)); + return; } -} - -const transformExpression = (node, context) => { - if (node.type === 5) { - node.content = processExpression( - node.content, - context - ); - } else if (node.type === 1) { - for (let i = 0; i < node.props.length; i++) { - const dir = node.props[i]; - if (dir.type === 7 && dir.name !== "for") { - const exp = dir.exp; - const arg = dir.arg; - if (exp && exp.type === 4 && !(dir.name === "on" && arg)) { - dir.exp = processExpression( - exp, - context, - // slot args must be processed as function params - dir.name === "slot" - ); - } - if (arg && arg.type === 4 && !arg.isStatic) { - dir.arg = processExpression(arg, context); - } + switch (node.type) { + case 1: + case 9: + case 11: + true && assert( + node.codegenNode != null, + `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` + ); + genNode(node.codegenNode, context); + break; + case 2: + genText(node, context); + break; + case 4: + genExpression(node, context); + break; + case 5: + genInterpolation(node, context); + break; + case 12: + genNode(node.codegenNode, context); + break; + case 8: + genCompoundExpression(node, context); + break; + case 3: + genComment(node, context); + break; + case 13: + genVNodeCall(node, context); + break; + case 14: + genCallExpression(node, context); + break; + case 15: + genObjectExpression(node, context); + break; + case 17: + genArrayExpression(node, context); + break; + case 18: + genFunctionExpression(node, context); + break; + case 19: + genConditionalExpression(node, context); + break; + case 20: + genCacheExpression(node, context); + break; + case 21: + genNodeList(node.body, context, true, false); + break; + case 22: + break; + case 23: + break; + case 24: + break; + case 25: + break; + case 26: + break; + case 10: + break; + default: + if (true) { + assert(false, `unhandled codegen node type: ${node.type}`); + const exhaustiveCheck = node; + return exhaustiveCheck; } - } } -}; -function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { - { - if (true) { - validateBrowserExpression(node, context, asParams, asRawStatements); +} +function genText(node, context) { + context.push(JSON.stringify(node.content), -3 /* Unknown */, node); +} +function genExpression(node, context) { + const { content, isStatic } = node; + context.push( + isStatic ? JSON.stringify(content) : content, + -3 /* Unknown */, + node + ); +} +function genInterpolation(node, context) { + const { push, helper, pure } = context; + if (pure) + push(PURE_ANNOTATION); + push(`${helper(TO_DISPLAY_STRING)}(`); + genNode(node.content, context); + push(`)`); +} +function genCompoundExpression(node, context) { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) { + context.push(child, -3 /* Unknown */); + } else { + genNode(child, context); } - return node; } } -function stringifyExpression(exp) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) { - return exp; - } else if (exp.type === 4) { - return exp.content; +function genExpressionAsPropertyKey(node, context) { + const { push } = context; + if (node.type === 8) { + push(`[`); + genCompoundExpression(node, context); + push(`]`); + } else if (node.isStatic) { + const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); + push(text, -2 /* None */, node); } else { - return exp.children.map(stringifyExpression).join(""); + push(`[${node.content}]`, -3 /* Unknown */, node); } } - -const transformIf = createStructuralDirectiveTransform( - /^(if|else|else-if)$/, - (node, dir, context) => { - return processIf(node, dir, context, (ifNode, branch, isRoot) => { - const siblings = context.parent.children; - let i = siblings.indexOf(ifNode); - let key = 0; - while (i-- >= 0) { - const sibling = siblings[i]; - if (sibling && sibling.type === 9) { - key += sibling.branches.length; - } - } - return () => { - if (isRoot) { - ifNode.codegenNode = createCodegenNodeForBranch( - branch, - key, - context - ); - } else { - const parentCondition = getParentCondition(ifNode.codegenNode); - parentCondition.alternate = createCodegenNodeForBranch( - branch, - key + ifNode.branches.length - 1, - context - ); - } - }; - }); +function genComment(node, context) { + const { push, helper, pure } = context; + if (pure) { + push(PURE_ANNOTATION); } -); -function processIf(node, dir, context, processCodegen) { - if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { - const loc = dir.exp ? dir.exp.loc : node.loc; - context.onError( - createCompilerError(28, dir.loc) - ); - dir.exp = createSimpleExpression(`true`, false, loc); + push( + `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, + -3 /* Unknown */, + node + ); +} +function genVNodeCall(node, context) { + const { push, helper, pure } = context; + const { + tag, + props, + children, + patchFlag, + dynamicProps, + directives, + isBlock, + disableTracking, + isComponent + } = node; + if (directives) { + push(helper(WITH_DIRECTIVES) + `(`); } - if ( true && dir.exp) { - validateBrowserExpression(dir.exp, context); + if (isBlock) { + push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); } - if (dir.name === "if") { - const branch = createIfBranch(node, dir); - const ifNode = { - type: 9, - loc: node.loc, - branches: [branch] - }; - context.replaceNode(ifNode); - if (processCodegen) { - return processCodegen(ifNode, branch, true); - } - } else { - const siblings = context.parent.children; - const comments = []; - let i = siblings.indexOf(node); - while (i-- >= -1) { - const sibling = siblings[i]; - if (sibling && sibling.type === 3) { - context.removeNode(sibling); - true && comments.unshift(sibling); - continue; - } - if (sibling && sibling.type === 2 && !sibling.content.trim().length) { - context.removeNode(sibling); - continue; - } - if (sibling && sibling.type === 9) { - if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { - context.onError( - createCompilerError(30, node.loc) - ); - } - context.removeNode(); - const branch = createIfBranch(node, dir); - if ( true && comments.length && // #3619 ignore comments if the v-if is direct child of <transition> - !(context.parent && context.parent.type === 1 && isBuiltInType(context.parent.tag, "transition"))) { - branch.children = [...comments, ...branch.children]; - } - if (true) { - const key = branch.userKey; - if (key) { - sibling.branches.forEach(({ userKey }) => { - if (isSameKey(userKey, key)) { - context.onError( - createCompilerError( - 29, - branch.userKey.loc - ) - ); - } - }); - } - } - sibling.branches.push(branch); - const onExit = processCodegen && processCodegen(sibling, branch, false); - traverseNode(branch, context); - if (onExit) - onExit(); - context.currentNode = null; - } else { - context.onError( - createCompilerError(30, node.loc) - ); - } - break; - } + if (pure) { + push(PURE_ANNOTATION); + } + const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); + push(helper(callHelper) + `(`, -2 /* None */, node); + genNodeList( + genNullableArgs([tag, props, children, patchFlag, dynamicProps]), + context + ); + push(`)`); + if (isBlock) { + push(`)`); + } + if (directives) { + push(`, `); + genNode(directives, context); + push(`)`); } } -function createIfBranch(node, dir) { - const isTemplateIf = node.tagType === 3; - return { - type: 10, - loc: node.loc, - condition: dir.name === "else" ? void 0 : dir.exp, - children: isTemplateIf && !findDir(node, "for") ? node.children : [node], - userKey: findProp(node, `key`), - isTemplateIf - }; -} -function createCodegenNodeForBranch(branch, keyIndex, context) { - if (branch.condition) { - return createConditionalExpression( - branch.condition, - createChildrenCodegenNode(branch, keyIndex, context), - // make sure to pass in asBlock: true so that the comment node call - // closes the current block. - createCallExpression(context.helper(CREATE_COMMENT), [ - true ? '"v-if"' : 0, - "true" - ]) - ); - } else { - return createChildrenCodegenNode(branch, keyIndex, context); +function genNullableArgs(args) { + let i = args.length; + while (i--) { + if (args[i] != null) + break; } + return args.slice(0, i + 1).map((arg) => arg || `null`); } -function createChildrenCodegenNode(branch, keyIndex, context) { - const { helper } = context; - const keyProperty = createObjectProperty( - `key`, - createSimpleExpression( - `${keyIndex}`, - false, - locStub, - 2 - ) - ); - const { children } = branch; - const firstChild = children[0]; - const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; - if (needFragmentWrapper) { - if (children.length === 1 && firstChild.type === 11) { - const vnodeCall = firstChild.codegenNode; - injectProp(vnodeCall, keyProperty, context); - return vnodeCall; - } else { - let patchFlag = 64; - let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; - if ( true && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { - patchFlag |= 2048; - patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; - } - return createVNodeCall( - context, - helper(FRAGMENT), - createObjectExpression([keyProperty]), - children, - patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), - void 0, - void 0, - true, - false, - false, - branch.loc - ); - } - } else { - const ret = firstChild.codegenNode; - const vnodeCall = getMemoedVNodeCall(ret); - if (vnodeCall.type === 13) { - convertToBlock(vnodeCall, context); - } - injectProp(vnodeCall, keyProperty, context); - return ret; +function genCallExpression(node, context) { + const { push, helper, pure } = context; + const callee = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(node.callee) ? node.callee : helper(node.callee); + if (pure) { + push(PURE_ANNOTATION); } + push(callee + `(`, -2 /* None */, node); + genNodeList(node.arguments, context); + push(`)`); } -function isSameKey(a, b) { - if (!a || a.type !== b.type) { - return false; +function genObjectExpression(node, context) { + const { push, indent, deindent, newline } = context; + const { properties } = node; + if (!properties.length) { + push(`{}`, -2 /* None */, node); + return; } - if (a.type === 6) { - if (a.value.content !== b.value.content) { - return false; - } - } else { - const exp = a.exp; - const branchExp = b.exp; - if (exp.type !== branchExp.type) { - return false; - } - if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { - return false; + const multilines = properties.length > 1 || true && properties.some((p) => p.value.type !== 4); + push(multilines ? `{` : `{ `); + multilines && indent(); + for (let i = 0; i < properties.length; i++) { + const { key, value } = properties[i]; + genExpressionAsPropertyKey(key, context); + push(`: `); + genNode(value, context); + if (i < properties.length - 1) { + push(`,`); + newline(); } } - return true; + multilines && deindent(); + push(multilines ? `}` : ` }`); } -function getParentCondition(node) { - while (true) { - if (node.type === 19) { - if (node.alternate.type === 19) { - node = node.alternate; - } else { - return node; - } - } else if (node.type === 20) { - node = node.value; - } - } +function genArrayExpression(node, context) { + genNodeListAsArray(node.elements, context); } - -const transformFor = createStructuralDirectiveTransform( - "for", - (node, dir, context) => { - const { helper, removeHelper } = context; - return processFor(node, dir, context, (forNode) => { - const renderExp = createCallExpression(helper(RENDER_LIST), [ - forNode.source - ]); - const isTemplate = isTemplateNode(node); - const memo = findDir(node, "memo"); - const keyProp = findProp(node, `key`); - const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp); - const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null; - const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; - const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; - forNode.codegenNode = createVNodeCall( - context, - helper(FRAGMENT), - void 0, - renderExp, - fragmentFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[fragmentFlag]} */` : 0), - void 0, - void 0, - true, - !isStableFragment, - false, - node.loc - ); - return () => { - let childBlock; - const { children } = forNode; - if (( true) && isTemplate) { - node.children.some((c) => { - if (c.type === 1) { - const key = findProp(c, "key"); - if (key) { - context.onError( - createCompilerError( - 33, - key.loc - ) - ); - return true; - } - } - }); - } - const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; - const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; - if (slotOutlet) { - childBlock = slotOutlet.codegenNode; - if (isTemplate && keyProperty) { - injectProp(childBlock, keyProperty, context); - } - } else if (needFragmentWrapper) { - childBlock = createVNodeCall( - context, - helper(FRAGMENT), - keyProperty ? createObjectExpression([keyProperty]) : void 0, - node.children, - 64 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]} */` : 0), - void 0, - void 0, - true, - void 0, - false - /* isComponent */ - ); - } else { - childBlock = children[0].codegenNode; - if (isTemplate && keyProperty) { - injectProp(childBlock, keyProperty, context); - } - if (childBlock.isBlock !== !isStableFragment) { - if (childBlock.isBlock) { - removeHelper(OPEN_BLOCK); - removeHelper( - getVNodeBlockHelper(context.inSSR, childBlock.isComponent) - ); - } else { - removeHelper( - getVNodeHelper(context.inSSR, childBlock.isComponent) - ); - } - } - childBlock.isBlock = !isStableFragment; - if (childBlock.isBlock) { - helper(OPEN_BLOCK); - helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); - } else { - helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); - } - } - if (memo) { - const loop = createFunctionExpression( - createForLoopParams(forNode.parseResult, [ - createSimpleExpression(`_cached`) - ]) - ); - loop.body = createBlockStatement([ - createCompoundExpression([`const _memo = (`, memo.exp, `)`]), - createCompoundExpression([ - `if (_cached`, - ...keyExp ? [` && _cached.key === `, keyExp] : [], - ` && ${context.helperString( - IS_MEMO_SAME - )}(_cached, _memo)) return _cached` - ]), - createCompoundExpression([`const _item = `, childBlock]), - createSimpleExpression(`_item.memo = _memo`), - createSimpleExpression(`return _item`) - ]); - renderExp.arguments.push( - loop, - createSimpleExpression(`_cache`), - createSimpleExpression(String(context.cached++)) - ); - } else { - renderExp.arguments.push( - createFunctionExpression( - createForLoopParams(forNode.parseResult), - childBlock, - true - /* force newline */ - ) - ); - } - }; - }); - } -); -function processFor(node, dir, context, processCodegen) { - if (!dir.exp) { - context.onError( - createCompilerError(31, dir.loc) - ); - return; +function genFunctionExpression(node, context) { + const { push, indent, deindent } = context; + const { params, returns, body, newline, isSlot } = node; + if (isSlot) { + push(`_${helperNameMap[WITH_CTX]}(`); } - const parseResult = parseForExpression( - // can only be simple expression because vFor transform is applied - // before expression transform. - dir.exp, - context - ); - if (!parseResult) { - context.onError( - createCompilerError(32, dir.loc) - ); - return; + push(`(`, -2 /* None */, node); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(params)) { + genNodeList(params, context); + } else if (params) { + genNode(params, context); } - const { addIdentifiers, removeIdentifiers, scopes } = context; - const { source, value, key, index } = parseResult; - const forNode = { - type: 11, - loc: dir.loc, - source, - valueAlias: value, - keyAlias: key, - objectIndexAlias: index, - parseResult, - children: isTemplateNode(node) ? node.children : [node] - }; - context.replaceNode(forNode); - scopes.vFor++; - const onExit = processCodegen && processCodegen(forNode); - return () => { - scopes.vFor--; - if (onExit) - onExit(); - }; -} -const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; -const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; -const stripParensRE = /^\(|\)$/g; -function parseForExpression(input, context) { - const loc = input.loc; - const exp = input.content; - const inMatch = exp.match(forAliasRE); - if (!inMatch) - return; - const [, LHS, RHS] = inMatch; - const result = { - source: createAliasExpression( - loc, - RHS.trim(), - exp.indexOf(RHS, LHS.length) - ), - value: void 0, - key: void 0, - index: void 0 - }; - if (true) { - validateBrowserExpression(result.source, context); + push(`) => `); + if (newline || body) { + push(`{`); + indent(); } - let valueContent = LHS.trim().replace(stripParensRE, "").trim(); - const trimmedOffset = LHS.indexOf(valueContent); - const iteratorMatch = valueContent.match(forIteratorRE); - if (iteratorMatch) { - valueContent = valueContent.replace(forIteratorRE, "").trim(); - const keyContent = iteratorMatch[1].trim(); - let keyOffset; - if (keyContent) { - keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); - result.key = createAliasExpression(loc, keyContent, keyOffset); - if (true) { - validateBrowserExpression( - result.key, - context, - true - ); - } + if (returns) { + if (newline) { + push(`return `); } - if (iteratorMatch[2]) { - const indexContent = iteratorMatch[2].trim(); - if (indexContent) { - result.index = createAliasExpression( - loc, - indexContent, - exp.indexOf( - indexContent, - result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length - ) - ); - if (true) { - validateBrowserExpression( - result.index, - context, - true - ); - } - } + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(returns)) { + genNodeListAsArray(returns, context); + } else { + genNode(returns, context); } + } else if (body) { + genNode(body, context); } - if (valueContent) { - result.value = createAliasExpression(loc, valueContent, trimmedOffset); - if (true) { - validateBrowserExpression( - result.value, - context, - true - ); + if (newline || body) { + deindent(); + push(`}`); + } + if (isSlot) { + if (node.isNonScopedSlot) { + push(`, undefined, true`); } + push(`)`); } - return result; } -function createAliasExpression(range, content, offset) { - return createSimpleExpression( - content, - false, - getInnerRange(range, offset, content.length) - ); -} -function createForLoopParams({ value, key, index }, memoArgs = []) { - return createParamsList([value, key, index, ...memoArgs]); -} -function createParamsList(args) { - let i = args.length; - while (i--) { - if (args[i]) - break; +function genConditionalExpression(node, context) { + const { test, consequent, alternate, newline: needNewline } = node; + const { push, indent, deindent, newline } = context; + if (test.type === 4) { + const needsParens = !isSimpleIdentifier(test.content); + needsParens && push(`(`); + genExpression(test, context); + needsParens && push(`)`); + } else { + push(`(`); + genNode(test, context); + push(`)`); } - return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); + needNewline && indent(); + context.indentLevel++; + needNewline || push(` `); + push(`? `); + genNode(consequent, context); + context.indentLevel--; + needNewline && newline(); + needNewline || push(` `); + push(`: `); + const isNested = alternate.type === 19; + if (!isNested) { + context.indentLevel++; + } + genNode(alternate, context); + if (!isNested) { + context.indentLevel--; + } + needNewline && deindent( + true + /* without newline */ + ); } - -const defaultFallback = createSimpleExpression(`undefined`, false); -const trackSlotScopes = (node, context) => { - if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { - const vSlot = findDir(node, "slot"); - if (vSlot) { - vSlot.exp; - context.scopes.vSlot++; - return () => { - context.scopes.vSlot--; - }; - } +function genCacheExpression(node, context) { + const { push, helper, indent, deindent, newline } = context; + push(`_cache[${node.index}] || (`); + if (node.isVNode) { + indent(); + push(`${helper(SET_BLOCK_TRACKING)}(-1),`); + newline(); } -}; -const trackVForSlotScopes = (node, context) => { - let vFor; - if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { - const result = vFor.parseResult = parseForExpression( - vFor.exp, - context - ); - if (result) { - const { value, key, index } = result; - const { addIdentifiers, removeIdentifiers } = context; - value && addIdentifiers(value); - key && addIdentifiers(key); - index && addIdentifiers(index); - return () => { - value && removeIdentifiers(value); - key && removeIdentifiers(key); - index && removeIdentifiers(index); - }; - } + push(`_cache[${node.index}] = `); + genNode(node.value, context); + if (node.isVNode) { + push(`,`); + newline(); + push(`${helper(SET_BLOCK_TRACKING)}(1),`); + newline(); + push(`_cache[${node.index}]`); + deindent(); } -}; -const buildClientSlotFn = (props, children, loc) => createFunctionExpression( - props, - children, - false, - true, - children.length ? children[0].loc : loc + push(`)`); +} + +const prohibitedKeywordRE = new RegExp( + "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b" ); -function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { - context.helper(WITH_CTX); - const { children, loc } = node; - const slotsProperties = []; - const dynamicSlots = []; - let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; - const onComponentSlot = findDir(node, "slot", true); - if (onComponentSlot) { - const { arg, exp } = onComponentSlot; - if (arg && !isStaticExp(arg)) { - hasDynamicSlots = true; +const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; +function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) { + const exp = node.content; + if (!exp.trim()) { + return; + } + try { + new Function( + asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}` + ); + } catch (e) { + let message = e.message; + const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE); + if (keywordMatch) { + message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`; } - slotsProperties.push( - createObjectProperty( - arg || createSimpleExpression("default", true), - buildSlotFn(exp, children, loc) + context.onError( + createCompilerError( + 45, + node.loc, + void 0, + message ) ); } - let hasTemplateSlots = false; - let hasNamedDefaultSlot = false; - const implicitDefaultChildren = []; - const seenSlotNames = /* @__PURE__ */ new Set(); - let conditionalBranchIndex = 0; - for (let i = 0; i < children.length; i++) { - const slotElement = children[i]; - let slotDir; - if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { - if (slotElement.type !== 3) { - implicitDefaultChildren.push(slotElement); +} + +const transformExpression = (node, context) => { + if (node.type === 5) { + node.content = processExpression( + node.content, + context + ); + } else if (node.type === 1) { + for (let i = 0; i < node.props.length; i++) { + const dir = node.props[i]; + if (dir.type === 7 && dir.name !== "for") { + const exp = dir.exp; + const arg = dir.arg; + if (exp && exp.type === 4 && !(dir.name === "on" && arg)) { + dir.exp = processExpression( + exp, + context, + // slot args must be processed as function params + dir.name === "slot" + ); + } + if (arg && arg.type === 4 && !arg.isStatic) { + dir.arg = processExpression(arg, context); + } } - continue; - } - if (onComponentSlot) { - context.onError( - createCompilerError(37, slotDir.loc) - ); - break; } - hasTemplateSlots = true; - const { children: slotChildren, loc: slotLoc } = slotElement; - const { - arg: slotName = createSimpleExpression(`default`, true), - exp: slotProps, - loc: dirLoc - } = slotDir; - let staticSlotName; - if (isStaticExp(slotName)) { - staticSlotName = slotName ? slotName.content : `default`; - } else { - hasDynamicSlots = true; + } +}; +function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { + { + if (true) { + validateBrowserExpression(node, context, asParams, asRawStatements); } - const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc); - let vIf; - let vElse; - let vFor; - if (vIf = findDir(slotElement, "if")) { - hasDynamicSlots = true; - dynamicSlots.push( - createConditionalExpression( - vIf.exp, - buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), - defaultFallback - ) - ); - } else if (vElse = findDir( - slotElement, - /^else(-if)?$/, - true - /* allowEmpty */ - )) { - let j = i; - let prev; - while (j--) { - prev = children[j]; - if (prev.type !== 3) { - break; + return node; + } +} +function stringifyExpression(exp) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(exp)) { + return exp; + } else if (exp.type === 4) { + return exp.content; + } else { + return exp.children.map(stringifyExpression).join(""); + } +} + +const transformIf = createStructuralDirectiveTransform( + /^(if|else|else-if)$/, + (node, dir, context) => { + return processIf(node, dir, context, (ifNode, branch, isRoot) => { + const siblings = context.parent.children; + let i = siblings.indexOf(ifNode); + let key = 0; + while (i-- >= 0) { + const sibling = siblings[i]; + if (sibling && sibling.type === 9) { + key += sibling.branches.length; } } - if (prev && isTemplateNode(prev) && findDir(prev, "if")) { - children.splice(i, 1); - i--; - let conditional = dynamicSlots[dynamicSlots.length - 1]; - while (conditional.alternate.type === 19) { - conditional = conditional.alternate; - } - conditional.alternate = vElse.exp ? createConditionalExpression( - vElse.exp, - buildDynamicSlot( - slotName, - slotFunction, - conditionalBranchIndex++ - ), - defaultFallback - ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); - } else { - context.onError( - createCompilerError(30, vElse.loc) - ); + return () => { + if (isRoot) { + ifNode.codegenNode = createCodegenNodeForBranch( + branch, + key, + context + ); + } else { + const parentCondition = getParentCondition(ifNode.codegenNode); + parentCondition.alternate = createCodegenNodeForBranch( + branch, + key + ifNode.branches.length - 1, + context + ); + } + }; + }); + } +); +function processIf(node, dir, context, processCodegen) { + if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { + const loc = dir.exp ? dir.exp.loc : node.loc; + context.onError( + createCompilerError(28, dir.loc) + ); + dir.exp = createSimpleExpression(`true`, false, loc); + } + if ( true && dir.exp) { + validateBrowserExpression(dir.exp, context); + } + if (dir.name === "if") { + const branch = createIfBranch(node, dir); + const ifNode = { + type: 9, + loc: node.loc, + branches: [branch] + }; + context.replaceNode(ifNode); + if (processCodegen) { + return processCodegen(ifNode, branch, true); + } + } else { + const siblings = context.parent.children; + const comments = []; + let i = siblings.indexOf(node); + while (i-- >= -1) { + const sibling = siblings[i]; + if (sibling && sibling.type === 3) { + context.removeNode(sibling); + true && comments.unshift(sibling); + continue; } - } else if (vFor = findDir(slotElement, "for")) { - hasDynamicSlots = true; - const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context); - if (parseResult) { - dynamicSlots.push( - createCallExpression(context.helper(RENDER_LIST), [ - parseResult.source, - createFunctionExpression( - createForLoopParams(parseResult), - buildDynamicSlot(slotName, slotFunction), - true - /* force newline */ - ) - ]) - ); - } else { - context.onError( - createCompilerError(32, vFor.loc) - ); + if (sibling && sibling.type === 2 && !sibling.content.trim().length) { + context.removeNode(sibling); + continue; } - } else { - if (staticSlotName) { - if (seenSlotNames.has(staticSlotName)) { + if (sibling && sibling.type === 9) { + if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { context.onError( - createCompilerError( - 38, - dirLoc - ) + createCompilerError(30, node.loc) ); - continue; } - seenSlotNames.add(staticSlotName); - if (staticSlotName === "default") { - hasNamedDefaultSlot = true; + context.removeNode(); + const branch = createIfBranch(node, dir); + if ( true && comments.length && // #3619 ignore comments if the v-if is direct child of <transition> + !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { + branch.children = [...comments, ...branch.children]; } - } - slotsProperties.push(createObjectProperty(slotName, slotFunction)); - } - } - if (!onComponentSlot) { - const buildDefaultSlotProperty = (props, children2) => { - const fn = buildSlotFn(props, children2, loc); - if (context.compatConfig) { - fn.isNonScopedSlot = true; - } - return createObjectProperty(`default`, fn); - }; - if (!hasTemplateSlots) { - slotsProperties.push(buildDefaultSlotProperty(void 0, children)); - } else if (implicitDefaultChildren.length && // #3766 - // with whitespace: 'preserve', whitespaces between slots will end up in - // implicitDefaultChildren. Ignore if all implicit children are whitespaces. - implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { - if (hasNamedDefaultSlot) { - context.onError( - createCompilerError( - 39, - implicitDefaultChildren[0].loc - ) - ); + if (true) { + const key = branch.userKey; + if (key) { + sibling.branches.forEach(({ userKey }) => { + if (isSameKey(userKey, key)) { + context.onError( + createCompilerError( + 29, + branch.userKey.loc + ) + ); + } + }); + } + } + sibling.branches.push(branch); + const onExit = processCodegen && processCodegen(sibling, branch, false); + traverseNode(branch, context); + if (onExit) + onExit(); + context.currentNode = null; } else { - slotsProperties.push( - buildDefaultSlotProperty(void 0, implicitDefaultChildren) + context.onError( + createCompilerError(30, node.loc) ); } + break; } } - const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; - let slots = createObjectExpression( - slotsProperties.concat( - createObjectProperty( - `_`, - // 2 = compiled but dynamic = can skip normalization, but must run diff - // 1 = compiled and static = can skip normalization AND diff as optimized - createSimpleExpression( - slotFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.slotFlagsText[slotFlag]} */` : 0), - false - ) - ) - ), - loc - ); - if (dynamicSlots.length) { - slots = createCallExpression(context.helper(CREATE_SLOTS), [ - slots, - createArrayExpression(dynamicSlots) - ]); - } +} +function createIfBranch(node, dir) { + const isTemplateIf = node.tagType === 3; return { - slots, - hasDynamicSlots + type: 10, + loc: node.loc, + condition: dir.name === "else" ? void 0 : dir.exp, + children: isTemplateIf && !findDir(node, "for") ? node.children : [node], + userKey: findProp(node, `key`), + isTemplateIf }; } -function buildDynamicSlot(name, fn, index) { - const props = [ - createObjectProperty(`name`, name), - createObjectProperty(`fn`, fn) - ]; - if (index != null) { - props.push( - createObjectProperty(`key`, createSimpleExpression(String(index), true)) +function createCodegenNodeForBranch(branch, keyIndex, context) { + if (branch.condition) { + return createConditionalExpression( + branch.condition, + createChildrenCodegenNode(branch, keyIndex, context), + // make sure to pass in asBlock: true so that the comment node call + // closes the current block. + createCallExpression(context.helper(CREATE_COMMENT), [ + true ? '"v-if"' : 0, + "true" + ]) ); + } else { + return createChildrenCodegenNode(branch, keyIndex, context); } - return createObjectExpression(props); } -function hasForwardedSlots(children) { - for (let i = 0; i < children.length; i++) { - const child = children[i]; - switch (child.type) { - case 1: - if (child.tagType === 2 || hasForwardedSlots(child.children)) { - return true; - } - break; - case 9: - if (hasForwardedSlots(child.branches)) - return true; - break; - case 10: - case 11: - if (hasForwardedSlots(child.children)) - return true; - break; +function createChildrenCodegenNode(branch, keyIndex, context) { + const { helper } = context; + const keyProperty = createObjectProperty( + `key`, + createSimpleExpression( + `${keyIndex}`, + false, + locStub, + 2 + ) + ); + const { children } = branch; + const firstChild = children[0]; + const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; + if (needFragmentWrapper) { + if (children.length === 1 && firstChild.type === 11) { + const vnodeCall = firstChild.codegenNode; + injectProp(vnodeCall, keyProperty, context); + return vnodeCall; + } else { + let patchFlag = 64; + let patchFlagText = _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]; + if ( true && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { + patchFlag |= 2048; + patchFlagText += `, ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[2048]}`; + } + return createVNodeCall( + context, + helper(FRAGMENT), + createObjectExpression([keyProperty]), + children, + patchFlag + ( true ? ` /* ${patchFlagText} */` : 0), + void 0, + void 0, + true, + false, + false, + branch.loc + ); } - } - return false; -} -function isNonWhitespaceContent(node) { - if (node.type !== 2 && node.type !== 12) - return true; - return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); + } else { + const ret = firstChild.codegenNode; + const vnodeCall = getMemoedVNodeCall(ret); + if (vnodeCall.type === 13) { + convertToBlock(vnodeCall, context); + } + injectProp(vnodeCall, keyProperty, context); + return ret; + } } - -const directiveImportMap = /* @__PURE__ */ new WeakMap(); -const transformElement = (node, context) => { - return function postTransformElement() { - node = context.currentNode; - if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { - return; +function isSameKey(a, b) { + if (!a || a.type !== b.type) { + return false; + } + if (a.type === 6) { + if (a.value.content !== b.value.content) { + return false; } - const { tag, props } = node; - const isComponent = node.tagType === 1; - let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; - const isDynamicComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; - let vnodeProps; - let vnodeChildren; - let vnodePatchFlag; - let patchFlag = 0; - let vnodeDynamicProps; - let dynamicPropNames; - let vnodeDirectives; - let shouldUseBlock = ( - // dynamic component may resolve to plain elements - isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block - // updates inside get proper isSVG flag at runtime. (#639, #643) - // This is technically web-specific, but splitting the logic out of core - // leads to too much unnecessary complexity. - (tag === "svg" || tag === "foreignObject") - ); - if (props.length > 0) { - const propsBuildResult = buildProps( - node, + } else { + const exp = a.exp; + const branchExp = b.exp; + if (exp.type !== branchExp.type) { + return false; + } + if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { + return false; + } + } + return true; +} +function getParentCondition(node) { + while (true) { + if (node.type === 19) { + if (node.alternate.type === 19) { + node = node.alternate; + } else { + return node; + } + } else if (node.type === 20) { + node = node.value; + } + } +} + +const transformFor = createStructuralDirectiveTransform( + "for", + (node, dir, context) => { + const { helper, removeHelper } = context; + return processFor(node, dir, context, (forNode) => { + const renderExp = createCallExpression(helper(RENDER_LIST), [ + forNode.source + ]); + const isTemplate = isTemplateNode(node); + const memo = findDir(node, "memo"); + const keyProp = findProp(node, `key`); + const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp); + const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null; + const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; + const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; + forNode.codegenNode = createVNodeCall( context, + helper(FRAGMENT), void 0, - isComponent, - isDynamicComponent + renderExp, + fragmentFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[fragmentFlag]} */` : 0), + void 0, + void 0, + true, + !isStableFragment, + false, + node.loc ); - vnodeProps = propsBuildResult.props; - patchFlag = propsBuildResult.patchFlag; - dynamicPropNames = propsBuildResult.dynamicPropNames; - const directives = propsBuildResult.directives; - vnodeDirectives = directives && directives.length ? createArrayExpression( - directives.map((dir) => buildDirectiveArgs(dir, context)) - ) : void 0; - if (propsBuildResult.shouldUseBlock) { - shouldUseBlock = true; - } - } - if (node.children.length > 0) { - if (vnodeTag === KEEP_ALIVE) { - shouldUseBlock = true; - patchFlag |= 1024; - if ( true && node.children.length > 1) { - context.onError( - createCompilerError(46, { - start: node.children[0].loc.start, - end: node.children[node.children.length - 1].loc.end, - source: "" - }) - ); - } - } - const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling - vnodeTag !== TELEPORT && // explained above. - vnodeTag !== KEEP_ALIVE; - if (shouldBuildAsSlots) { - const { slots, hasDynamicSlots } = buildSlots(node, context); - vnodeChildren = slots; - if (hasDynamicSlots) { - patchFlag |= 1024; - } - } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { - const child = node.children[0]; - const type = child.type; - const hasDynamicTextChild = type === 5 || type === 8; - if (hasDynamicTextChild && getConstantType(child, context) === 0) { - patchFlag |= 1; + return () => { + let childBlock; + const { children } = forNode; + if (( true) && isTemplate) { + node.children.some((c) => { + if (c.type === 1) { + const key = findProp(c, "key"); + if (key) { + context.onError( + createCompilerError( + 33, + key.loc + ) + ); + return true; + } + } + }); } - if (hasDynamicTextChild || type === 2) { - vnodeChildren = child; + const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; + const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; + if (slotOutlet) { + childBlock = slotOutlet.codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + } else if (needFragmentWrapper) { + childBlock = createVNodeCall( + context, + helper(FRAGMENT), + keyProperty ? createObjectExpression([keyProperty]) : void 0, + node.children, + 64 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[64]} */` : 0), + void 0, + void 0, + true, + void 0, + false + ); } else { - vnodeChildren = node.children; + childBlock = children[0].codegenNode; + if (isTemplate && keyProperty) { + injectProp(childBlock, keyProperty, context); + } + if (childBlock.isBlock !== !isStableFragment) { + if (childBlock.isBlock) { + removeHelper(OPEN_BLOCK); + removeHelper( + getVNodeBlockHelper(context.inSSR, childBlock.isComponent) + ); + } else { + removeHelper( + getVNodeHelper(context.inSSR, childBlock.isComponent) + ); + } + } + childBlock.isBlock = !isStableFragment; + if (childBlock.isBlock) { + helper(OPEN_BLOCK); + helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); + } else { + helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); + } } - } else { - vnodeChildren = node.children; - } - } - if (patchFlag !== 0) { - if (true) { - if (patchFlag < 0) { - vnodePatchFlag = patchFlag + ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[patchFlag]} */`; + if (memo) { + const loop = createFunctionExpression( + createForLoopParams(forNode.parseResult, [ + createSimpleExpression(`_cached`) + ]) + ); + loop.body = createBlockStatement([ + createCompoundExpression([`const _memo = (`, memo.exp, `)`]), + createCompoundExpression([ + `if (_cached`, + ...keyExp ? [` && _cached.key === `, keyExp] : [], + ` && ${context.helperString( + IS_MEMO_SAME + )}(_cached, _memo)) return _cached` + ]), + createCompoundExpression([`const _item = `, childBlock]), + createSimpleExpression(`_item.memo = _memo`), + createSimpleExpression(`return _item`) + ]); + renderExp.arguments.push( + loop, + createSimpleExpression(`_cache`), + createSimpleExpression(String(context.cached++)) + ); } else { - const flagNames = Object.keys(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[n]).join(`, `); - vnodePatchFlag = patchFlag + ` /* ${flagNames} */`; + renderExp.arguments.push( + createFunctionExpression( + createForLoopParams(forNode.parseResult), + childBlock, + true + ) + ); } - } else {} - if (dynamicPropNames && dynamicPropNames.length) { - vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); - } - } - node.codegenNode = createVNodeCall( - context, - vnodeTag, - vnodeProps, - vnodeChildren, - vnodePatchFlag, - vnodeDynamicProps, - vnodeDirectives, - !!shouldUseBlock, - false, - isComponent, - node.loc + }; + }); + } +); +function processFor(node, dir, context, processCodegen) { + if (!dir.exp) { + context.onError( + createCompilerError(31, dir.loc) + ); + return; + } + const parseResult = dir.forParseResult; + if (!parseResult) { + context.onError( + createCompilerError(32, dir.loc) ); + return; + } + finalizeForParseResult(parseResult, context); + const { addIdentifiers, removeIdentifiers, scopes } = context; + const { source, value, key, index } = parseResult; + const forNode = { + type: 11, + loc: dir.loc, + source, + valueAlias: value, + keyAlias: key, + objectIndexAlias: index, + parseResult, + children: isTemplateNode(node) ? node.children : [node] }; -}; -function resolveComponentType(node, context, ssr = false) { - let { tag } = node; - const isExplicitDynamic = isComponentTag(tag); - const isProp = findProp(node, "is"); - if (isProp) { - if (isExplicitDynamic || isCompatEnabled( - "COMPILER_IS_ON_ELEMENT", - context - )) { - const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp; - if (exp) { - return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ - exp - ]); - } - } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { - tag = isProp.value.content.slice(4); + context.replaceNode(forNode); + scopes.vFor++; + const onExit = processCodegen && processCodegen(forNode); + return () => { + scopes.vFor--; + if (onExit) + onExit(); + }; +} +function finalizeForParseResult(result, context) { + if (result.finalized) + return; + if (true) { + validateBrowserExpression(result.source, context); + if (result.key) { + validateBrowserExpression( + result.key, + context, + true + ); } - } - const isDir = !isExplicitDynamic && findDir(node, "is"); - if (isDir && isDir.exp) { - if (true) { - context.onWarn( - createCompilerError(52, isDir.loc) + if (result.index) { + validateBrowserExpression( + result.index, + context, + true + ); + } + if (result.value) { + validateBrowserExpression( + result.value, + context, + true ); } - return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ - isDir.exp - ]); } - const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); - if (builtIn) { - if (!ssr) - context.helper(builtIn); - return builtIn; + result.finalized = true; +} +function createForLoopParams({ value, key, index }, memoArgs = []) { + return createParamsList([value, key, index, ...memoArgs]); +} +function createParamsList(args) { + let i = args.length; + while (i--) { + if (args[i]) + break; } - context.helper(RESOLVE_COMPONENT); - context.components.add(tag); - return toValidAssetId(tag, `component`); + return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); } -function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { - const { tag, loc: elementLoc, children } = node; - let properties = []; - const mergeArgs = []; - const runtimeDirectives = []; - const hasChildren = children.length > 0; - let shouldUseBlock = false; - let patchFlag = 0; - let hasRef = false; - let hasClassBinding = false; - let hasStyleBinding = false; - let hasHydrationEventBinding = false; - let hasDynamicKeys = false; - let hasVnodeHook = false; - const dynamicPropNames = []; - const pushMergeArg = (arg) => { - if (properties.length) { - mergeArgs.push( - createObjectExpression(dedupeProperties(properties), elementLoc) - ); - properties = []; + +const defaultFallback = createSimpleExpression(`undefined`, false); +const trackSlotScopes = (node, context) => { + if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { + const vSlot = findDir(node, "slot"); + if (vSlot) { + vSlot.exp; + context.scopes.vSlot++; + return () => { + context.scopes.vSlot--; + }; } - if (arg) - mergeArgs.push(arg); - }; - const analyzePatchFlag = ({ key, value }) => { - if (isStaticExp(key)) { - const name = key.content; - const isEventHandler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name); - if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click - // dedicated fast path. - name.toLowerCase() !== "onclick" && // omit v-model handlers - name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks - !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { - hasHydrationEventBinding = true; - } - if (isEventHandler && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { - hasVnodeHook = true; - } - if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { - return; - } - if (name === "ref") { - hasRef = true; - } else if (name === "class") { - hasClassBinding = true; - } else if (name === "style") { - hasStyleBinding = true; - } else if (name !== "key" && !dynamicPropNames.includes(name)) { - dynamicPropNames.push(name); - } - if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { - dynamicPropNames.push(name); - } - } else { - hasDynamicKeys = true; + } +}; +const trackVForSlotScopes = (node, context) => { + let vFor; + if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { + const result = vFor.forParseResult; + if (result) { + finalizeForParseResult(result, context); + const { value, key, index } = result; + const { addIdentifiers, removeIdentifiers } = context; + value && addIdentifiers(value); + key && addIdentifiers(key); + index && addIdentifiers(index); + return () => { + value && removeIdentifiers(value); + key && removeIdentifiers(key); + index && removeIdentifiers(index); + }; } - }; - for (let i = 0; i < props.length; i++) { - const prop = props[i]; - if (prop.type === 6) { - const { loc, name, value } = prop; - let isStatic = true; - if (name === "ref") { - hasRef = true; - if (context.scopes.vFor > 0) { - properties.push( - createObjectProperty( - createSimpleExpression("ref_for", true), - createSimpleExpression("true") - ) - ); - } - } - if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( - "COMPILER_IS_ON_ELEMENT", - context - ))) { - continue; + } +}; +const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( + props, + children, + false, + true, + children.length ? children[0].loc : loc +); +function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { + context.helper(WITH_CTX); + const { children, loc } = node; + const slotsProperties = []; + const dynamicSlots = []; + let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; + const onComponentSlot = findDir(node, "slot", true); + if (onComponentSlot) { + const { arg, exp } = onComponentSlot; + if (arg && !isStaticExp(arg)) { + hasDynamicSlots = true; + } + slotsProperties.push( + createObjectProperty( + arg || createSimpleExpression("default", true), + buildSlotFn(exp, void 0, children, loc) + ) + ); + } + let hasTemplateSlots = false; + let hasNamedDefaultSlot = false; + const implicitDefaultChildren = []; + const seenSlotNames = /* @__PURE__ */ new Set(); + let conditionalBranchIndex = 0; + for (let i = 0; i < children.length; i++) { + const slotElement = children[i]; + let slotDir; + if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { + if (slotElement.type !== 3) { + implicitDefaultChildren.push(slotElement); } - properties.push( - createObjectProperty( - createSimpleExpression( - name, - true, - getInnerRange(loc, 0, name.length) - ), - createSimpleExpression( - value ? value.content : "", - isStatic, - value ? value.loc : loc - ) - ) + continue; + } + if (onComponentSlot) { + context.onError( + createCompilerError(37, slotDir.loc) ); - } else { - const { name, arg, exp, loc } = prop; - const isVBind = name === "bind"; - const isVOn = name === "on"; - if (name === "slot") { - if (!isComponent) { - context.onError( - createCompilerError(40, loc) - ); + break; + } + hasTemplateSlots = true; + const { children: slotChildren, loc: slotLoc } = slotElement; + const { + arg: slotName = createSimpleExpression(`default`, true), + exp: slotProps, + loc: dirLoc + } = slotDir; + let staticSlotName; + if (isStaticExp(slotName)) { + staticSlotName = slotName ? slotName.content : `default`; + } else { + hasDynamicSlots = true; + } + const vFor = findDir(slotElement, "for"); + const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); + let vIf; + let vElse; + if (vIf = findDir(slotElement, "if")) { + hasDynamicSlots = true; + dynamicSlots.push( + createConditionalExpression( + vIf.exp, + buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), + defaultFallback + ) + ); + } else if (vElse = findDir( + slotElement, + /^else(-if)?$/, + true + /* allowEmpty */ + )) { + let j = i; + let prev; + while (j--) { + prev = children[j]; + if (prev.type !== 3) { + break; } - continue; - } - if (name === "once" || name === "memo") { - continue; - } - if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( - "COMPILER_IS_ON_ELEMENT", - context - ))) { - continue; } - if (isVOn && ssr) { - continue; - } - if ( - // #938: elements with dynamic keys should be forced into blocks - isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked - // before children - isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") - ) { - shouldUseBlock = true; + if (prev && isTemplateNode(prev) && findDir(prev, "if")) { + children.splice(i, 1); + i--; + let conditional = dynamicSlots[dynamicSlots.length - 1]; + while (conditional.alternate.type === 19) { + conditional = conditional.alternate; + } + conditional.alternate = vElse.exp ? createConditionalExpression( + vElse.exp, + buildDynamicSlot( + slotName, + slotFunction, + conditionalBranchIndex++ + ), + defaultFallback + ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); + } else { + context.onError( + createCompilerError(30, vElse.loc) + ); } - if (isVBind && isStaticArgOf(arg, "ref") && context.scopes.vFor > 0) { - properties.push( - createObjectProperty( - createSimpleExpression("ref_for", true), - createSimpleExpression("true") + } else if (vFor) { + hasDynamicSlots = true; + const parseResult = vFor.forParseResult; + if (parseResult) { + finalizeForParseResult(parseResult, context); + dynamicSlots.push( + createCallExpression(context.helper(RENDER_LIST), [ + parseResult.source, + createFunctionExpression( + createForLoopParams(parseResult), + buildDynamicSlot(slotName, slotFunction), + true + ) + ]) + ); + } else { + context.onError( + createCompilerError( + 32, + vFor.loc ) ); } - if (!arg && (isVBind || isVOn)) { - hasDynamicKeys = true; - if (exp) { - if (isVBind) { - pushMergeArg(); - { - if (true) { - const hasOverridableKeys = mergeArgs.some((arg2) => { - if (arg2.type === 15) { - return arg2.properties.some(({ key }) => { - if (key.type !== 4 || !key.isStatic) { - return true; - } - return key.content !== "class" && key.content !== "style" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(key.content); - }); - } else { - return true; - } - }); - if (hasOverridableKeys) { - checkCompatEnabled( - "COMPILER_V_BIND_OBJECT_ORDER", - context, - loc - ); - } - } - if (isCompatEnabled( - "COMPILER_V_BIND_OBJECT_ORDER", - context - )) { - mergeArgs.unshift(exp); - continue; - } - } - mergeArgs.push(exp); - } else { - pushMergeArg({ - type: 14, - loc, - callee: context.helper(TO_HANDLERS), - arguments: isComponent ? [exp] : [exp, `true`] - }); - } - } else { + } else { + if (staticSlotName) { + if (seenSlotNames.has(staticSlotName)) { context.onError( createCompilerError( - isVBind ? 34 : 35, - loc + 38, + dirLoc ) ); + continue; } - continue; - } - const directiveTransform = context.directiveTransforms[name]; - if (directiveTransform) { - const { props: props2, needRuntime } = directiveTransform(prop, node, context); - !ssr && props2.forEach(analyzePatchFlag); - if (isVOn && arg && !isStaticExp(arg)) { - pushMergeArg(createObjectExpression(props2, elementLoc)); - } else { - properties.push(...props2); - } - if (needRuntime) { - runtimeDirectives.push(prop); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(needRuntime)) { - directiveImportMap.set(prop, needRuntime); - } - } - } else if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isBuiltInDirective)(name)) { - runtimeDirectives.push(prop); - if (hasChildren) { - shouldUseBlock = true; + seenSlotNames.add(staticSlotName); + if (staticSlotName === "default") { + hasNamedDefaultSlot = true; } } + slotsProperties.push(createObjectProperty(slotName, slotFunction)); } } - let propsExpression = void 0; - if (mergeArgs.length) { - pushMergeArg(); - if (mergeArgs.length > 1) { - propsExpression = createCallExpression( - context.helper(MERGE_PROPS), - mergeArgs, - elementLoc - ); - } else { - propsExpression = mergeArgs[0]; + if (!onComponentSlot) { + const buildDefaultSlotProperty = (props, children2) => { + const fn = buildSlotFn(props, void 0, children2, loc); + if (context.compatConfig) { + fn.isNonScopedSlot = true; + } + return createObjectProperty(`default`, fn); + }; + if (!hasTemplateSlots) { + slotsProperties.push(buildDefaultSlotProperty(void 0, children)); + } else if (implicitDefaultChildren.length && // #3766 + // with whitespace: 'preserve', whitespaces between slots will end up in + // implicitDefaultChildren. Ignore if all implicit children are whitespaces. + implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { + if (hasNamedDefaultSlot) { + context.onError( + createCompilerError( + 39, + implicitDefaultChildren[0].loc + ) + ); + } else { + slotsProperties.push( + buildDefaultSlotProperty(void 0, implicitDefaultChildren) + ); + } } - } else if (properties.length) { - propsExpression = createObjectExpression( - dedupeProperties(properties), - elementLoc - ); } - if (hasDynamicKeys) { - patchFlag |= 16; - } else { - if (hasClassBinding && !isComponent) { - patchFlag |= 2; - } - if (hasStyleBinding && !isComponent) { - patchFlag |= 4; - } - if (dynamicPropNames.length) { - patchFlag |= 8; - } - if (hasHydrationEventBinding) { - patchFlag |= 32; - } + const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; + let slots = createObjectExpression( + slotsProperties.concat( + createObjectProperty( + `_`, + // 2 = compiled but dynamic = can skip normalization, but must run diff + // 1 = compiled and static = can skip normalization AND diff as optimized + createSimpleExpression( + slotFlag + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.slotFlagsText[slotFlag]} */` : 0), + false + ) + ) + ), + loc + ); + if (dynamicSlots.length) { + slots = createCallExpression(context.helper(CREATE_SLOTS), [ + slots, + createArrayExpression(dynamicSlots) + ]); } - if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { - patchFlag |= 512; + return { + slots, + hasDynamicSlots + }; +} +function buildDynamicSlot(name, fn, index) { + const props = [ + createObjectProperty(`name`, name), + createObjectProperty(`fn`, fn) + ]; + if (index != null) { + props.push( + createObjectProperty(`key`, createSimpleExpression(String(index), true)) + ); } - if (!context.inSSR && propsExpression) { - switch (propsExpression.type) { - case 15: - let classKeyIndex = -1; - let styleKeyIndex = -1; - let hasDynamicKey = false; - for (let i = 0; i < propsExpression.properties.length; i++) { - const key = propsExpression.properties[i].key; - if (isStaticExp(key)) { - if (key.content === "class") { - classKeyIndex = i; - } else if (key.content === "style") { - styleKeyIndex = i; - } - } else if (!key.isHandlerKey) { - hasDynamicKey = true; - } - } - const classProp = propsExpression.properties[classKeyIndex]; - const styleProp = propsExpression.properties[styleKeyIndex]; - if (!hasDynamicKey) { - if (classProp && !isStaticExp(classProp.value)) { - classProp.value = createCallExpression( - context.helper(NORMALIZE_CLASS), - [classProp.value] - ); - } - if (styleProp && // the static style is compiled into an object, - // so use `hasStyleBinding` to ensure that it is a dynamic style binding - (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, - // v-bind:style with static literal object - styleProp.value.type === 17)) { - styleProp.value = createCallExpression( - context.helper(NORMALIZE_STYLE), - [styleProp.value] - ); - } - } else { - propsExpression = createCallExpression( - context.helper(NORMALIZE_PROPS), - [propsExpression] - ); + return createObjectExpression(props); +} +function hasForwardedSlots(children) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + switch (child.type) { + case 1: + if (child.tagType === 2 || hasForwardedSlots(child.children)) { + return true; } break; - case 14: + case 9: + if (hasForwardedSlots(child.branches)) + return true; break; - default: - propsExpression = createCallExpression( - context.helper(NORMALIZE_PROPS), - [ - createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ - propsExpression - ]) - ] - ); + case 10: + case 11: + if (hasForwardedSlots(child.children)) + return true; break; } } - return { - props: propsExpression, - directives: runtimeDirectives, - patchFlag, - dynamicPropNames, - shouldUseBlock - }; + return false; } -function dedupeProperties(properties) { - const knownProps = /* @__PURE__ */ new Map(); - const deduped = []; - for (let i = 0; i < properties.length; i++) { - const prop = properties[i]; - if (prop.key.type === 8 || !prop.key.isStatic) { - deduped.push(prop); - continue; - } - const name = prop.key.content; - const existing = knownProps.get(name); - if (existing) { - if (name === "style" || name === "class" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name)) { - mergeAsArray(existing, prop); - } - } else { - knownProps.set(name, prop); - deduped.push(prop); - } - } - return deduped; +function isNonWhitespaceContent(node) { + if (node.type !== 2 && node.type !== 12) + return true; + return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); } -function mergeAsArray(existing, incoming) { - if (existing.value.type === 17) { - existing.value.elements.push(incoming.value); - } else { - existing.value = createArrayExpression( - [existing.value, incoming.value], - existing.loc + +const directiveImportMap = /* @__PURE__ */ new WeakMap(); +const transformElement = (node, context) => { + return function postTransformElement() { + node = context.currentNode; + if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { + return; + } + const { tag, props } = node; + const isComponent = node.tagType === 1; + let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; + const isDynamicComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; + let vnodeProps; + let vnodeChildren; + let vnodePatchFlag; + let patchFlag = 0; + let vnodeDynamicProps; + let dynamicPropNames; + let vnodeDirectives; + let shouldUseBlock = ( + // dynamic component may resolve to plain elements + isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block + // updates inside get proper isSVG flag at runtime. (#639, #643) + // This is technically web-specific, but splitting the logic out of core + // leads to too much unnecessary complexity. + (tag === "svg" || tag === "foreignObject") ); - } -} -function buildDirectiveArgs(dir, context) { - const dirArgs = []; - const runtime = directiveImportMap.get(dir); - if (runtime) { - dirArgs.push(context.helperString(runtime)); - } else { - { - context.helper(RESOLVE_DIRECTIVE); - context.directives.add(dir.name); - dirArgs.push(toValidAssetId(dir.name, `directive`)); + if (props.length > 0) { + const propsBuildResult = buildProps( + node, + context, + void 0, + isComponent, + isDynamicComponent + ); + vnodeProps = propsBuildResult.props; + patchFlag = propsBuildResult.patchFlag; + dynamicPropNames = propsBuildResult.dynamicPropNames; + const directives = propsBuildResult.directives; + vnodeDirectives = directives && directives.length ? createArrayExpression( + directives.map((dir) => buildDirectiveArgs(dir, context)) + ) : void 0; + if (propsBuildResult.shouldUseBlock) { + shouldUseBlock = true; + } } - } - const { loc } = dir; - if (dir.exp) - dirArgs.push(dir.exp); - if (dir.arg) { - if (!dir.exp) { - dirArgs.push(`void 0`); + if (node.children.length > 0) { + if (vnodeTag === KEEP_ALIVE) { + shouldUseBlock = true; + patchFlag |= 1024; + if ( true && node.children.length > 1) { + context.onError( + createCompilerError(46, { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + }) + ); + } + } + const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling + vnodeTag !== TELEPORT && // explained above. + vnodeTag !== KEEP_ALIVE; + if (shouldBuildAsSlots) { + const { slots, hasDynamicSlots } = buildSlots(node, context); + vnodeChildren = slots; + if (hasDynamicSlots) { + patchFlag |= 1024; + } + } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { + const child = node.children[0]; + const type = child.type; + const hasDynamicTextChild = type === 5 || type === 8; + if (hasDynamicTextChild && getConstantType(child, context) === 0) { + patchFlag |= 1; + } + if (hasDynamicTextChild || type === 2) { + vnodeChildren = child; + } else { + vnodeChildren = node.children; + } + } else { + vnodeChildren = node.children; + } } - dirArgs.push(dir.arg); - } - if (Object.keys(dir.modifiers).length) { - if (!dir.arg) { - if (!dir.exp) { - dirArgs.push(`void 0`); + if (patchFlag !== 0) { + if (true) { + if (patchFlag < 0) { + vnodePatchFlag = patchFlag + ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[patchFlag]} */`; + } else { + const flagNames = Object.keys(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => _vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[n]).join(`, `); + vnodePatchFlag = patchFlag + ` /* ${flagNames} */`; + } + } else {} + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); } - dirArgs.push(`void 0`); } - const trueExpression = createSimpleExpression(`true`, false, loc); - dirArgs.push( - createObjectExpression( - dir.modifiers.map( - (modifier) => createObjectProperty(modifier, trueExpression) - ), - loc - ) - ); - } - return createArrayExpression(dirArgs, dir.loc); -} -function stringifyDynamicPropNames(props) { - let propsNamesString = `[`; - for (let i = 0, l = props.length; i < l; i++) { - propsNamesString += JSON.stringify(props[i]); - if (i < l - 1) - propsNamesString += ", "; - } - return propsNamesString + `]`; -} -function isComponentTag(tag) { - return tag === "component" || tag === "Component"; -} - -const transformSlotOutlet = (node, context) => { - if (isSlotOutlet(node)) { - const { children, loc } = node; - const { slotName, slotProps } = processSlotOutlet(node, context); - const slotArgs = [ - context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, - slotName, - "{}", - "undefined", - "true" - ]; - let expectedLen = 2; - if (slotProps) { - slotArgs[2] = slotProps; - expectedLen = 3; - } - if (children.length) { - slotArgs[3] = createFunctionExpression([], children, false, false, loc); - expectedLen = 4; - } - if (context.scopeId && !context.slotted) { - expectedLen = 5; - } - slotArgs.splice(expectedLen); - node.codegenNode = createCallExpression( - context.helper(RENDER_SLOT), - slotArgs, - loc + node.codegenNode = createVNodeCall( + context, + vnodeTag, + vnodeProps, + vnodeChildren, + vnodePatchFlag, + vnodeDynamicProps, + vnodeDirectives, + !!shouldUseBlock, + false, + isComponent, + node.loc ); - } + }; }; -function processSlotOutlet(node, context) { - let slotName = `"default"`; - let slotProps = void 0; - const nonNameProps = []; - for (let i = 0; i < node.props.length; i++) { - const p = node.props[i]; - if (p.type === 6) { - if (p.value) { - if (p.name === "name") { - slotName = JSON.stringify(p.value.content); - } else { - p.name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.name); - nonNameProps.push(p); - } - } - } else { - if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { - if (p.exp) - slotName = p.exp; - } else { - if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { - p.arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.arg.content); - } - nonNameProps.push(p); +function resolveComponentType(node, context, ssr = false) { + let { tag } = node; + const isExplicitDynamic = isComponentTag(tag); + const isProp = findProp(node, "is"); + if (isProp) { + if (isExplicitDynamic || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + )) { + const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp; + if (exp) { + return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ + exp + ]); } + } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { + tag = isProp.value.content.slice(4); } } - if (nonNameProps.length > 0) { - const { props, directives } = buildProps( - node, - context, - nonNameProps, - false, - false - ); - slotProps = props; - if (directives.length) { - context.onError( - createCompilerError( - 36, - directives[0].loc - ) + const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); + if (builtIn) { + if (!ssr) + context.helper(builtIn); + return builtIn; + } + context.helper(RESOLVE_COMPONENT); + context.components.add(tag); + return toValidAssetId(tag, `component`); +} +function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { + const { tag, loc: elementLoc, children } = node; + let properties = []; + const mergeArgs = []; + const runtimeDirectives = []; + const hasChildren = children.length > 0; + let shouldUseBlock = false; + let patchFlag = 0; + let hasRef = false; + let hasClassBinding = false; + let hasStyleBinding = false; + let hasHydrationEventBinding = false; + let hasDynamicKeys = false; + let hasVnodeHook = false; + const dynamicPropNames = []; + const pushMergeArg = (arg) => { + if (properties.length) { + mergeArgs.push( + createObjectExpression(dedupeProperties(properties), elementLoc) ); + properties = []; } - } - return { - slotName, - slotProps + if (arg) + mergeArgs.push(arg); }; -} - -const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; -const transformOn = (dir, node, context, augmentor) => { - const { loc, modifiers, arg } = dir; - if (!dir.exp && !modifiers.length) { - context.onError(createCompilerError(35, loc)); - } - let eventName; - if (arg.type === 4) { - if (arg.isStatic) { - let rawName = arg.content; - if ( true && rawName.startsWith("vnode")) { - context.onWarn( - createCompilerError(51, arg.loc) - ); + const analyzePatchFlag = ({ key, value }) => { + if (isStaticExp(key)) { + const name = key.content; + const isEventHandler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name); + if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click + // dedicated fast path. + name.toLowerCase() !== "onclick" && // omit v-model handlers + name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks + !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { + hasHydrationEventBinding = true; } - if (rawName.startsWith("vue:")) { - rawName = `vnode-${rawName.slice(4)}`; + if (isEventHandler && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isReservedProp)(name)) { + hasVnodeHook = true; + } + if (isEventHandler && value.type === 14) { + value = value.arguments[0]; + } + if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { + return; + } + if (name === "ref") { + hasRef = true; + } else if (name === "class") { + hasClassBinding = true; + } else if (name === "style") { + hasStyleBinding = true; + } else if (name !== "key" && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); + } + if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { + dynamicPropNames.push(name); } - const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( - // for non-element and vnode lifecycle event listeners, auto convert - // it to camelCase. See issue #2249 - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(rawName)) - ) : ( - // preserve case for plain element listeners that have uppercase - // letters, as these may be custom elements' custom events - `on:${rawName}` - ); - eventName = createSimpleExpression(eventString, true, arg.loc); } else { - eventName = createCompoundExpression([ - `${context.helperString(TO_HANDLER_KEY)}(`, - arg, - `)` - ]); - } - } else { - eventName = arg; - eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); - eventName.children.push(`)`); - } - let exp = dir.exp; - if (exp && !exp.content.trim()) { - exp = void 0; - } - let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; - if (exp) { - const isMemberExp = isMemberExpression(exp.content); - const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content)); - const hasMultipleStatements = exp.content.includes(`;`); - if (true) { - validateBrowserExpression( - exp, - context, - false, - hasMultipleStatements - ); - } - if (isInlineStatement || shouldCache && isMemberExp) { - exp = createCompoundExpression([ - `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, - exp, - hasMultipleStatements ? `}` : `)` - ]); + hasDynamicKeys = true; } - } - let ret = { - props: [ - createObjectProperty( - eventName, - exp || createSimpleExpression(`() => {}`, false, loc) - ) - ] }; - if (augmentor) { - ret = augmentor(ret); - } - if (shouldCache) { - ret.props[0].value = context.cache(ret.props[0].value); - } - ret.props.forEach((p) => p.key.isHandlerKey = true); - return ret; -}; - -const transformBind = (dir, _node, context) => { - const { exp, modifiers, loc } = dir; - const arg = dir.arg; - if (arg.type !== 4) { - arg.children.unshift(`(`); - arg.children.push(`) || ""`); - } else if (!arg.isStatic) { - arg.content = `${arg.content} || ""`; - } - if (modifiers.includes("camel")) { - if (arg.type === 4) { - if (arg.isStatic) { - arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content); - } else { - arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (prop.type === 6) { + const { loc, name, nameLoc, value } = prop; + let isStatic = true; + if (name === "ref") { + hasRef = true; + if (context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } } + if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + properties.push( + createObjectProperty( + createSimpleExpression(name, true, nameLoc), + createSimpleExpression( + value ? value.content : "", + isStatic, + value ? value.loc : loc + ) + ) + ); } else { - arg.children.unshift(`${context.helperString(CAMELIZE)}(`); - arg.children.push(`)`); - } - } - if (!context.inSSR) { - if (modifiers.includes("prop")) { - injectPrefix(arg, "."); - } - if (modifiers.includes("attr")) { - injectPrefix(arg, "^"); - } - } - if (!exp || exp.type === 4 && !exp.content.trim()) { - context.onError(createCompilerError(34, loc)); - return { - props: [createObjectProperty(arg, createSimpleExpression("", true, loc))] - }; - } - return { - props: [createObjectProperty(arg, exp)] - }; -}; -const injectPrefix = (arg, prefix) => { - if (arg.type === 4) { - if (arg.isStatic) { - arg.content = prefix + arg.content; - } else { - arg.content = `\`${prefix}\${${arg.content}}\``; - } - } else { - arg.children.unshift(`'${prefix}' + (`); - arg.children.push(`)`); - } -}; - -const transformText = (node, context) => { - if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { - return () => { - const children = node.children; - let currentContainer = void 0; - let hasText = false; - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (isText$1(child)) { - hasText = true; - for (let j = i + 1; j < children.length; j++) { - const next = children[j]; - if (isText$1(next)) { - if (!currentContainer) { - currentContainer = children[i] = createCompoundExpression( - [child], - child.loc - ); + const { name, arg, exp, loc, modifiers } = prop; + const isVBind = name === "bind"; + const isVOn = name === "on"; + if (name === "slot") { + if (!isComponent) { + context.onError( + createCompilerError(40, loc) + ); + } + continue; + } + if (name === "once" || name === "memo") { + continue; + } + if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( + "COMPILER_IS_ON_ELEMENT", + context + ))) { + continue; + } + if (isVOn && ssr) { + continue; + } + if ( + // #938: elements with dynamic keys should be forced into blocks + isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked + // before children + isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") + ) { + shouldUseBlock = true; + } + if (isVBind && isStaticArgOf(arg, "ref") && context.scopes.vFor > 0) { + properties.push( + createObjectProperty( + createSimpleExpression("ref_for", true), + createSimpleExpression("true") + ) + ); + } + if (!arg && (isVBind || isVOn)) { + hasDynamicKeys = true; + if (exp) { + if (isVBind) { + pushMergeArg(); + { + if (true) { + const hasOverridableKeys = mergeArgs.some((arg2) => { + if (arg2.type === 15) { + return arg2.properties.some(({ key }) => { + if (key.type !== 4 || !key.isStatic) { + return true; + } + return key.content !== "class" && key.content !== "style" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(key.content); + }); + } else { + return true; + } + }); + if (hasOverridableKeys) { + checkCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context, + loc + ); + } + } + if (isCompatEnabled( + "COMPILER_V_BIND_OBJECT_ORDER", + context + )) { + mergeArgs.unshift(exp); + continue; } - currentContainer.children.push(` + `, next); - children.splice(j, 1); - j--; - } else { - currentContainer = void 0; - break; } + mergeArgs.push(exp); + } else { + pushMergeArg({ + type: 14, + loc, + callee: context.helper(TO_HANDLERS), + arguments: isComponent ? [exp] : [exp, `true`] + }); } + } else { + context.onError( + createCompilerError( + isVBind ? 34 : 35, + loc + ) + ); } + continue; } - if (!hasText || // if this is a plain element with a single text child, leave it - // as-is since the runtime has dedicated fast path for this by directly - // setting textContent of the element. - // for component root it's always normalized anyway. - children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 - // custom directives can potentially add DOM elements arbitrarily, - // we need to avoid setting textContent of the element at runtime - // to avoid accidentally overwriting the DOM elements added - // by the user through custom directives. - !node.props.find( - (p) => p.type === 7 && !context.directiveTransforms[p.name] - ) && // in compat mode, <template> tags with no special directives - // will be rendered as a fragment so its children must be - // converted into vnodes. - !(node.tag === "template"))) { - return; + if (isVBind && modifiers.includes("prop")) { + patchFlag |= 32; } - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (isText$1(child) || child.type === 8) { - const callArgs = []; - if (child.type !== 2 || child.content !== " ") { - callArgs.push(child); - } - if (!context.ssr && getConstantType(child, context) === 0) { - callArgs.push( - 1 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[1]} */` : 0) - ); + const directiveTransform = context.directiveTransforms[name]; + if (directiveTransform) { + const { props: props2, needRuntime } = directiveTransform(prop, node, context); + !ssr && props2.forEach(analyzePatchFlag); + if (isVOn && arg && !isStaticExp(arg)) { + pushMergeArg(createObjectExpression(props2, elementLoc)); + } else { + properties.push(...props2); + } + if (needRuntime) { + runtimeDirectives.push(prop); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(needRuntime)) { + directiveImportMap.set(prop, needRuntime); } - children[i] = { - type: 12, - content: child, - loc: child.loc, - codegenNode: createCallExpression( - context.helper(CREATE_TEXT), - callArgs - ) - }; + } + } else if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isBuiltInDirective)(name)) { + runtimeDirectives.push(prop); + if (hasChildren) { + shouldUseBlock = true; } } - }; - } -}; - -const seen$1 = /* @__PURE__ */ new WeakSet(); -const transformOnce = (node, context) => { - if (node.type === 1 && findDir(node, "once", true)) { - if (seen$1.has(node) || context.inVOnce || context.inSSR) { - return; } - seen$1.add(node); - context.inVOnce = true; - context.helper(SET_BLOCK_TRACKING); - return () => { - context.inVOnce = false; - const cur = context.currentNode; - if (cur.codegenNode) { - cur.codegenNode = context.cache( - cur.codegenNode, - true - /* isVNode */ - ); - } - }; } -}; - -const transformModel = (dir, node, context) => { - const { exp, arg } = dir; - if (!exp) { - context.onError( - createCompilerError(41, dir.loc) + let propsExpression = void 0; + if (mergeArgs.length) { + pushMergeArg(); + if (mergeArgs.length > 1) { + propsExpression = createCallExpression( + context.helper(MERGE_PROPS), + mergeArgs, + elementLoc + ); + } else { + propsExpression = mergeArgs[0]; + } + } else if (properties.length) { + propsExpression = createObjectExpression( + dedupeProperties(properties), + elementLoc ); - return createTransformProps(); } - const rawExp = exp.loc.source; - const expString = exp.type === 4 ? exp.content : rawExp; - const bindingType = context.bindingMetadata[rawExp]; - if (bindingType === "props" || bindingType === "props-aliased") { - context.onError(createCompilerError(44, exp.loc)); - return createTransformProps(); + if (hasDynamicKeys) { + patchFlag |= 16; + } else { + if (hasClassBinding && !isComponent) { + patchFlag |= 2; + } + if (hasStyleBinding && !isComponent) { + patchFlag |= 4; + } + if (dynamicPropNames.length) { + patchFlag |= 8; + } + if (hasHydrationEventBinding) { + patchFlag |= 32; + } } - const maybeRef = false; - if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) { - context.onError( - createCompilerError(42, exp.loc) - ); - return createTransformProps(); + if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { + patchFlag |= 512; } - const propName = arg ? arg : createSimpleExpression("modelValue", true); - const eventName = arg ? isStaticExp(arg) ? `onUpdate:${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; - let assignmentExp; - const eventArg = context.isTS ? `($event: any)` : `$event`; - { - assignmentExp = createCompoundExpression([ - `${eventArg} => ((`, - exp, - `) = $event)` - ]); + if (!context.inSSR && propsExpression) { + switch (propsExpression.type) { + case 15: + let classKeyIndex = -1; + let styleKeyIndex = -1; + let hasDynamicKey = false; + for (let i = 0; i < propsExpression.properties.length; i++) { + const key = propsExpression.properties[i].key; + if (isStaticExp(key)) { + if (key.content === "class") { + classKeyIndex = i; + } else if (key.content === "style") { + styleKeyIndex = i; + } + } else if (!key.isHandlerKey) { + hasDynamicKey = true; + } + } + const classProp = propsExpression.properties[classKeyIndex]; + const styleProp = propsExpression.properties[styleKeyIndex]; + if (!hasDynamicKey) { + if (classProp && !isStaticExp(classProp.value)) { + classProp.value = createCallExpression( + context.helper(NORMALIZE_CLASS), + [classProp.value] + ); + } + if (styleProp && // the static style is compiled into an object, + // so use `hasStyleBinding` to ensure that it is a dynamic style binding + (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, + // v-bind:style with static literal object + styleProp.value.type === 17)) { + styleProp.value = createCallExpression( + context.helper(NORMALIZE_STYLE), + [styleProp.value] + ); + } + } else { + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [propsExpression] + ); + } + break; + case 14: + break; + default: + propsExpression = createCallExpression( + context.helper(NORMALIZE_PROPS), + [ + createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ + propsExpression + ]) + ] + ); + break; + } } - const props = [ - // modelValue: foo - createObjectProperty(propName, dir.exp), - // "onUpdate:modelValue": $event => (foo = $event) - createObjectProperty(eventName, assignmentExp) - ]; - if (dir.modifiers.length && node.tagType === 1) { - const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); - const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; - props.push( - createObjectProperty( - modifiersKey, - createSimpleExpression( - `{ ${modifiers} }`, - false, - dir.loc, - 2 - ) - ) - ); + return { + props: propsExpression, + directives: runtimeDirectives, + patchFlag, + dynamicPropNames, + shouldUseBlock + }; +} +function dedupeProperties(properties) { + const knownProps = /* @__PURE__ */ new Map(); + const deduped = []; + for (let i = 0; i < properties.length; i++) { + const prop = properties[i]; + if (prop.key.type === 8 || !prop.key.isStatic) { + deduped.push(prop); + continue; + } + const name = prop.key.content; + const existing = knownProps.get(name); + if (existing) { + if (name === "style" || name === "class" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isOn)(name)) { + mergeAsArray(existing, prop); + } + } else { + knownProps.set(name, prop); + deduped.push(prop); + } } - return createTransformProps(props); -}; -function createTransformProps(props = []) { - return { props }; + return deduped; } - -const validDivisionCharRE = /[\w).+\-_$\]]/; -const transformFilter = (node, context) => { - if (!isCompatEnabled("COMPILER_FILTER", context)) { - return; +function mergeAsArray(existing, incoming) { + if (existing.value.type === 17) { + existing.value.elements.push(incoming.value); + } else { + existing.value = createArrayExpression( + [existing.value, incoming.value], + existing.loc + ); } - if (node.type === 5) { - rewriteFilter(node.content, context); +} +function buildDirectiveArgs(dir, context) { + const dirArgs = []; + const runtime = directiveImportMap.get(dir); + if (runtime) { + dirArgs.push(context.helperString(runtime)); + } else { + { + context.helper(RESOLVE_DIRECTIVE); + context.directives.add(dir.name); + dirArgs.push(toValidAssetId(dir.name, `directive`)); + } } - if (node.type === 1) { - node.props.forEach((prop) => { - if (prop.type === 7 && prop.name !== "for" && prop.exp) { - rewriteFilter(prop.exp, context); - } - }); + const { loc } = dir; + if (dir.exp) + dirArgs.push(dir.exp); + if (dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); + } + dirArgs.push(dir.arg); } -}; -function rewriteFilter(node, context) { - if (node.type === 4) { - parseFilter(node, context); - } else { - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - if (typeof child !== "object") - continue; - if (child.type === 4) { - parseFilter(child, context); - } else if (child.type === 8) { - rewriteFilter(node, context); - } else if (child.type === 5) { - rewriteFilter(child.content, context); + if (Object.keys(dir.modifiers).length) { + if (!dir.arg) { + if (!dir.exp) { + dirArgs.push(`void 0`); } + dirArgs.push(`void 0`); } + const trueExpression = createSimpleExpression(`true`, false, loc); + dirArgs.push( + createObjectExpression( + dir.modifiers.map( + (modifier) => createObjectProperty(modifier, trueExpression) + ), + loc + ) + ); } + return createArrayExpression(dirArgs, dir.loc); } -function parseFilter(node, context) { - const exp = node.content; - let inSingle = false; - let inDouble = false; - let inTemplateString = false; - let inRegex = false; - let curly = 0; - let square = 0; - let paren = 0; - let lastFilterIndex = 0; - let c, prev, i, expression, filters = []; - for (i = 0; i < exp.length; i++) { - prev = c; - c = exp.charCodeAt(i); - if (inSingle) { - if (c === 39 && prev !== 92) - inSingle = false; - } else if (inDouble) { - if (c === 34 && prev !== 92) - inDouble = false; - } else if (inTemplateString) { - if (c === 96 && prev !== 92) - inTemplateString = false; - } else if (inRegex) { - if (c === 47 && prev !== 92) - inRegex = false; - } else if (c === 124 && // pipe - exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { - if (expression === void 0) { - lastFilterIndex = i + 1; - expression = exp.slice(0, i).trim(); - } else { - pushFilter(); +function stringifyDynamicPropNames(props) { + let propsNamesString = `[`; + for (let i = 0, l = props.length; i < l; i++) { + propsNamesString += JSON.stringify(props[i]); + if (i < l - 1) + propsNamesString += ", "; + } + return propsNamesString + `]`; +} +function isComponentTag(tag) { + return tag === "component" || tag === "Component"; +} + +const transformSlotOutlet = (node, context) => { + if (isSlotOutlet(node)) { + const { children, loc } = node; + const { slotName, slotProps } = processSlotOutlet(node, context); + const slotArgs = [ + context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, + slotName, + "{}", + "undefined", + "true" + ]; + let expectedLen = 2; + if (slotProps) { + slotArgs[2] = slotProps; + expectedLen = 3; + } + if (children.length) { + slotArgs[3] = createFunctionExpression([], children, false, false, loc); + expectedLen = 4; + } + if (context.scopeId && !context.slotted) { + expectedLen = 5; + } + slotArgs.splice(expectedLen); + node.codegenNode = createCallExpression( + context.helper(RENDER_SLOT), + slotArgs, + loc + ); + } +}; +function processSlotOutlet(node, context) { + let slotName = `"default"`; + let slotProps = void 0; + const nonNameProps = []; + for (let i = 0; i < node.props.length; i++) { + const p = node.props[i]; + if (p.type === 6) { + if (p.value) { + if (p.name === "name") { + slotName = JSON.stringify(p.value.content); + } else { + p.name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.name); + nonNameProps.push(p); + } } } else { - switch (c) { - case 34: - inDouble = true; - break; - case 39: - inSingle = true; - break; - case 96: - inTemplateString = true; - break; - case 40: - paren++; - break; - case 41: - paren--; - break; - case 91: - square++; - break; - case 93: - square--; - break; - case 123: - curly++; - break; - case 125: - curly--; - break; - } - if (c === 47) { - let j = i - 1; - let p; - for (; j >= 0; j--) { - p = exp.charAt(j); - if (p !== " ") - break; - } - if (!p || !validDivisionCharRE.test(p)) { - inRegex = true; + if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { + if (p.exp) + slotName = p.exp; + } else { + if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { + p.arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(p.arg.content); } + nonNameProps.push(p); } } } - if (expression === void 0) { - expression = exp.slice(0, i).trim(); - } else if (lastFilterIndex !== 0) { - pushFilter(); - } - function pushFilter() { - filters.push(exp.slice(lastFilterIndex, i).trim()); - lastFilterIndex = i + 1; - } - if (filters.length) { - true && warnDeprecation( - "COMPILER_FILTER", + if (nonNameProps.length > 0) { + const { props, directives } = buildProps( + node, context, - node.loc + nonNameProps, + false, + false ); - for (i = 0; i < filters.length; i++) { - expression = wrapFilter(expression, filters[i], context); + slotProps = props; + if (directives.length) { + context.onError( + createCompilerError( + 36, + directives[0].loc + ) + ); } - node.content = expression; } + return { + slotName, + slotProps + }; } -function wrapFilter(exp, filter, context) { - context.helper(RESOLVE_FILTER); - const i = filter.indexOf("("); - if (i < 0) { - context.filters.add(filter); - return `${toValidAssetId(filter, "filter")}(${exp})`; + +const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; +const transformOn = (dir, node, context, augmentor) => { + const { loc, modifiers, arg } = dir; + if (!dir.exp && !modifiers.length) { + context.onError(createCompilerError(35, loc)); + } + let eventName; + if (arg.type === 4) { + if (arg.isStatic) { + let rawName = arg.content; + if ( true && rawName.startsWith("vnode")) { + context.onError(createCompilerError(51, arg.loc)); + } + if (rawName.startsWith("vue:")) { + rawName = `vnode-${rawName.slice(4)}`; + } + const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( + // for non-element and vnode lifecycle event listeners, auto convert + // it to camelCase. See issue #2249 + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(rawName)) + ) : ( + // preserve case for plain element listeners that have uppercase + // letters, as these may be custom elements' custom events + `on:${rawName}` + ); + eventName = createSimpleExpression(eventString, true, arg.loc); + } else { + eventName = createCompoundExpression([ + `${context.helperString(TO_HANDLER_KEY)}(`, + arg, + `)` + ]); + } } else { - const name = filter.slice(0, i); - const args = filter.slice(i + 1); - context.filters.add(name); - return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; + eventName = arg; + eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); + eventName.children.push(`)`); } -} - -const seen = /* @__PURE__ */ new WeakSet(); -const transformMemo = (node, context) => { - if (node.type === 1) { - const dir = findDir(node, "memo"); - if (!dir || seen.has(node)) { - return; + let exp = dir.exp; + if (exp && !exp.content.trim()) { + exp = void 0; + } + let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; + if (exp) { + const isMemberExp = isMemberExpression(exp.content); + const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content)); + const hasMultipleStatements = exp.content.includes(`;`); + if (true) { + validateBrowserExpression( + exp, + context, + false, + hasMultipleStatements + ); + } + if (isInlineStatement || shouldCache && isMemberExp) { + exp = createCompoundExpression([ + `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, + exp, + hasMultipleStatements ? `}` : `)` + ]); } - seen.add(node); - return () => { - const codegenNode = node.codegenNode || context.currentNode.codegenNode; - if (codegenNode && codegenNode.type === 13) { - if (node.tagType !== 1) { - convertToBlock(codegenNode, context); - } - node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ - dir.exp, - createFunctionExpression(void 0, codegenNode), - `_cache`, - String(context.cached++) - ]); - } - }; } -}; - -function getBaseTransformPreset(prefixIdentifiers) { - return [ - [ - transformOnce, - transformIf, - transformMemo, - transformFor, - ...[transformFilter] , - ... true ? [transformExpression] : 0, - transformSlotOutlet, - transformElement, - trackSlotScopes, - transformText - ], - { - on: transformOn, - bind: transformBind, - model: transformModel + let ret = { + props: [ + createObjectProperty( + eventName, + exp || createSimpleExpression(`() => {}`, false, loc) + ) + ] + }; + if (augmentor) { + ret = augmentor(ret); + } + if (shouldCache) { + ret.props[0].value = context.cache(ret.props[0].value); + } + ret.props.forEach((p) => p.key.isHandlerKey = true); + return ret; +}; + +const transformBind = (dir, _node, context) => { + const { modifiers, loc } = dir; + const arg = dir.arg; + let { exp } = dir; + if (!exp && arg.type === 4) { + const propName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content); + exp = dir.exp = createSimpleExpression(propName, false, arg.loc); + } + if (arg.type !== 4) { + arg.children.unshift(`(`); + arg.children.push(`) || ""`); + } else if (!arg.isStatic) { + arg.content = `${arg.content} || ""`; + } + if (modifiers.includes("camel")) { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content); + } else { + arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; + } + } else { + arg.children.unshift(`${context.helperString(CAMELIZE)}(`); + arg.children.push(`)`); } - ]; -} -function baseCompile(template, options = {}) { - const onError = options.onError || defaultOnError; - const isModuleMode = options.mode === "module"; - { - if (options.prefixIdentifiers === true) { - onError(createCompilerError(47)); - } else if (isModuleMode) { - onError(createCompilerError(48)); + } + if (!context.inSSR) { + if (modifiers.includes("prop")) { + injectPrefix(arg, "."); + } + if (modifiers.includes("attr")) { + injectPrefix(arg, "^"); } } - const prefixIdentifiers = false; - if (options.cacheHandlers) { - onError(createCompilerError(49)); + if (!exp || exp.type === 4 && !exp.content.trim()) { + context.onError(createCompilerError(34, loc)); + return { + props: [createObjectProperty(arg, createSimpleExpression("", true, loc))] + }; } - if (options.scopeId && !isModuleMode) { - onError(createCompilerError(50)); + return { + props: [createObjectProperty(arg, exp)] + }; +}; +const injectPrefix = (arg, prefix) => { + if (arg.type === 4) { + if (arg.isStatic) { + arg.content = prefix + arg.content; + } else { + arg.content = `\`${prefix}\${${arg.content}}\``; + } + } else { + arg.children.unshift(`'${prefix}' + (`); + arg.children.push(`)`); } - const ast = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(template) ? baseParse(template, options) : template; - const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); - transform( - ast, - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, options, { - prefixIdentifiers, - nodeTransforms: [ - ...nodeTransforms, - ...options.nodeTransforms || [] - // user transforms - ], - directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( - {}, - directiveTransforms, - options.directiveTransforms || {} - // user transforms - ) - }) - ); - return generate( - ast, - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, options, { - prefixIdentifiers - }) - ); -} - -const noopDirectiveTransform = () => ({ props: [] }); - - - +}; -/***/ }), +const transformText = (node, context) => { + if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { + return () => { + const children = node.children; + let currentContainer = void 0; + let hasText = false; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child)) { + hasText = true; + for (let j = i + 1; j < children.length; j++) { + const next = children[j]; + if (isText$1(next)) { + if (!currentContainer) { + currentContainer = children[i] = createCompoundExpression( + [child], + child.loc + ); + } + currentContainer.children.push(` + `, next); + children.splice(j, 1); + j--; + } else { + currentContainer = void 0; + break; + } + } + } + } + if (!hasText || // if this is a plain element with a single text child, leave it + // as-is since the runtime has dedicated fast path for this by directly + // setting textContent of the element. + // for component root it's always normalized anyway. + children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 + // custom directives can potentially add DOM elements arbitrarily, + // we need to avoid setting textContent of the element at runtime + // to avoid accidentally overwriting the DOM elements added + // by the user through custom directives. + !node.props.find( + (p) => p.type === 7 && !context.directiveTransforms[p.name] + ) && // in compat mode, <template> tags with no special directives + // will be rendered as a fragment so its children must be + // converted into vnodes. + !(node.tag === "template"))) { + return; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isText$1(child) || child.type === 8) { + const callArgs = []; + if (child.type !== 2 || child.content !== " ") { + callArgs.push(child); + } + if (!context.ssr && getConstantType(child, context) === 0) { + callArgs.push( + 1 + ( true ? ` /* ${_vue_shared__WEBPACK_IMPORTED_MODULE_0__.PatchFlagNames[1]} */` : 0) + ); + } + children[i] = { + type: 12, + content: child, + loc: child.loc, + codegenNode: createCallExpression( + context.helper(CREATE_TEXT), + callArgs + ) + }; + } + } + }; + } +}; -/***/ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +const seen$1 = /* @__PURE__ */ new WeakSet(); +const transformOnce = (node, context) => { + if (node.type === 1 && findDir(node, "once", true)) { + if (seen$1.has(node) || context.inVOnce || context.inSSR) { + return; + } + seen$1.add(node); + context.inVOnce = true; + context.helper(SET_BLOCK_TRACKING); + return () => { + context.inVOnce = false; + const cur = context.currentNode; + if (cur.codegenNode) { + cur.codegenNode = context.cache( + cur.codegenNode, + true + /* isVNode */ + ); + } + }; + } +}; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ BASE_TRANSITION: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.BASE_TRANSITION), -/* harmony export */ CAMELIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAMELIZE), -/* harmony export */ CAPITALIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAPITALIZE), -/* harmony export */ CREATE_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_BLOCK), -/* harmony export */ CREATE_COMMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_COMMENT), -/* harmony export */ CREATE_ELEMENT_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_BLOCK), -/* harmony export */ CREATE_ELEMENT_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_VNODE), -/* harmony export */ CREATE_SLOTS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_SLOTS), -/* harmony export */ CREATE_STATIC: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_STATIC), -/* harmony export */ CREATE_TEXT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_TEXT), -/* harmony export */ CREATE_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_VNODE), -/* harmony export */ DOMDirectiveTransforms: () => (/* binding */ DOMDirectiveTransforms), -/* harmony export */ DOMNodeTransforms: () => (/* binding */ DOMNodeTransforms), -/* harmony export */ FRAGMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.FRAGMENT), -/* harmony export */ GUARD_REACTIVE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.GUARD_REACTIVE_PROPS), -/* harmony export */ IS_MEMO_SAME: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_MEMO_SAME), -/* harmony export */ IS_REF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_REF), -/* harmony export */ KEEP_ALIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.KEEP_ALIVE), -/* harmony export */ MERGE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.MERGE_PROPS), -/* harmony export */ NORMALIZE_CLASS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_CLASS), -/* harmony export */ NORMALIZE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_PROPS), -/* harmony export */ NORMALIZE_STYLE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_STYLE), -/* harmony export */ OPEN_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.OPEN_BLOCK), -/* harmony export */ POP_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.POP_SCOPE_ID), -/* harmony export */ PUSH_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.PUSH_SCOPE_ID), -/* harmony export */ RENDER_LIST: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_LIST), -/* harmony export */ RENDER_SLOT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_SLOT), -/* harmony export */ RESOLVE_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_COMPONENT), -/* harmony export */ RESOLVE_DIRECTIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DIRECTIVE), -/* harmony export */ RESOLVE_DYNAMIC_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DYNAMIC_COMPONENT), -/* harmony export */ RESOLVE_FILTER: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_FILTER), -/* harmony export */ SET_BLOCK_TRACKING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SET_BLOCK_TRACKING), -/* harmony export */ SUSPENSE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SUSPENSE), -/* harmony export */ TELEPORT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TELEPORT), -/* harmony export */ TO_DISPLAY_STRING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), -/* harmony export */ TO_HANDLERS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLERS), -/* harmony export */ TO_HANDLER_KEY: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLER_KEY), -/* harmony export */ TRANSITION: () => (/* binding */ TRANSITION), -/* harmony export */ TRANSITION_GROUP: () => (/* binding */ TRANSITION_GROUP), -/* harmony export */ TS_NODE_TYPES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TS_NODE_TYPES), -/* harmony export */ UNREF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.UNREF), -/* harmony export */ V_MODEL_CHECKBOX: () => (/* binding */ V_MODEL_CHECKBOX), -/* harmony export */ V_MODEL_DYNAMIC: () => (/* binding */ V_MODEL_DYNAMIC), -/* harmony export */ V_MODEL_RADIO: () => (/* binding */ V_MODEL_RADIO), -/* harmony export */ V_MODEL_SELECT: () => (/* binding */ V_MODEL_SELECT), -/* harmony export */ V_MODEL_TEXT: () => (/* binding */ V_MODEL_TEXT), -/* harmony export */ V_ON_WITH_KEYS: () => (/* binding */ V_ON_WITH_KEYS), -/* harmony export */ V_ON_WITH_MODIFIERS: () => (/* binding */ V_ON_WITH_MODIFIERS), -/* harmony export */ V_SHOW: () => (/* binding */ V_SHOW), -/* harmony export */ WITH_CTX: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_CTX), -/* harmony export */ WITH_DIRECTIVES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_DIRECTIVES), -/* harmony export */ WITH_MEMO: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_MEMO), -/* harmony export */ advancePositionWithClone: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithClone), -/* harmony export */ advancePositionWithMutation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithMutation), -/* harmony export */ assert: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.assert), -/* harmony export */ baseCompile: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile), -/* harmony export */ baseParse: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse), -/* harmony export */ buildDirectiveArgs: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildDirectiveArgs), -/* harmony export */ buildProps: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildProps), -/* harmony export */ buildSlots: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildSlots), -/* harmony export */ checkCompatEnabled: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled), -/* harmony export */ compile: () => (/* binding */ compile), -/* harmony export */ convertToBlock: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.convertToBlock), -/* harmony export */ createArrayExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createArrayExpression), -/* harmony export */ createAssignmentExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createAssignmentExpression), -/* harmony export */ createBlockStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createBlockStatement), -/* harmony export */ createCacheExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCacheExpression), -/* harmony export */ createCallExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression), -/* harmony export */ createCompilerError: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError), -/* harmony export */ createCompoundExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression), -/* harmony export */ createConditionalExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createConditionalExpression), -/* harmony export */ createDOMCompilerError: () => (/* binding */ createDOMCompilerError), -/* harmony export */ createForLoopParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createForLoopParams), -/* harmony export */ createFunctionExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createFunctionExpression), -/* harmony export */ createIfStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createIfStatement), -/* harmony export */ createInterpolation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createInterpolation), -/* harmony export */ createObjectExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectExpression), -/* harmony export */ createObjectProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty), -/* harmony export */ createReturnStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createReturnStatement), -/* harmony export */ createRoot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createRoot), -/* harmony export */ createSequenceExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSequenceExpression), -/* harmony export */ createSimpleExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression), -/* harmony export */ createStructuralDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createStructuralDirectiveTransform), -/* harmony export */ createTemplateLiteral: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTemplateLiteral), -/* harmony export */ createTransformContext: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTransformContext), -/* harmony export */ createVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createVNodeCall), -/* harmony export */ extractIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.extractIdentifiers), -/* harmony export */ findDir: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findDir), -/* harmony export */ findProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp), -/* harmony export */ generate: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generate), -/* harmony export */ generateCodeFrame: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generateCodeFrame), -/* harmony export */ getBaseTransformPreset: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getBaseTransformPreset), -/* harmony export */ getConstantType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType), -/* harmony export */ getInnerRange: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getInnerRange), -/* harmony export */ getMemoedVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getMemoedVNodeCall), -/* harmony export */ getVNodeBlockHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeBlockHelper), -/* harmony export */ getVNodeHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeHelper), -/* harmony export */ hasDynamicKeyVBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind), -/* harmony export */ hasScopeRef: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasScopeRef), -/* harmony export */ helperNameMap: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.helperNameMap), -/* harmony export */ injectProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.injectProp), -/* harmony export */ isBuiltInType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isBuiltInType), -/* harmony export */ isCoreComponent: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isCoreComponent), -/* harmony export */ isFunctionType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isFunctionType), -/* harmony export */ isInDestructureAssignment: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isInDestructureAssignment), -/* harmony export */ isMemberExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpression), -/* harmony export */ isMemberExpressionBrowser: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionBrowser), -/* harmony export */ isMemberExpressionNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionNode), -/* harmony export */ isReferencedIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isReferencedIdentifier), -/* harmony export */ isSimpleIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSimpleIdentifier), -/* harmony export */ isSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSlotOutlet), -/* harmony export */ isStaticArgOf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticArgOf), -/* harmony export */ isStaticExp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp), -/* harmony export */ isStaticProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticProperty), -/* harmony export */ isStaticPropertyKey: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticPropertyKey), -/* harmony export */ isTemplateNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isTemplateNode), -/* harmony export */ isText: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isText), -/* harmony export */ isVSlot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isVSlot), -/* harmony export */ locStub: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.locStub), -/* harmony export */ noopDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform), -/* harmony export */ parse: () => (/* binding */ parse), -/* harmony export */ parserOptions: () => (/* binding */ parserOptions), -/* harmony export */ processExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processExpression), -/* harmony export */ processFor: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processFor), -/* harmony export */ processIf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processIf), -/* harmony export */ processSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processSlotOutlet), -/* harmony export */ registerRuntimeHelpers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers), -/* harmony export */ resolveComponentType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponentType), -/* harmony export */ stringifyExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.stringifyExpression), -/* harmony export */ toValidAssetId: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.toValidAssetId), -/* harmony export */ trackSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackSlotScopes), -/* harmony export */ trackVForSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackVForSlotScopes), -/* harmony export */ transform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transform), -/* harmony export */ transformBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformBind), -/* harmony export */ transformElement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformElement), -/* harmony export */ transformExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformExpression), -/* harmony export */ transformModel: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel), -/* harmony export */ transformOn: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn), -/* harmony export */ transformStyle: () => (/* binding */ transformStyle), -/* harmony export */ traverseNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.traverseNode), -/* harmony export */ walkBlockDeclarations: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkBlockDeclarations), -/* harmony export */ walkFunctionParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkFunctionParams), -/* harmony export */ walkIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkIdentifiers), -/* harmony export */ warnDeprecation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.warnDeprecation) -/* harmony export */ }); -/* harmony import */ var _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/compiler-core */ "./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js"); -/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); - - - - -const V_MODEL_RADIO = Symbol( true ? `vModelRadio` : 0); -const V_MODEL_CHECKBOX = Symbol( true ? `vModelCheckbox` : 0); -const V_MODEL_TEXT = Symbol( true ? `vModelText` : 0); -const V_MODEL_SELECT = Symbol( true ? `vModelSelect` : 0); -const V_MODEL_DYNAMIC = Symbol( true ? `vModelDynamic` : 0); -const V_ON_WITH_MODIFIERS = Symbol( true ? `vOnModifiersGuard` : 0); -const V_ON_WITH_KEYS = Symbol( true ? `vOnKeysGuard` : 0); -const V_SHOW = Symbol( true ? `vShow` : 0); -const TRANSITION = Symbol( true ? `Transition` : 0); -const TRANSITION_GROUP = Symbol( true ? `TransitionGroup` : 0); -(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers)({ - [V_MODEL_RADIO]: `vModelRadio`, - [V_MODEL_CHECKBOX]: `vModelCheckbox`, - [V_MODEL_TEXT]: `vModelText`, - [V_MODEL_SELECT]: `vModelSelect`, - [V_MODEL_DYNAMIC]: `vModelDynamic`, - [V_ON_WITH_MODIFIERS]: `withModifiers`, - [V_ON_WITH_KEYS]: `withKeys`, - [V_SHOW]: `vShow`, - [TRANSITION]: `Transition`, - [TRANSITION_GROUP]: `TransitionGroup` -}); - -let decoder; -function decodeHtmlBrowser(raw, asAttr = false) { - if (!decoder) { - decoder = document.createElement("div"); +const transformModel = (dir, node, context) => { + const { exp, arg } = dir; + if (!exp) { + context.onError( + createCompilerError(41, dir.loc) + ); + return createTransformProps(); } - if (asAttr) { - decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; - return decoder.children[0].getAttribute("foo"); - } else { - decoder.innerHTML = raw; - return decoder.textContent; + const rawExp = exp.loc.source; + const expString = exp.type === 4 ? exp.content : rawExp; + const bindingType = context.bindingMetadata[rawExp]; + if (bindingType === "props" || bindingType === "props-aliased") { + context.onError(createCompilerError(44, exp.loc)); + return createTransformProps(); } -} - -const isRawTextContainer = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( - "style,iframe,script,noscript", - true -); -const parserOptions = { - isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.isVoidTag, - isNativeTag: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag), - isPreTag: (tag) => tag === "pre", - decodeEntities: decodeHtmlBrowser , - isBuiltInComponent: (tag) => { - if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isBuiltInType)(tag, `Transition`)) { - return TRANSITION; - } else if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isBuiltInType)(tag, `TransitionGroup`)) { - return TRANSITION_GROUP; - } - }, - // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher - getNamespace(tag, parent) { - let ns = parent ? parent.ns : 0; - if (parent && ns === 2) { - if (parent.tag === "annotation-xml") { - if (tag === "svg") { - return 1; - } - if (parent.props.some( - (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") - )) { - ns = 0; - } - } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { - ns = 0; - } - } else if (parent && ns === 1) { - if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { - ns = 0; - } - } - if (ns === 0) { - if (tag === "svg") { - return 1; - } - if (tag === "math") { - return 2; - } - } - return ns; - }, - // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments - getTextMode({ tag, ns }) { - if (ns === 0) { - if (tag === "textarea" || tag === "title") { - return 1; - } - if (isRawTextContainer(tag)) { - return 2; - } - } - return 0; + const maybeRef = false; + if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) { + context.onError( + createCompilerError(42, exp.loc) + ); + return createTransformProps(); + } + const propName = arg ? arg : createSimpleExpression("modelValue", true); + const eventName = arg ? isStaticExp(arg) ? `onUpdate:${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.camelize)(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; + let assignmentExp; + const eventArg = context.isTS ? `($event: any)` : `$event`; + { + assignmentExp = createCompoundExpression([ + `${eventArg} => ((`, + exp, + `) = $event)` + ]); + } + const props = [ + // modelValue: foo + createObjectProperty(propName, dir.exp), + // "onUpdate:modelValue": $event => (foo = $event) + createObjectProperty(eventName, assignmentExp) + ]; + if (dir.modifiers.length && node.tagType === 1) { + const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); + const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; + props.push( + createObjectProperty( + modifiersKey, + createSimpleExpression( + `{ ${modifiers} }`, + false, + dir.loc, + 2 + ) + ) + ); } + return createTransformProps(props); }; +function createTransformProps(props = []) { + return { props }; +} -const transformStyle = (node) => { - if (node.type === 1) { - node.props.forEach((p, i) => { - if (p.type === 6 && p.name === "style" && p.value) { - node.props[i] = { - type: 7, - name: `bind`, - arg: (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`style`, true, p.loc), - exp: parseInlineCSS(p.value.content, p.loc), - modifiers: [], - loc: p.loc - }; +const validDivisionCharRE = /[\w).+\-_$\]]/; +const transformFilter = (node, context) => { + if (!isCompatEnabled("COMPILER_FILTERS", context)) { + return; + } + if (node.type === 5) { + rewriteFilter(node.content, context); + } + if (node.type === 1) { + node.props.forEach((prop) => { + if (prop.type === 7 && prop.name !== "for" && prop.exp) { + rewriteFilter(prop.exp, context); } }); } }; -const parseInlineCSS = (cssText, loc) => { - const normalized = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.parseStringStyle)(cssText); - return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)( - JSON.stringify(normalized), - false, - loc, - 3 - ); -}; - -function createDOMCompilerError(code, loc) { - return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError)( - code, - loc, - true ? DOMErrorMessages : 0 - ); +function rewriteFilter(node, context) { + if (node.type === 4) { + parseFilter(node, context); + } else { + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (typeof child !== "object") + continue; + if (child.type === 4) { + parseFilter(child, context); + } else if (child.type === 8) { + rewriteFilter(node, context); + } else if (child.type === 5) { + rewriteFilter(child.content, context); + } + } + } } -const DOMErrorMessages = { - [53]: `v-html is missing expression.`, - [54]: `v-html will override element children.`, - [55]: `v-text is missing expression.`, - [56]: `v-text will override element children.`, - [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, - [58]: `v-model argument is not supported on plain elements.`, - [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, - [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, - [61]: `v-show is missing expression.`, - [62]: `<Transition> expects exactly one child element or component.`, - [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` -}; - -const transformVHtml = (dir, node, context) => { - const { exp, loc } = dir; - if (!exp) { - context.onError( - createDOMCompilerError(53, loc) - ); +function parseFilter(node, context) { + const exp = node.content; + let inSingle = false; + let inDouble = false; + let inTemplateString = false; + let inRegex = false; + let curly = 0; + let square = 0; + let paren = 0; + let lastFilterIndex = 0; + let c, prev, i, expression, filters = []; + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 39 && prev !== 92) + inSingle = false; + } else if (inDouble) { + if (c === 34 && prev !== 92) + inDouble = false; + } else if (inTemplateString) { + if (c === 96 && prev !== 92) + inTemplateString = false; + } else if (inRegex) { + if (c === 47 && prev !== 92) + inRegex = false; + } else if (c === 124 && // pipe + exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { + if (expression === void 0) { + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 34: + inDouble = true; + break; + case 39: + inSingle = true; + break; + case 96: + inTemplateString = true; + break; + case 40: + paren++; + break; + case 41: + paren--; + break; + case 91: + square++; + break; + case 93: + square--; + break; + case 123: + curly++; + break; + case 125: + curly--; + break; + } + if (c === 47) { + let j = i - 1; + let p; + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== " ") + break; + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } } - if (node.children.length) { - context.onError( - createDOMCompilerError(54, loc) - ); - node.children.length = 0; + if (expression === void 0) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); } - return { - props: [ - (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( - (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`innerHTML`, true, loc), - exp || (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) - ) - ] - }; -}; - -const transformVText = (dir, node, context) => { - const { exp, loc } = dir; - if (!exp) { - context.onError( - createDOMCompilerError(55, loc) - ); + function pushFilter() { + filters.push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; } - if (node.children.length) { - context.onError( - createDOMCompilerError(56, loc) + if (filters.length) { + true && warnDeprecation( + "COMPILER_FILTERS", + context, + node.loc ); - node.children.length = 0; - } - return { - props: [ - (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( - (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`textContent`, true), - exp ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType)(exp, context) > 0 ? exp : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)( - context.helperString(_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), - [exp], - loc - ) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) - ) - ] - }; -}; - -const transformModel = (dir, node, context) => { - const baseResult = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel)(dir, node, context); - if (!baseResult.props.length || node.tagType === 1) { - return baseResult; + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i], context); + } + node.content = expression; } - if (dir.arg) { - context.onError( - createDOMCompilerError( - 58, - dir.arg.loc - ) - ); +} +function wrapFilter(exp, filter, context) { + context.helper(RESOLVE_FILTER); + const i = filter.indexOf("("); + if (i < 0) { + context.filters.add(filter); + return `${toValidAssetId(filter, "filter")}(${exp})`; + } else { + const name = filter.slice(0, i); + const args = filter.slice(i + 1); + context.filters.add(name); + return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; } - function checkDuplicatedValue() { - const value = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp)(node, "value"); - if (value) { - context.onError( - createDOMCompilerError( - 60, - value.loc - ) - ); +} + +const seen = /* @__PURE__ */ new WeakSet(); +const transformMemo = (node, context) => { + if (node.type === 1) { + const dir = findDir(node, "memo"); + if (!dir || seen.has(node)) { + return; } - } - const { tag } = node; - const isCustomElement = context.isCustomElement(tag); - if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { - let directiveToUse = V_MODEL_TEXT; - let isInvalidType = false; - if (tag === "input" || isCustomElement) { - const type = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp)(node, `type`); - if (type) { - if (type.type === 7) { - directiveToUse = V_MODEL_DYNAMIC; - } else if (type.value) { - switch (type.value.content) { - case "radio": - directiveToUse = V_MODEL_RADIO; - break; - case "checkbox": - directiveToUse = V_MODEL_CHECKBOX; - break; - case "file": - isInvalidType = true; - context.onError( - createDOMCompilerError( - 59, - dir.loc - ) - ); - break; - default: - true && checkDuplicatedValue(); - break; - } + seen.add(node); + return () => { + const codegenNode = node.codegenNode || context.currentNode.codegenNode; + if (codegenNode && codegenNode.type === 13) { + if (node.tagType !== 1) { + convertToBlock(codegenNode, context); } - } else if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind)(node)) { - directiveToUse = V_MODEL_DYNAMIC; - } else { - true && checkDuplicatedValue(); + node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ + dir.exp, + createFunctionExpression(void 0, codegenNode), + `_cache`, + String(context.cached++) + ]); } - } else if (tag === "select") { - directiveToUse = V_MODEL_SELECT; - } else { - true && checkDuplicatedValue(); - } - if (!isInvalidType) { - baseResult.needRuntime = context.helper(directiveToUse); - } - } else { - context.onError( - createDOMCompilerError( - 57, - dir.loc - ) - ); + }; } - baseResult.props = baseResult.props.filter( - (p) => !(p.key.type === 4 && p.key.content === "modelValue") - ); - return baseResult; }; -const isEventOptionModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)(`passive,once,capture`); -const isNonKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( - // event propagation management - `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` -); -const maybeKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("left,right"); -const isKeyboardEvent = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( - `onkeyup,onkeydown,onkeypress`, - true -); -const resolveModifiers = (key, modifiers, context, loc) => { - const keyModifiers = []; - const nonKeyModifiers = []; - const eventOptionModifiers = []; - for (let i = 0; i < modifiers.length; i++) { - const modifier = modifiers[i]; - if (modifier === "native" && (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled)( - "COMPILER_V_ON_NATIVE", - context, - loc - )) { - eventOptionModifiers.push(modifier); - } else if (isEventOptionModifier(modifier)) { - eventOptionModifiers.push(modifier); - } else { - if (maybeKeyModifier(modifier)) { - if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key)) { - if (isKeyboardEvent(key.content)) { - keyModifiers.push(modifier); - } else { - nonKeyModifiers.push(modifier); - } - } else { - keyModifiers.push(modifier); - nonKeyModifiers.push(modifier); - } - } else { - if (isNonKeyModifier(modifier)) { - nonKeyModifiers.push(modifier); - } else { - keyModifiers.push(modifier); - } - } - } - } - return { - keyModifiers, - nonKeyModifiers, - eventOptionModifiers - }; -}; -const transformClick = (key, event) => { - const isStaticClick = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) && key.content.toLowerCase() === "onclick"; - return isStaticClick ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(event, true) : key.type !== 4 ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([ - `(`, - key, - `) === "onClick" ? "${event}" : (`, - key, - `)` - ]) : key; -}; -const transformOn = (dir, node, context) => { - return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn)(dir, node, context, (baseResult) => { - const { modifiers } = dir; - if (!modifiers.length) - return baseResult; - let { key, value: handlerExp } = baseResult.props[0]; - const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); - if (nonKeyModifiers.includes("right")) { - key = transformClick(key, `onContextmenu`); - } - if (nonKeyModifiers.includes("middle")) { - key = transformClick(key, `onMouseup`); - } - if (nonKeyModifiers.length) { - handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [ - handlerExp, - JSON.stringify(nonKeyModifiers) - ]); - } - if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard - (!(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) || isKeyboardEvent(key.content))) { - handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_KEYS), [ - handlerExp, - JSON.stringify(keyModifiers) - ]); +function getBaseTransformPreset(prefixIdentifiers) { + return [ + [ + transformOnce, + transformIf, + transformMemo, + transformFor, + ...[transformFilter] , + ... true ? [transformExpression] : 0, + transformSlotOutlet, + transformElement, + trackSlotScopes, + transformText + ], + { + on: transformOn, + bind: transformBind, + model: transformModel } - if (eventOptionModifiers.length) { - const modifierPostfix = eventOptionModifiers.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(""); - key = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([`(`, key, `) + "${modifierPostfix}"`]); + ]; +} +function baseCompile(source, options = {}) { + const onError = options.onError || defaultOnError; + const isModuleMode = options.mode === "module"; + { + if (options.prefixIdentifiers === true) { + onError(createCompilerError(47)); + } else if (isModuleMode) { + onError(createCompilerError(48)); } - return { - props: [(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)(key, handlerExp)] - }; - }); -}; - -const transformShow = (dir, node, context) => { - const { exp, loc } = dir; - if (!exp) { - context.onError( - createDOMCompilerError(61, loc) - ); } - return { - props: [], - needRuntime: context.helper(V_SHOW) - }; -}; - -const transformTransition = (node, context) => { - if (node.type === 1 && node.tagType === 1) { - const component = context.isBuiltInComponent(node.tag); - if (component === TRANSITION) { - return () => { - if (!node.children.length) { - return; - } - if (hasMultipleChildren(node)) { - context.onError( - createDOMCompilerError( - 62, - { - start: node.children[0].loc.start, - end: node.children[node.children.length - 1].loc.end, - source: "" - } - ) - ); - } - const child = node.children[0]; - if (child.type === 1) { - for (const p of child.props) { - if (p.type === 7 && p.name === "show") { - node.props.push({ - type: 6, - name: "persisted", - value: void 0, - loc: node.loc - }); - } - } - } - }; - } + const prefixIdentifiers = false; + if (options.cacheHandlers) { + onError(createCompilerError(49)); } -}; -function hasMultipleChildren(node) { - const children = node.children = node.children.filter( - (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + if (options.scopeId && !isModuleMode) { + onError(createCompilerError(50)); + } + const resolvedOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, options, { + prefixIdentifiers + }); + const ast = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isString)(source) ? baseParse(source, resolvedOptions) : source; + const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(); + transform( + ast, + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({}, resolvedOptions, { + nodeTransforms: [ + ...nodeTransforms, + ...options.nodeTransforms || [] + // user transforms + ], + directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( + {}, + directiveTransforms, + options.directiveTransforms || {} + // user transforms + ) + }) ); - const child = children[0]; - return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); + return generate(ast, resolvedOptions); } -const ignoreSideEffectTags = (node, context) => { - if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { - true && context.onError( - createDOMCompilerError( - 63, - node.loc - ) - ); - context.removeNode(); - } +const BindingTypes = { + "DATA": "data", + "PROPS": "props", + "PROPS_ALIASED": "props-aliased", + "SETUP_LET": "setup-let", + "SETUP_CONST": "setup-const", + "SETUP_REACTIVE_CONST": "setup-reactive-const", + "SETUP_MAYBE_REF": "setup-maybe-ref", + "SETUP_REF": "setup-ref", + "OPTIONS": "options", + "LITERAL_CONST": "literal-const" }; -const DOMNodeTransforms = [ - transformStyle, - ... true ? [transformTransition] : 0 -]; -const DOMDirectiveTransforms = { - cloak: _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform, - html: transformVHtml, - text: transformVText, - model: transformModel, - // override compiler-core - on: transformOn, - // override compiler-core - show: transformShow -}; -function compile(template, options = {}) { - return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile)( - template, - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options, { - nodeTransforms: [ - // ignore <script> and <tag> - // this is not put inside DOMNodeTransforms because that list is used - // by compiler-ssr to generate vnode fallback branches - ignoreSideEffectTags, - ...DOMNodeTransforms, - ...options.nodeTransforms || [] - ], - directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - {}, - DOMDirectiveTransforms, - options.directiveTransforms || {} - ), - transformHoist: null - }) - ); -} -function parse(template, options = {}) { - return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse)(template, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options)); -} +const noopDirectiveTransform = () => ({ props: [] }); /***/ }), -/***/ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js ***! - \*********************************************************************/ +/***/ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js ***! + \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ EffectScope: () => (/* binding */ EffectScope), -/* harmony export */ ITERATE_KEY: () => (/* binding */ ITERATE_KEY), -/* harmony export */ ReactiveEffect: () => (/* binding */ ReactiveEffect), -/* harmony export */ computed: () => (/* binding */ computed), -/* harmony export */ customRef: () => (/* binding */ customRef), -/* harmony export */ deferredComputed: () => (/* binding */ deferredComputed), -/* harmony export */ effect: () => (/* binding */ effect), -/* harmony export */ effectScope: () => (/* binding */ effectScope), -/* harmony export */ enableTracking: () => (/* binding */ enableTracking), -/* harmony export */ getCurrentScope: () => (/* binding */ getCurrentScope), -/* harmony export */ isProxy: () => (/* binding */ isProxy), -/* harmony export */ isReactive: () => (/* binding */ isReactive), -/* harmony export */ isReadonly: () => (/* binding */ isReadonly), -/* harmony export */ isRef: () => (/* binding */ isRef), -/* harmony export */ isShallow: () => (/* binding */ isShallow), -/* harmony export */ markRaw: () => (/* binding */ markRaw), -/* harmony export */ onScopeDispose: () => (/* binding */ onScopeDispose), -/* harmony export */ pauseTracking: () => (/* binding */ pauseTracking), -/* harmony export */ proxyRefs: () => (/* binding */ proxyRefs), -/* harmony export */ reactive: () => (/* binding */ reactive), -/* harmony export */ readonly: () => (/* binding */ readonly), -/* harmony export */ ref: () => (/* binding */ ref), -/* harmony export */ resetTracking: () => (/* binding */ resetTracking), -/* harmony export */ shallowReactive: () => (/* binding */ shallowReactive), -/* harmony export */ shallowReadonly: () => (/* binding */ shallowReadonly), -/* harmony export */ shallowRef: () => (/* binding */ shallowRef), -/* harmony export */ stop: () => (/* binding */ stop), -/* harmony export */ toRaw: () => (/* binding */ toRaw), -/* harmony export */ toRef: () => (/* binding */ toRef), -/* harmony export */ toRefs: () => (/* binding */ toRefs), -/* harmony export */ toValue: () => (/* binding */ toValue), -/* harmony export */ track: () => (/* binding */ track), -/* harmony export */ trigger: () => (/* binding */ trigger), -/* harmony export */ triggerRef: () => (/* binding */ triggerRef), -/* harmony export */ unref: () => (/* binding */ unref) +/* harmony export */ BASE_TRANSITION: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.BASE_TRANSITION), +/* harmony export */ BindingTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.BindingTypes), +/* harmony export */ CAMELIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAMELIZE), +/* harmony export */ CAPITALIZE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CAPITALIZE), +/* harmony export */ CREATE_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_BLOCK), +/* harmony export */ CREATE_COMMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_COMMENT), +/* harmony export */ CREATE_ELEMENT_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_BLOCK), +/* harmony export */ CREATE_ELEMENT_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_ELEMENT_VNODE), +/* harmony export */ CREATE_SLOTS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_SLOTS), +/* harmony export */ CREATE_STATIC: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_STATIC), +/* harmony export */ CREATE_TEXT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_TEXT), +/* harmony export */ CREATE_VNODE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CREATE_VNODE), +/* harmony export */ CompilerDeprecationTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.CompilerDeprecationTypes), +/* harmony export */ ConstantTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ConstantTypes), +/* harmony export */ DOMDirectiveTransforms: () => (/* binding */ DOMDirectiveTransforms), +/* harmony export */ DOMErrorCodes: () => (/* binding */ DOMErrorCodes), +/* harmony export */ DOMErrorMessages: () => (/* binding */ DOMErrorMessages), +/* harmony export */ DOMNodeTransforms: () => (/* binding */ DOMNodeTransforms), +/* harmony export */ ElementTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ElementTypes), +/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), +/* harmony export */ FRAGMENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.FRAGMENT), +/* harmony export */ GUARD_REACTIVE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.GUARD_REACTIVE_PROPS), +/* harmony export */ IS_MEMO_SAME: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_MEMO_SAME), +/* harmony export */ IS_REF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.IS_REF), +/* harmony export */ KEEP_ALIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.KEEP_ALIVE), +/* harmony export */ MERGE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.MERGE_PROPS), +/* harmony export */ NORMALIZE_CLASS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_CLASS), +/* harmony export */ NORMALIZE_PROPS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_PROPS), +/* harmony export */ NORMALIZE_STYLE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NORMALIZE_STYLE), +/* harmony export */ Namespaces: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.Namespaces), +/* harmony export */ NodeTypes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.NodeTypes), +/* harmony export */ OPEN_BLOCK: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.OPEN_BLOCK), +/* harmony export */ POP_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.POP_SCOPE_ID), +/* harmony export */ PUSH_SCOPE_ID: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.PUSH_SCOPE_ID), +/* harmony export */ RENDER_LIST: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_LIST), +/* harmony export */ RENDER_SLOT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RENDER_SLOT), +/* harmony export */ RESOLVE_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_COMPONENT), +/* harmony export */ RESOLVE_DIRECTIVE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DIRECTIVE), +/* harmony export */ RESOLVE_DYNAMIC_COMPONENT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_DYNAMIC_COMPONENT), +/* harmony export */ RESOLVE_FILTER: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.RESOLVE_FILTER), +/* harmony export */ SET_BLOCK_TRACKING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SET_BLOCK_TRACKING), +/* harmony export */ SUSPENSE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.SUSPENSE), +/* harmony export */ TELEPORT: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TELEPORT), +/* harmony export */ TO_DISPLAY_STRING: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), +/* harmony export */ TO_HANDLERS: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLERS), +/* harmony export */ TO_HANDLER_KEY: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_HANDLER_KEY), +/* harmony export */ TRANSITION: () => (/* binding */ TRANSITION), +/* harmony export */ TRANSITION_GROUP: () => (/* binding */ TRANSITION_GROUP), +/* harmony export */ TS_NODE_TYPES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TS_NODE_TYPES), +/* harmony export */ UNREF: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.UNREF), +/* harmony export */ V_MODEL_CHECKBOX: () => (/* binding */ V_MODEL_CHECKBOX), +/* harmony export */ V_MODEL_DYNAMIC: () => (/* binding */ V_MODEL_DYNAMIC), +/* harmony export */ V_MODEL_RADIO: () => (/* binding */ V_MODEL_RADIO), +/* harmony export */ V_MODEL_SELECT: () => (/* binding */ V_MODEL_SELECT), +/* harmony export */ V_MODEL_TEXT: () => (/* binding */ V_MODEL_TEXT), +/* harmony export */ V_ON_WITH_KEYS: () => (/* binding */ V_ON_WITH_KEYS), +/* harmony export */ V_ON_WITH_MODIFIERS: () => (/* binding */ V_ON_WITH_MODIFIERS), +/* harmony export */ V_SHOW: () => (/* binding */ V_SHOW), +/* harmony export */ WITH_CTX: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_CTX), +/* harmony export */ WITH_DIRECTIVES: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_DIRECTIVES), +/* harmony export */ WITH_MEMO: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.WITH_MEMO), +/* harmony export */ advancePositionWithClone: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithClone), +/* harmony export */ advancePositionWithMutation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.advancePositionWithMutation), +/* harmony export */ assert: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.assert), +/* harmony export */ baseCompile: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile), +/* harmony export */ baseParse: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse), +/* harmony export */ buildDirectiveArgs: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildDirectiveArgs), +/* harmony export */ buildProps: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildProps), +/* harmony export */ buildSlots: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.buildSlots), +/* harmony export */ checkCompatEnabled: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled), +/* harmony export */ compile: () => (/* binding */ compile), +/* harmony export */ convertToBlock: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.convertToBlock), +/* harmony export */ createArrayExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createArrayExpression), +/* harmony export */ createAssignmentExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createAssignmentExpression), +/* harmony export */ createBlockStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createBlockStatement), +/* harmony export */ createCacheExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCacheExpression), +/* harmony export */ createCallExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression), +/* harmony export */ createCompilerError: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError), +/* harmony export */ createCompoundExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression), +/* harmony export */ createConditionalExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createConditionalExpression), +/* harmony export */ createDOMCompilerError: () => (/* binding */ createDOMCompilerError), +/* harmony export */ createForLoopParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createForLoopParams), +/* harmony export */ createFunctionExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createFunctionExpression), +/* harmony export */ createIfStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createIfStatement), +/* harmony export */ createInterpolation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createInterpolation), +/* harmony export */ createObjectExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectExpression), +/* harmony export */ createObjectProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty), +/* harmony export */ createReturnStatement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createReturnStatement), +/* harmony export */ createRoot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createRoot), +/* harmony export */ createSequenceExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSequenceExpression), +/* harmony export */ createSimpleExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression), +/* harmony export */ createStructuralDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createStructuralDirectiveTransform), +/* harmony export */ createTemplateLiteral: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTemplateLiteral), +/* harmony export */ createTransformContext: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createTransformContext), +/* harmony export */ createVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createVNodeCall), +/* harmony export */ errorMessages: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.errorMessages), +/* harmony export */ extractIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.extractIdentifiers), +/* harmony export */ findDir: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findDir), +/* harmony export */ findProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp), +/* harmony export */ forAliasRE: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.forAliasRE), +/* harmony export */ generate: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generate), +/* harmony export */ generateCodeFrame: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.generateCodeFrame), +/* harmony export */ getBaseTransformPreset: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getBaseTransformPreset), +/* harmony export */ getConstantType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType), +/* harmony export */ getMemoedVNodeCall: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getMemoedVNodeCall), +/* harmony export */ getVNodeBlockHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeBlockHelper), +/* harmony export */ getVNodeHelper: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getVNodeHelper), +/* harmony export */ hasDynamicKeyVBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind), +/* harmony export */ hasScopeRef: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasScopeRef), +/* harmony export */ helperNameMap: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.helperNameMap), +/* harmony export */ injectProp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.injectProp), +/* harmony export */ isCoreComponent: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isCoreComponent), +/* harmony export */ isFunctionType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isFunctionType), +/* harmony export */ isInDestructureAssignment: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isInDestructureAssignment), +/* harmony export */ isInNewExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isInNewExpression), +/* harmony export */ isMemberExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpression), +/* harmony export */ isMemberExpressionBrowser: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionBrowser), +/* harmony export */ isMemberExpressionNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isMemberExpressionNode), +/* harmony export */ isReferencedIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isReferencedIdentifier), +/* harmony export */ isSimpleIdentifier: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSimpleIdentifier), +/* harmony export */ isSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isSlotOutlet), +/* harmony export */ isStaticArgOf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticArgOf), +/* harmony export */ isStaticExp: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp), +/* harmony export */ isStaticProperty: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticProperty), +/* harmony export */ isStaticPropertyKey: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticPropertyKey), +/* harmony export */ isTemplateNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isTemplateNode), +/* harmony export */ isText: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isText), +/* harmony export */ isVSlot: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isVSlot), +/* harmony export */ locStub: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.locStub), +/* harmony export */ noopDirectiveTransform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform), +/* harmony export */ parse: () => (/* binding */ parse), +/* harmony export */ parserOptions: () => (/* binding */ parserOptions), +/* harmony export */ processExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processExpression), +/* harmony export */ processFor: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processFor), +/* harmony export */ processIf: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processIf), +/* harmony export */ processSlotOutlet: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.processSlotOutlet), +/* harmony export */ registerRuntimeHelpers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers), +/* harmony export */ resolveComponentType: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponentType), +/* harmony export */ stringifyExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.stringifyExpression), +/* harmony export */ toValidAssetId: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.toValidAssetId), +/* harmony export */ trackSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackSlotScopes), +/* harmony export */ trackVForSlotScopes: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.trackVForSlotScopes), +/* harmony export */ transform: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transform), +/* harmony export */ transformBind: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformBind), +/* harmony export */ transformElement: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformElement), +/* harmony export */ transformExpression: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformExpression), +/* harmony export */ transformModel: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel), +/* harmony export */ transformOn: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn), +/* harmony export */ transformStyle: () => (/* binding */ transformStyle), +/* harmony export */ traverseNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.traverseNode), +/* harmony export */ unwrapTSNode: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.unwrapTSNode), +/* harmony export */ walkBlockDeclarations: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkBlockDeclarations), +/* harmony export */ walkFunctionParams: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkFunctionParams), +/* harmony export */ walkIdentifiers: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.walkIdentifiers), +/* harmony export */ warnDeprecation: () => (/* reexport safe */ _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.warnDeprecation) /* harmony export */ }); -/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); +/* harmony import */ var _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/compiler-core */ "./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js"); +/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); -function warn(msg, ...args) { - console.warn(`[Vue warn] ${msg}`, ...args); -} -let activeEffectScope; -class EffectScope { - constructor(detached = false) { - this.detached = detached; - /** - * @internal - */ - this._active = true; - /** - * @internal - */ - this.effects = []; - /** - * @internal - */ - this.cleanups = []; - this.parent = activeEffectScope; - if (!detached && activeEffectScope) { - this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( - this - ) - 1; - } + +const V_MODEL_RADIO = Symbol( true ? `vModelRadio` : 0); +const V_MODEL_CHECKBOX = Symbol( true ? `vModelCheckbox` : 0); +const V_MODEL_TEXT = Symbol( true ? `vModelText` : 0); +const V_MODEL_SELECT = Symbol( true ? `vModelSelect` : 0); +const V_MODEL_DYNAMIC = Symbol( true ? `vModelDynamic` : 0); +const V_ON_WITH_MODIFIERS = Symbol( true ? `vOnModifiersGuard` : 0); +const V_ON_WITH_KEYS = Symbol( true ? `vOnKeysGuard` : 0); +const V_SHOW = Symbol( true ? `vShow` : 0); +const TRANSITION = Symbol( true ? `Transition` : 0); +const TRANSITION_GROUP = Symbol( true ? `TransitionGroup` : 0); +(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeHelpers)({ + [V_MODEL_RADIO]: `vModelRadio`, + [V_MODEL_CHECKBOX]: `vModelCheckbox`, + [V_MODEL_TEXT]: `vModelText`, + [V_MODEL_SELECT]: `vModelSelect`, + [V_MODEL_DYNAMIC]: `vModelDynamic`, + [V_ON_WITH_MODIFIERS]: `withModifiers`, + [V_ON_WITH_KEYS]: `withKeys`, + [V_SHOW]: `vShow`, + [TRANSITION]: `Transition`, + [TRANSITION_GROUP]: `TransitionGroup` +}); + +let decoder; +function decodeHtmlBrowser(raw, asAttr = false) { + if (!decoder) { + decoder = document.createElement("div"); } - get active() { - return this._active; + if (asAttr) { + decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`; + return decoder.children[0].getAttribute("foo"); + } else { + decoder.innerHTML = raw; + return decoder.textContent; } - run(fn) { - if (this._active) { - const currentEffectScope = activeEffectScope; - try { - activeEffectScope = this; - return fn(); - } finally { - activeEffectScope = currentEffectScope; - } - } else if (true) { - warn(`cannot run an inactive effect scope.`); +} + +const parserOptions = { + parseMode: "html", + isVoidTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.isVoidTag, + isNativeTag: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMathMLTag)(tag), + isPreTag: (tag) => tag === "pre", + decodeEntities: decodeHtmlBrowser , + isBuiltInComponent: (tag) => { + if (tag === "Transition" || tag === "transition") { + return TRANSITION; + } else if (tag === "TransitionGroup" || tag === "transition-group") { + return TRANSITION_GROUP; } - } - /** - * This should only be called on non-detached scopes - * @internal - */ - on() { - activeEffectScope = this; - } - /** - * This should only be called on non-detached scopes - * @internal - */ - off() { - activeEffectScope = this.parent; - } - stop(fromParent) { - if (this._active) { - let i, l; - for (i = 0, l = this.effects.length; i < l; i++) { - this.effects[i].stop(); + }, + // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher + getNamespace(tag, parent, rootNamespace) { + let ns = parent ? parent.ns : rootNamespace; + if (parent && ns === 2) { + if (parent.tag === "annotation-xml") { + if (tag === "svg") { + return 1; + } + if (parent.props.some( + (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") + )) { + ns = 0; + } + } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { + ns = 0; } - for (i = 0, l = this.cleanups.length; i < l; i++) { - this.cleanups[i](); + } else if (parent && ns === 1) { + if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { + ns = 0; } - if (this.scopes) { - for (i = 0, l = this.scopes.length; i < l; i++) { - this.scopes[i].stop(true); - } + } + if (ns === 0) { + if (tag === "svg") { + return 1; } - if (!this.detached && this.parent && !fromParent) { - const last = this.parent.scopes.pop(); - if (last && last !== this) { - this.parent.scopes[this.index] = last; - last.index = this.index; - } + if (tag === "math") { + return 2; } - this.parent = void 0; - this._active = false; } + return ns; } -} -function effectScope(detached) { - return new EffectScope(detached); -} -function recordEffectScope(effect, scope = activeEffectScope) { - if (scope && scope.active) { - scope.effects.push(effect); +}; + +const transformStyle = (node) => { + if (node.type === 1) { + node.props.forEach((p, i) => { + if (p.type === 6 && p.name === "style" && p.value) { + node.props[i] = { + type: 7, + name: `bind`, + arg: (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`style`, true, p.loc), + exp: parseInlineCSS(p.value.content, p.loc), + modifiers: [], + loc: p.loc + }; + } + }); } +}; +const parseInlineCSS = (cssText, loc) => { + const normalized = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.parseStringStyle)(cssText); + return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)( + JSON.stringify(normalized), + false, + loc, + 3 + ); +}; + +function createDOMCompilerError(code, loc) { + return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompilerError)( + code, + loc, + true ? DOMErrorMessages : 0 + ); } -function getCurrentScope() { - return activeEffectScope; -} -function onScopeDispose(fn) { - if (activeEffectScope) { - activeEffectScope.cleanups.push(fn); - } else if (true) { - warn( - `onScopeDispose() is called when there is no active effect scope to be associated with.` +const DOMErrorCodes = { + "X_V_HTML_NO_EXPRESSION": 53, + "53": "X_V_HTML_NO_EXPRESSION", + "X_V_HTML_WITH_CHILDREN": 54, + "54": "X_V_HTML_WITH_CHILDREN", + "X_V_TEXT_NO_EXPRESSION": 55, + "55": "X_V_TEXT_NO_EXPRESSION", + "X_V_TEXT_WITH_CHILDREN": 56, + "56": "X_V_TEXT_WITH_CHILDREN", + "X_V_MODEL_ON_INVALID_ELEMENT": 57, + "57": "X_V_MODEL_ON_INVALID_ELEMENT", + "X_V_MODEL_ARG_ON_ELEMENT": 58, + "58": "X_V_MODEL_ARG_ON_ELEMENT", + "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, + "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", + "X_V_MODEL_UNNECESSARY_VALUE": 60, + "60": "X_V_MODEL_UNNECESSARY_VALUE", + "X_V_SHOW_NO_EXPRESSION": 61, + "61": "X_V_SHOW_NO_EXPRESSION", + "X_TRANSITION_INVALID_CHILDREN": 62, + "62": "X_TRANSITION_INVALID_CHILDREN", + "X_IGNORED_SIDE_EFFECT_TAG": 63, + "63": "X_IGNORED_SIDE_EFFECT_TAG", + "__EXTEND_POINT__": 64, + "64": "__EXTEND_POINT__" +}; +const DOMErrorMessages = { + [53]: `v-html is missing expression.`, + [54]: `v-html will override element children.`, + [55]: `v-text is missing expression.`, + [56]: `v-text will override element children.`, + [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, + [58]: `v-model argument is not supported on plain elements.`, + [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, + [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, + [61]: `v-show is missing expression.`, + [62]: `<Transition> expects exactly one child element or component.`, + [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` +}; + +const transformVHtml = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(53, loc) ); } -} - -const createDep = (effects) => { - const dep = new Set(effects); - dep.w = 0; - dep.n = 0; - return dep; -}; -const wasTracked = (dep) => (dep.w & trackOpBit) > 0; -const newTracked = (dep) => (dep.n & trackOpBit) > 0; -const initDepMarkers = ({ deps }) => { - if (deps.length) { - for (let i = 0; i < deps.length; i++) { - deps[i].w |= trackOpBit; - } + if (node.children.length) { + context.onError( + createDOMCompilerError(54, loc) + ); + node.children.length = 0; } + return { + props: [ + (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( + (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`innerHTML`, true, loc), + exp || (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) + ) + ] + }; }; -const finalizeDepMarkers = (effect) => { - const { deps } = effect; - if (deps.length) { - let ptr = 0; - for (let i = 0; i < deps.length; i++) { - const dep = deps[i]; - if (wasTracked(dep) && !newTracked(dep)) { - dep.delete(effect); - } else { - deps[ptr++] = dep; - } - dep.w &= ~trackOpBit; - dep.n &= ~trackOpBit; - } - deps.length = ptr; + +const transformVText = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(55, loc) + ); + } + if (node.children.length) { + context.onError( + createDOMCompilerError(56, loc) + ); + node.children.length = 0; } + return { + props: [ + (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)( + (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`textContent`, true), + exp ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.getConstantType)(exp, context) > 0 ? exp : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)( + context.helperString(_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.TO_DISPLAY_STRING), + [exp], + loc + ) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)("", true) + ) + ] + }; }; -const targetMap = /* @__PURE__ */ new WeakMap(); -let effectTrackDepth = 0; -let trackOpBit = 1; -const maxMarkerBits = 30; -let activeEffect; -const ITERATE_KEY = Symbol( true ? "iterate" : 0); -const MAP_KEY_ITERATE_KEY = Symbol( true ? "Map key iterate" : 0); -class ReactiveEffect { - constructor(fn, scheduler = null, scope) { - this.fn = fn; - this.scheduler = scheduler; - this.active = true; - this.deps = []; - this.parent = void 0; - recordEffectScope(this, scope); +const transformModel = (dir, node, context) => { + const baseResult = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformModel)(dir, node, context); + if (!baseResult.props.length || node.tagType === 1) { + return baseResult; } - run() { - if (!this.active) { - return this.fn(); - } - let parent = activeEffect; - let lastShouldTrack = shouldTrack; - while (parent) { - if (parent === this) { - return; - } - parent = parent.parent; - } - try { - this.parent = activeEffect; - activeEffect = this; - shouldTrack = true; - trackOpBit = 1 << ++effectTrackDepth; - if (effectTrackDepth <= maxMarkerBits) { - initDepMarkers(this); - } else { - cleanupEffect(this); - } - return this.fn(); - } finally { - if (effectTrackDepth <= maxMarkerBits) { - finalizeDepMarkers(this); - } - trackOpBit = 1 << --effectTrackDepth; - activeEffect = this.parent; - shouldTrack = lastShouldTrack; - this.parent = void 0; - if (this.deferStop) { - this.stop(); - } - } - } - stop() { - if (activeEffect === this) { - this.deferStop = true; - } else if (this.active) { - cleanupEffect(this); - if (this.onStop) { - this.onStop(); - } - this.active = false; - } - } -} -function cleanupEffect(effect2) { - const { deps } = effect2; - if (deps.length) { - for (let i = 0; i < deps.length; i++) { - deps[i].delete(effect2); - } - deps.length = 0; - } -} -function effect(fn, options) { - if (fn.effect) { - fn = fn.effect.fn; - } - const _effect = new ReactiveEffect(fn); - if (options) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)(_effect, options); - if (options.scope) - recordEffectScope(_effect, options.scope); - } - if (!options || !options.lazy) { - _effect.run(); - } - const runner = _effect.run.bind(_effect); - runner.effect = _effect; - return runner; -} -function stop(runner) { - runner.effect.stop(); -} -let shouldTrack = true; -const trackStack = []; -function pauseTracking() { - trackStack.push(shouldTrack); - shouldTrack = false; -} -function enableTracking() { - trackStack.push(shouldTrack); - shouldTrack = true; -} -function resetTracking() { - const last = trackStack.pop(); - shouldTrack = last === void 0 ? true : last; -} -function track(target, type, key) { - if (shouldTrack && activeEffect) { - let depsMap = targetMap.get(target); - if (!depsMap) { - targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); - } - let dep = depsMap.get(key); - if (!dep) { - depsMap.set(key, dep = createDep()); - } - const eventInfo = true ? { effect: activeEffect, target, type, key } : 0; - trackEffects(dep, eventInfo); + if (dir.arg) { + context.onError( + createDOMCompilerError( + 58, + dir.arg.loc + ) + ); } -} -function trackEffects(dep, debuggerEventExtraInfo) { - let shouldTrack2 = false; - if (effectTrackDepth <= maxMarkerBits) { - if (!newTracked(dep)) { - dep.n |= trackOpBit; - shouldTrack2 = !wasTracked(dep); - } - } else { - shouldTrack2 = !dep.has(activeEffect); - } - if (shouldTrack2) { - dep.add(activeEffect); - activeEffect.deps.push(dep); - if ( true && activeEffect.onTrack) { - activeEffect.onTrack( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( - { - effect: activeEffect - }, - debuggerEventExtraInfo + function checkDuplicatedValue() { + const value = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findDir)(node, "bind"); + if (value && (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticArgOf)(value.arg, "value")) { + context.onError( + createDOMCompilerError( + 60, + value.loc ) ); } } -} -function trigger(target, type, key, newValue, oldValue, oldTarget) { - const depsMap = targetMap.get(target); - if (!depsMap) { - return; - } - let deps = []; - if (type === "clear") { - deps = [...depsMap.values()]; - } else if (key === "length" && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { - const newLength = Number(newValue); - depsMap.forEach((dep, key2) => { - if (key2 === "length" || key2 >= newLength) { - deps.push(dep); - } - }); - } else { - if (key !== void 0) { - deps.push(depsMap.get(key)); - } - switch (type) { - case "add": - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key)) { - deps.push(depsMap.get("length")); - } - break; - case "delete": - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { - deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + const { tag } = node; + const isCustomElement = context.isCustomElement(tag); + if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { + let directiveToUse = V_MODEL_TEXT; + let isInvalidType = false; + if (tag === "input" || isCustomElement) { + const type = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.findProp)(node, `type`); + if (type) { + if (type.type === 7) { + directiveToUse = V_MODEL_DYNAMIC; + } else if (type.value) { + switch (type.value.content) { + case "radio": + directiveToUse = V_MODEL_RADIO; + break; + case "checkbox": + directiveToUse = V_MODEL_CHECKBOX; + break; + case "file": + isInvalidType = true; + context.onError( + createDOMCompilerError( + 59, + dir.loc + ) + ); + break; + default: + true && checkDuplicatedValue(); + break; } } - break; - case "set": - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { - deps.push(depsMap.get(ITERATE_KEY)); - } - break; + } else if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.hasDynamicKeyVBind)(node)) { + directiveToUse = V_MODEL_DYNAMIC; + } else { + true && checkDuplicatedValue(); + } + } else if (tag === "select") { + directiveToUse = V_MODEL_SELECT; + } else { + true && checkDuplicatedValue(); } - } - const eventInfo = true ? { target, type, key, newValue, oldValue, oldTarget } : 0; - if (deps.length === 1) { - if (deps[0]) { - if (true) { - triggerEffects(deps[0], eventInfo); - } else {} + if (!isInvalidType) { + baseResult.needRuntime = context.helper(directiveToUse); } } else { - const effects = []; - for (const dep of deps) { - if (dep) { - effects.push(...dep); - } - } - if (true) { - triggerEffects(createDep(effects), eventInfo); - } else {} + context.onError( + createDOMCompilerError( + 57, + dir.loc + ) + ); } -} -function triggerEffects(dep, debuggerEventExtraInfo) { - const effects = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(dep) ? dep : [...dep]; - for (const effect2 of effects) { - if (effect2.computed) { - triggerEffect(effect2, debuggerEventExtraInfo); + baseResult.props = baseResult.props.filter( + (p) => !(p.key.type === 4 && p.key.content === "modelValue") + ); + return baseResult; +}; + +const isEventOptionModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)(`passive,once,capture`); +const isNonKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( + // event propagation management + `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` +); +const maybeKeyModifier = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("left,right"); +const isKeyboardEvent = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( + `onkeyup,onkeydown,onkeypress`, + true +); +const resolveModifiers = (key, modifiers, context, loc) => { + const keyModifiers = []; + const nonKeyModifiers = []; + const eventOptionModifiers = []; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + if (modifier === "native" && (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.checkCompatEnabled)( + "COMPILER_V_ON_NATIVE", + context, + loc + )) { + eventOptionModifiers.push(modifier); + } else if (isEventOptionModifier(modifier)) { + eventOptionModifiers.push(modifier); + } else { + if (maybeKeyModifier(modifier)) { + if ((0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key)) { + if (isKeyboardEvent(key.content)) { + keyModifiers.push(modifier); + } else { + nonKeyModifiers.push(modifier); + } + } else { + keyModifiers.push(modifier); + nonKeyModifiers.push(modifier); + } + } else { + if (isNonKeyModifier(modifier)) { + nonKeyModifiers.push(modifier); + } else { + keyModifiers.push(modifier); + } + } } } - for (const effect2 of effects) { - if (!effect2.computed) { - triggerEffect(effect2, debuggerEventExtraInfo); + return { + keyModifiers, + nonKeyModifiers, + eventOptionModifiers + }; +}; +const transformClick = (key, event) => { + const isStaticClick = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) && key.content.toLowerCase() === "onclick"; + return isStaticClick ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(event, true) : key.type !== 4 ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([ + `(`, + key, + `) === "onClick" ? "${event}" : (`, + key, + `)` + ]) : key; +}; +const transformOn = (dir, node, context) => { + return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.transformOn)(dir, node, context, (baseResult) => { + const { modifiers } = dir; + if (!modifiers.length) + return baseResult; + let { key, value: handlerExp } = baseResult.props[0]; + const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); + if (nonKeyModifiers.includes("right")) { + key = transformClick(key, `onContextmenu`); } - } -} -function triggerEffect(effect2, debuggerEventExtraInfo) { - if (effect2 !== activeEffect || effect2.allowRecurse) { - if ( true && effect2.onTrigger) { - effect2.onTrigger((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({ effect: effect2 }, debuggerEventExtraInfo)); + if (nonKeyModifiers.includes("middle")) { + key = transformClick(key, `onMouseup`); } - if (effect2.scheduler) { - effect2.scheduler(); - } else { - effect2.run(); + if (nonKeyModifiers.length) { + handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [ + handlerExp, + JSON.stringify(nonKeyModifiers) + ]); } - } -} -function getDepFromReactive(object, key) { - var _a; - return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key); -} - -const isNonTrackableKeys = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.makeMap)(`__proto__,__v_isRef,__isVue`); -const builtInSymbols = new Set( - /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol) -); -const get$1 = /* @__PURE__ */ createGetter(); -const shallowGet = /* @__PURE__ */ createGetter(false, true); -const readonlyGet = /* @__PURE__ */ createGetter(true); -const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); -const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); -function createArrayInstrumentations() { - const instrumentations = {}; - ["includes", "indexOf", "lastIndexOf"].forEach((key) => { - instrumentations[key] = function(...args) { - const arr = toRaw(this); - for (let i = 0, l = this.length; i < l; i++) { - track(arr, "get", i + ""); - } - const res = arr[key](...args); - if (res === -1 || res === false) { - return arr[key](...args.map(toRaw)); - } else { - return res; - } - }; - }); - ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { - instrumentations[key] = function(...args) { - pauseTracking(); - const res = toRaw(this)[key].apply(this, args); - resetTracking(); - return res; - }; - }); - return instrumentations; -} -function hasOwnProperty(key) { - const obj = toRaw(this); - track(obj, "has", key); - return obj.hasOwnProperty(key); -} -function createGetter(isReadonly2 = false, shallow = false) { - return function get2(target, key, receiver) { - if (key === "__v_isReactive") { - return !isReadonly2; - } else if (key === "__v_isReadonly") { - return isReadonly2; - } else if (key === "__v_isShallow") { - return shallow; - } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { - return target; - } - const targetIsArray = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target); - if (!isReadonly2) { - if (targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(arrayInstrumentations, key)) { - return Reflect.get(arrayInstrumentations, key, receiver); - } - if (key === "hasOwnProperty") { - return hasOwnProperty; - } - } - const res = Reflect.get(target, key, receiver); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { - return res; - } - if (!isReadonly2) { - track(target, "get", key); - } - if (shallow) { - return res; - } - if (isRef(res)) { - return targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? res : res.value; - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(res)) { - return isReadonly2 ? readonly(res) : reactive(res); - } - return res; - }; -} -const set$1 = /* @__PURE__ */ createSetter(); -const shallowSet = /* @__PURE__ */ createSetter(true); -function createSetter(shallow = false) { - return function set2(target, key, value, receiver) { - let oldValue = target[key]; - if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { - return false; - } - if (!shallow) { - if (!isShallow(value) && !isReadonly(value)) { - oldValue = toRaw(oldValue); - value = toRaw(value); - } - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } + if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard + (!(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) || isKeyboardEvent(key.content))) { + handlerExp = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCallExpression)(context.helper(V_ON_WITH_KEYS), [ + handlerExp, + JSON.stringify(keyModifiers) + ]); } - const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? Number(key) < target.length : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); - const result = Reflect.set(target, key, value, receiver); - if (target === toRaw(receiver)) { - if (!hadKey) { - trigger(target, "add", key, value); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { - trigger(target, "set", key, value, oldValue); - } + if (eventOptionModifiers.length) { + const modifierPostfix = eventOptionModifiers.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(""); + key = (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.isStaticExp)(key) ? (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createCompoundExpression)([`(`, key, `) + "${modifierPostfix}"`]); } - return result; - }; -} -function deleteProperty(target, key) { - const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); - const oldValue = target[key]; - const result = Reflect.deleteProperty(target, key); - if (result && hadKey) { - trigger(target, "delete", key, void 0, oldValue); - } - return result; -} -function has$1(target, key) { - const result = Reflect.has(target, key); - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) || !builtInSymbols.has(key)) { - track(target, "has", key); - } - return result; -} -function ownKeys(target) { - track(target, "iterate", (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) ? "length" : ITERATE_KEY); - return Reflect.ownKeys(target); -} -const mutableHandlers = { - get: get$1, - set: set$1, - deleteProperty, - has: has$1, - ownKeys + return { + props: [(0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.createObjectProperty)(key, handlerExp)] + }; + }); }; -const readonlyHandlers = { - get: readonlyGet, - set(target, key) { - if (true) { - warn( - `Set operation on key "${String(key)}" failed: target is readonly.`, - target - ); - } - return true; - }, - deleteProperty(target, key) { - if (true) { - warn( - `Delete operation on key "${String(key)}" failed: target is readonly.`, - target - ); - } - return true; + +const transformShow = (dir, node, context) => { + const { exp, loc } = dir; + if (!exp) { + context.onError( + createDOMCompilerError(61, loc) + ); } + return { + props: [], + needRuntime: context.helper(V_SHOW) + }; }; -const shallowReactiveHandlers = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( - {}, - mutableHandlers, - { - get: shallowGet, - set: shallowSet - } -); -const shallowReadonlyHandlers = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)( - {}, - readonlyHandlers, - { - get: shallowReadonlyGet - } -); -const toShallow = (value) => value; -const getProto = (v) => Reflect.getPrototypeOf(v); -function get(target, key, isReadonly = false, isShallow = false) { - target = target["__v_raw"]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!isReadonly) { - if (key !== rawKey) { - track(rawTarget, "get", key); - } - track(rawTarget, "get", rawKey); - } - const { has: has2 } = getProto(rawTarget); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - if (has2.call(rawTarget, key)) { - return wrap(target.get(key)); - } else if (has2.call(rawTarget, rawKey)) { - return wrap(target.get(rawKey)); - } else if (target !== rawTarget) { - target.get(key); - } -} -function has(key, isReadonly = false) { - const target = this["__v_raw"]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!isReadonly) { - if (key !== rawKey) { - track(rawTarget, "has", key); +const transformTransition = (node, context) => { + if (node.type === 1 && node.tagType === 1) { + const component = context.isBuiltInComponent(node.tag); + if (component === TRANSITION) { + return () => { + if (!node.children.length) { + return; + } + if (hasMultipleChildren(node)) { + context.onError( + createDOMCompilerError( + 62, + { + start: node.children[0].loc.start, + end: node.children[node.children.length - 1].loc.end, + source: "" + } + ) + ); + } + const child = node.children[0]; + if (child.type === 1) { + for (const p of child.props) { + if (p.type === 7 && p.name === "show") { + node.props.push({ + type: 6, + name: "persisted", + nameLoc: node.loc, + value: void 0, + loc: node.loc + }); + } + } + } + }; } - track(rawTarget, "has", rawKey); } - return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); -} -function size(target, isReadonly = false) { - target = target["__v_raw"]; - !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); - return Reflect.get(target, "size", target); +}; +function hasMultipleChildren(node) { + const children = node.children = node.children.filter( + (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) + ); + const child = children[0]; + return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); } -function add(value) { - value = toRaw(value); - const target = toRaw(this); - const proto = getProto(target); - const hadKey = proto.has.call(target, value); - if (!hadKey) { - target.add(value); - trigger(target, "add", value, value); + +const ignoreSideEffectTags = (node, context) => { + if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { + true && context.onError( + createDOMCompilerError( + 63, + node.loc + ) + ); + context.removeNode(); } - return this; -} -function set(key, value) { - value = toRaw(value); - const target = toRaw(this); - const { has: has2, get: get2 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else if (true) { - checkIdentityKeys(target, has2, key); +}; + +const DOMNodeTransforms = [ + transformStyle, + ... true ? [transformTransition] : 0 +]; +const DOMDirectiveTransforms = { + cloak: _vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.noopDirectiveTransform, + html: transformVHtml, + text: transformVText, + model: transformModel, + // override compiler-core + on: transformOn, + // override compiler-core + show: transformShow +}; +function compile(src, options = {}) { + return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseCompile)( + src, + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options, { + nodeTransforms: [ + // ignore <script> and <tag> + // this is not put inside DOMNodeTransforms because that list is used + // by compiler-ssr to generate vnode fallback branches + ignoreSideEffectTags, + ...DOMNodeTransforms, + ...options.nodeTransforms || [] + ], + directiveTransforms: (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + {}, + DOMDirectiveTransforms, + options.directiveTransforms || {} + ), + transformHoist: null + }) + ); +} +function parse(template, options = {}) { + return (0,_vue_compiler_core__WEBPACK_IMPORTED_MODULE_0__.baseParse)(template, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, parserOptions, options)); +} + + + + +/***/ }), + +/***/ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ EffectScope: () => (/* binding */ EffectScope), +/* harmony export */ ITERATE_KEY: () => (/* binding */ ITERATE_KEY), +/* harmony export */ ReactiveEffect: () => (/* binding */ ReactiveEffect), +/* harmony export */ ReactiveFlags: () => (/* binding */ ReactiveFlags), +/* harmony export */ TrackOpTypes: () => (/* binding */ TrackOpTypes), +/* harmony export */ TriggerOpTypes: () => (/* binding */ TriggerOpTypes), +/* harmony export */ computed: () => (/* binding */ computed), +/* harmony export */ customRef: () => (/* binding */ customRef), +/* harmony export */ deferredComputed: () => (/* binding */ deferredComputed), +/* harmony export */ effect: () => (/* binding */ effect), +/* harmony export */ effectScope: () => (/* binding */ effectScope), +/* harmony export */ enableTracking: () => (/* binding */ enableTracking), +/* harmony export */ getCurrentScope: () => (/* binding */ getCurrentScope), +/* harmony export */ isProxy: () => (/* binding */ isProxy), +/* harmony export */ isReactive: () => (/* binding */ isReactive), +/* harmony export */ isReadonly: () => (/* binding */ isReadonly), +/* harmony export */ isRef: () => (/* binding */ isRef), +/* harmony export */ isShallow: () => (/* binding */ isShallow), +/* harmony export */ markRaw: () => (/* binding */ markRaw), +/* harmony export */ onScopeDispose: () => (/* binding */ onScopeDispose), +/* harmony export */ pauseScheduling: () => (/* binding */ pauseScheduling), +/* harmony export */ pauseTracking: () => (/* binding */ pauseTracking), +/* harmony export */ proxyRefs: () => (/* binding */ proxyRefs), +/* harmony export */ reactive: () => (/* binding */ reactive), +/* harmony export */ readonly: () => (/* binding */ readonly), +/* harmony export */ ref: () => (/* binding */ ref), +/* harmony export */ resetScheduling: () => (/* binding */ resetScheduling), +/* harmony export */ resetTracking: () => (/* binding */ resetTracking), +/* harmony export */ shallowReactive: () => (/* binding */ shallowReactive), +/* harmony export */ shallowReadonly: () => (/* binding */ shallowReadonly), +/* harmony export */ shallowRef: () => (/* binding */ shallowRef), +/* harmony export */ stop: () => (/* binding */ stop), +/* harmony export */ toRaw: () => (/* binding */ toRaw), +/* harmony export */ toRef: () => (/* binding */ toRef), +/* harmony export */ toRefs: () => (/* binding */ toRefs), +/* harmony export */ toValue: () => (/* binding */ toValue), +/* harmony export */ track: () => (/* binding */ track), +/* harmony export */ trigger: () => (/* binding */ trigger), +/* harmony export */ triggerRef: () => (/* binding */ triggerRef), +/* harmony export */ unref: () => (/* binding */ unref) +/* harmony export */ }); +/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); + + +function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } } - const oldValue = get2.call(target, key); - target.set(key, value); - if (!hadKey) { - trigger(target, "add", key, value); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { - trigger(target, "set", key, value, oldValue); + get active() { + return this._active; } - return this; -} -function deleteEntry(key) { - const target = toRaw(this); - const { has: has2, get: get2 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else if (true) { - checkIdentityKeys(target, has2, key); + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else if (true) { + warn(`cannot run an inactive effect scope.`); + } } - const oldValue = get2 ? get2.call(target, key) : void 0; - const result = target.delete(key); - if (hadKey) { - trigger(target, "delete", key, void 0, oldValue); + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + this._active = false; + } } - return result; } -function clear() { - const target = toRaw(this); - const hadItems = target.size !== 0; - const oldTarget = true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target) ? new Map(target) : new Set(target) : 0; - const result = target.clear(); - if (hadItems) { - trigger(target, "clear", void 0, void 0, oldTarget); +function effectScope(detached) { + return new EffectScope(detached); +} +function recordEffectScope(effect, scope = activeEffectScope) { + if (scope && scope.active) { + scope.effects.push(effect); } - return result; } -function createForEach(isReadonly, isShallow) { - return function forEach(callback, thisArg) { - const observed = this; - const target = observed["__v_raw"]; - const rawTarget = toRaw(target); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); - return target.forEach((value, key) => { - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - }; +function getCurrentScope() { + return activeEffectScope; } -function createIterableMethod(method, isReadonly, isShallow) { - return function(...args) { - const target = this["__v_raw"]; - const rawTarget = toRaw(target); - const targetIsMap = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(rawTarget); - const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; - const isKeyOnly = method === "keys" && targetIsMap; - const innerIterator = target[method](...args); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track( - rawTarget, - "iterate", - isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY +function onScopeDispose(fn) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (true) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` ); - return { - // iterator protocol - next() { - const { value, done } = innerIterator.next(); - return done ? { value, done } : { - value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), - done - }; - }, - // iterable protocol - [Symbol.iterator]() { - return this; - } - }; - }; + } } -function createReadonlyMethod(type) { - return function(...args) { - if (true) { - const key = args[0] ? `on key "${args[0]}" ` : ``; - console.warn( - `${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)(type)} operation ${key}failed: target is readonly.`, - toRaw(this) - ); + +let activeEffect; +class ReactiveEffect { + constructor(fn, trigger, scheduler, scope) { + this.fn = fn; + this.trigger = trigger; + this.scheduler = scheduler; + this.active = true; + this.deps = []; + /** + * @internal + */ + this._dirtyLevel = 3; + /** + * @internal + */ + this._trackId = 0; + /** + * @internal + */ + this._runnings = 0; + /** + * @internal + */ + this._queryings = 0; + /** + * @internal + */ + this._depsLength = 0; + recordEffectScope(this, scope); + } + get dirty() { + if (this._dirtyLevel === 1) { + this._dirtyLevel = 0; + this._queryings++; + pauseTracking(); + for (const dep of this.deps) { + if (dep.computed) { + triggerComputed(dep.computed); + if (this._dirtyLevel >= 2) { + break; + } + } + } + resetTracking(); + this._queryings--; } - return type === "delete" ? false : this; - }; + return this._dirtyLevel >= 2; + } + set dirty(v) { + this._dirtyLevel = v ? 3 : 0; + } + run() { + this._dirtyLevel = 0; + if (!this.active) { + return this.fn(); + } + let lastShouldTrack = shouldTrack; + let lastEffect = activeEffect; + try { + shouldTrack = true; + activeEffect = this; + this._runnings++; + preCleanupEffect(this); + return this.fn(); + } finally { + postCleanupEffect(this); + this._runnings--; + activeEffect = lastEffect; + shouldTrack = lastShouldTrack; + } + } + stop() { + var _a; + if (this.active) { + preCleanupEffect(this); + postCleanupEffect(this); + (_a = this.onStop) == null ? void 0 : _a.call(this); + this.active = false; + } + } } -function createInstrumentations() { - const mutableInstrumentations2 = { - get(key) { - return get(this, key); - }, - get size() { - return size(this); - }, - has, - add, - set, - delete: deleteEntry, - clear, - forEach: createForEach(false, false) - }; - const shallowInstrumentations2 = { - get(key) { - return get(this, key, false, true); - }, - get size() { - return size(this); - }, - has, - add, - set, - delete: deleteEntry, - clear, - forEach: createForEach(false, true) - }; - const readonlyInstrumentations2 = { - get(key) { - return get(this, key, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has.call(this, key, true); - }, - add: createReadonlyMethod("add"), - set: createReadonlyMethod("set"), - delete: createReadonlyMethod("delete"), - clear: createReadonlyMethod("clear"), - forEach: createForEach(true, false) - }; - const shallowReadonlyInstrumentations2 = { - get(key) { - return get(this, key, true, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has.call(this, key, true); - }, - add: createReadonlyMethod("add"), - set: createReadonlyMethod("set"), - delete: createReadonlyMethod("delete"), - clear: createReadonlyMethod("clear"), - forEach: createForEach(true, true) - }; - const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; - iteratorMethods.forEach((method) => { - mutableInstrumentations2[method] = createIterableMethod( - method, - false, - false - ); - readonlyInstrumentations2[method] = createIterableMethod( - method, - true, - false - ); - shallowInstrumentations2[method] = createIterableMethod( - method, - false, - true - ); - shallowReadonlyInstrumentations2[method] = createIterableMethod( - method, - true, - true - ); - }); - return [ - mutableInstrumentations2, - readonlyInstrumentations2, - shallowInstrumentations2, - shallowReadonlyInstrumentations2 - ]; +function triggerComputed(computed) { + return computed.value; } -const [ - mutableInstrumentations, - readonlyInstrumentations, - shallowInstrumentations, - shallowReadonlyInstrumentations -] = /* @__PURE__ */ createInstrumentations(); -function createInstrumentationGetter(isReadonly, shallow) { - const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; - return (target, key, receiver) => { - if (key === "__v_isReactive") { - return !isReadonly; - } else if (key === "__v_isReadonly") { - return isReadonly; - } else if (key === "__v_raw") { - return target; +function preCleanupEffect(effect2) { + effect2._trackId++; + effect2._depsLength = 0; +} +function postCleanupEffect(effect2) { + if (effect2.deps && effect2.deps.length > effect2._depsLength) { + for (let i = effect2._depsLength; i < effect2.deps.length; i++) { + cleanupDepEffect(effect2.deps[i], effect2); } - return Reflect.get( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(instrumentations, key) && key in target ? instrumentations : target, - key, - receiver - ); - }; + effect2.deps.length = effect2._depsLength; + } } -const mutableCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, false) -}; -const shallowCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, true) -}; -const readonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, false) -}; -const shallowReadonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, true) -}; -function checkIdentityKeys(target, has2, key) { - const rawKey = toRaw(key); - if (rawKey !== key && has2.call(target, rawKey)) { - const type = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(target); - console.warn( - `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` - ); +function cleanupDepEffect(dep, effect2) { + const trackId = dep.get(effect2); + if (trackId !== void 0 && effect2._trackId !== trackId) { + dep.delete(effect2); + if (dep.size === 0) { + dep.cleanup(); + } } } - -const reactiveMap = /* @__PURE__ */ new WeakMap(); -const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); -const readonlyMap = /* @__PURE__ */ new WeakMap(); -const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); -function targetTypeMap(rawType) { - switch (rawType) { - case "Object": - case "Array": - return 1 /* COMMON */; - case "Map": - case "Set": - case "WeakMap": - case "WeakSet": - return 2 /* COLLECTION */; - default: - return 0 /* INVALID */; +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const _effect = new ReactiveEffect(fn, _vue_shared__WEBPACK_IMPORTED_MODULE_0__.NOOP, () => { + if (_effect.dirty) { + _effect.run(); + } + }); + if (options) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)(_effect, options); + if (options.scope) + recordEffectScope(_effect, options.scope); + } + if (!options || !options.lazy) { + _effect.run(); } + const runner = _effect.run.bind(_effect); + runner.effect = _effect; + return runner; } -function getTargetType(value) { - return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(value)); +function stop(runner) { + runner.effect.stop(); } -function reactive(target) { - if (isReadonly(target)) { - return target; - } - return createReactiveObject( - target, - false, - mutableHandlers, - mutableCollectionHandlers, - reactiveMap - ); +let shouldTrack = true; +let pauseScheduleStack = 0; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; } -function shallowReactive(target) { - return createReactiveObject( - target, - false, - shallowReactiveHandlers, - shallowCollectionHandlers, - shallowReactiveMap - ); +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; } -function readonly(target) { - return createReactiveObject( - target, - true, - readonlyHandlers, - readonlyCollectionHandlers, - readonlyMap - ); +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; } -function shallowReadonly(target) { - return createReactiveObject( - target, - true, - shallowReadonlyHandlers, - shallowReadonlyCollectionHandlers, - shallowReadonlyMap - ); +function pauseScheduling() { + pauseScheduleStack++; } -function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(target)) { +function resetScheduling() { + pauseScheduleStack--; + while (!pauseScheduleStack && queueEffectSchedulers.length) { + queueEffectSchedulers.shift()(); + } +} +function trackEffect(effect2, dep, debuggerEventExtraInfo) { + var _a; + if (dep.get(effect2) !== effect2._trackId) { + dep.set(effect2, effect2._trackId); + const oldDep = effect2.deps[effect2._depsLength]; + if (oldDep !== dep) { + if (oldDep) { + cleanupDepEffect(oldDep, effect2); + } + effect2.deps[effect2._depsLength++] = dep; + } else { + effect2._depsLength++; + } if (true) { - console.warn(`value cannot be made reactive: ${String(target)}`); + (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({ effect: effect2 }, debuggerEventExtraInfo)); } - return target; - } - if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { - return target; - } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } - const targetType = getTargetType(target); - if (targetType === 0 /* INVALID */) { - return target; } - const proxy = new Proxy( - target, - targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers - ); - proxyMap.set(target, proxy); - return proxy; } -function isReactive(value) { - if (isReadonly(value)) { - return isReactive(value["__v_raw"]); +const queueEffectSchedulers = []; +function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) { + var _a; + pauseScheduling(); + for (const effect2 of dep.keys()) { + if (!effect2.allowRecurse && effect2._runnings) { + continue; + } + if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) { + const lastDirtyLevel = effect2._dirtyLevel; + effect2._dirtyLevel = dirtyLevel; + if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) { + if (true) { + (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.extend)({ effect: effect2 }, debuggerEventExtraInfo)); + } + effect2.trigger(); + if (effect2.scheduler) { + queueEffectSchedulers.push(effect2.scheduler); + } + } + } } - return !!(value && value["__v_isReactive"]); -} -function isReadonly(value) { - return !!(value && value["__v_isReadonly"]); -} -function isShallow(value) { - return !!(value && value["__v_isShallow"]); -} -function isProxy(value) { - return isReactive(value) || isReadonly(value); -} -function toRaw(observed) { - const raw = observed && observed["__v_raw"]; - return raw ? toRaw(raw) : observed; -} -function markRaw(value) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.def)(value, "__v_skip", true); - return value; + resetScheduling(); } -const toReactive = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? reactive(value) : value; -const toReadonly = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? readonly(value) : value; -function trackRefValue(ref2) { +const createDep = (cleanup, computed) => { + const dep = /* @__PURE__ */ new Map(); + dep.cleanup = cleanup; + dep.computed = computed; + return dep; +}; + +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol( true ? "iterate" : 0); +const MAP_KEY_ITERATE_KEY = Symbol( true ? "Map key iterate" : 0); +function track(target, type, key) { if (shouldTrack && activeEffect) { - ref2 = toRaw(ref2); - if (true) { - trackEffects(ref2.dep || (ref2.dep = createDep()), { - target: ref2, - type: "get", - key: "value" - }); - } else {} - } -} -function triggerRefValue(ref2, newVal) { - ref2 = toRaw(ref2); - const dep = ref2.dep; - if (dep) { - if (true) { - triggerEffects(dep, { - target: ref2, - type: "set", - key: "value", - newValue: newVal - }); - } else {} - } -} -function isRef(r) { - return !!(r && r.__v_isRef === true); -} -function ref(value) { - return createRef(value, false); -} -function shallowRef(value) { - return createRef(value, true); -} -function createRef(rawValue, shallow) { - if (isRef(rawValue)) { - return rawValue; + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = createDep(() => depsMap.delete(key))); + } + trackEffect( + activeEffect, + dep, + true ? { + target, + type, + key + } : 0 + ); } - return new RefImpl(rawValue, shallow); } -class RefImpl { - constructor(value, __v_isShallow) { - this.__v_isShallow = __v_isShallow; - this.dep = void 0; - this.__v_isRef = true; - this._rawValue = __v_isShallow ? value : toRaw(value); - this._value = __v_isShallow ? value : toReactive(value); +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; } - get value() { - trackRefValue(this); - return this._value; + let deps = []; + if (type === "clear") { + deps = [...depsMap.values()]; + } else if (key === "length" && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key2) && key2 >= newLength) { + deps.push(dep); + } + }); + } else { + if (key !== void 0) { + deps.push(depsMap.get(key)); + } + switch (type) { + case "add": + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key)) { + deps.push(depsMap.get("length")); + } + break; + case "delete": + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + } + break; + } } - set value(newVal) { - const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); - newVal = useDirectValue ? newVal : toRaw(newVal); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(newVal, this._rawValue)) { - this._rawValue = newVal; - this._value = useDirectValue ? newVal : toReactive(newVal); - triggerRefValue(this, newVal); + pauseScheduling(); + for (const dep of deps) { + if (dep) { + triggerEffects( + dep, + 3, + true ? { + target, + type, + key, + newValue, + oldValue, + oldTarget + } : 0 + ); } } + resetScheduling(); } -function triggerRef(ref2) { - triggerRefValue(ref2, true ? ref2.value : 0); -} -function unref(ref2) { - return isRef(ref2) ? ref2.value : ref2; +function getDepFromReactive(object, key) { + var _a; + return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key); } -function toValue(source) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source) ? source() : unref(source); + +const isNonTrackableKeys = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.makeMap)(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol) +); +const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); +function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw(this); + for (let i = 0, l = this.length; i < l; i++) { + track(arr, "get", i + ""); + } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw)); + } else { + return res; + } + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + pauseScheduling(); + const res = toRaw(this)[key].apply(this, args); + resetScheduling(); + resetTracking(); + return res; + }; + }); + return instrumentations; } -const shallowUnwrapHandlers = { - get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), - set: (target, key, value, receiver) => { - const oldValue = target[key]; - if (isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } else { - return Reflect.set(target, key, value, receiver); - } - } -}; -function proxyRefs(objectWithRefs) { - return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +function hasOwnProperty(key) { + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); } -class CustomRefImpl { - constructor(factory) { - this.dep = void 0; - this.__v_isRef = true; - const { get, set } = factory( - () => trackRefValue(this), - () => triggerRefValue(this) - ); - this._get = get; - this._set = set; - } - get value() { - return this._get(); +class BaseReactiveHandler { + constructor(_isReadonly = false, _shallow = false) { + this._isReadonly = _isReadonly; + this._shallow = _shallow; } - set value(newVal) { - this._set(newVal); + get(target, key, receiver) { + const isReadonly2 = this._isReadonly, shallow = this._shallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return shallow; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the reciever is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target); + if (!isReadonly2) { + if (targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get(target, key, receiver); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (shallow) { + return res; + } + if (isRef(res)) { + return targetIsArray && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? res : res.value; + } + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; } } -function customRef(factory) { - return new CustomRefImpl(factory); -} -function toRefs(object) { - if ( true && !isProxy(object)) { - console.warn(`toRefs() expects a reactive object but received a plain one.`); - } - const ret = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(object) ? new Array(object.length) : {}; - for (const key in object) { - ret[key] = propertyToRef(object, key); +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(shallow = false) { + super(false, shallow); } - return ret; -} -class ObjectRefImpl { - constructor(_object, _key, _defaultValue) { - this._object = _object; - this._key = _key; - this._defaultValue = _defaultValue; - this.__v_isRef = true; + set(target, key, value, receiver) { + let oldValue = target[key]; + if (!this._shallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && isRef(oldValue) && !isRef(value)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isIntegerKey)(key) ? Number(key) < target.length : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); + const result = Reflect.set(target, key, value, receiver); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; } - get value() { - const val = this._object[this._key]; - return val === void 0 ? this._defaultValue : val; + deleteProperty(target, key) { + const hadKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; } - set value(newVal) { - this._object[this._key] = newVal; + has(target, key) { + const result = Reflect.has(target, key); + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; } - get dep() { - return getDepFromReactive(toRaw(this._object), this._key); + ownKeys(target) { + track( + target, + "iterate", + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); } } -class GetterRefImpl { - constructor(_getter) { - this._getter = _getter; - this.__v_isRef = true; - this.__v_isReadonly = true; +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(shallow = false) { + super(true, shallow); } - get value() { - return this._getter(); + set(target, key) { + if (true) { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; } -} -function toRef(source, key, defaultValue) { - if (isRef(source)) { - return source; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source)) { - return new GetterRefImpl(source); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(source) && arguments.length > 1) { - return propertyToRef(source, key, defaultValue); - } else { - return ref(source); + deleteProperty(target, key) { + if (true) { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; } } -function propertyToRef(source, key, defaultValue) { - const val = source[key]; - return isRef(val) ? val : new ObjectRefImpl( - source, - key, - defaultValue - ); -} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler( + true +); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); -class ComputedRefImpl { - constructor(getter, _setter, isReadonly, isSSR) { - this._setter = _setter; - this.dep = void 0; - this.__v_isRef = true; - this["__v_isReadonly"] = false; - this._dirty = true; - this.effect = new ReactiveEffect(getter, () => { - if (!this._dirty) { - this._dirty = true; - triggerRefValue(this); - } - }); - this.effect.computed = this; - this.effect.active = this._cacheable = !isSSR; - this["__v_isReadonly"] = isReadonly; - } - get value() { - const self = toRaw(this); - trackRefValue(self); - if (self._dirty || !self._cacheable) { - self._dirty = false; - self._value = self.effect.run(); +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function get(target, key, isReadonly = false, isShallow = false) { + target = target["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(key, rawKey)) { + track(rawTarget, "get", key); } - return self._value; + track(rawTarget, "get", rawKey); } - set value(newValue) { - this._setter(newValue); + const { has: has2 } = getProto(rawTarget); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + if (has2.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); } } -function computed(getterOrOptions, debugOptions, isSSR = false) { - let getter; - let setter; - const onlyGetter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(getterOrOptions); - if (onlyGetter) { - getter = getterOrOptions; - setter = true ? () => { - console.warn("Write operation failed: computed value is readonly"); - } : 0; - } else { - getter = getterOrOptions.get; - setter = getterOrOptions.set; - } - const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); - if ( true && debugOptions && !isSSR) { - cRef.effect.onTrack = debugOptions.onTrack; - cRef.effect.onTrigger = debugOptions.onTrigger; +function has(key, isReadonly = false) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); } - return cRef; + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); } - -const tick = /* @__PURE__ */ Promise.resolve(); -const queue = []; -let queued = false; -const scheduler = (fn) => { - queue.push(fn); - if (!queued) { - queued = true; - tick.then(flush); - } -}; -const flush = () => { - for (let i = 0; i < queue.length; i++) { - queue[i](); - } - queue.length = 0; - queued = false; -}; -class DeferredComputedRefImpl { - constructor(getter) { - this.dep = void 0; - this._dirty = true; - this.__v_isRef = true; - this["__v_isReadonly"] = true; - let compareTarget; - let hasCompareTarget = false; - let scheduled = false; - this.effect = new ReactiveEffect(getter, (computedTrigger) => { - if (this.dep) { - if (computedTrigger) { - compareTarget = this._value; - hasCompareTarget = true; - } else if (!scheduled) { - const valueToCompare = hasCompareTarget ? compareTarget : this._value; - scheduled = true; - hasCompareTarget = false; - scheduler(() => { - if (this.effect.active && this._get() !== valueToCompare) { - triggerRefValue(this); - } - scheduled = false; - }); - } - for (const e of this.dep) { - if (e.computed instanceof DeferredComputedRefImpl) { - e.scheduler( - true - /* computedTrigger */ - ); - } - } - } - this._dirty = true; - }); - this.effect.computed = this; +function size(target, isReadonly = false) { + target = target["__v_raw"]; + !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); +} +function add(value) { + value = toRaw(value); + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); } - _get() { - if (this._dirty) { - this._dirty = false; - return this._value = this.effect.run(); - } - return this._value; + return this; +} +function set(key, value) { + value = toRaw(value); + const target = toRaw(this); + const { has: has2, get: get2 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else if (true) { + checkIdentityKeys(target, has2, key); } - get value() { - trackRefValue(this); - return toRaw(this)._get(); + const oldValue = get2.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(value, oldValue)) { + trigger(target, "set", key, value, oldValue); } + return this; } -function deferredComputed(getter) { - return new DeferredComputedRefImpl(getter); -} - - - - -/***/ }), - -/***/ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ BaseTransition: () => (/* binding */ BaseTransition), -/* harmony export */ BaseTransitionPropsValidators: () => (/* binding */ BaseTransitionPropsValidators), -/* harmony export */ Comment: () => (/* binding */ Comment), -/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope), -/* harmony export */ Fragment: () => (/* binding */ Fragment), -/* harmony export */ KeepAlive: () => (/* binding */ KeepAlive), -/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), -/* harmony export */ Static: () => (/* binding */ Static), -/* harmony export */ Suspense: () => (/* binding */ Suspense), -/* harmony export */ Teleport: () => (/* binding */ Teleport), -/* harmony export */ Text: () => (/* binding */ Text), -/* harmony export */ assertNumber: () => (/* binding */ assertNumber), -/* harmony export */ callWithAsyncErrorHandling: () => (/* binding */ callWithAsyncErrorHandling), -/* harmony export */ callWithErrorHandling: () => (/* binding */ callWithErrorHandling), -/* harmony export */ camelize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize), -/* harmony export */ capitalize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize), -/* harmony export */ cloneVNode: () => (/* binding */ cloneVNode), -/* harmony export */ compatUtils: () => (/* binding */ compatUtils), -/* harmony export */ computed: () => (/* binding */ computed), -/* harmony export */ createBlock: () => (/* binding */ createBlock), -/* harmony export */ createCommentVNode: () => (/* binding */ createCommentVNode), -/* harmony export */ createElementBlock: () => (/* binding */ createElementBlock), -/* harmony export */ createElementVNode: () => (/* binding */ createBaseVNode), -/* harmony export */ createHydrationRenderer: () => (/* binding */ createHydrationRenderer), -/* harmony export */ createPropsRestProxy: () => (/* binding */ createPropsRestProxy), -/* harmony export */ createRenderer: () => (/* binding */ createRenderer), -/* harmony export */ createSlots: () => (/* binding */ createSlots), -/* harmony export */ createStaticVNode: () => (/* binding */ createStaticVNode), -/* harmony export */ createTextVNode: () => (/* binding */ createTextVNode), -/* harmony export */ createVNode: () => (/* binding */ createVNode), -/* harmony export */ customRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.customRef), -/* harmony export */ defineAsyncComponent: () => (/* binding */ defineAsyncComponent), -/* harmony export */ defineComponent: () => (/* binding */ defineComponent), -/* harmony export */ defineEmits: () => (/* binding */ defineEmits), -/* harmony export */ defineExpose: () => (/* binding */ defineExpose), -/* harmony export */ defineModel: () => (/* binding */ defineModel), -/* harmony export */ defineOptions: () => (/* binding */ defineOptions), -/* harmony export */ defineProps: () => (/* binding */ defineProps), -/* harmony export */ defineSlots: () => (/* binding */ defineSlots), -/* harmony export */ devtools: () => (/* binding */ devtools), -/* harmony export */ effect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effect), -/* harmony export */ effectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effectScope), -/* harmony export */ getCurrentInstance: () => (/* binding */ getCurrentInstance), -/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), -/* harmony export */ getTransitionRawChildren: () => (/* binding */ getTransitionRawChildren), -/* harmony export */ guardReactiveProps: () => (/* binding */ guardReactiveProps), -/* harmony export */ h: () => (/* binding */ h), -/* harmony export */ handleError: () => (/* binding */ handleError), -/* harmony export */ hasInjectionContext: () => (/* binding */ hasInjectionContext), -/* harmony export */ initCustomFormatter: () => (/* binding */ initCustomFormatter), -/* harmony export */ inject: () => (/* binding */ inject), -/* harmony export */ isMemoSame: () => (/* binding */ isMemoSame), -/* harmony export */ isProxy: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy), -/* harmony export */ isReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive), -/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly), -/* harmony export */ isRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef), -/* harmony export */ isRuntimeOnly: () => (/* binding */ isRuntimeOnly), -/* harmony export */ isShallow: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow), -/* harmony export */ isVNode: () => (/* binding */ isVNode), -/* harmony export */ markRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw), -/* harmony export */ mergeDefaults: () => (/* binding */ mergeDefaults), -/* harmony export */ mergeModels: () => (/* binding */ mergeModels), -/* harmony export */ mergeProps: () => (/* binding */ mergeProps), -/* harmony export */ nextTick: () => (/* binding */ nextTick), -/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass), -/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeProps), -/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle), -/* harmony export */ onActivated: () => (/* binding */ onActivated), -/* harmony export */ onBeforeMount: () => (/* binding */ onBeforeMount), -/* harmony export */ onBeforeUnmount: () => (/* binding */ onBeforeUnmount), -/* harmony export */ onBeforeUpdate: () => (/* binding */ onBeforeUpdate), -/* harmony export */ onDeactivated: () => (/* binding */ onDeactivated), -/* harmony export */ onErrorCaptured: () => (/* binding */ onErrorCaptured), -/* harmony export */ onMounted: () => (/* binding */ onMounted), -/* harmony export */ onRenderTracked: () => (/* binding */ onRenderTracked), -/* harmony export */ onRenderTriggered: () => (/* binding */ onRenderTriggered), -/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), -/* harmony export */ onServerPrefetch: () => (/* binding */ onServerPrefetch), -/* harmony export */ onUnmounted: () => (/* binding */ onUnmounted), -/* harmony export */ onUpdated: () => (/* binding */ onUpdated), -/* harmony export */ openBlock: () => (/* binding */ openBlock), -/* harmony export */ popScopeId: () => (/* binding */ popScopeId), -/* harmony export */ provide: () => (/* binding */ provide), -/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), -/* harmony export */ pushScopeId: () => (/* binding */ pushScopeId), -/* harmony export */ queuePostFlushCb: () => (/* binding */ queuePostFlushCb), -/* harmony export */ reactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive), -/* harmony export */ readonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.readonly), -/* harmony export */ ref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref), -/* harmony export */ registerRuntimeCompiler: () => (/* binding */ registerRuntimeCompiler), -/* harmony export */ renderList: () => (/* binding */ renderList), -/* harmony export */ renderSlot: () => (/* binding */ renderSlot), -/* harmony export */ resolveComponent: () => (/* binding */ resolveComponent), -/* harmony export */ resolveDirective: () => (/* binding */ resolveDirective), -/* harmony export */ resolveDynamicComponent: () => (/* binding */ resolveDynamicComponent), -/* harmony export */ resolveFilter: () => (/* binding */ resolveFilter), -/* harmony export */ resolveTransitionHooks: () => (/* binding */ resolveTransitionHooks), -/* harmony export */ setBlockTracking: () => (/* binding */ setBlockTracking), -/* harmony export */ setDevtoolsHook: () => (/* binding */ setDevtoolsHook), -/* harmony export */ setTransitionHooks: () => (/* binding */ setTransitionHooks), -/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), -/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), -/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowRef), -/* harmony export */ ssrContextKey: () => (/* binding */ ssrContextKey), -/* harmony export */ ssrUtils: () => (/* binding */ ssrUtils), -/* harmony export */ stop: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.stop), -/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toDisplayString), -/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey), -/* harmony export */ toHandlers: () => (/* binding */ toHandlers), -/* harmony export */ toRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw), -/* harmony export */ toRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRef), -/* harmony export */ toRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRefs), -/* harmony export */ toValue: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toValue), -/* harmony export */ transformVNodeArgs: () => (/* binding */ transformVNodeArgs), -/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.triggerRef), -/* harmony export */ unref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.unref), -/* harmony export */ useAttrs: () => (/* binding */ useAttrs), -/* harmony export */ useModel: () => (/* binding */ useModel), -/* harmony export */ useSSRContext: () => (/* binding */ useSSRContext), -/* harmony export */ useSlots: () => (/* binding */ useSlots), -/* harmony export */ useTransitionState: () => (/* binding */ useTransitionState), -/* harmony export */ version: () => (/* binding */ version), -/* harmony export */ warn: () => (/* binding */ warn), -/* harmony export */ watch: () => (/* binding */ watch), -/* harmony export */ watchEffect: () => (/* binding */ watchEffect), -/* harmony export */ watchPostEffect: () => (/* binding */ watchPostEffect), -/* harmony export */ watchSyncEffect: () => (/* binding */ watchSyncEffect), -/* harmony export */ withAsyncContext: () => (/* binding */ withAsyncContext), -/* harmony export */ withCtx: () => (/* binding */ withCtx), -/* harmony export */ withDefaults: () => (/* binding */ withDefaults), -/* harmony export */ withDirectives: () => (/* binding */ withDirectives), -/* harmony export */ withMemo: () => (/* binding */ withMemo), -/* harmony export */ withScopeId: () => (/* binding */ withScopeId) -/* harmony export */ }); -/* harmony import */ var _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/reactivity */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); -/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); - - - - - -const stack = []; -function pushWarningContext(vnode) { - stack.push(vnode); -} -function popWarningContext() { - stack.pop(); -} -function warn(msg, ...args) { - if (false) - {} - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - const instance = stack.length ? stack[stack.length - 1].component : null; - const appWarnHandler = instance && instance.appContext.config.warnHandler; - const trace = getComponentTrace(); - if (appWarnHandler) { - callWithErrorHandling( - appWarnHandler, - instance, - 11, - [ - msg + args.join(""), - instance && instance.proxy, - trace.map( - ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` - ).join("\n"), - trace - ] - ); - } else { - const warnArgs = [`[Vue warn]: ${msg}`, ...args]; - if (trace.length && // avoid spamming console during tests - true) { - warnArgs.push(` -`, ...formatTrace(trace)); - } - console.warn(...warnArgs); +function deleteEntry(key) { + const target = toRaw(this); + const { has: has2, get: get2 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else if (true) { + checkIdentityKeys(target, has2, key); } - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); -} -function getComponentTrace() { - let currentVNode = stack[stack.length - 1]; - if (!currentVNode) { - return []; + const oldValue = get2 ? get2.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); } - const normalizedStack = []; - while (currentVNode) { - const last = normalizedStack[0]; - if (last && last.vnode === currentVNode) { - last.recurseCount++; - } else { - normalizedStack.push({ - vnode: currentVNode, - recurseCount: 0 - }); - } - const parentInstance = currentVNode.component && currentVNode.component.parent; - currentVNode = parentInstance && parentInstance.vnode; + return result; +} +function clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(target) ? new Map(target) : new Set(target) : 0; + const result = target.clear(); + if (hadItems) { + trigger(target, "clear", void 0, void 0, oldTarget); } - return normalizedStack; + return result; } -function formatTrace(trace) { - const logs = []; - trace.forEach((entry, i) => { - logs.push(...i === 0 ? [] : [` -`], ...formatTraceEntry(entry)); - }); - return logs; +function createForEach(isReadonly, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + }; } -function formatTraceEntry({ vnode, recurseCount }) { - const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; - const isRoot = vnode.component ? vnode.component.parent == null : false; - const open = ` at <${formatComponentName( - vnode.component, - vnode.type, - isRoot - )}`; - const close = `>` + postfix; - return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +function createIterableMethod(method, isReadonly, isShallow) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isMap)(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + !isReadonly && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; } -function formatProps(props) { - const res = []; - const keys = Object.keys(props); - keys.slice(0, 3).forEach((key) => { - res.push(...formatProp(key, props[key])); +function createReadonlyMethod(type) { + return function(...args) { + if (true) { + const key = args[0] ? `on key "${args[0]}" ` : ``; + console.warn( + `${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.capitalize)(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get(this, key); + }, + get size() { + return size(this); + }, + has, + add, + set, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) + }; + const shallowInstrumentations2 = { + get(key) { + return get(this, key, false, true); + }, + get size() { + return size(this); + }, + has, + add, + set, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, true) + }; + const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod( + method, + false, + false + ); + readonlyInstrumentations2[method] = createIterableMethod( + method, + true, + false + ); + shallowInstrumentations2[method] = createIterableMethod( + method, + false, + true + ); + shallowReadonlyInstrumentations2[method] = createIterableMethod( + method, + true, + true + ); }); - if (keys.length > 3) { - res.push(` ...`); - } - return res; + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; } -function formatProp(key, value, raw) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { - value = JSON.stringify(value); - return raw ? value : [`${key}=${value}`]; - } else if (typeof value === "number" || typeof value === "boolean" || value == null) { - return raw ? value : [`${key}=${value}`]; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { - value = formatProp(key, (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value.value), true); - return raw ? value : [`${key}=Ref<`, value, `>`]; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { - return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; - } else { - value = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value); - return raw ? value : [`${key}=`, value]; - } +const [ + mutableInstrumentations, + readonlyInstrumentations, + shallowInstrumentations, + shallowReadonlyInstrumentations +] = /* @__PURE__ */ createInstrumentations(); +function createInstrumentationGetter(isReadonly, shallow) { + const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly; + } else if (key === "__v_isReadonly") { + return isReadonly; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; } -function assertNumber(val, type) { - if (false) - {} - if (val === void 0) { - return; - } else if (typeof val !== "number") { - warn(`${type} is not a valid number - got ${JSON.stringify(val)}.`); - } else if (isNaN(val)) { - warn(`${type} is NaN - the duration expression might be incorrect.`); +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(target); + console.warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); } } -const ErrorTypeStrings = { - ["sp"]: "serverPrefetch hook", - ["bc"]: "beforeCreate hook", - ["c"]: "created hook", - ["bm"]: "beforeMount hook", - ["m"]: "mounted hook", - ["bu"]: "beforeUpdate hook", - ["u"]: "updated", - ["bum"]: "beforeUnmount hook", - ["um"]: "unmounted hook", - ["a"]: "activated hook", - ["da"]: "deactivated hook", - ["ec"]: "errorCaptured hook", - ["rtc"]: "renderTracked hook", - ["rtg"]: "renderTriggered hook", - [0]: "setup function", - [1]: "render function", - [2]: "watcher getter", - [3]: "watcher callback", - [4]: "watcher cleanup function", - [5]: "native event handler", - [6]: "component event handler", - [7]: "vnode hook", - [8]: "directive hook", - [9]: "transition hook", - [10]: "app errorHandler", - [11]: "app warnHandler", - [12]: "ref function", - [13]: "async component loader", - [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core" -}; -function callWithErrorHandling(fn, instance, type, args) { - let res; - try { - res = args ? fn(...args) : fn(); - } catch (err) { - handleError(err, instance, type); +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; } - return res; } -function callWithAsyncErrorHandling(fn, instance, type, args) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(fn)) { - const res = callWithErrorHandling(fn, instance, type, args); - if (res && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(res)) { - res.catch((err) => { - handleError(err, instance, type); - }); - } - return res; - } - const values = []; - for (let i = 0; i < fn.length; i++) { - values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); - } - return values; +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.toRawType)(value)); } -function handleError(err, instance, type, throwInDev = true) { - const contextVNode = instance ? instance.vnode : null; - if (instance) { - let cur = instance.parent; - const exposedInstance = instance.proxy; - const errorInfo = true ? ErrorTypeStrings[type] : 0; - while (cur) { - const errorCapturedHooks = cur.ec; - if (errorCapturedHooks) { - for (let i = 0; i < errorCapturedHooks.length; i++) { - if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { - return; - } - } - } - cur = cur.parent; - } - const appErrorHandler = instance.appContext.config.errorHandler; - if (appErrorHandler) { - callWithErrorHandling( - appErrorHandler, - null, - 10, - [err, exposedInstance, errorInfo] - ); - return; - } +function reactive(target) { + if (isReadonly(target)) { + return target; } - logError(err, type, contextVNode, throwInDev); + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); } -function logError(err, type, contextVNode, throwInDev = true) { - if (true) { - const info = ErrorTypeStrings[type]; - if (contextVNode) { - pushWarningContext(contextVNode); - } - warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`); - if (contextVNode) { - popWarningContext(); - } - if (throwInDev) { - throw err; - } else { - console.error(err); - } - } else {} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); } - -let isFlushing = false; -let isFlushPending = false; -const queue = []; -let flushIndex = 0; -const pendingPostFlushCbs = []; -let activePostFlushCbs = null; -let postFlushIndex = 0; -const resolvedPromise = /* @__PURE__ */ Promise.resolve(); -let currentFlushPromise = null; -const RECURSION_LIMIT = 100; -function nextTick(fn) { - const p = currentFlushPromise || resolvedPromise; - return fn ? p.then(this ? fn.bind(this) : fn) : p; +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); } -function findInsertionIndex(id) { - let start = flushIndex + 1; - let end = queue.length; - while (start < end) { - const middle = start + end >>> 1; - const middleJobId = getId(queue[middle]); - middleJobId < id ? start = middle + 1 : end = middle; - } - return start; +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); } -function queueJob(job) { - if (!queue.length || !queue.includes( - job, - isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex - )) { - if (job.id == null) { - queue.push(job); - } else { - queue.splice(findInsertionIndex(job.id), 0, job); +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(target)) { + if (true) { + console.warn(`value cannot be made reactive: ${String(target)}`); } - queueFlush(); + return target; } -} -function queueFlush() { - if (!isFlushing && !isFlushPending) { - isFlushPending = true; - currentFlushPromise = resolvedPromise.then(flushJobs); + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; } -} -function invalidateJob(job) { - const i = queue.indexOf(job); - if (i > flushIndex) { - queue.splice(i, 1); + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; } -function queuePostFlushCb(cb) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(cb)) { - if (!activePostFlushCbs || !activePostFlushCbs.includes( - cb, - cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex - )) { - pendingPostFlushCbs.push(cb); - } - } else { - pendingPostFlushCbs.push(...cb); +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); } - queueFlush(); + return !!(value && value["__v_isReactive"]); } -function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) { - if (true) { - seen = seen || /* @__PURE__ */ new Map(); +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return isReactive(value) || isReadonly(value); +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.def)(value, "__v_skip", true); + return value; +} +const toReactive = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? reactive(value) : value; +const toReadonly = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) ? readonly(value) : value; + +class ComputedRefImpl { + constructor(getter, _setter, isReadonly, isSSR) { + this._setter = _setter; + this.dep = void 0; + this.__v_isRef = true; + this["__v_isReadonly"] = false; + this.effect = new ReactiveEffect( + () => getter(this._value), + () => triggerRefValue(this, 1) + ); + this.effect.computed = this; + this.effect.active = this._cacheable = !isSSR; + this["__v_isReadonly"] = isReadonly; } - for (; i < queue.length; i++) { - const cb = queue[i]; - if (cb && cb.pre) { - if ( true && checkRecursiveUpdates(seen, cb)) { - continue; + get value() { + const self = toRaw(this); + trackRefValue(self); + if (!self._cacheable || self.effect.dirty) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(self._value, self._value = self.effect.run())) { + triggerRefValue(self, 2); } - queue.splice(i, 1); - i--; - cb(); } + return self._value; } -} -function flushPostFlushCbs(seen) { - if (pendingPostFlushCbs.length) { - const deduped = [...new Set(pendingPostFlushCbs)]; - pendingPostFlushCbs.length = 0; - if (activePostFlushCbs) { - activePostFlushCbs.push(...deduped); - return; - } - activePostFlushCbs = deduped; - if (true) { - seen = seen || /* @__PURE__ */ new Map(); - } - activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); - for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { - if ( true && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) { - continue; - } - activePostFlushCbs[postFlushIndex](); - } - activePostFlushCbs = null; - postFlushIndex = 0; + set value(newValue) { + this._setter(newValue); } -} -const getId = (job) => job.id == null ? Infinity : job.id; -const comparator = (a, b) => { - const diff = getId(a) - getId(b); - if (diff === 0) { - if (a.pre && !b.pre) - return -1; - if (b.pre && !a.pre) - return 1; + // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x + get _dirty() { + return this.effect.dirty; } - return diff; -}; -function flushJobs(seen) { - isFlushPending = false; - isFlushing = true; - if (true) { - seen = seen || /* @__PURE__ */ new Map(); - } - queue.sort(comparator); - const check = true ? (job) => checkRecursiveUpdates(seen, job) : 0; - try { - for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job && job.active !== false) { - if ( true && check(job)) { - continue; - } - callWithErrorHandling(job, null, 14); - } - } - } finally { - flushIndex = 0; - queue.length = 0; - flushPostFlushCbs(seen); - isFlushing = false; - currentFlushPromise = null; - if (queue.length || pendingPostFlushCbs.length) { - flushJobs(seen); - } + set _dirty(v) { + this.effect.dirty = v; } + // #endregion } -function checkRecursiveUpdates(seen, fn) { - if (!seen.has(fn)) { - seen.set(fn, 1); +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + const onlyGetter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(getterOrOptions); + if (onlyGetter) { + getter = getterOrOptions; + setter = true ? () => { + console.warn("Write operation failed: computed value is readonly"); + } : 0; } else { - const count = seen.get(fn); - if (count > RECURSION_LIMIT) { - const instance = fn.ownerInstance; - const componentName = instance && getComponentName(instance.type); - warn( - `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.` - ); - return true; - } else { - seen.set(fn, count + 1); - } + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); + if ( true && debugOptions && !isSSR) { + cRef.effect.onTrack = debugOptions.onTrack; + cRef.effect.onTrigger = debugOptions.onTrigger; } + return cRef; } -let isHmrUpdating = false; -const hmrDirtyComponents = /* @__PURE__ */ new Set(); -if (true) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)().__VUE_HMR_RUNTIME__ = { - createRecord: tryWrap(createRecord), - rerender: tryWrap(rerender), - reload: tryWrap(reload) - }; +function trackRefValue(ref2) { + if (shouldTrack && activeEffect) { + ref2 = toRaw(ref2); + trackEffect( + activeEffect, + ref2.dep || (ref2.dep = createDep( + () => ref2.dep = void 0, + ref2 instanceof ComputedRefImpl ? ref2 : void 0 + )), + true ? { + target: ref2, + type: "get", + key: "value" + } : 0 + ); + } } -const map = /* @__PURE__ */ new Map(); -function registerHMR(instance) { - const id = instance.type.__hmrId; - let record = map.get(id); - if (!record) { - createRecord(id, instance.type); - record = map.get(id); +function triggerRefValue(ref2, dirtyLevel = 3, newVal) { + ref2 = toRaw(ref2); + const dep = ref2.dep; + if (dep) { + triggerEffects( + dep, + dirtyLevel, + true ? { + target: ref2, + type: "set", + key: "value", + newValue: newVal + } : 0 + ); } - record.instances.add(instance); } -function unregisterHMR(instance) { - map.get(instance.type.__hmrId).instances.delete(instance); +function isRef(r) { + return !!(r && r.__v_isRef === true); } -function createRecord(id, initialDef) { - if (map.has(id)) { - return false; - } - map.set(id, { - initialDef: normalizeClassComponent(initialDef), - instances: /* @__PURE__ */ new Set() - }); - return true; +function ref(value) { + return createRef(value, false); } -function normalizeClassComponent(component) { - return isClassComponent(component) ? component.__vccOpts : component; +function shallowRef(value) { + return createRef(value, true); } -function rerender(id, newRender) { - const record = map.get(id); - if (!record) { - return; +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; } - record.initialDef.render = newRender; - [...record.instances].forEach((instance) => { - if (newRender) { - instance.render = newRender; - normalizeClassComponent(instance.type).render = newRender; - } - instance.renderCache = []; - isHmrUpdating = true; - instance.update(); - isHmrUpdating = false; - }); + return new RefImpl(rawValue, shallow); } -function reload(id, newComp) { - const record = map.get(id); - if (!record) - return; - newComp = normalizeClassComponent(newComp); - updateComponentDef(record.initialDef, newComp); - const instances = [...record.instances]; - for (const instance of instances) { - const oldComp = normalizeClassComponent(instance.type); - if (!hmrDirtyComponents.has(oldComp)) { - if (oldComp !== record.initialDef) { - updateComponentDef(oldComp, newComp); - } - hmrDirtyComponents.add(oldComp); - } - instance.appContext.propsCache.delete(instance.type); - instance.appContext.emitsCache.delete(instance.type); - instance.appContext.optionsCache.delete(instance.type); - if (instance.ceReload) { - hmrDirtyComponents.add(oldComp); - instance.ceReload(newComp.styles); - hmrDirtyComponents.delete(oldComp); - } else if (instance.parent) { - queueJob(instance.parent.update); - } else if (instance.appContext.reload) { - instance.appContext.reload(); - } else if (typeof window !== "undefined") { - window.location.reload(); - } else { - console.warn( - "[HMR] Root or manually mounted instance modified. Full reload required." - ); - } +class RefImpl { + constructor(value, __v_isShallow) { + this.__v_isShallow = __v_isShallow; + this.dep = void 0; + this.__v_isRef = true; + this._rawValue = __v_isShallow ? value : toRaw(value); + this._value = __v_isShallow ? value : toReactive(value); } - queuePostFlushCb(() => { - for (const instance of instances) { - hmrDirtyComponents.delete( - normalizeClassComponent(instance.type) - ); - } - }); -} -function updateComponentDef(oldComp, newComp) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(oldComp, newComp); - for (const key in oldComp) { - if (key !== "__file" && !(key in newComp)) { - delete oldComp[key]; - } + get value() { + trackRefValue(this); + return this._value; } -} -function tryWrap(fn) { - return (id, arg) => { - try { - return fn(id, arg); - } catch (e) { - console.error(e); - console.warn( - `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` - ); + set value(newVal) { + const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); + newVal = useDirectValue ? newVal : toRaw(newVal); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.hasChanged)(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = useDirectValue ? newVal : toReactive(newVal); + triggerRefValue(this, 3, newVal); } - }; -} - -let devtools; -let buffer = []; -let devtoolsNotInstalled = false; -function emit$1(event, ...args) { - if (devtools) { - devtools.emit(event, ...args); - } else if (!devtoolsNotInstalled) { - buffer.push({ event, args }); } } -function setDevtoolsHook(hook, target) { - var _a, _b; - devtools = hook; - if (devtools) { - devtools.enabled = true; - buffer.forEach(({ event, args }) => devtools.emit(event, ...args)); - buffer = []; - } else if ( - // handle late devtools injection - only do this if we are in an actual - // browser environment to avoid the timer handle stalling test runner exit - // (#4815) - typeof window !== "undefined" && // some envs mock window but not fully - window.HTMLElement && // also exclude jsdom - !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) - ) { - const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; - replay.push((newHook) => { - setDevtoolsHook(newHook, target); - }); - setTimeout(() => { - if (!devtools) { - target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; - devtoolsNotInstalled = true; - buffer = []; - } - }, 3e3); - } else { - devtoolsNotInstalled = true; - buffer = []; - } +function triggerRef(ref2) { + triggerRefValue(ref2, 3, true ? ref2.value : 0); } -function devtoolsInitApp(app, version) { - emit$1("app:init" /* APP_INIT */, app, version, { - Fragment, - Text, - Comment, - Static - }); +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; } -function devtoolsUnmountApp(app) { - emit$1("app:unmount" /* APP_UNMOUNT */, app); +function toValue(source) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source) ? source() : unref(source); } -const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( - "component:added" /* COMPONENT_ADDED */ -); -const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); -const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( - "component:removed" /* COMPONENT_REMOVED */ -); -const devtoolsComponentRemoved = (component) => { - if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered - !devtools.cleanupBuffer(component)) { - _devtoolsComponentRemoved(component); +const shallowUnwrapHandlers = { + get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } } }; -function createDevtoolsComponentHook(hook) { - return (component) => { - emit$1( - hook, - component.appContext.app, - component.uid, - component.parent ? component.parent.uid : void 0, - component - ); - }; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); } -const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:start" /* PERFORMANCE_START */ -); -const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:end" /* PERFORMANCE_END */ -); -function createDevtoolsPerformanceHook(hook) { - return (component, type, time) => { - emit$1(hook, component.appContext.app, component.uid, component, type, time); - }; +class CustomRefImpl { + constructor(factory) { + this.dep = void 0; + this.__v_isRef = true; + const { get, set } = factory( + () => trackRefValue(this), + () => triggerRefValue(this) + ); + this._get = get; + this._set = set; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } } -function devtoolsComponentEmit(component, event, params) { - emit$1( - "component:emit" /* COMPONENT_EMIT */, - component.appContext.app, - component, - event, - params - ); +function customRef(factory) { + return new CustomRefImpl(factory); } - -function emit(instance, event, ...rawArgs) { - if (instance.isUnmounted) - return; - const props = instance.vnode.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - if (true) { - const { - emitsOptions, - propsOptions: [propsOptions] - } = instance; - if (emitsOptions) { - if (!(event in emitsOptions) && true) { - if (!propsOptions || !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event) in propsOptions)) { - warn( - `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)}" prop.` - ); - } - } else { - const validator = emitsOptions[event]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(validator)) { - const isValid = validator(...rawArgs); - if (!isValid) { - warn( - `Invalid event arguments: event validation failed for event "${event}".` - ); - } - } - } - } - } - let args = rawArgs; - const isModelListener = event.startsWith("update:"); - const modelArg = isModelListener && event.slice(7); - if (modelArg && modelArg in props) { - const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; - const { number, trim } = props[modifiersKey] || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - if (trim) { - args = rawArgs.map((a) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(a) ? a.trim() : a); - } - if (number) { - args = rawArgs.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber); - } +function toRefs(object) { + if ( true && !isProxy(object)) { + console.warn(`toRefs() expects a reactive object but received a plain one.`); } - if (true) { - devtoolsComponentEmit(instance, event, args); + const ret = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isArray)(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); } - if (true) { - const lowerCaseEvent = event.toLowerCase(); - if (lowerCaseEvent !== event && props[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(lowerCaseEvent)]) { - warn( - `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( - instance, - instance.type - )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event)}" instead of "${event}".` - ); - } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this.__v_isRef = true; } - let handlerName; - let handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)] || // also try camelCase event handler (#2249) - props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(event))]; - if (!handler && isModelListener) { - handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event))]; + get value() { + const val = this._object[this._key]; + return val === void 0 ? this._defaultValue : val; } - if (handler) { - callWithAsyncErrorHandling( - handler, - instance, - 6, - args - ); + set value(newVal) { + this._object[this._key] = newVal; } - const onceHandler = props[handlerName + `Once`]; - if (onceHandler) { - if (!instance.emitted) { - instance.emitted = {}; - } else if (instance.emitted[handlerName]) { - return; - } - instance.emitted[handlerName] = true; - callWithAsyncErrorHandling( - onceHandler, - instance, - 6, - args - ); + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); } } -function normalizeEmitsOptions(comp, appContext, asMixin = false) { - const cache = appContext.emitsCache; - const cached = cache.get(comp); - if (cached !== void 0) { - return cached; - } - const raw = comp.emits; - let normalized = {}; - let hasExtends = false; - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { - const extendEmits = (raw2) => { - const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); - if (normalizedFromExtend) { - hasExtends = true; - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, normalizedFromExtend); - } - }; - if (!asMixin && appContext.mixins.length) { - appContext.mixins.forEach(extendEmits); - } - if (comp.extends) { - extendEmits(comp.extends); - } - if (comp.mixins) { - comp.mixins.forEach(extendEmits); - } +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this.__v_isRef = true; + this.__v_isReadonly = true; } - if (!raw && !hasExtends) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { - cache.set(comp, null); - } - return null; + get value() { + return this._getter(); } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { - raw.forEach((key) => normalized[key] = null); +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source)) { + return new GetterRefImpl(source); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_0__.isObject)(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); } else { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, raw); - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { - cache.set(comp, normalized); + return ref(source); } - return normalized; } -function isEmitListener(options, key) { - if (!options || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { - return false; - } - key = key.slice(2).replace(/Once$/, ""); - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key); +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); } -let currentRenderingInstance = null; -let currentScopeId = null; -function setCurrentRenderingInstance(instance) { - const prev = currentRenderingInstance; - currentRenderingInstance = instance; - currentScopeId = instance && instance.type.__scopeId || null; - return prev; -} -function pushScopeId(id) { - currentScopeId = id; -} -function popScopeId() { - currentScopeId = null; -} -const withScopeId = (_id) => withCtx; -function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { - if (!ctx) - return fn; - if (fn._n) { - return fn; - } - const renderFnWithContext = (...args) => { - if (renderFnWithContext._d) { - setBlockTracking(-1); - } - const prevInstance = setCurrentRenderingInstance(ctx); - let res; - try { - res = fn(...args); - } finally { - setCurrentRenderingInstance(prevInstance); - if (renderFnWithContext._d) { - setBlockTracking(1); - } - } - if (true) { - devtoolsComponentUpdated(ctx); - } - return res; - }; - renderFnWithContext._n = true; - renderFnWithContext._c = true; - renderFnWithContext._d = true; - return renderFnWithContext; -} +const deferredComputed = computed; -let accessedAttrs = false; -function markAttrsAccessed() { - accessedAttrs = true; -} -function renderComponentRoot(instance) { - const { - type: Component, - vnode, - proxy, - withProxy, - props, - propsOptions: [propsOptions], - slots, - attrs, - emit, - render, - renderCache, - data, - setupState, - ctx, - inheritAttrs - } = instance; - let result; - let fallthroughAttrs; - const prev = setCurrentRenderingInstance(instance); - if (true) { - accessedAttrs = false; - } - try { - if (vnode.shapeFlag & 4) { - const proxyToUse = withProxy || proxy; - result = normalizeVNode( - render.call( - proxyToUse, - proxyToUse, - renderCache, - props, - setupState, - data, - ctx - ) - ); - fallthroughAttrs = attrs; - } else { - const render2 = Component; - if ( true && attrs === props) { - markAttrsAccessed(); - } - result = normalizeVNode( - render2.length > 1 ? render2( - props, - true ? { - get attrs() { - markAttrsAccessed(); - return attrs; - }, - slots, - emit - } : 0 - ) : render2( - props, - null - /* we know it doesn't need it */ - ) - ); - fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); - } - } catch (err) { - blockStack.length = 0; - handleError(err, instance, 1); - result = createVNode(Comment); - } - let root = result; - let setRoot = void 0; - if ( true && result.patchFlag > 0 && result.patchFlag & 2048) { - [root, setRoot] = getChildRoot(result); - } - if (fallthroughAttrs && inheritAttrs !== false) { - const keys = Object.keys(fallthroughAttrs); - const { shapeFlag } = root; - if (keys.length) { - if (shapeFlag & (1 | 6)) { - if (propsOptions && keys.some(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)) { - fallthroughAttrs = filterModelListeners( - fallthroughAttrs, - propsOptions - ); - } - root = cloneVNode(root, fallthroughAttrs); - } else if ( true && !accessedAttrs && root.type !== Comment) { - const allAttrs = Object.keys(attrs); - const eventAttrs = []; - const extraAttrs = []; - for (let i = 0, l = allAttrs.length; i < l; i++) { - const key = allAttrs[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { - eventAttrs.push(key[2].toLowerCase() + key.slice(3)); - } - } else { - extraAttrs.push(key); - } - } - if (extraAttrs.length) { - warn( - `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` - ); - } - if (eventAttrs.length) { - warn( - `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` - ); - } - } - } - } - if (vnode.dirs) { - if ( true && !isElementRoot(root)) { - warn( - `Runtime directive used on component with non-element root node. The directives will not function as intended.` - ); - } - root = cloneVNode(root); - root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; - } - if (vnode.transition) { - if ( true && !isElementRoot(root)) { - warn( - `Component inside <Transition> renders non-element root node that cannot be animated.` - ); - } - root.transition = vnode.transition; - } - if ( true && setRoot) { - setRoot(root); - } else { - result = root; - } - setCurrentRenderingInstance(prev); - return result; -} -const getChildRoot = (vnode) => { - const rawChildren = vnode.children; - const dynamicChildren = vnode.dynamicChildren; - const childRoot = filterSingleRoot(rawChildren); - if (!childRoot) { - return [vnode, void 0]; - } - const index = rawChildren.indexOf(childRoot); - const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; - const setRoot = (updatedRoot) => { - rawChildren[index] = updatedRoot; - if (dynamicChildren) { - if (dynamicIndex > -1) { - dynamicChildren[dynamicIndex] = updatedRoot; - } else if (updatedRoot.patchFlag > 0) { - vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; - } - } - }; - return [normalizeVNode(childRoot), setRoot]; -}; -function filterSingleRoot(children) { - let singleRoot; - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (isVNode(child)) { - if (child.type !== Comment || child.children === "v-if") { - if (singleRoot) { - return; - } else { - singleRoot = child; - } - } - } else { - return; - } - } - return singleRoot; -} -const getFunctionalFallthrough = (attrs) => { - let res; - for (const key in attrs) { - if (key === "class" || key === "style" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { - (res || (res = {}))[key] = attrs[key]; - } - } - return res; +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" }; -const filterModelListeners = (attrs, props) => { - const res = {}; - for (const key in attrs) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key) || !(key.slice(9) in props)) { - res[key] = attrs[key]; - } - } - return res; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" }; -const isElementRoot = (vnode) => { - return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw" }; -function shouldUpdateComponent(prevVNode, nextVNode, optimized) { - const { props: prevProps, children: prevChildren, component } = prevVNode; - const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; - const emits = component.emitsOptions; - if ( true && (prevChildren || nextChildren) && isHmrUpdating) { - return true; - } - if (nextVNode.dirs || nextVNode.transition) { - return true; - } - if (optimized && patchFlag >= 0) { - if (patchFlag & 1024) { - return true; - } - if (patchFlag & 16) { - if (!prevProps) { - return !!nextProps; - } - return hasPropsChanged(prevProps, nextProps, emits); - } else if (patchFlag & 8) { - const dynamicProps = nextVNode.dynamicProps; - for (let i = 0; i < dynamicProps.length; i++) { - const key = dynamicProps[i]; - if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { - return true; - } - } - } - } else { - if (prevChildren || nextChildren) { - if (!nextChildren || !nextChildren.$stable) { - return true; - } - } - if (prevProps === nextProps) { - return false; - } - if (!prevProps) { - return !!nextProps; - } - if (!nextProps) { - return true; - } - return hasPropsChanged(prevProps, nextProps, emits); - } - return false; -} -function hasPropsChanged(prevProps, nextProps, emitsOptions) { - const nextKeys = Object.keys(nextProps); - if (nextKeys.length !== Object.keys(prevProps).length) { - return true; - } - for (let i = 0; i < nextKeys.length; i++) { - const key = nextKeys[i]; - if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { - return true; - } - } - return false; -} -function updateHOCHostEl({ vnode, parent }, el) { - while (parent && parent.subTree === vnode) { - (vnode = parent.vnode).el = el; - parent = parent.parent; - } -} -const isSuspense = (type) => type.__isSuspense; -const SuspenseImpl = { - name: "Suspense", - // In order to make Suspense tree-shakable, we need to avoid importing it - // directly in the renderer. The renderer checks for the __isSuspense flag - // on a vnode's type and calls the `process` method, passing in renderer - // internals. - __isSuspense: true, - process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { - if (n1 == null) { - mountSuspense( - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized, - rendererInternals - ); + + + +/***/ }), + +/***/ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseTransition: () => (/* binding */ BaseTransition), +/* harmony export */ BaseTransitionPropsValidators: () => (/* binding */ BaseTransitionPropsValidators), +/* harmony export */ Comment: () => (/* binding */ Comment), +/* harmony export */ DeprecationTypes: () => (/* binding */ DeprecationTypes), +/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope), +/* harmony export */ ErrorCodes: () => (/* binding */ ErrorCodes), +/* harmony export */ ErrorTypeStrings: () => (/* binding */ ErrorTypeStrings), +/* harmony export */ Fragment: () => (/* binding */ Fragment), +/* harmony export */ KeepAlive: () => (/* binding */ KeepAlive), +/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), +/* harmony export */ Static: () => (/* binding */ Static), +/* harmony export */ Suspense: () => (/* binding */ Suspense), +/* harmony export */ Teleport: () => (/* binding */ Teleport), +/* harmony export */ Text: () => (/* binding */ Text), +/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), +/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), +/* harmony export */ assertNumber: () => (/* binding */ assertNumber), +/* harmony export */ callWithAsyncErrorHandling: () => (/* binding */ callWithAsyncErrorHandling), +/* harmony export */ callWithErrorHandling: () => (/* binding */ callWithErrorHandling), +/* harmony export */ camelize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize), +/* harmony export */ capitalize: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize), +/* harmony export */ cloneVNode: () => (/* binding */ cloneVNode), +/* harmony export */ compatUtils: () => (/* binding */ compatUtils), +/* harmony export */ computed: () => (/* binding */ computed), +/* harmony export */ createBlock: () => (/* binding */ createBlock), +/* harmony export */ createCommentVNode: () => (/* binding */ createCommentVNode), +/* harmony export */ createElementBlock: () => (/* binding */ createElementBlock), +/* harmony export */ createElementVNode: () => (/* binding */ createBaseVNode), +/* harmony export */ createHydrationRenderer: () => (/* binding */ createHydrationRenderer), +/* harmony export */ createPropsRestProxy: () => (/* binding */ createPropsRestProxy), +/* harmony export */ createRenderer: () => (/* binding */ createRenderer), +/* harmony export */ createSlots: () => (/* binding */ createSlots), +/* harmony export */ createStaticVNode: () => (/* binding */ createStaticVNode), +/* harmony export */ createTextVNode: () => (/* binding */ createTextVNode), +/* harmony export */ createVNode: () => (/* binding */ createVNode), +/* harmony export */ customRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.customRef), +/* harmony export */ defineAsyncComponent: () => (/* binding */ defineAsyncComponent), +/* harmony export */ defineComponent: () => (/* binding */ defineComponent), +/* harmony export */ defineEmits: () => (/* binding */ defineEmits), +/* harmony export */ defineExpose: () => (/* binding */ defineExpose), +/* harmony export */ defineModel: () => (/* binding */ defineModel), +/* harmony export */ defineOptions: () => (/* binding */ defineOptions), +/* harmony export */ defineProps: () => (/* binding */ defineProps), +/* harmony export */ defineSlots: () => (/* binding */ defineSlots), +/* harmony export */ devtools: () => (/* binding */ devtools), +/* harmony export */ effect: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effect), +/* harmony export */ effectScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.effectScope), +/* harmony export */ getCurrentInstance: () => (/* binding */ getCurrentInstance), +/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), +/* harmony export */ getTransitionRawChildren: () => (/* binding */ getTransitionRawChildren), +/* harmony export */ guardReactiveProps: () => (/* binding */ guardReactiveProps), +/* harmony export */ h: () => (/* binding */ h), +/* harmony export */ handleError: () => (/* binding */ handleError), +/* harmony export */ hasInjectionContext: () => (/* binding */ hasInjectionContext), +/* harmony export */ initCustomFormatter: () => (/* binding */ initCustomFormatter), +/* harmony export */ inject: () => (/* binding */ inject), +/* harmony export */ isMemoSame: () => (/* binding */ isMemoSame), +/* harmony export */ isProxy: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy), +/* harmony export */ isReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive), +/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly), +/* harmony export */ isRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef), +/* harmony export */ isRuntimeOnly: () => (/* binding */ isRuntimeOnly), +/* harmony export */ isShallow: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow), +/* harmony export */ isVNode: () => (/* binding */ isVNode), +/* harmony export */ markRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw), +/* harmony export */ mergeDefaults: () => (/* binding */ mergeDefaults), +/* harmony export */ mergeModels: () => (/* binding */ mergeModels), +/* harmony export */ mergeProps: () => (/* binding */ mergeProps), +/* harmony export */ nextTick: () => (/* binding */ nextTick), +/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass), +/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeProps), +/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle), +/* harmony export */ onActivated: () => (/* binding */ onActivated), +/* harmony export */ onBeforeMount: () => (/* binding */ onBeforeMount), +/* harmony export */ onBeforeUnmount: () => (/* binding */ onBeforeUnmount), +/* harmony export */ onBeforeUpdate: () => (/* binding */ onBeforeUpdate), +/* harmony export */ onDeactivated: () => (/* binding */ onDeactivated), +/* harmony export */ onErrorCaptured: () => (/* binding */ onErrorCaptured), +/* harmony export */ onMounted: () => (/* binding */ onMounted), +/* harmony export */ onRenderTracked: () => (/* binding */ onRenderTracked), +/* harmony export */ onRenderTriggered: () => (/* binding */ onRenderTriggered), +/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), +/* harmony export */ onServerPrefetch: () => (/* binding */ onServerPrefetch), +/* harmony export */ onUnmounted: () => (/* binding */ onUnmounted), +/* harmony export */ onUpdated: () => (/* binding */ onUpdated), +/* harmony export */ openBlock: () => (/* binding */ openBlock), +/* harmony export */ popScopeId: () => (/* binding */ popScopeId), +/* harmony export */ provide: () => (/* binding */ provide), +/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), +/* harmony export */ pushScopeId: () => (/* binding */ pushScopeId), +/* harmony export */ queuePostFlushCb: () => (/* binding */ queuePostFlushCb), +/* harmony export */ reactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive), +/* harmony export */ readonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.readonly), +/* harmony export */ ref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref), +/* harmony export */ registerRuntimeCompiler: () => (/* binding */ registerRuntimeCompiler), +/* harmony export */ renderList: () => (/* binding */ renderList), +/* harmony export */ renderSlot: () => (/* binding */ renderSlot), +/* harmony export */ resolveComponent: () => (/* binding */ resolveComponent), +/* harmony export */ resolveDirective: () => (/* binding */ resolveDirective), +/* harmony export */ resolveDynamicComponent: () => (/* binding */ resolveDynamicComponent), +/* harmony export */ resolveFilter: () => (/* binding */ resolveFilter), +/* harmony export */ resolveTransitionHooks: () => (/* binding */ resolveTransitionHooks), +/* harmony export */ setBlockTracking: () => (/* binding */ setBlockTracking), +/* harmony export */ setDevtoolsHook: () => (/* binding */ setDevtoolsHook), +/* harmony export */ setTransitionHooks: () => (/* binding */ setTransitionHooks), +/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), +/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), +/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowRef), +/* harmony export */ ssrContextKey: () => (/* binding */ ssrContextKey), +/* harmony export */ ssrUtils: () => (/* binding */ ssrUtils), +/* harmony export */ stop: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.stop), +/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toDisplayString), +/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey), +/* harmony export */ toHandlers: () => (/* binding */ toHandlers), +/* harmony export */ toRaw: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw), +/* harmony export */ toRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRef), +/* harmony export */ toRefs: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRefs), +/* harmony export */ toValue: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toValue), +/* harmony export */ transformVNodeArgs: () => (/* binding */ transformVNodeArgs), +/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.triggerRef), +/* harmony export */ unref: () => (/* reexport safe */ _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.unref), +/* harmony export */ useAttrs: () => (/* binding */ useAttrs), +/* harmony export */ useModel: () => (/* binding */ useModel), +/* harmony export */ useSSRContext: () => (/* binding */ useSSRContext), +/* harmony export */ useSlots: () => (/* binding */ useSlots), +/* harmony export */ useTransitionState: () => (/* binding */ useTransitionState), +/* harmony export */ version: () => (/* binding */ version), +/* harmony export */ warn: () => (/* binding */ warn), +/* harmony export */ watch: () => (/* binding */ watch), +/* harmony export */ watchEffect: () => (/* binding */ watchEffect), +/* harmony export */ watchPostEffect: () => (/* binding */ watchPostEffect), +/* harmony export */ watchSyncEffect: () => (/* binding */ watchSyncEffect), +/* harmony export */ withAsyncContext: () => (/* binding */ withAsyncContext), +/* harmony export */ withCtx: () => (/* binding */ withCtx), +/* harmony export */ withDefaults: () => (/* binding */ withDefaults), +/* harmony export */ withDirectives: () => (/* binding */ withDirectives), +/* harmony export */ withMemo: () => (/* binding */ withMemo), +/* harmony export */ withScopeId: () => (/* binding */ withScopeId) +/* harmony export */ }); +/* harmony import */ var _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/reactivity */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); +/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); + + + + + +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +function warn$1(msg, ...args) { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + msg + args.join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; } else { - patchSuspense( - n1, - n2, - container, - anchor, - parentComponent, - isSVG, - slotScopeIds, - optimized, - rendererInternals - ); + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); } - }, - hydrate: hydrateSuspense, - create: createSuspenseBoundary, - normalize: normalizeSuspenseChildren -}; -const Suspense = SuspenseImpl ; -function triggerEvent(vnode, name) { - const eventListener = vnode.props && vnode.props[name]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(eventListener)) { - eventListener(); + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; } + return normalizedStack; } -function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { - const { - p: patch, - o: { createElement } - } = rendererInternals; - const hiddenContainer = createElement("div"); - const suspense = vnode.suspense = createSuspenseBoundary( - vnode, - parentSuspense, - parentComponent, - container, - hiddenContainer, - anchor, - isSVG, - slotScopeIds, - optimized, - rendererInternals - ); - patch( - null, - suspense.pendingBranch = vnode.ssContent, - hiddenContainer, - null, - parentComponent, - suspense, - isSVG, - slotScopeIds - ); - if (suspense.deps > 0) { - triggerEvent(vnode, "onPending"); - triggerEvent(vnode, "onFallback"); - patch( - null, - vnode.ssFallback, - container, - anchor, - parentComponent, - null, - // fallback tree will not have suspense context - isSVG, - slotScopeIds - ); - setActiveBranch(suspense, vnode.ssFallback); - } else { - suspense.resolve(false, true); +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); } + return res; } -function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { - const suspense = n2.suspense = n1.suspense; - suspense.vnode = n2; - n2.el = n1.el; - const newBranch = n2.ssContent; - const newFallback = n2.ssFallback; - const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; - if (pendingBranch) { - suspense.pendingBranch = newBranch; - if (isSameVNodeType(newBranch, pendingBranch)) { - patch( - pendingBranch, - newBranch, - suspense.hiddenContainer, - null, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - if (suspense.deps <= 0) { - suspense.resolve(); - } else if (isInFallback) { - patch( - activeBranch, - newFallback, - container, - anchor, - parentComponent, - null, - // fallback tree will not have suspense context - isSVG, - slotScopeIds, - optimized - ); - setActiveBranch(suspense, newFallback); - } - } else { - suspense.pendingId++; - if (isHydrating) { - suspense.isHydrating = false; - suspense.activeBranch = pendingBranch; - } else { - unmount(pendingBranch, parentComponent, suspense); - } - suspense.deps = 0; - suspense.effects.length = 0; - suspense.hiddenContainer = createElement("div"); - if (isInFallback) { - patch( - null, - newBranch, - suspense.hiddenContainer, - null, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - if (suspense.deps <= 0) { - suspense.resolve(); - } else { - patch( - activeBranch, - newFallback, - container, - anchor, - parentComponent, - null, - // fallback tree will not have suspense context - isSVG, - slotScopeIds, - optimized - ); - setActiveBranch(suspense, newFallback); - } - } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { - patch( - activeBranch, - newBranch, - container, - anchor, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - suspense.resolve(true); - } else { - patch( - null, - newBranch, - suspense.hiddenContainer, - null, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - if (suspense.deps <= 0) { - suspense.resolve(); - } - } - } +function formatProp(key, value, raw) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { + value = formatProp(key, (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; } else { - if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { - patch( - activeBranch, - newBranch, - container, - anchor, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - setActiveBranch(suspense, newBranch); - } else { - triggerEvent(n2, "onPending"); - suspense.pendingBranch = newBranch; - suspense.pendingId++; - patch( - null, - newBranch, - suspense.hiddenContainer, - null, - parentComponent, - suspense, - isSVG, - slotScopeIds, - optimized - ); - if (suspense.deps <= 0) { - suspense.resolve(); - } else { - const { timeout, pendingId } = suspense; - if (timeout > 0) { - setTimeout(() => { - if (suspense.pendingId === pendingId) { - suspense.fallback(newFallback); - } - }, timeout); - } else if (timeout === 0) { - suspense.fallback(newFallback); - } - } - } + value = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(value); + return raw ? value : [`${key}=`, value]; } } -let hasWarned = false; -function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) { - if ( true && !hasWarned) { - hasWarned = true; - console[console.info ? "info" : "log"]( - `<Suspense> is an experimental feature and its API will likely change.` - ); +function assertNumber(val, type) { + if (false) + {} + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} + +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ." +}; +function callWithErrorHandling(fn, instance, type, args) { + let res; + try { + res = args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); } - const { - p: patch, - m: move, - um: unmount, - n: next, - o: { parentNode, remove } - } = rendererInternals; - let parentSuspenseId; - const isSuspensible = isVNodeSuspensible(vnode); - if (isSuspensible) { - if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) { - parentSuspenseId = parentSuspense.pendingId; - parentSuspense.deps++; + return res; +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); } + return res; } - const timeout = vnode.props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(vnode.props.timeout) : void 0; - if (true) { - assertNumber(timeout, `Suspense timeout`); + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); } - const suspense = { - vnode, - parent: parentSuspense, - parentComponent, - isSVG, - container, - hiddenContainer, - anchor, - deps: 0, - pendingId: 0, - timeout: typeof timeout === "number" ? timeout : -1, - activeBranch: null, - pendingBranch: null, - isInFallback: true, - isHydrating, - isUnmounted: false, - effects: [], - resolve(resume = false, sync = false) { - if (true) { - if (!resume && !suspense.pendingBranch) { - throw new Error( - `suspense.resolve() is called without a pending branch.` - ); - } - if (suspense.isUnmounted) { - throw new Error( - `suspense.resolve() is called on an already unmounted suspense boundary.` - ); - } - } - const { - vnode: vnode2, - activeBranch, - pendingBranch, - pendingId, - effects, - parentComponent: parentComponent2, - container: container2 - } = suspense; - if (suspense.isHydrating) { - suspense.isHydrating = false; - } else if (!resume) { - const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; - if (delayEnter) { - activeBranch.transition.afterLeave = () => { - if (pendingId === suspense.pendingId) { - move(pendingBranch, container2, anchor2, 0); - } - }; - } - let { anchor: anchor2 } = suspense; - if (activeBranch) { - anchor2 = next(activeBranch); - unmount(activeBranch, parentComponent2, suspense, true); - } - if (!delayEnter) { - move(pendingBranch, container2, anchor2, 0); - } - } - setActiveBranch(suspense, pendingBranch); - suspense.pendingBranch = null; - suspense.isInFallback = false; - let parent = suspense.parent; - let hasUnresolvedAncestor = false; - while (parent) { - if (parent.pendingBranch) { - parent.effects.push(...effects); - hasUnresolvedAncestor = true; - break; - } - parent = parent.parent; - } - if (!hasUnresolvedAncestor) { - queuePostFlushCb(effects); - } - suspense.effects = []; - if (isSuspensible) { - if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { - parentSuspense.deps--; - if (parentSuspense.deps === 0 && !sync) { - parentSuspense.resolve(); + return values; +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = true ? ErrorTypeStrings$1[type] : 0; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; } } } - triggerEvent(vnode2, "onResolve"); - }, - fallback(fallbackVNode) { - if (!suspense.pendingBranch) { - return; - } - const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense; - triggerEvent(vnode2, "onFallback"); - const anchor2 = next(activeBranch); - const mountFallback = () => { - if (!suspense.isInFallback) { - return; - } - patch( - null, - fallbackVNode, - container2, - anchor2, - parentComponent2, - null, - // fallback tree will not have suspense context - isSVG2, - slotScopeIds, - optimized - ); - setActiveBranch(suspense, fallbackVNode); - }; - const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; - if (delayEnter) { - activeBranch.transition.afterLeave = mountFallback; - } - suspense.isInFallback = true; - unmount( - activeBranch, - parentComponent2, + cur = cur.parent; + } + const appErrorHandler = instance.appContext.config.errorHandler; + if (appErrorHandler) { + callWithErrorHandling( + appErrorHandler, null, - // no suspense so unmount hooks fire now - true - // shouldRemove + 10, + [err, exposedInstance, errorInfo] ); - if (!delayEnter) { - mountFallback(); - } - }, - move(container2, anchor2, type) { - suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); - suspense.container = container2; - }, - next() { - return suspense.activeBranch && next(suspense.activeBranch); - }, - registerDep(instance, setupRenderEffect) { - const isInPendingSuspense = !!suspense.pendingBranch; - if (isInPendingSuspense) { - suspense.deps++; - } - const hydratedEl = instance.vnode.el; - instance.asyncDep.catch((err) => { - handleError(err, instance, 0); - }).then((asyncSetupResult) => { - if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { - return; - } - instance.asyncResolved = true; - const { vnode: vnode2 } = instance; - if (true) { - pushWarningContext(vnode2); - } - handleSetupResult(instance, asyncSetupResult, false); - if (hydratedEl) { - vnode2.el = hydratedEl; - } - const placeholder = !hydratedEl && instance.subTree.el; - setupRenderEffect( - instance, - vnode2, - // component may have been moved before resolve. - // if this is not a hydration, instance.subTree will be the comment - // placeholder. - parentNode(hydratedEl || instance.subTree.el), - // anchor will not be used if this is hydration, so only need to - // consider the comment placeholder case. - hydratedEl ? null : next(instance.subTree), - suspense, - isSVG, - optimized - ); - if (placeholder) { - remove(placeholder); - } - updateHOCHostEl(instance, vnode2.el); - if (true) { - popWarningContext(); - } - if (isInPendingSuspense && --suspense.deps === 0) { - suspense.resolve(); - } - }); - }, - unmount(parentSuspense2, doRemove) { - suspense.isUnmounted = true; - if (suspense.activeBranch) { - unmount( - suspense.activeBranch, - parentComponent, - parentSuspense2, - doRemove - ); - } - if (suspense.pendingBranch) { - unmount( - suspense.pendingBranch, - parentComponent, - parentSuspense2, - doRemove - ); - } + return; } - }; - return suspense; + } + logError(err, type, contextVNode, throwInDev); } -function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) { - const suspense = vnode.suspense = createSuspenseBoundary( - vnode, - parentSuspense, - parentComponent, - node.parentNode, - document.createElement("div"), - null, - isSVG, - slotScopeIds, - optimized, - rendererInternals, - true - /* hydrating */ - ); - const result = hydrateNode( - node, - suspense.pendingBranch = vnode.ssContent, - parentComponent, - suspense, - slotScopeIds, - optimized - ); - if (suspense.deps === 0) { - suspense.resolve(false, true); - } - return result; -} -function normalizeSuspenseChildren(vnode) { - const { shapeFlag, children } = vnode; - const isSlotChildren = shapeFlag & 32; - vnode.ssContent = normalizeSuspenseSlot( - isSlotChildren ? children.default : children - ); - vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); -} -function normalizeSuspenseSlot(s) { - let block; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { - const trackBlock = isBlockTreeEnabled && s._c; - if (trackBlock) { - s._d = false; - openBlock(); +function logError(err, type, contextVNode, throwInDev = true) { + if (true) { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); } - s = s(); - if (trackBlock) { - s._d = true; - block = currentBlock; - closeBlock(); + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); } - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(s)) { - const singleChild = filterSingleRoot(s); - if ( true && !singleChild) { - warn(`<Suspense> slots expect a single root node.`); + if (throwInDev) { + throw err; + } else { + console.error(err); } - s = singleChild; - } - s = normalizeVNode(s); - if (block && !s.dynamicChildren) { - s.dynamicChildren = block.filter((c) => c !== s); - } - return s; + } else {} } -function queueEffectWithSuspense(fn, suspense) { - if (suspense && suspense.pendingBranch) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn)) { - suspense.effects.push(...fn); + +let isFlushing = false; +let isFlushPending = false; +const queue = []; +let flushIndex = 0; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.pre) { + start = middle + 1; } else { - suspense.effects.push(fn); + end = middle; } - } else { - queuePostFlushCb(fn); } + return start; } -function setActiveBranch(suspense, branch) { - suspense.activeBranch = branch; - const { vnode, parentComponent } = suspense; - const el = vnode.el = branch.el; - if (parentComponent && parentComponent.subTree === vnode) { - parentComponent.vnode.el = el; - updateHOCHostEl(parentComponent, el); +function queueJob(job) { + if (!queue.length || !queue.includes( + job, + isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex + )) { + if (job.id == null) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(job.id), 0, job); + } + queueFlush(); } } -function isVNodeSuspensible(vnode) { - var _a; - return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false; +function queueFlush() { + if (!isFlushing && !isFlushPending) { + isFlushPending = true; + currentFlushPromise = resolvedPromise.then(flushJobs); + } } - -function watchEffect(effect, options) { - return doWatch(effect, null, options); +function invalidateJob(job) { + const i = queue.indexOf(job); + if (i > flushIndex) { + queue.splice(i, 1); + } } -function watchPostEffect(effect, options) { - return doWatch( - effect, - null, - true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "post" }) : 0 - ); +function queuePostFlushCb(cb) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(cb)) { + if (!activePostFlushCbs || !activePostFlushCbs.includes( + cb, + cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex + )) { + pendingPostFlushCbs.push(cb); + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); } -function watchSyncEffect(effect, options) { - return doWatch( - effect, - null, - true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "sync" }) : 0 - ); +function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) { + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.pre) { + if (instance && cb.id !== instance.uid) { + continue; + } + if ( true && checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + cb(); + } + } } -const INITIAL_WATCHER_VALUE = {}; -function watch(source, cb, options) { - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(cb)) { - warn( - `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + if ( true && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) { + continue; + } + activePostFlushCbs[postFlushIndex](); + } + activePostFlushCbs = null; + postFlushIndex = 0; } - return doWatch(source, cb, options); } -function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { - var _a; - if ( true && !cb) { - if (immediate !== void 0) { - warn( - `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` - ); +const getId = (job) => job.id == null ? Infinity : job.id; +const comparator = (a, b) => { + const diff = getId(a) - getId(b); + if (diff === 0) { + if (a.pre && !b.pre) + return -1; + if (b.pre && !a.pre) + return 1; + } + return diff; +}; +function flushJobs(seen) { + isFlushPending = false; + isFlushing = true; + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + queue.sort(comparator); + const check = true ? (job) => checkRecursiveUpdates(seen, job) : 0; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && job.active !== false) { + if ( true && check(job)) { + continue; + } + callWithErrorHandling(job, null, 14); + } } - if (deep !== void 0) { - warn( - `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + } finally { + flushIndex = 0; + queue.length = 0; + flushPostFlushCbs(seen); + isFlushing = false; + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + if (!seen.has(fn)) { + seen.set(fn, 1); + } else { + const count = seen.get(fn); + if (count > RECURSION_LIMIT) { + const instance = fn.ownerInstance; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 ); + return true; + } else { + seen.set(fn, count + 1); } } - const warnInvalidSource = (s) => { - warn( - `Invalid watch source: `, - s, - `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` - ); +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Set(); +if (true) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) }; - const instance = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null; - let getter; - let forceTrigger = false; - let isMultiSource = false; - if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(source)) { - getter = () => source.value; - forceTrigger = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(source); - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(source)) { - getter = () => source; - deep = true; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source)) { - isMultiSource = true; - forceTrigger = source.some((s) => (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(s)); - getter = () => source.map((s) => { - if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(s)) { - return s.value; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s)) { - return traverse(s); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { - return callWithErrorHandling(s, instance, 2); - } else { - true && warnInvalidSource(s); - } - }); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { - if (cb) { - getter = () => callWithErrorHandling(source, instance, 2); - } else { - getter = () => { - if (instance && instance.isUnmounted) { - return; - } - if (cleanup) { - cleanup(); - } - return callWithAsyncErrorHandling( - source, - instance, - 3, - [onCleanup] - ); - }; - } - } else { - getter = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; - true && warnInvalidSource(source); +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); } - if (cb && deep) { - const baseGetter = getter; - getter = () => traverse(baseGetter()); + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; } - let cleanup; - let onCleanup = (fn) => { - cleanup = effect.onStop = () => { - callWithErrorHandling(fn, instance, 4); - }; - }; - let ssrCleanup; - if (isInSSRComponentSetup) { - onCleanup = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; - if (!cb) { - getter(); - } else if (immediate) { - callWithAsyncErrorHandling(cb, instance, 3, [ - getter(), - isMultiSource ? [] : void 0, - onCleanup - ]); - } - if (flush === "sync") { - const ctx = useSSRContext(); - ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); - } else { - return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; - } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; } - let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; - const job = () => { - if (!effect.active) { - return; + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; } - if (cb) { - const newValue = effect.run(); - if (deep || forceTrigger || (isMultiSource ? newValue.some( - (v, i) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(v, oldValue[i]) - ) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(newValue, oldValue)) || false) { - if (cleanup) { - cleanup(); - } - callWithAsyncErrorHandling(cb, instance, 3, [ - newValue, - // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, - onCleanup - ]); - oldValue = newValue; + instance.renderCache = []; + isHmrUpdating = true; + instance.effect.dirty = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) + return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (const instance of instances) { + const oldComp = normalizeClassComponent(instance.type); + if (!hmrDirtyComponents.has(oldComp)) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); } - } else { - effect.run(); + hmrDirtyComponents.add(oldComp); } - }; - job.allowRecurse = !!cb; - let scheduler; - if (flush === "sync") { - scheduler = job; - } else if (flush === "post") { - scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); - } else { - job.pre = true; - if (instance) - job.id = instance.uid; - scheduler = () => queueJob(job); - } - const effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect(getter, scheduler); - if (true) { - effect.onTrack = onTrack; - effect.onTrigger = onTrigger; - } - if (cb) { - if (immediate) { - job(); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + hmrDirtyComponents.add(oldComp); + instance.ceReload(newComp.styles); + hmrDirtyComponents.delete(oldComp); + } else if (instance.parent) { + instance.parent.effect.dirty = true; + queueJob(instance.parent.update); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); } else { - oldValue = effect.run(); + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); } - } else if (flush === "post") { - queuePostRenderEffect( - effect.run.bind(effect), - instance && instance.suspense - ); - } else { - effect.run(); } - const unwatch = () => { - effect.stop(); - if (instance && instance.scope) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(instance.scope.effects, effect); + queuePostFlushCb(() => { + for (const instance of instances) { + hmrDirtyComponents.delete( + normalizeClassComponent(instance.type) + ); } - }; - if (ssrCleanup) - ssrCleanup.push(unwatch); - return unwatch; + }); } -function instanceWatch(source, value, options) { - const publicThis = this.proxy; - const getter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); - let cb; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { - cb = value; - } else { - cb = value.handler; - options = value; - } - const cur = currentInstance; - setCurrentInstance(this); - const res = doWatch(getter, cb.bind(publicThis), options); - if (cur) { - setCurrentInstance(cur); - } else { - unsetCurrentInstance(); +function updateComponentDef(oldComp, newComp) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } } - return res; } -function createPathGetter(ctx, path) { - const segments = path.split("."); - return () => { - let cur = ctx; - for (let i = 0; i < segments.length && cur; i++) { - cur = cur[segments[i]]; +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); } - return cur; }; } -function traverse(value, seen) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value) || value["__v_skip"]) { - return value; - } - seen = seen || /* @__PURE__ */ new Set(); - if (seen.has(value)) { - return value; - } - seen.add(value); - if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { - traverse(value.value, seen); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - for (let i = 0; i < value.length; i++) { - traverse(value[i], seen); - } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMap)(value)) { - value.forEach((v) => { - traverse(v, seen); - }); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)) { - for (const key in value) { - traverse(value[key], seen); - } - } - return value; -} -function validateDirectiveName(name) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBuiltInDirective)(name)) { - warn("Do not use built-in directive ids as custom directive id: " + name); +let devtools$1; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); } } -function withDirectives(vnode, directives) { - const internalInstance = currentRenderingInstance; - if (internalInstance === null) { - true && warn(`withDirectives can only be used inside render functions.`); - return vnode; - } - const instance = getExposeProxy(internalInstance) || internalInstance.proxy; - const bindings = vnode.dirs || (vnode.dirs = []); - for (let i = 0; i < directives.length; i++) { - let [dir, value, arg, modifiers = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ] = directives[i]; - if (dir) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dir)) { - dir = { - mounted: dir, - updated: dir - }; - } - if (dir.deep) { - traverse(value); +function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; } - bindings.push({ - dir, - instance, - value, - oldValue: void 0, - arg, - modifiers - }); - } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; } - return vnode; } -function invokeDirectiveHook(vnode, prevVNode, instance, name) { - const bindings = vnode.dirs; - const oldBindings = prevVNode && prevVNode.dirs; - for (let i = 0; i < bindings.length; i++) { - const binding = bindings[i]; - if (oldBindings) { - binding.oldValue = oldBindings[i].value; - } - let hook = binding.dir[name]; - if (hook) { - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - callWithAsyncErrorHandling(hook, instance, 8, [ - vnode.el, - binding, - vnode, - prevVNode - ]); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); - } +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( + "component:added" /* COMPONENT_ADDED */ +); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); } +}; +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; } - -function useTransitionState() { - const state = { - isMounted: false, - isLeaving: false, - isUnmounting: false, - leavingVNodes: /* @__PURE__ */ new Map() +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:start" /* PERFORMANCE_START */ +); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:end" /* PERFORMANCE_END */ +); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); }; - onMounted(() => { - state.isMounted = true; - }); - onBeforeUnmount(() => { - state.isUnmounting = true; - }); - return state; } -const TransitionHookValidator = [Function, Array]; -const BaseTransitionPropsValidators = { - mode: String, - appear: Boolean, - persisted: Boolean, - // enter - onBeforeEnter: TransitionHookValidator, - onEnter: TransitionHookValidator, - onAfterEnter: TransitionHookValidator, - onEnterCancelled: TransitionHookValidator, - // leave - onBeforeLeave: TransitionHookValidator, - onLeave: TransitionHookValidator, - onAfterLeave: TransitionHookValidator, - onLeaveCancelled: TransitionHookValidator, - // appear - onBeforeAppear: TransitionHookValidator, - onAppear: TransitionHookValidator, - onAfterAppear: TransitionHookValidator, - onAppearCancelled: TransitionHookValidator -}; -const BaseTransitionImpl = { - name: `BaseTransition`, - props: BaseTransitionPropsValidators, - setup(props, { slots }) { - const instance = getCurrentInstance(); - const state = useTransitionState(); - let prevTransitionKey; - return () => { - const children = slots.default && getTransitionRawChildren(slots.default(), true); - if (!children || !children.length) { - return; - } - let child = children[0]; - if (children.length > 1) { - let hasFound = false; - for (const c of children) { - if (c.type !== Comment) { - if ( true && hasFound) { - warn( - "<transition> can only be used on a single element or component. Use <transition-group> for lists." - ); - break; - } - child = c; - hasFound = true; - if (false) - {} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) + return; + const props = instance.vnode.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + if (true) { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event) in propsOptions)) { + warn$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); } } } - const rawProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); - const { mode } = rawProps; - if ( true && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { - warn(`invalid <transition> mode: ${mode}`); - } - if (state.isLeaving) { - return emptyPlaceholder(child); - } - const innerChild = getKeepAliveChild(child); - if (!innerChild) { - return emptyPlaceholder(child); - } - const enterHooks = resolveTransitionHooks( - innerChild, - rawProps, - state, - instance + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modelArg = isModelListener && event.slice(7); + if (modelArg && modelArg in props) { + const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; + const { number, trim } = props[modifiersKey] || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + if (trim) { + args = rawArgs.map((a) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(a) ? a.trim() : a); + } + if (number) { + args = rawArgs.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber); + } + } + if (true) { + devtoolsComponentEmit(instance, event, args); + } + if (true) { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(lowerCaseEvent)]) { + warn$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)( + event + )}" instead of "${event}".` ); - setTransitionHooks(innerChild, enterHooks); - const oldChild = instance.subTree; - const oldInnerChild = oldChild && getKeepAliveChild(oldChild); - let transitionKeyChanged = false; - const { getTransitionKey } = innerChild.type; - if (getTransitionKey) { - const key = getTransitionKey(); - if (prevTransitionKey === void 0) { - prevTransitionKey = key; - } else if (key !== prevTransitionKey) { - prevTransitionKey = key; - transitionKeyChanged = true; - } - } - if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { - const leavingHooks = resolveTransitionHooks( - oldInnerChild, - rawProps, - state, - instance - ); - setTransitionHooks(oldInnerChild, leavingHooks); - if (mode === "out-in") { - state.isLeaving = true; - leavingHooks.afterLeave = () => { - state.isLeaving = false; - if (instance.update.active !== false) { - instance.update(); - } - }; - return emptyPlaceholder(child); - } else if (mode === "in-out" && innerChild.type !== Comment) { - leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { - const leavingVNodesCache = getLeavingNodesForType( - state, - oldInnerChild - ); - leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; - el._leaveCb = () => { - earlyRemove(); - el._leaveCb = void 0; - delete enterHooks.delayedLeave; - }; - enterHooks.delayedLeave = delayedLeave; - }; - } - } - return child; - }; + } } -}; -const BaseTransition = BaseTransitionImpl; -function getLeavingNodesForType(state, vnode) { - const { leavingVNodes } = state; - let leavingVNodesCache = leavingVNodes.get(vnode.type); - if (!leavingVNodesCache) { - leavingVNodesCache = /* @__PURE__ */ Object.create(null); - leavingVNodes.set(vnode.type, leavingVNodesCache); + let handlerName; + let handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(event)] || // also try camelCase event handler (#2249) + props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event))]; } - return leavingVNodesCache; -} -function resolveTransitionHooks(vnode, props, state, instance) { - const { - appear, - mode, - persisted = false, - onBeforeEnter, - onEnter, - onAfterEnter, - onEnterCancelled, - onBeforeLeave, - onLeave, - onAfterLeave, - onLeaveCancelled, - onBeforeAppear, - onAppear, - onAfterAppear, - onAppearCancelled - } = props; - const key = String(vnode.key); - const leavingVNodesCache = getLeavingNodesForType(state, vnode); - const callHook = (hook, args) => { - hook && callWithAsyncErrorHandling( - hook, + if (handler) { + callWithAsyncErrorHandling( + handler, instance, - 9, + 6, args ); - }; - const callAsyncHook = (hook, args) => { - const done = args[1]; - callHook(hook, args); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { - if (hook.every((hook2) => hook2.length <= 1)) - done(); - } else if (hook.length <= 1) { - done(); - } - }; - const hooks = { - mode, - persisted, - beforeEnter(el) { - let hook = onBeforeEnter; - if (!state.isMounted) { - if (appear) { - hook = onBeforeAppear || onBeforeEnter; - } else { - return; - } - } - if (el._leaveCb) { - el._leaveCb( - true - /* cancelled */ - ); - } - const leavingVNode = leavingVNodesCache[key]; - if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) { - leavingVNode.el._leaveCb(); - } - callHook(hook, [el]); - }, - enter(el) { - let hook = onEnter; - let afterHook = onAfterEnter; - let cancelHook = onEnterCancelled; - if (!state.isMounted) { - if (appear) { - hook = onAppear || onEnter; - afterHook = onAfterAppear || onAfterEnter; - cancelHook = onAppearCancelled || onEnterCancelled; - } else { - return; - } - } - let called = false; - const done = el._enterCb = (cancelled) => { - if (called) - return; - called = true; - if (cancelled) { - callHook(cancelHook, [el]); - } else { - callHook(afterHook, [el]); - } - if (hooks.delayedLeave) { - hooks.delayedLeave(); - } - el._enterCb = void 0; - }; - if (hook) { - callAsyncHook(hook, [el, done]); - } else { - done(); - } - }, - leave(el, remove) { - const key2 = String(vnode.key); - if (el._enterCb) { - el._enterCb( - true - /* cancelled */ - ); - } - if (state.isUnmounting) { - return remove(); - } - callHook(onBeforeLeave, [el]); - let called = false; - const done = el._leaveCb = (cancelled) => { - if (called) - return; - called = true; - remove(); - if (cancelled) { - callHook(onLeaveCancelled, [el]); - } else { - callHook(onAfterLeave, [el]); - } - el._leaveCb = void 0; - if (leavingVNodesCache[key2] === vnode) { - delete leavingVNodesCache[key2]; - } - }; - leavingVNodesCache[key2] = vnode; - if (onLeave) { - callAsyncHook(onLeave, [el, done]); - } else { - done(); - } - }, - clone(vnode2) { - return resolveTransitionHooks(vnode2, props, state, instance); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; } - }; - return hooks; -} -function emptyPlaceholder(vnode) { - if (isKeepAlive(vnode)) { - vnode = cloneVNode(vnode); - vnode.children = null; - return vnode; + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); } } -function getKeepAliveChild(vnode) { - return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode; -} -function setTransitionHooks(vnode, hooks) { - if (vnode.shapeFlag & 6 && vnode.component) { - setTransitionHooks(vnode.component.subTree, hooks); - } else if (vnode.shapeFlag & 128) { - vnode.ssContent.transition = hooks.clone(vnode.ssContent); - vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); - } else { - vnode.transition = hooks; +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; } -} -function getTransitionRawChildren(children, keepComment = false, parentKey) { - let ret = []; - let keyedFragmentCount = 0; - for (let i = 0; i < children.length; i++) { - let child = children[i]; - const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); - if (child.type === Fragment) { - if (child.patchFlag & 128) - keyedFragmentCount++; - ret = ret.concat( - getTransitionRawChildren(child.children, keepComment, key) - ); - } else if (keepComment || child.type !== Comment) { - ret.push(key != null ? cloneVNode(child, { key }) : child); + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); } } - if (keyedFragmentCount > 1) { - for (let i = 0; i < ret.length; i++) { - ret[i].patchFlag = -2; + if (!raw && !hasExtends) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { + cache.set(comp, null); } + return null; } - return ret; -} - -function defineComponent(options, extraOptions) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? ( - // #8326: extend call and options.name access are considered side-effects - // by Rollup, so we have to wrap it in a pure-annotated IIFE. - /* @__PURE__ */ (() => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ name: options.name }, extraOptions, { setup: options }))() - ) : options; -} - -const isAsyncWrapper = (i) => !!i.type.__asyncLoader; -function defineAsyncComponent(source) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { - source = { loader: source }; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, raw); } - const { - loader, - loadingComponent, - errorComponent, - delay = 200, - timeout, - // undefined = never times out - suspensible = true, - onError: userOnError - } = source; - let pendingRequest = null; - let resolvedComp; - let retries = 0; - const retry = () => { - retries++; - pendingRequest = null; - return load(); - }; - const load = () => { - let thisRequest; - return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { - err = err instanceof Error ? err : new Error(String(err)); - if (userOnError) { - return new Promise((resolve, reject) => { - const userRetry = () => resolve(retry()); - const userFail = () => reject(err); - userOnError(err, userRetry, userFail, retries + 1); - }); - } else { - throw err; - } - }).then((comp) => { - if (thisRequest !== pendingRequest && pendingRequest) { - return pendingRequest; - } - if ( true && !comp) { - warn( - `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` - ); - } - if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { - comp = comp.default; - } - if ( true && comp && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { - throw new Error(`Invalid async component load result: ${comp}`); - } - resolvedComp = comp; - return comp; - })); - }; - return defineComponent({ - name: "AsyncComponentWrapper", - __asyncLoader: load, - get __asyncResolved() { - return resolvedComp; - }, - setup() { - const instance = currentInstance; - if (resolvedComp) { - return () => createInnerComp(resolvedComp, instance); - } - const onError = (err) => { - pendingRequest = null; - handleError( - err, - instance, - 13, - !errorComponent - /* do not throw in dev if user provided error component */ - ); - }; - if (suspensible && instance.suspense || isInSSRComponentSetup) { - return load().then((comp) => { - return () => createInnerComp(comp, instance); - }).catch((err) => { - onError(err); - return () => errorComponent ? createVNode(errorComponent, { - error: err - }) : null; - }); - } - const loaded = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(false); - const error = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); - const delayed = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(!!delay); - if (delay) { - setTimeout(() => { - delayed.value = false; - }, delay); - } - if (timeout != null) { - setTimeout(() => { - if (!loaded.value && !error.value) { - const err = new Error( - `Async component timed out after ${timeout}ms.` - ); - onError(err); - error.value = err; - } - }, timeout); - } - load().then(() => { - loaded.value = true; - if (instance.parent && isKeepAlive(instance.parent.vnode)) { - queueJob(instance.parent.update); - } - }).catch((err) => { - onError(err); - error.value = err; - }); - return () => { - if (loaded.value && resolvedComp) { - return createInnerComp(resolvedComp, instance); - } else if (error.value && errorComponent) { - return createVNode(errorComponent, { - error: error.value - }); - } else if (loadingComponent && !delayed.value) { - return createVNode(loadingComponent); - } - }; - } - }); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { + cache.set(comp, normalized); + } + return normalized; } -function createInnerComp(comp, parent) { - const { ref: ref2, props, children, ce } = parent.vnode; - const vnode = createVNode(comp, props, children); - vnode.ref = ref2; - vnode.ce = ce; - delete parent.vnode.ce; - return vnode; +function isEmitListener(options, key) { + if (!options || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, key); } -const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; -const KeepAliveImpl = { - name: `KeepAlive`, - // Marker for special handling inside the renderer. We are not using a === - // check directly on KeepAlive in the renderer, because importing it directly - // would prevent it from being tree-shaken. - __isKeepAlive: true, - props: { - include: [String, RegExp, Array], - exclude: [String, RegExp, Array], - max: [String, Number] - }, - setup(props, { slots }) { - const instance = getCurrentInstance(); - const sharedContext = instance.ctx; - if (!sharedContext.renderer) { - return () => { - const children = slots.default && slots.default(); - return children && children.length === 1 ? children[0] : children; - }; +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) + return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } } - const cache = /* @__PURE__ */ new Map(); - const keys = /* @__PURE__ */ new Set(); - let current = null; if (true) { - instance.__v_cache = cache; + devtoolsComponentUpdated(ctx); } - const parentSuspense = instance.suspense; - const { - renderer: { - p: patch, - m: move, - um: _unmount, - o: { createElement } - } - } = sharedContext; - const storageContainer = createElement("div"); - sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => { - const instance2 = vnode.component; - move(vnode, container, anchor, 0, parentSuspense); - patch( - instance2.vnode, - vnode, - container, - anchor, - instance2, - parentSuspense, - isSVG, - vnode.slotScopeIds, - optimized - ); - queuePostRenderEffect(() => { - instance2.isDeactivated = false; - if (instance2.a) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.a); - } - const vnodeHook = vnode.props && vnode.props.onVnodeMounted; - if (vnodeHook) { - invokeVNodeHook(vnodeHook, instance2.parent, vnode); - } - }, parentSuspense); - if (true) { - devtoolsComponentAdded(instance2); - } - }; - sharedContext.deactivate = (vnode) => { - const instance2 = vnode.component; - move(vnode, storageContainer, null, 1, parentSuspense); - queuePostRenderEffect(() => { - if (instance2.da) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.da); - } - const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; - if (vnodeHook) { - invokeVNodeHook(vnodeHook, instance2.parent, vnode); - } - instance2.isDeactivated = true; - }, parentSuspense); - if (true) { - devtoolsComponentAdded(instance2); - } - }; - function unmount(vnode) { - resetShapeFlag(vnode); - _unmount(vnode, instance, parentSuspense, true); - } - function pruneCache(filter) { - cache.forEach((vnode, key) => { - const name = getComponentName(vnode.type); - if (name && (!filter || !filter(name))) { - pruneCacheEntry(key); + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + props, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + data, + setupState, + ctx, + inheritAttrs + } = instance; + let result; + let fallthroughAttrs; + const prev = setCurrentRenderingInstance(instance); + if (true) { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = true && setupState.__isScriptSetup ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); } - }); - } - function pruneCacheEntry(key) { - const cached = cache.get(key); - if (!current || !isSameVNodeType(cached, current)) { - unmount(cached); - } else if (current) { - resetShapeFlag(current); + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if ( true && attrs === props) { + markAttrsAccessed(); } - cache.delete(key); - keys.delete(key); + result = normalizeVNode( + render2.length > 1 ? render2( + props, + true ? { + get attrs() { + markAttrsAccessed(); + return attrs; + }, + slots, + emit + } : 0 + ) : render2( + props, + null + /* we know it doesn't need it */ + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } - watch( - () => [props.include, props.exclude], - ([include, exclude]) => { - include && pruneCache((name) => matches(include, name)); - exclude && pruneCache((name) => !matches(exclude, name)); - }, - // prune post-render after `current` has been updated - { flush: "post", deep: true } - ); - let pendingCacheKey = null; - const cacheSubtree = () => { - if (pendingCacheKey != null) { - cache.set(pendingCacheKey, getInnerChild(instance.subTree)); - } - }; - onMounted(cacheSubtree); - onUpdated(cacheSubtree); - onBeforeUnmount(() => { - cache.forEach((cached) => { - const { subTree, suspense } = instance; - const vnode = getInnerChild(subTree); - if (cached.type === vnode.type && cached.key === vnode.key) { - resetShapeFlag(vnode); - const da = vnode.component.da; - da && queuePostRenderEffect(da, suspense); - return; - } - unmount(cached); - }); - }); - return () => { - pendingCacheKey = null; - if (!slots.default) { - return null; - } - const children = slots.default(); - const rawVNode = children[0]; - if (children.length > 1) { - if (true) { - warn(`KeepAlive should contain exactly one component child.`); + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if ( true && result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); } - current = null; - return children; - } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { - current = null; - return rawVNode; - } - let vnode = getInnerChild(rawVNode); - const comp = vnode.type; - const name = getComponentName( - isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp - ); - const { include, exclude, max } = props; - if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { - current = vnode; - return rawVNode; - } - const key = vnode.key == null ? comp : vnode.key; - const cachedVNode = cache.get(key); - if (vnode.el) { - vnode = cloneVNode(vnode); - if (rawVNode.shapeFlag & 128) { - rawVNode.ssContent = vnode; + root = cloneVNode(root, fallthroughAttrs); + } else if ( true && !accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } } - } - pendingCacheKey = key; - if (cachedVNode) { - vnode.el = cachedVNode.el; - vnode.component = cachedVNode.component; - if (vnode.transition) { - setTransitionHooks(vnode, vnode.transition); + if (extraAttrs.length) { + warn$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` + ); } - vnode.shapeFlag |= 512; - keys.delete(key); - keys.add(key); - } else { - keys.add(key); - if (max && keys.size > parseInt(max, 10)) { - pruneCacheEntry(keys.values().next().value); + if (eventAttrs.length) { + warn$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); } } - vnode.shapeFlag |= 256; - current = vnode; - return isSuspense(rawVNode.type) ? rawVNode : vnode; - }; + } } -}; -const KeepAlive = KeepAliveImpl; -function matches(pattern, name) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(pattern)) { - return pattern.some((p) => matches(p, name)); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(pattern)) { - return pattern.split(",").includes(name); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isRegExp)(pattern)) { - return pattern.test(name); + if (vnode.dirs) { + if ( true && !isElementRoot(root)) { + warn$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; } - return false; -} -function onActivated(hook, target) { - registerKeepAliveHook(hook, "a", target); -} -function onDeactivated(hook, target) { - registerKeepAliveHook(hook, "da", target); -} -function registerKeepAliveHook(hook, type, target = currentInstance) { - const wrappedHook = hook.__wdc || (hook.__wdc = () => { - let current = target; - while (current) { - if (current.isDeactivated) { - return; - } - current = current.parent; + if (vnode.transition) { + if ( true && !isElementRoot(root)) { + warn$1( + `Component inside <Transition> renders non-element root node that cannot be animated.` + ); } - return hook(); - }); - injectHook(type, wrappedHook, target); - if (target) { - let current = target.parent; - while (current && current.parent) { - if (isKeepAlive(current.parent.vnode)) { - injectToKeepAliveRoot(wrappedHook, type, target, current); + root.transition = vnode.transition; + } + if ( true && setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren); + if (!childRoot) { + return [vnode, void 0]; + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; } - current = current.parent; + } + }; + return [normalizeVNode(childRoot), setRoot]; +}; +function filterSingleRoot(children) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + } + } + } else { + return; } } + return singleRoot; } -function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { - const injected = injectHook( - type, - hook, - keepAliveRoot, - true - /* prepend */ - ); - onUnmounted(() => { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(keepAliveRoot[type], injected); - }, target); -} -function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ( true && (prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; } -function getInnerChild(vnode) { - return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; } - -function injectHook(type, hook, target = currentInstance, prepend = false) { - if (target) { - const hooks = target[type] || (target[type] = []); - const wrappedHook = hook.__weh || (hook.__weh = (...args) => { - if (target.isUnmounted) { - return; - } - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - setCurrentInstance(target); - const res = callWithAsyncErrorHandling(hook, target, type, args); - unsetCurrentInstance(); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); - return res; - }); - if (prepend) { - hooks.unshift(wrappedHook); +function updateHOCHostEl({ vnode, parent }, el) { + if (!el) + return; + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.el = vnode.el; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; } else { - hooks.push(wrappedHook); + break; } - return wrappedHook; - } else if (true) { - const apiName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(ErrorTypeStrings[type].replace(/ hook$/, "")); - warn( - `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) - ); } } -const createHook = (lifecycle) => (hook, target = currentInstance) => ( - // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) - (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target) -); -const onBeforeMount = createHook("bm"); -const onMounted = createHook("m"); -const onBeforeUpdate = createHook("bu"); -const onUpdated = createHook("u"); -const onBeforeUnmount = createHook("bum"); -const onUnmounted = createHook("um"); -const onServerPrefetch = createHook("sp"); -const onRenderTriggered = createHook( - "rtg" -); -const onRenderTracked = createHook( - "rtc" -); -function onErrorCaptured(hook, target = currentInstance) { - injectHook("ec", hook, target); -} const COMPONENTS = "components"; const DIRECTIVES = "directives"; @@ -12648,7 +12054,6 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false const selfName = getComponentName( Component, false - /* do not include inferred name to avoid breaking existing code */ ); if (selfName && (selfName === name || selfName === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name) || selfName === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name)))) { return Component; @@ -12666,11 +12071,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false if ( true && warnMissing && !res) { const extra = type === COMPONENTS ? ` If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; - warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); } return res; } else if (true) { - warn( + warn$1( `resolve${(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)(type.slice(0, -1))} can only be used in render() or setup().` ); } @@ -12679,12365 +12084,10261 @@ function resolve(registry, name) { return registry && (registry[name] || registry[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name)] || registry[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name))]); } -function renderList(source, renderItem, cache, index) { - let ret; - const cached = cache && cache[index]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source)) { - ret = new Array(source.length); - for (let i = 0, l = source.length; i < l; i++) { - ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); - } - } else if (typeof source === "number") { - if ( true && !Number.isInteger(source)) { - warn(`The v-for range expect an integer value but got ${source}.`); - } - ret = new Array(source); - for (let i = 0; i < source; i++) { - ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); - } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(source)) { - if (source[Symbol.iterator]) { - ret = Array.from( - source, - (item, i) => renderItem(item, i, void 0, cached && cached[i]) +const isSuspense = (type) => type.__isSuspense; +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals ); } else { - const keys = Object.keys(source); - ret = new Array(keys.length); - for (let i = 0, l = keys.length; i < l; i++) { - const key = keys[i]; - ret[i] = renderItem(source[key], key, i, cached && cached[i]); - } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); } - } else { - ret = []; - } - if (cache) { - cache[index] = ret; + }, + hydrate: hydrateSuspense, + create: createSuspenseBoundary, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(eventListener)) { + eventListener(); } - return ret; } - -function createSlots(slots, dynamicSlots) { - for (let i = 0; i < dynamicSlots.length; i++) { - const slot = dynamicSlots[i]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(slot)) { - for (let j = 0; j < slot.length; j++) { - slots[slot[j].name] = slot[j].fn; +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } } - } else if (slot) { - slots[slot.name] = slot.key ? (...args) => { - const res = slot.fn(...args); - if (res) - res.key = slot.key; - return res; - } : slot.fn; } } - return slots; } - -function renderSlot(slots, name, props = {}, fallback, noSlotted) { - if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { - if (name !== "default") - props.name = name; - return createVNode("slot", props, fallback && fallback()); - } - let slot = slots[name]; - if ( true && slot && slot.length > 1) { - warn( - `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` +let hasWarned = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if ( true && !hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + `<Suspense> is an experimental feature and its API will likely change.` ); - slot = () => []; } - if (slot && slot._c) { - slot._d = false; + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } } - openBlock(); - const validSlotContent = slot && ensureValidVNode(slot(props)); - const rendered = createBlock( - Fragment, - { - key: props.key || // slot content array of a dynamic conditional slot may have a branch - // key attached in the `createSlots` helper, respect that - validSlotContent && validSlotContent.key || `_${name}` - }, - validSlotContent || (fallback ? fallback() : []), - validSlotContent && slots._ === 1 ? 64 : -2 - ); - if (!noSlotted && rendered.scopeId) { - rendered.slotScopeIds = [rendered.scopeId + "-s"]; - } - if (slot && slot._c) { - slot._d = true; - } - return rendered; -} -function ensureValidVNode(vnodes) { - return vnodes.some((child) => { - if (!isVNode(child)) - return true; - if (child.type === Comment) - return false; - if (child.type === Fragment && !ensureValidVNode(child.children)) - return false; - return true; - }) ? vnodes : null; -} - -function toHandlers(obj, preserveCaseIfNecessary) { - const ret = {}; - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { - warn(`v-on with no argument expects an object value.`); - return ret; - } - for (const key in obj) { - ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(key)] = obj[key]; + const timeout = vnode.props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(vnode.props.timeout) : void 0; + if (true) { + assertNumber(timeout, `Suspense timeout`); } - return ret; -} - -const getPublicInstance = (i) => { - if (!i) - return null; - if (isStatefulComponent(i)) - return getExposeProxy(i) || i.proxy; - return getPublicInstance(i.parent); -}; -const publicPropertiesMap = ( - // Move PURE marker to new line to workaround compiler discarding it - // due to type annotation - /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), { - $: (i) => i, - $el: (i) => i.vnode.el, - $data: (i) => i.data, - $props: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.props) : 0, - $attrs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.attrs) : 0, - $slots: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.slots) : 0, - $refs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.refs) : 0, - $parent: (i) => getPublicInstance(i.parent), - $root: (i) => getPublicInstance(i.root), - $emit: (i) => i.emit, - $options: (i) => true ? resolveMergedOptions(i) : 0, - $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)), - $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), - $watch: (i) => true ? instanceWatch.bind(i) : 0 - }) -); -const isReservedPrefix = (key) => key === "_" || key === "$"; -const hasSetupBinding = (state, key) => state !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && !state.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(state, key); -const PublicInstanceProxyHandlers = { - get({ _: instance }, key) { - const { ctx, setupState, data, props, accessCache, type, appContext } = instance; - if ( true && key === "__isVue") { - return true; - } - let normalizedProps; - if (key[0] !== "$") { - const n = accessCache[key]; - if (n !== void 0) { - switch (n) { - case 1 /* SETUP */: - return setupState[key]; - case 2 /* DATA */: - return data[key]; - case 4 /* CONTEXT */: - return ctx[key]; - case 3 /* PROPS */: - return props[key]; + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + if (true) { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); } - } else if (hasSetupBinding(setupState, key)) { - accessCache[key] = 1 /* SETUP */; - return setupState[key]; - } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { - accessCache[key] = 2 /* DATA */; - return data[key]; - } else if ( - // only cache other properties when instance has declared (thus stable) - // props - (normalizedProps = instance.propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) - ) { - accessCache[key] = 3 /* PROPS */; - return props[key]; - } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { - accessCache[key] = 4 /* CONTEXT */; - return ctx[key]; - } else if ( false || shouldCacheAccess) { - accessCache[key] = 0 /* OTHER */; } - } - const publicGetter = publicPropertiesMap[key]; - let cssModule, globalProperties; - if (publicGetter) { - if (key === "$attrs") { - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); - true && markAttrsAccessed(); - } else if ( true && key === "$slots") { - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode(activeBranch.el) !== suspense.hiddenContainer) { + anchor = next(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } } - return publicGetter(instance); - } else if ( - // css module (injected by vue-loader) - (cssModule = type.__cssModules) && (cssModule = cssModule[key]) - ) { - return cssModule; - } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { - accessCache[key] = 4 /* CONTEXT */; - return ctx[key]; - } else if ( - // global properties - globalProperties = appContext.config.globalProperties, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(globalProperties, key) - ) { - { - return globalProperties[key]; + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; } - } else if ( true && currentRenderingInstance && (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading - // to infinite warning loop - key.indexOf("__v") !== 0)) { - if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && isReservedPrefix(key[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { - warn( - `Property ${JSON.stringify( - key - )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` - ); - } else if (instance === currentRenderingInstance) { - warn( - `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; } - } - }, - set({ _: instance }, key, value) { - const { data, setupState, ctx } = instance; - if (hasSetupBinding(setupState, key)) { - setupState[key] = value; - return true; - } else if ( true && setupState.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, key)) { - warn(`Cannot mutate <script setup> binding "${key}" from Options API.`); - return false; - } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { - data[key] = value; - return true; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(instance.props, key)) { - true && warn(`Attempting to mutate prop "${key}". Props are readonly.`); - return false; - } - if (key[0] === "$" && key.slice(1) in instance) { - true && warn( - `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove ); - return false; - } else { - if ( true && key in instance.appContext.config.globalProperties) { - Object.defineProperty(ctx, key, { - enumerable: true, - configurable: true, - value - }); - } else { - ctx[key] = value; + if (!delayEnter) { + mountFallback(); } - } - return true; - }, - has({ - _: { data, setupState, accessCache, ctx, appContext, propsOptions } - }, key) { - let normalizedProps; - return !!accessCache[key] || data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(publicPropertiesMap, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(appContext.config.globalProperties, key); - }, - defineProperty(target, key, descriptor) { - if (descriptor.get != null) { - target._.accessCache[key] = 0; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(descriptor, "value")) { - this.set(target, key, descriptor.value, null); - } - return Reflect.defineProperty(target, key, descriptor); - } -}; -if (true) { - PublicInstanceProxyHandlers.ownKeys = (target) => { - warn( - `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` - ); - return Reflect.ownKeys(target); - }; -} -const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - {}, - PublicInstanceProxyHandlers, - { - get(target, key) { - if (key === Symbol.unscopables) { - return; + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; } - return PublicInstanceProxyHandlers.get(target, key, target); + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + if (true) { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + namespace, + optimized + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + if (true) { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); }, - has(_, key) { - const has = key[0] !== "_" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isGloballyWhitelisted)(key); - if ( true && !has && PublicInstanceProxyHandlers.has(_, key)) { - warn( - `Property ${JSON.stringify( - key - )} should not start with _ which is a reserved prefix for Vue internals.` + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove ); } - return has; - } - } -); -function createDevRenderContext(instance) { - const target = {}; - Object.defineProperty(target, `_`, { - configurable: true, - enumerable: false, - get: () => instance - }); - Object.keys(publicPropertiesMap).forEach((key) => { - Object.defineProperty(target, key, { - configurable: true, - enumerable: false, - get: () => publicPropertiesMap[key](instance), - // intercepted by the proxy so no need for implementation, - // but needed to prevent set errors - set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP - }); - }); - return target; -} -function exposePropsOnRenderContext(instance) { - const { - ctx, - propsOptions: [propsOptions] - } = instance; - if (propsOptions) { - Object.keys(propsOptions).forEach((key) => { - Object.defineProperty(ctx, key, { - enumerable: true, - configurable: true, - get: () => instance.props[key], - set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP - }); - }); - } -} -function exposeSetupStateOnRenderContext(instance) { - const { ctx, setupState } = instance; - Object.keys((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(setupState)).forEach((key) => { - if (!setupState.__isScriptSetup) { - if (isReservedPrefix(key[0])) { - warn( - `setup() return property ${JSON.stringify( - key - )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove ); - return; } - Object.defineProperty(ctx, key, { - enumerable: true, - configurable: true, - get: () => setupState[key], - set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP - }); } - }); -} - -const warnRuntimeUsage = (method) => warn( - `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` -); -function defineProps() { - if (true) { - warnRuntimeUsage(`defineProps`); - } - return null; + }; + return suspense; } -function defineEmits() { - if (true) { - warnRuntimeUsage(`defineEmits`); +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); } - return null; + return result; } -function defineExpose(exposed) { - if (true) { - warnRuntimeUsage(`defineExpose`); - } +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); } -function defineOptions(options) { - if (true) { - warnRuntimeUsage(`defineOptions`); +function normalizeSuspenseSlot(s) { + let block; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } } -} -function defineSlots() { - if (true) { - warnRuntimeUsage(`defineSlots`); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(s)) { + const singleChild = filterSingleRoot(s); + if ( true && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn$1(`<Suspense> slots expect a single root node.`); + } + s = singleChild; } - return null; -} -function defineModel() { - if (true) { - warnRuntimeUsage("defineModel"); + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); } + return s; } -function withDefaults(props, defaults) { - if (true) { - warnRuntimeUsage(`withDefaults`); - } - return null; -} -function useSlots() { - return getContext().slots; -} -function useAttrs() { - return getContext().attrs; -} -function useModel(props, name, options) { - const i = getCurrentInstance(); - if ( true && !i) { - warn(`useModel() called without active instance.`); - return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); - } - if ( true && !i.propsOptions[0][name]) { - warn(`useModel() called with prop "${name}" which is not declared.`); - return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); - } - if (options && options.local) { - const proxy = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(props[name]); - watch( - () => props[name], - (v) => proxy.value = v - ); - watch(proxy, (value) => { - if (value !== props[name]) { - i.emit(`update:${name}`, value); - } - }); - return proxy; +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } } else { - return { - __v_isRef: true, - get value() { - return props[name]; - }, - set value(value) { - i.emit(`update:${name}`, value); - } - }; + queuePostFlushCb(fn); } } -function getContext() { - const i = getCurrentInstance(); - if ( true && !i) { - warn(`useContext() called without active instance.`); +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + const el = vnode.el = branch.el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); } - return i.setupContext || (i.setupContext = createSetupContext(i)); } -function normalizePropsOrEmits(props) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props.reduce( - (normalized, p) => (normalized[p] = null, normalized), - {} - ) : props; +function isVNodeSuspensible(vnode) { + var _a; + return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false; } -function mergeDefaults(raw, defaults) { - const props = normalizePropsOrEmits(raw); - for (const key in defaults) { - if (key.startsWith("__skip")) - continue; - let opt = props[key]; - if (opt) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt)) { - opt = props[key] = { type: opt, default: defaults[key] }; - } else { - opt.default = defaults[key]; - } - } else if (opt === null) { - opt = props[key] = { default: defaults[key] }; - } else if (true) { - warn(`props default key "${key}" has no corresponding declaration.`); - } - if (opt && defaults[`__skip_${key}`]) { - opt.skipFactory = true; + +const ssrContextKey = Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + true && warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); } + return ctx; } - return props; +}; + +function watchEffect(effect, options) { + return doWatch(effect, null, options); } -function mergeModels(a, b) { - if (!a || !b) - return a || b; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(a) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(b)) - return a.concat(b); - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "post" }) : 0 + ); } -function createPropsRestProxy(props, excludedKeys) { - const ret = {}; - for (const key in props) { - if (!excludedKeys.includes(key)) { - Object.defineProperty(ret, key, { - enumerable: true, - get: () => props[key] - }); - } - } - return ret; +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + true ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, options, { flush: "sync" }) : 0 + ); } -function withAsyncContext(getAwaitable) { - const ctx = getCurrentInstance(); - if ( true && !ctx) { - warn( - `withAsyncContext called without active current instance. This is likely a bug.` +const INITIAL_WATCHER_VALUE = {}; +function watch(source, cb, options) { + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` ); } - let awaitable = getAwaitable(); - unsetCurrentInstance(); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) { - awaitable = awaitable.catch((e) => { - setCurrentInstance(ctx); - throw e; - }); - } - return [awaitable, () => setCurrentInstance(ctx)]; -} - -function createDuplicateChecker() { - const cache = /* @__PURE__ */ Object.create(null); - return (type, key) => { - if (cache[key]) { - warn(`${type} property "${key}" is already defined in ${cache[key]}.`); - } else { - cache[key] = type; - } - }; + return doWatch(source, cb, options); } -let shouldCacheAccess = true; -function applyOptions(instance) { - const options = resolveMergedOptions(instance); - const publicThis = instance.proxy; - const ctx = instance.ctx; - shouldCacheAccess = false; - if (options.beforeCreate) { - callHook(options.beforeCreate, instance, "bc"); - } - const { - // state - data: dataOptions, - computed: computedOptions, - methods, - watch: watchOptions, - provide: provideOptions, - inject: injectOptions, - // lifecycle - created, - beforeMount, - mounted, - beforeUpdate, - updated, - activated, - deactivated, - beforeDestroy, - beforeUnmount, - destroyed, - unmounted, - render, - renderTracked, - renderTriggered, - errorCaptured, - serverPrefetch, - // public API - expose, - inheritAttrs, - // assets - components, - directives, - filters - } = options; - const checkDuplicateProperties = true ? createDuplicateChecker() : 0; - if (true) { - const [propsOptions] = instance.propsOptions; - if (propsOptions) { - for (const key in propsOptions) { - checkDuplicateProperties("Props" /* PROPS */, key); - } - } - } - if (injectOptions) { - resolveInjections(injectOptions, ctx, checkDuplicateProperties); - } - if (methods) { - for (const key in methods) { - const methodHandler = methods[key]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(methodHandler)) { - if (true) { - Object.defineProperty(ctx, key, { - value: methodHandler.bind(publicThis), - configurable: true, - enumerable: true, - writable: true - }); - } else {} - if (true) { - checkDuplicateProperties("Methods" /* METHODS */, key); - } - } else if (true) { - warn( - `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` - ); - } - } +function doWatch(source, cb, { + immediate, + deep, + flush, + once, + onTrack, + onTrigger +} = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { + if (cb && once) { + const _cb = cb; + cb = (...args) => { + _cb(...args); + unwatch(); + }; + } + if ( true && deep !== void 0 && typeof deep === "number") { + warn$1( + `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.` + ); } - if (dataOptions) { - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dataOptions)) { - warn( - `The data option must be a function. Plain object usage is no longer supported.` + if ( true && !cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` ); } - const data = dataOptions.call(publicThis, publicThis); - if ( true && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(data)) { - warn( - `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` ); } - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(data)) { - true && warn(`data() should return an object.`); - } else { - instance.data = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive)(data); - if (true) { - for (const key in data) { - checkDuplicateProperties("Data" /* DATA */, key); - if (!isReservedPrefix(key[0])) { - Object.defineProperty(ctx, key, { - configurable: true, - enumerable: true, - get: () => data[key], - set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP - }); - } - } - } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); } } - shouldCacheAccess = true; - if (computedOptions) { - for (const key in computedOptions) { - const opt = computedOptions[key]; - const get = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; - if ( true && get === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { - warn(`Computed property "${key}" has no getter.`); + const warnInvalidSource = (s) => { + warn$1( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const instance = currentInstance; + const reactiveGetter = (source2) => deep === true ? source2 : ( + // for deep: false, only traverse root-level properties + traverse(source2, deep === false ? 1 : void 0) + ); + let getter; + let forceTrigger = false; + let isMultiSource = false; + if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(source)) { + getter = () => source.value; + forceTrigger = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(source); + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isShallow)(s)); + getter = () => source.map((s) => { + if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(s)) { + return s.value; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(s)) { + return reactiveGetter(s); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(s)) { + return callWithErrorHandling(s, instance, 2); + } else { + true && warnInvalidSource(s); } - const set = !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.set) ? opt.set.bind(publicThis) : true ? () => { - warn( - `Write operation failed: computed property "${key}" is readonly.` + }); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { + if (cb) { + getter = () => callWithErrorHandling(source, instance, 2); + } else { + getter = () => { + if (cleanup) { + cleanup(); + } + return callWithAsyncErrorHandling( + source, + instance, + 3, + [onCleanup] ); - } : 0; - const c = computed({ - get, - set - }); - Object.defineProperty(ctx, key, { - enumerable: true, - configurable: true, - get: () => c.value, - set: (v) => c.value = v - }); - if (true) { - checkDuplicateProperties("Computed" /* COMPUTED */, key); - } - } - } - if (watchOptions) { - for (const key in watchOptions) { - createWatcher(watchOptions[key], ctx, publicThis, key); + }; } + } else { + getter = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; + true && warnInvalidSource(source); } - if (provideOptions) { - const provides = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(provideOptions) ? provideOptions.call(publicThis) : provideOptions; - Reflect.ownKeys(provides).forEach((key) => { - provide(key, provides[key]); - }); - } - if (created) { - callHook(created, instance, "c"); + if (cb && deep) { + const baseGetter = getter; + getter = () => traverse(baseGetter()); } - function registerLifecycleHook(register, hook) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { - hook.forEach((_hook) => register(_hook.bind(publicThis))); - } else if (hook) { - register(hook.bind(publicThis)); + let cleanup; + let onCleanup = (fn) => { + cleanup = effect.onStop = () => { + callWithErrorHandling(fn, instance, 4); + cleanup = effect.onStop = void 0; + }; + }; + let ssrCleanup; + if (isInSSRComponentSetup) { + onCleanup = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; + if (!cb) { + getter(); + } else if (immediate) { + callWithAsyncErrorHandling(cb, instance, 3, [ + getter(), + isMultiSource ? [] : void 0, + onCleanup + ]); } - } - registerLifecycleHook(onBeforeMount, beforeMount); - registerLifecycleHook(onMounted, mounted); - registerLifecycleHook(onBeforeUpdate, beforeUpdate); - registerLifecycleHook(onUpdated, updated); - registerLifecycleHook(onActivated, activated); - registerLifecycleHook(onDeactivated, deactivated); - registerLifecycleHook(onErrorCaptured, errorCaptured); - registerLifecycleHook(onRenderTracked, renderTracked); - registerLifecycleHook(onRenderTriggered, renderTriggered); - registerLifecycleHook(onBeforeUnmount, beforeUnmount); - registerLifecycleHook(onUnmounted, unmounted); - registerLifecycleHook(onServerPrefetch, serverPrefetch); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expose)) { - if (expose.length) { - const exposed = instance.exposed || (instance.exposed = {}); - expose.forEach((key) => { - Object.defineProperty(exposed, key, { - get: () => publicThis[key], - set: (val) => publicThis[key] = val - }); - }); - } else if (!instance.exposed) { - instance.exposed = {}; + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else { + return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; } } - if (render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { - instance.render = render; - } - if (inheritAttrs != null) { - instance.inheritAttrs = inheritAttrs; - } - if (components) - instance.components = components; - if (directives) - instance.directives = directives; -} -function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(injectOptions)) { - injectOptions = normalizeInject(injectOptions); - } - for (const key in injectOptions) { - const opt = injectOptions[key]; - let injected; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opt)) { - if ("default" in opt) { - injected = inject( - opt.from || key, - opt.default, - true - /* treat default function as factory */ - ); - } else { - injected = inject(opt.from || key); - } - } else { - injected = inject(opt); + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = () => { + if (!effect.active || !effect.dirty) { + return; } - if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(injected)) { - Object.defineProperty(ctx, key, { - enumerable: true, - configurable: true, - get: () => injected.value, - set: (v) => injected.value = v - }); + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(v, oldValue[i])) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(newValue, oldValue)) || false) { + if (cleanup) { + cleanup(); + } + callWithAsyncErrorHandling(cb, instance, 3, [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + onCleanup + ]); + oldValue = newValue; + } } else { - ctx[key] = injected; - } - if (true) { - checkDuplicateProperties("Inject" /* INJECT */, key); + effect.run(); } + }; + job.allowRecurse = !!cb; + let scheduler; + if (flush === "sync") { + scheduler = job; + } else if (flush === "post") { + scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); + } else { + job.pre = true; + if (instance) + job.id = instance.uid; + scheduler = () => queueJob(job); } -} -function callHook(hook, instance, type) { - callWithAsyncErrorHandling( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), - instance, - type - ); -} -function createWatcher(raw, ctx, publicThis, key) { - const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw)) { - const handler = ctx[raw]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { - watch(getter, handler); - } else if (true) { - warn(`Invalid watch handler specified by key "${raw}"`, handler); + const effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect(getter, _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, scheduler); + const scope = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope)(); + const unwatch = () => { + effect.stop(); + if (scope) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(scope.effects, effect); } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw)) { - watch(getter, raw.bind(publicThis)); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { - raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + }; + if (true) { + effect.onTrack = onTrack; + effect.onTrigger = onTrigger; + } + if (cb) { + if (immediate) { + job(); } else { - const handler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { - watch(getter, handler, raw); - } else if (true) { - warn(`Invalid watch handler specified by key "${raw.handler}"`, handler); - } + oldValue = effect.run(); } - } else if (true) { - warn(`Invalid watch option: "${key}"`, raw); + } else if (flush === "post") { + queuePostRenderEffect( + effect.run.bind(effect), + instance && instance.suspense + ); + } else { + effect.run(); } + if (ssrCleanup) + ssrCleanup.push(unwatch); + return unwatch; } -function resolveMergedOptions(instance) { - const base = instance.type; - const { mixins, extends: extendsOptions } = base; - const { - mixins: globalMixins, - optionsCache: cache, - config: { optionMergeStrategies } - } = instance.appContext; - const cached = cache.get(base); - let resolved; - if (cached) { - resolved = cached; - } else if (!globalMixins.length && !mixins && !extendsOptions) { - { - resolved = base; - } +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { + cb = value; } else { - resolved = {}; - if (globalMixins.length) { - globalMixins.forEach( - (m) => mergeOptions(resolved, m, optionMergeStrategies, true) - ); - } - mergeOptions(resolved, base, optionMergeStrategies); + cb = value.handler; + options = value; } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(base)) { - cache.set(base, resolved); + const cur = currentInstance; + setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + if (cur) { + setCurrentInstance(cur); + } else { + unsetCurrentInstance(); } - return resolved; + return res; } -function mergeOptions(to, from, strats, asMixin = false) { - const { mixins, extends: extendsOptions } = from; - if (extendsOptions) { - mergeOptions(to, extendsOptions, strats, true); - } - if (mixins) { - mixins.forEach( - (m) => mergeOptions(to, m, strats, true) - ); - } - for (const key in from) { - if (asMixin && key === "expose") { - true && warn( - `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` - ); - } else { - const strat = internalOptionMergeStrats[key] || strats && strats[key]; - to[key] = strat ? strat(to[key], from[key]) : from[key]; +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; } - } - return to; + return cur; + }; } -const internalOptionMergeStrats = { - data: mergeDataFn, - props: mergeEmitsOrPropsOptions, - emits: mergeEmitsOrPropsOptions, - // objects - methods: mergeObjectOptions, - computed: mergeObjectOptions, - // lifecycle - beforeCreate: mergeAsArray, - created: mergeAsArray, - beforeMount: mergeAsArray, - mounted: mergeAsArray, - beforeUpdate: mergeAsArray, - updated: mergeAsArray, - beforeDestroy: mergeAsArray, - beforeUnmount: mergeAsArray, - destroyed: mergeAsArray, - unmounted: mergeAsArray, - activated: mergeAsArray, - deactivated: mergeAsArray, - errorCaptured: mergeAsArray, - serverPrefetch: mergeAsArray, - // assets - components: mergeObjectOptions, - directives: mergeObjectOptions, - // watch - watch: mergeWatchOptions, - // provide / inject - provide: mergeDataFn, - inject: mergeInject -}; -function mergeDataFn(to, from) { - if (!from) { - return to; +function traverse(value, depth, currentDepth = 0, seen) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value) || value["__v_skip"]) { + return value; } - if (!to) { - return from; + if (depth && depth > 0) { + if (currentDepth >= depth) { + return value; + } + currentDepth++; } - return function mergedDataFn() { - return ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend))( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(to) ? to.call(this, this) : to, - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(from) ? from.call(this, this) : from - ); - }; -} -function mergeInject(to, from) { - return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); -} -function normalizeInject(raw) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { - const res = {}; - for (let i = 0; i < raw.length; i++) { - res[raw[i]] = raw[i]; + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(value)) { + traverse(value.value, depth, currentDepth, seen); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, currentDepth, seen); + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMap)(value)) { + value.forEach((v) => { + traverse(v, depth, currentDepth, seen); + }); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)) { + for (const key in value) { + traverse(value[key], depth, currentDepth, seen); } - return res; } - return raw; -} -function mergeAsArray(to, from) { - return to ? [...new Set([].concat(to, from))] : from; + return value; } -function mergeObjectOptions(to, from) { - return to ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to, from) : from; + +function validateDirectiveName(name) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBuiltInDirective)(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } } -function mergeEmitsOrPropsOptions(to, from) { - if (to) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(to) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(from)) { - return [.../* @__PURE__ */ new Set([...to, ...from])]; +function withDirectives(vnode, directives) { + const internalInstance = currentRenderingInstance; + if (internalInstance === null) { + true && warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getExposeProxy(internalInstance) || internalInstance.proxy; + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ] = directives[i]; + if (dir) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); } - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - /* @__PURE__ */ Object.create(null), - normalizePropsOrEmits(to), - normalizePropsOrEmits(from != null ? from : {}) - ); - } else { - return from; } + return vnode; } -function mergeWatchOptions(to, from) { - if (!to) - return from; - if (!from) - return to; - const merged = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to); - for (const key in from) { - merged[key] = mergeAsArray(to[key], from[key]); +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); + } } - return merged; } -function createAppContext() { - return { - app: null, - config: { - isNativeTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO, - performance: false, - globalProperties: {}, - optionMergeStrategies: {}, - errorHandler: void 0, - warnHandler: void 0, - compilerOptions: {} - }, - mixins: [], - components: {}, - directives: {}, - provides: /* @__PURE__ */ Object.create(null), - optionsCache: /* @__PURE__ */ new WeakMap(), - propsCache: /* @__PURE__ */ new WeakMap(), - emitsCache: /* @__PURE__ */ new WeakMap() +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; } -let uid$1 = 0; -function createAppAPI(render, hydrate) { - return function createApp(rootComponent, rootProps = null) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(rootComponent)) { - rootComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, rootComponent); - } - if (rootProps != null && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(rootProps)) { - true && warn(`root props passed to app.mount() must be an object.`); - rootProps = null; - } - const context = createAppContext(); - if (true) { - Object.defineProperty(context.config, "unwrapInjectedRef", { - get() { - return true; - }, - set() { - warn( - `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.` - ); - } - }); - } - const installedPlugins = /* @__PURE__ */ new Set(); - let isMounted = false; - const app = context.app = { - _uid: uid$1++, - _component: rootComponent, - _props: rootProps, - _container: null, - _context: context, - _instance: null, - version, - get config() { - return context.config; - }, - set config(v) { - if (true) { - warn( - `app.config cannot be replaced. Modify individual options instead.` - ); - } - }, - use(plugin, ...options) { - if (installedPlugins.has(plugin)) { - true && warn(`Plugin has already been applied to target app.`); - } else if (plugin && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin.install)) { - installedPlugins.add(plugin); - plugin.install(app, ...options); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin)) { - installedPlugins.add(plugin); - plugin(app, ...options); - } else if (true) { - warn( - `A plugin must either be a function or an object with an "install" function.` - ); - } - return app; - }, - mixin(mixin) { - if (true) { - if (!context.mixins.includes(mixin)) { - context.mixins.push(mixin); - } else if (true) { - warn( - "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") - ); +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + let prevTransitionKey; + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if ( true && hasFound) { + warn$1( + "<transition> can only be used on a single element or component. Use <transition-group> for lists." + ); + break; + } + child = c; + hasFound = true; + if (false) + {} } - } else {} - return app; - }, - component(name, component) { - if (true) { - validateComponentName(name, context.config); - } - if (!component) { - return context.components[name]; - } - if ( true && context.components[name]) { - warn(`Component "${name}" has already been registered in target app.`); - } - context.components[name] = component; - return app; - }, - directive(name, directive) { - if (true) { - validateDirectiveName(name); - } - if (!directive) { - return context.directives[name]; } - if ( true && context.directives[name]) { - warn(`Directive "${name}" has already been registered in target app.`); + } + const rawProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); + const { mode } = rawProps; + if ( true && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid <transition> mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getKeepAliveChild(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + const enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance + ); + setTransitionHooks(innerChild, enterHooks); + const oldChild = instance.subTree; + const oldInnerChild = oldChild && getKeepAliveChild(oldChild); + let transitionKeyChanged = false; + const { getTransitionKey } = innerChild.type; + if (getTransitionKey) { + const key = getTransitionKey(); + if (prevTransitionKey === void 0) { + prevTransitionKey = key; + } else if (key !== prevTransitionKey) { + prevTransitionKey = key; + transitionKeyChanged = true; } - context.directives[name] = directive; - return app; - }, - mount(rootContainer, isHydrate, isSVG) { - if (!isMounted) { - if ( true && rootContainer.__vue_app__) { - warn( - `There is already an app instance mounted on the host container. - If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` + } + if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { + const leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in") { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (instance.update.active !== false) { + instance.effect.dirty = true; + instance.update(); + } + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild ); - } - const vnode = createVNode( - rootComponent, - rootProps - ); - vnode.appContext = context; - if (true) { - context.reload = () => { - render(cloneVNode(vnode), rootContainer, isSVG); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; }; - } - if (isHydrate && hydrate) { - hydrate(vnode, rootContainer); - } else { - render(vnode, rootContainer, isSVG); - } - isMounted = true; - app._container = rootContainer; - rootContainer.__vue_app__ = app; - if (true) { - app._instance = vnode.component; - devtoolsInitApp(app, version); - } - return getExposeProxy(vnode.component) || vnode.component.proxy; - } else if (true) { - warn( - `App has already been mounted. -If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` - ); - } - }, - unmount() { - if (isMounted) { - render(null, app._container); - if (true) { - app._instance = null; - devtoolsUnmountApp(app); - } - delete app._container.__vue_app__; - } else if (true) { - warn(`Cannot unmount an app that is not mounted.`); - } - }, - provide(key, value) { - if ( true && key in context.provides) { - warn( - `App already provides property with key "${String(key)}". It will be overwritten with the new value.` - ); - } - context.provides[key] = value; - return app; - }, - runWithContext(fn) { - currentApp = app; - try { - return fn(); - } finally { - currentApp = null; + enterHooks.delayedLeave = delayedLeave; + }; } } + return child; }; - return app; - }; -} -let currentApp = null; - -function provide(key, value) { - if (!currentInstance) { - if (true) { - warn(`provide() can only be used inside setup().`); - } - } else { - let provides = currentInstance.provides; - const parentProvides = currentInstance.parent && currentInstance.parent.provides; - if (parentProvides === provides) { - provides = currentInstance.provides = Object.create(parentProvides); - } - provides[key] = value; } -} -function inject(key, defaultValue, treatDefaultAsFactory = false) { - const instance = currentInstance || currentRenderingInstance; - if (instance || currentApp) { - const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides; - if (provides && key in provides) { - return provides[key]; - } else if (arguments.length > 1) { - return treatDefaultAsFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; - } else if (true) { - warn(`injection "${String(key)}" not found.`); - } - } else if (true) { - warn(`inject() can only be used inside setup() or functional components.`); - } -} -function hasInjectionContext() { - return !!(currentInstance || currentRenderingInstance || currentApp); -} - -function initProps(instance, rawProps, isStateful, isSSR = false) { - const props = {}; - const attrs = {}; - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(attrs, InternalObjectKey, 1); - instance.propsDefaults = /* @__PURE__ */ Object.create(null); - setFullProps(instance, rawProps, props, attrs); - for (const key in instance.propsOptions[0]) { - if (!(key in props)) { - props[key] = void 0; - } - } - if (true) { - validateProps(rawProps || {}, props, instance); - } - if (isStateful) { - instance.props = isSSR ? props : (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive)(props); - } else { - if (!instance.type.props) { - instance.props = attrs; - } else { - instance.props = props; - } - } - instance.attrs = attrs; -} -function isInHmrContext(instance) { - while (instance) { - if (instance.type.__hmrId) - return true; - instance = instance.parent; +}; +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); } + return leavingVNodesCache; } -function updateProps(instance, rawProps, rawPrevProps, optimized) { +function resolveTransitionHooks(vnode, props, state, instance) { const { - props, - attrs, - vnode: { patchFlag } - } = instance; - const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); - const [options] = instance.propsOptions; - let hasAttrsChanged = false; - if ( - // always force full diff in dev - // - #1942 if hmr is enabled with sfc component - // - vite#872 non-sfc component used by sfc component - !( true && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16) - ) { - if (patchFlag & 8) { - const propsToUpdate = instance.vnode.dynamicProps; - for (let i = 0; i < propsToUpdate.length; i++) { - let key = propsToUpdate[i]; - if (isEmitListener(instance.emitsOptions, key)) { - continue; - } - const value = rawProps[key]; - if (options) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(attrs, key)) { - if (value !== attrs[key]) { - attrs[key] = value; - hasAttrsChanged = true; - } - } else { - const camelizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); - props[camelizedKey] = resolvePropValue( - options, - rawCurrentProps, - camelizedKey, - value, - instance, - false - /* isAbsent */ - ); - } + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) + done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; } else { - if (value !== attrs[key]) { - attrs[key] = value; - hasAttrsChanged = true; - } + return; } } - } - } else { - if (setFullProps(instance, rawProps, props, attrs)) { - hasAttrsChanged = true; - } - let kebabKey; - for (const key in rawCurrentProps) { - if (!rawProps || // for camelCase - !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && // it's possible the original props was passed in as kebab-case - // and converted to camelCase (#955) - ((kebabKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) === key || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, kebabKey))) { - if (options) { - if (rawPrevProps && // for camelCase - (rawPrevProps[key] !== void 0 || // for kebab-case - rawPrevProps[kebabKey] !== void 0)) { - props[key] = resolvePropValue( - options, - rawCurrentProps, - key, - void 0, - instance, - true - /* isAbsent */ - ); - } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; } else { - delete props[key]; + return; } } - } - if (attrs !== rawCurrentProps) { - for (const key in attrs) { - if (!rawProps || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && true) { - delete attrs[key]; - hasAttrsChanged = true; + let called = false; + const done = el[enterCbKey] = (cancelled) => { + if (called) + return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); } + el[enterCbKey] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); } - } - } - if (hasAttrsChanged) { - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$attrs"); - } - if (true) { - validateProps(rawProps || {}, props, instance); - } -} -function setFullProps(instance, rawProps, props, attrs) { - const [options, needCastKeys] = instance.propsOptions; - let hasAttrsChanged = false; - let rawCastValues; - if (rawProps) { - for (let key in rawProps) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { - continue; + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); } - const value = rawProps[key]; - let camelKey; - if (options && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key))) { - if (!needCastKeys || !needCastKeys.includes(camelKey)) { - props[camelKey] = value; + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) + return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); } else { - (rawCastValues || (rawCastValues = {}))[camelKey] = value; + callHook(onAfterLeave, [el]); } - } else if (!isEmitListener(instance.emitsOptions, key)) { - if (!(key in attrs) || value !== attrs[key]) { - attrs[key] = value; - hasAttrsChanged = true; + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); } + }, + clone(vnode2) { + return resolveTransitionHooks(vnode2, props, state, instance); } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; } - if (needCastKeys) { - const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); - const castValues = rawCastValues || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - for (let i = 0; i < needCastKeys.length; i++) { - const key = needCastKeys[i]; - props[key] = resolvePropValue( - options, - rawCurrentProps, - key, - castValues[key], - instance, - !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(castValues, key) - ); - } - } - return hasAttrsChanged; } -function resolvePropValue(options, props, key, value, instance, isAbsent) { - const opt = options[key]; - if (opt != null) { - const hasDefault = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(opt, "default"); - if (hasDefault && value === void 0) { - const defaultValue = opt.default; - if (opt.type !== Function && !opt.skipFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue)) { - const { propsDefaults } = instance; - if (key in propsDefaults) { - value = propsDefaults[key]; - } else { - setCurrentInstance(instance); - value = propsDefaults[key] = defaultValue.call( - null, - props - ); - unsetCurrentInstance(); - } - } else { - value = defaultValue; - } - } - if (opt[0 /* shouldCast */]) { - if (isAbsent && !hasDefault) { - value = false; - } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key))) { - value = true; - } - } - } - return value; +function getKeepAliveChild(vnode) { + return isKeepAlive(vnode) ? ( + // #7121 ensure get the child component subtree in case + // it's been replaced during HMR + true && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0 + ) : vnode; } -function normalizePropsOptions(comp, appContext, asMixin = false) { - const cache = appContext.propsCache; - const cached = cache.get(comp); - if (cached) { - return cached; +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; } - const raw = comp.props; - const normalized = {}; - const needCastKeys = []; - let hasExtends = false; - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { - const extendProps = (raw2) => { - hasExtends = true; - const [props, keys] = normalizePropsOptions(raw2, appContext, true); - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, props); - if (keys) - needCastKeys.push(...keys); - }; - if (!asMixin && appContext.mixins.length) { - appContext.mixins.forEach(extendProps); - } - if (comp.extends) { - extendProps(comp.extends); - } - if (comp.mixins) { - comp.mixins.forEach(extendProps); +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) + keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); } } - if (!raw && !hasExtends) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { - cache.set(comp, _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR); + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; } - return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { - for (let i = 0; i < raw.length; i++) { - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw[i])) { - warn(`props must be strings when using array syntax.`, raw[i]); + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? ( + // #8326: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; } - const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(raw[i]); - if (validatePropName(normalizedKey)) { - normalized[normalizedKey] = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; } - } - } else if (raw) { - if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { - warn(`invalid props options`, raw); - } - for (const key in raw) { - const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); - if (validatePropName(normalizedKey)) { - const opt = raw[key]; - const prop = normalized[normalizedKey] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? { type: opt } : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, opt); - if (prop) { - const booleanIndex = getTypeIndex(Boolean, prop.type); - const stringIndex = getTypeIndex(String, prop.type); - prop[0 /* shouldCast */] = booleanIndex > -1; - prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex; - if (booleanIndex > -1 || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(prop, "default")) { - needCastKeys.push(normalizedKey); + if ( true && !comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if ( true && comp && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(false); + const error = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); + const delayed = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; } - } + }, timeout); } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.effect.dirty = true; + queueJob(instance.parent.update); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; } - } - const res = [normalized, needCastKeys]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { - cache.set(comp, res); - } - return res; -} -function validatePropName(key) { - if (key[0] !== "$") { - return true; - } else if (true) { - warn(`Invalid prop name: "${key}" is a reserved property.`); - } - return false; -} -function getType(ctor) { - const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/); - return match ? match[2] : ctor === null ? "null" : ""; -} -function isSameType(a, b) { - return getType(a) === getType(b); -} -function getTypeIndex(type, expectedTypes) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expectedTypes)) { - return expectedTypes.findIndex((t) => isSameType(t, type)); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(expectedTypes)) { - return isSameType(expectedTypes, type) ? 0 : -1; - } - return -1; + }); } -function validateProps(rawProps, props, instance) { - const resolvedValues = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); - const options = instance.propsOptions[0]; - for (const key in options) { - let opt = options[key]; - if (opt == null) - continue; - validateProp( - key, - resolvedValues[key], - opt, - !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) - ); - } +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; } -function validateProp(name, value, prop, isAbsent) { - const { type, required, validator, skipCheck } = prop; - if (required && isAbsent) { - warn('Missing required prop: "' + name + '"'); - return; - } - if (value == null && !required) { - return; - } - if (type != null && type !== true && !skipCheck) { - let isValid = false; - const types = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(type) ? type : [type]; - const expectedTypes = []; - for (let i = 0; i < types.length && !isValid; i++) { - const { valid, expectedType } = assertType(value, types[i]); - expectedTypes.push(expectedType || ""); - isValid = valid; - } - if (!isValid) { - warn(getInvalidTypeMessage(name, value, expectedTypes)); - return; + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; } - } - if (validator && !validator(value)) { - warn('Invalid prop: custom validator check failed for prop "' + name + '".'); - } -} -const isSimpleType = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( - "String,Number,Boolean,Function,Symbol,BigInt" -); -function assertType(value, type) { - let valid; - const expectedType = getType(type); - if (isSimpleType(expectedType)) { - const t = typeof value; - valid = t === expectedType.toLowerCase(); - if (!valid && t === "object") { - valid = value instanceof type; + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + if (true) { + instance.__v_cache = cache; } - } else if (expectedType === "Object") { - valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value); - } else if (expectedType === "Array") { - valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value); - } else if (expectedType === "null") { - valid = value === null; - } else { - valid = value instanceof type; - } - return { - valid, - expectedType - }; -} -function getInvalidTypeMessage(name, value, expectedTypes) { - let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(" | ")}`; - const expectedType = expectedTypes[0]; - const receivedType = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toRawType)(value); - const expectedValue = styleValue(value, expectedType); - const receivedValue = styleValue(value, receivedType); - if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { - message += ` with value ${expectedValue}`; - } - message += `, got ${receivedType} `; - if (isExplicable(receivedType)) { - message += `with value ${receivedValue}.`; - } - return message; -} -function styleValue(value, type) { - if (type === "String") { - return `"${value}"`; - } else if (type === "Number") { - return `${Number(value)}`; - } else { - return `${value}`; - } -} -function isExplicable(type) { - const explicitTypes = ["string", "number", "boolean"]; - return explicitTypes.some((elem) => type.toLowerCase() === elem); -} -function isBoolean(...args) { - return args.some((elem) => elem.toLowerCase() === "boolean"); -} - -const isInternalKey = (key) => key[0] === "_" || key === "$stable"; -const normalizeSlotValue = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; -const normalizeSlot = (key, rawSlot, ctx) => { - if (rawSlot._n) { - return rawSlot; - } - const normalized = withCtx((...args) => { - if ( true && currentInstance) { - warn( - `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized ); - } - return normalizeSlotValue(rawSlot(...args)); - }, ctx); - normalized._c = false; - return normalized; -}; -const normalizeObjectSlots = (rawSlots, slots, instance) => { - const ctx = rawSlots._ctx; - for (const key in rawSlots) { - if (isInternalKey(key)) - continue; - const value = rawSlots[key]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { - slots[key] = normalizeSlot(key, value, ctx); - } else if (value != null) { + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); if (true) { - warn( - `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` - ); + devtoolsComponentAdded(instance2); } - const normalized = normalizeSlotValue(value); - slots[key] = () => normalized; + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + if (true) { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); } - } -}; -const normalizeVNodeSlots = (instance, children) => { - if ( true && !isKeepAlive(instance.vnode) && true) { - warn( - `Non-function value encountered for default slot. Prefer function slots for better performance.` - ); - } - const normalized = normalizeSlotValue(children); - instance.slots.default = () => normalized; -}; -const initSlots = (instance, children) => { - if (instance.vnode.shapeFlag & 32) { - const type = children._; - if (type) { - instance.slots = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(children); - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(children, "_", type); - } else { - normalizeObjectSlots( - children, - instance.slots = {}); + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && (!filter || !filter(name))) { + pruneCacheEntry(key); + } + }); } - } else { - instance.slots = {}; - if (children) { - normalizeVNodeSlots(instance, children); + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (!current || !isSameVNodeType(cached, current)) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); } - } - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(instance.slots, InternalObjectKey, 1); -}; -const updateSlots = (instance, children, optimized) => { - const { vnode, slots } = instance; - let needDeletionCheck = true; - let deletionComparisonTarget = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - if (vnode.shapeFlag & 32) { - const type = children._; - if (type) { - if ( true && isHmrUpdating) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$slots"); - } else if (optimized && type === 1) { - needDeletionCheck = false; - } else { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); - if (!optimized && type === 1) { - delete slots._; + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return null; } - } else { - needDeletionCheck = !children.$stable; - normalizeObjectSlots(children, slots); - } - deletionComparisonTarget = children; - } else if (children) { - normalizeVNodeSlots(instance, children); - deletionComparisonTarget = { default: 1 }; - } - if (needDeletionCheck) { - for (const key in slots) { - if (!isInternalKey(key) && !(key in deletionComparisonTarget)) { - delete slots[key]; + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + if (true) { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; } - } + let vnode = getInnerChild(rawVNode); + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; } }; - -function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(rawRef)) { - rawRef.forEach( - (r, i) => setRef( - r, - oldRawRef && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(oldRawRef) ? oldRawRef[i] : oldRawRef), - parentSuspense, - vnode, - isUnmount - ) - ); - return; - } - if (isAsyncWrapper(vnode) && !isUnmount) { - return; - } - const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; - const value = isUnmount ? null : refValue; - const { i: owner, r: ref } = rawRef; - if ( true && !owner) { - warn( - `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` - ); - return; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(pattern)) { + return pattern.split(",").includes(name); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isRegExp)(pattern)) { + return pattern.test(name); } - const oldRef = oldRawRef && oldRawRef.r; - const refs = owner.refs === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ ? owner.refs = {} : owner.refs; - const setupState = owner.setupState; - if (oldRef != null && oldRef !== ref) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(oldRef)) { - refs[oldRef] = null; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, oldRef)) { - setupState[oldRef] = null; + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; } - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(oldRef)) { - oldRef.value = null; + current = current.parent; } - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref)) { - callWithErrorHandling(ref, owner, 12, [value, refs]); - } else { - const _isString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref); - const _isRef = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref); - if (_isString || _isRef) { - const doSet = () => { - if (rawRef.f) { - const existing = _isString ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref) ? setupState[ref] : refs[ref] : ref.value; - if (isUnmount) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(existing, refValue); - } else { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing)) { - if (_isString) { - refs[ref] = [refValue]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { - setupState[ref] = refs[ref]; - } - } else { - ref.value = [refValue]; - if (rawRef.k) - refs[rawRef.k] = ref.value; - } - } else if (!existing.includes(refValue)) { - existing.push(refValue); - } - } - } else if (_isString) { - refs[ref] = value; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { - setupState[ref] = value; - } - } else if (_isRef) { - ref.value = value; - if (rawRef.k) - refs[rawRef.k] = value; - } else if (true) { - warn("Invalid template ref type:", ref, `(${typeof ref})`); - } - }; - if (value) { - doSet.id = -1; - queuePostRenderEffect(doSet, parentSuspense); - } else { - doSet(); + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); } - } else if (true) { - warn("Invalid template ref type:", ref, `(${typeof ref})`); + current = current.parent; } } } - -let hasMismatch = false; -const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject"; -const isComment = (node) => node.nodeType === 8 /* COMMENT */; -function createHydrationFunctions(rendererInternals) { - const { - mt: mountComponent, - p: patch, - o: { - patchProp, - createText, - nextSibling, - parentNode, - remove, - insert, - createComment +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + if (target.isUnmounted) { + return; + } + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + unsetCurrentInstance(); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); } - } = rendererInternals; - const hydrate = (vnode, container) => { - if (!container.hasChildNodes()) { - true && warn( - `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + return wrappedHook; + } else if (true) { + const apiName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => ( + // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) + (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target) +); +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook("bu"); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook("bum"); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook("sp"); +const onRenderTriggered = createHook( + "rtg" +); +const onRenderTracked = createHook( + "rtc" +); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(source) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(source)) { + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); + } + } else if (typeof source === "number") { + if ( true && !Number.isInteger(source)) { + warn$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) ); - patch(null, vnode, container); - flushPostFlushCbs(); - container._vnode = vnode; - return; + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } } - hasMismatch = false; - hydrateNode(container.firstChild, vnode, null, null, null); - flushPostFlushCbs(); - container._vnode = vnode; - if (hasMismatch && true) { - console.error(`Hydration completed but contains mismatches.`); + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) + res.key = slot.key; + return res; + } : slot.fn; } - }; - const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { - const isFragmentStart = isComment(node) && node.data === "["; - const onMismatch = () => handleMismatch( - node, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - isFragmentStart + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { + if (name !== "default") + props.name = name; + return createVNode("slot", props, fallback && fallback()); + } + let slot = slots[name]; + if ( true && slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` ); - const { type, ref, shapeFlag, patchFlag } = vnode; - let domType = node.nodeType; - vnode.el = node; - if (patchFlag === -2) { - optimized = false; - vnode.dynamicChildren = null; + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const rendered = createBlock( + Fragment, + { + key: props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key || `_${name}` + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) + return true; + if (child.type === Comment) + return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toHandlerKey)(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) + return null; + if (isStatefulComponent(i)) + return getExposeProxy(i) || i.proxy; + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.props) : 0, + $attrs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.attrs) : 0, + $slots: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.slots) : 0, + $refs: (i) => true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(i.refs) : 0, + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $emit: (i) => i.emit, + $options: (i) => true ? resolveMergedOptions(i) : 0, + $forceUpdate: (i) => i.f || (i.f = () => { + i.effect.dirty = true; + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => true ? instanceWatch.bind(i) : 0 + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && !state.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if ( true && key === "__isVue") { + return true; } - let nextNode = null; - switch (type) { - case Text: - if (domType !== 3 /* TEXT */) { - if (vnode.children === "") { - insert(vnode.el = createText(""), parentNode(node), node); - nextNode = node; - } else { - nextNode = onMismatch(); - } - } else { - if (node.data !== vnode.children) { - hasMismatch = true; - true && warn( - `Hydration text mismatch: -- Client: ${JSON.stringify(node.data)} -- Server: ${JSON.stringify(vnode.children)}` - ); - node.data = vnode.children; - } - nextNode = nextSibling(node); - } - break; - case Comment: - if (domType !== 8 /* COMMENT */ || isFragmentStart) { - nextNode = onMismatch(); - } else { - nextNode = nextSibling(node); - } - break; - case Static: - if (isFragmentStart) { - node = nextSibling(node); - domType = node.nodeType; - } - if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) { - nextNode = node; - const needToAdoptContent = !vnode.children.length; - for (let i = 0; i < vnode.staticCount; i++) { - if (needToAdoptContent) - vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data; - if (i === vnode.staticCount - 1) { - vnode.anchor = nextNode; - } - nextNode = nextSibling(nextNode); - } - return isFragmentStart ? nextSibling(nextNode) : nextNode; - } else { - onMismatch(); - } - break; - case Fragment: - if (!isFragmentStart) { - nextNode = onMismatch(); - } else { - nextNode = hydrateFragment( - node, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } - break; - default: - if (shapeFlag & 1) { - if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) { - nextNode = onMismatch(); - } else { - nextNode = hydrateElement( - node, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } - } else if (shapeFlag & 6) { - vnode.slotScopeIds = slotScopeIds; - const container = parentNode(node); - mountComponent( - vnode, - container, - null, - parentComponent, - parentSuspense, - isSVGContainer(container), - optimized - ); - nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node); - if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") { - nextNode = nextSibling(nextNode); - } - if (isAsyncWrapper(vnode)) { - let subTree; - if (isFragmentStart) { - subTree = createVNode(Fragment); - subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; - } else { - subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); - } - subTree.el = node; - vnode.component.subTree = subTree; - } - } else if (shapeFlag & 64) { - if (domType !== 8 /* COMMENT */) { - nextNode = onMismatch(); - } else { - nextNode = vnode.type.hydrate( - node, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized, - rendererInternals, - hydrateChildren - ); - } - } else if (shapeFlag & 128) { - nextNode = vnode.type.hydrate( - node, - vnode, - parentComponent, - parentSuspense, - isSVGContainer(parentNode(node)), - slotScopeIds, - optimized, - rendererInternals, - hydrateNode - ); - } else if (true) { - warn("Invalid HostVNode type:", type, `(${typeof type})`); - } - } - if (ref != null) { - setRef(ref, null, parentSuspense, vnode); - } - return nextNode; - }; - const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { - optimized = optimized || !!vnode.dynamicChildren; - const { type, props, patchFlag, shapeFlag, dirs } = vnode; - const forcePatchValue = type === "input" && dirs || type === "option"; - if (true) { - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "created"); - } - if (props) { - if (forcePatchValue || !optimized || patchFlag & (16 | 32)) { - for (const key in props) { - if (forcePatchValue && key.endsWith("value") || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { - patchProp( - el, - key, - null, - props[key], - false, - void 0, - parentComponent - ); - } - } - } else if (props.onClick) { - patchProp( - el, - "onClick", - null, - props.onClick, - false, - void 0, - parentComponent - ); + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( false || shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; } - let vnodeHooks; - if (vnodeHooks = props && props.onVnodeBeforeMount) { - invokeVNodeHook(vnodeHooks, parentComponent, vnode); - } - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); + true && markAttrsAccessed(); + } else if ( true && key === "$slots") { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", key); } - if ((vnodeHooks = props && props.onVnodeMounted) || dirs) { - queueEffectWithSuspense(() => { - vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); - dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); - }, parentSuspense); + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(globalProperties, key) + ) { + { + return globalProperties[key]; } - if (shapeFlag & 16 && // skip if element has innerHTML / textContent - !(props && (props.innerHTML || props.textContent))) { - let next = hydrateChildren( - el.firstChild, - vnode, - el, - parentComponent, - parentSuspense, - slotScopeIds, - optimized + } else if ( true && currentRenderingInstance && (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && isReservedPrefix(key[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` ); - let hasWarned = false; - while (next) { - hasMismatch = true; - if ( true && !hasWarned) { - warn( - `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.` - ); - hasWarned = true; - } - const cur = next; - next = next.nextSibling; - remove(cur); - } - } else if (shapeFlag & 8) { - if (el.textContent !== vnode.children) { - hasMismatch = true; - true && warn( - `Hydration text content mismatch in <${vnode.type}>: -- Client: ${el.textContent} -- Server: ${vnode.children}` - ); - el.textContent = vnode.children; - } } } - return el.nextSibling; - }; - const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { - optimized = optimized || !!parentVNode.dynamicChildren; - const children = parentVNode.children; - const l = children.length; - let hasWarned = false; - for (let i = 0; i < l; i++) { - const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); - if (node) { - node = hydrateNode( - node, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } else if (vnode.type === Text && !vnode.children) { - continue; + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if ( true && setupState.__isScriptSetup && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, key)) { + warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); + return false; + } else if (data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key)) { + data[key] = value; + return true; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(instance.props, key)) { + true && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + true && warn$1( + `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` + ); + return false; + } else { + if ( true && key in instance.appContext.config.globalProperties) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + value + }); } else { - hasMismatch = true; - if ( true && !hasWarned) { - warn( - `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.` - ); - hasWarned = true; - } - patch( - null, - vnode, - container, - null, - parentComponent, - parentSuspense, - isSVGContainer(container), - slotScopeIds - ); + ctx[key] = value; } } - return node; - }; - const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { - const { slotScopeIds: fragmentSlotScopeIds } = vnode; - if (fragmentSlotScopeIds) { - slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, propsOptions } + }, key) { + let normalizedProps; + return !!accessCache[key] || data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(normalizedProps, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(ctx, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(publicPropertiesMap, key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(appContext.config.globalProperties, key); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(descriptor, "value")) { + this.set(target, key, descriptor.value, null); } - const container = parentNode(node); - const next = hydrateChildren( - nextSibling(node), - vnode, - container, - parentComponent, - parentSuspense, - slotScopeIds, - optimized + return Reflect.defineProperty(target, key, descriptor); + } +}; +if (true) { + PublicInstanceProxyHandlers.ownKeys = (target) => { + warn$1( + `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` ); - if (next && isComment(next) && next.data === "]") { - return nextSibling(vnode.anchor = next); - } else { - hasMismatch = true; - insert(vnode.anchor = createComment(`]`), container, next); - return next; - } + return Reflect.ownKeys(target); }; - const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { - hasMismatch = true; - true && warn( - `Hydration node mismatch: -- Client vnode:`, - vnode.type, - ` -- Server rendered DOM:`, - node, - node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : `` - ); - vnode.el = null; - if (isFragment) { - const end = locateClosingAsyncAnchor(node); - while (true) { - const next2 = nextSibling(node); - if (next2 && next2 !== end) { - remove(next2); - } else { - break; - } +} +const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + {}, + PublicInstanceProxyHandlers, + { + get(target, key) { + if (key === Symbol.unscopables) { + return; + } + return PublicInstanceProxyHandlers.get(target, key, target); + }, + has(_, key) { + const has = key[0] !== "_" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isGloballyAllowed)(key); + if ( true && !has && PublicInstanceProxyHandlers.has(_, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} should not start with _ which is a reserved prefix for Vue internals.` + ); } + return has; } - const next = nextSibling(node); - const container = parentNode(node); - remove(node); - patch( - null, - vnode, - container, - next, - parentComponent, - parentSuspense, - isSVGContainer(container), - slotScopeIds - ); - return next; - }; - const locateClosingAsyncAnchor = (node) => { - let match = 0; - while (node) { - node = nextSibling(node); - if (node && isComment(node)) { - if (node.data === "[") - match++; - if (node.data === "]") { - if (match === 0) { - return nextSibling(node); - } else { - match--; - } - } + } +); +function createDevRenderContext(instance) { + const target = {}; + Object.defineProperty(target, `_`, { + configurable: true, + enumerable: false, + get: () => instance + }); + Object.keys(publicPropertiesMap).forEach((key) => { + Object.defineProperty(target, key, { + configurable: true, + enumerable: false, + get: () => publicPropertiesMap[key](instance), + // intercepted by the proxy so no need for implementation, + // but needed to prevent set errors + set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP + }); + }); + return target; +} +function exposePropsOnRenderContext(instance) { + const { + ctx, + propsOptions: [propsOptions] + } = instance; + if (propsOptions) { + Object.keys(propsOptions).forEach((key) => { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => instance.props[key], + set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP + }); + }); + } +} +function exposeSetupStateOnRenderContext(instance) { + const { ctx, setupState } = instance; + Object.keys((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(setupState)).forEach((key) => { + if (!setupState.__isScriptSetup) { + if (isReservedPrefix(key[0])) { + warn$1( + `setup() return property ${JSON.stringify( + key + )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` + ); + return; } + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => setupState[key], + set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP + }); } - return node; - }; - return [hydrate, hydrateNode]; + }); } -let supported; -let perf; -function startMeasure(instance, type) { - if (instance.appContext.config.performance && isSupported()) { - perf.mark(`vue-${type}-${instance.uid}`); - } +const warnRuntimeUsage = (method) => warn$1( + `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` +); +function defineProps() { if (true) { - devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); + warnRuntimeUsage(`defineProps`); } + return null; } -function endMeasure(instance, type) { - if (instance.appContext.config.performance && isSupported()) { - const startTag = `vue-${type}-${instance.uid}`; - const endTag = startTag + `:end`; - perf.mark(endTag); - perf.measure( - `<${formatComponentName(instance, instance.type)}> ${type}`, - startTag, - endTag - ); - perf.clearMarks(startTag); - perf.clearMarks(endTag); +function defineEmits() { + if (true) { + warnRuntimeUsage(`defineEmits`); } + return null; +} +function defineExpose(exposed) { if (true) { - devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + warnRuntimeUsage(`defineExpose`); } } -function isSupported() { - if (supported !== void 0) { - return supported; +function defineOptions(options) { + if (true) { + warnRuntimeUsage(`defineOptions`); } - if (typeof window !== "undefined" && window.performance) { - supported = true; - perf = window.performance; - } else { - supported = false; +} +function defineSlots() { + if (true) { + warnRuntimeUsage(`defineSlots`); } - return supported; + return null; } - -function initFeatureFlags() { - const needWarn = []; - if (false) {} - if (false) {} - if ( true && needWarn.length) { - const multi = needWarn.length > 1; - console.warn( - `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. - -For more details, see https://link.vuejs.org/feature-flags.` - ); +function defineModel() { + if (true) { + warnRuntimeUsage("defineModel"); } } - -const queuePostRenderEffect = queueEffectWithSuspense ; -function createRenderer(options) { - return baseCreateRenderer(options); +function withDefaults(props, defaults) { + if (true) { + warnRuntimeUsage(`withDefaults`); + } + return null; } -function createHydrationRenderer(options) { - return baseCreateRenderer(options, createHydrationFunctions); +function useSlots() { + return getContext().slots; } -function baseCreateRenderer(options, createHydrationFns) { - { - initFeatureFlags(); +function useAttrs() { + return getContext().attrs; +} +function useModel(props, name, options = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { + const i = getCurrentInstance(); + if ( true && !i) { + warn$1(`useModel() called without active instance.`); + return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); } - const target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)(); - target.__VUE__ = true; - if (true) { - setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + if ( true && !i.propsOptions[0][name]) { + warn$1(`useModel() called with prop "${name}" which is not declared.`); + return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ref)(); } - const { - insert: hostInsert, - remove: hostRemove, - patchProp: hostPatchProp, - createElement: hostCreateElement, - createText: hostCreateText, - createComment: hostCreateComment, - setText: hostSetText, - setElementText: hostSetElementText, - parentNode: hostParentNode, - nextSibling: hostNextSibling, - setScopeId: hostSetScopeId = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, - insertStaticContent: hostInsertStaticContent - } = options; - const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = true && isHmrUpdating ? false : !!n2.dynamicChildren) => { - if (n1 === n2) { - return; - } - if (n1 && !isSameVNodeType(n1, n2)) { - anchor = getNextHostNode(n1); - unmount(n1, parentComponent, parentSuspense, true); - n1 = null; - } - if (n2.patchFlag === -2) { - optimized = false; - n2.dynamicChildren = null; - } - const { type, ref, shapeFlag } = n2; - switch (type) { - case Text: - processText(n1, n2, container, anchor); - break; - case Comment: - processCommentNode(n1, n2, container, anchor); - break; - case Static: - if (n1 == null) { - mountStaticNode(n2, container, anchor, isSVG); - } else if (true) { - patchStaticNode(n1, n2, container, isSVG); + const camelizedName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(name); + const hyphenatedName = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(name); + const res = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.customRef)((track, trigger) => { + let localValue; + watchSyncEffect(() => { + const propValue = props[name]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(localValue, propValue)) { + localValue = propValue; + trigger(); + } + }); + return { + get() { + track(); + return options.get ? options.get(localValue) : localValue; + }, + set(value) { + const rawProps = i.vnode.props; + if (!(rawProps && // check if parent has passed v-model + (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(value, localValue)) { + localValue = value; + trigger(); } - break; - case Fragment: - processFragment( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - break; - default: - if (shapeFlag & 1) { - processElement( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else if (shapeFlag & 6) { - processComponent( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else if (shapeFlag & 64) { - type.process( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized, - internals - ); - } else if (shapeFlag & 128) { - type.process( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized, - internals - ); - } else if (true) { - warn("Invalid VNode type:", type, `(${typeof type})`); + i.emit(`update:${name}`, options.set ? options.set(value) : value); + } + }; + }); + const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`; + res[Symbol.iterator] = () => { + let i2 = 0; + return { + next() { + if (i2 < 2) { + return { value: i2++ ? props[modifierKey] || {} : res, done: false }; + } else { + return { done: true }; } - } - if (ref != null && parentComponent) { - setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); - } + } + }; }; - const processText = (n1, n2, container, anchor) => { - if (n1 == null) { - hostInsert( - n2.el = hostCreateText(n2.children), - container, - anchor - ); - } else { - const el = n2.el = n1.el; - if (n2.children !== n1.children) { - hostSetText(el, n2.children); + return res; +} +function getContext() { + const i = getCurrentInstance(); + if ( true && !i) { + warn$1(`useContext() called without active instance.`); + } + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props.reduce( + (normalized, p) => (normalized[p] = null, normalized), + {} + ) : props; +} +function mergeDefaults(raw, defaults) { + const props = normalizePropsOrEmits(raw); + for (const key in defaults) { + if (key.startsWith("__skip")) + continue; + let opt = props[key]; + if (opt) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt)) { + opt = props[key] = { type: opt, default: defaults[key] }; + } else { + opt.default = defaults[key]; } + } else if (opt === null) { + opt = props[key] = { default: defaults[key] }; + } else if (true) { + warn$1(`props default key "${key}" has no corresponding declaration.`); } - }; - const processCommentNode = (n1, n2, container, anchor) => { - if (n1 == null) { - hostInsert( - n2.el = hostCreateComment(n2.children || ""), - container, - anchor - ); + if (opt && defaults[`__skip_${key}`]) { + opt.skipFactory = true; + } + } + return props; +} +function mergeModels(a, b) { + if (!a || !b) + return a || b; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(a) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(b)) + return a.concat(b); + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); +} +function createPropsRestProxy(props, excludedKeys) { + const ret = {}; + for (const key in props) { + if (!excludedKeys.includes(key)) { + Object.defineProperty(ret, key, { + enumerable: true, + get: () => props[key] + }); + } + } + return ret; +} +function withAsyncContext(getAwaitable) { + const ctx = getCurrentInstance(); + if ( true && !ctx) { + warn$1( + `withAsyncContext called without active current instance. This is likely a bug.` + ); + } + let awaitable = getAwaitable(); + unsetCurrentInstance(); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) { + awaitable = awaitable.catch((e) => { + setCurrentInstance(ctx); + throw e; + }); + } + return [awaitable, () => setCurrentInstance(ctx)]; +} + +function createDuplicateChecker() { + const cache = /* @__PURE__ */ Object.create(null); + return (type, key) => { + if (cache[key]) { + warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); } else { - n2.el = n1.el; + cache[key] = type; } }; - const mountStaticNode = (n2, container, anchor, isSVG) => { - [n2.el, n2.anchor] = hostInsertStaticContent( - n2.children, - container, - anchor, - isSVG, - n2.el, - n2.anchor - ); - }; - const patchStaticNode = (n1, n2, container, isSVG) => { - if (n2.children !== n1.children) { - const anchor = hostNextSibling(n1.anchor); - removeStaticNode(n1); - [n2.el, n2.anchor] = hostInsertStaticContent( - n2.children, - container, - anchor, - isSVG - ); - } else { - n2.el = n1.el; - n2.anchor = n1.anchor; - } - }; - const moveStaticNode = ({ el, anchor }, container, nextSibling) => { - let next; - while (el && el !== anchor) { - next = hostNextSibling(el); - hostInsert(el, container, nextSibling); - el = next; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = true ? createDuplicateChecker() : 0; + if (true) { + const [propsOptions] = instance.propsOptions; + if (propsOptions) { + for (const key in propsOptions) { + checkDuplicateProperties("Props" /* PROPS */, key); + } } - hostInsert(anchor, container, nextSibling); - }; - const removeStaticNode = ({ el, anchor }) => { - let next; - while (el && el !== anchor) { - next = hostNextSibling(el); - hostRemove(el); - el = next; + } + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(methodHandler)) { + if (true) { + Object.defineProperty(ctx, key, { + value: methodHandler.bind(publicThis), + configurable: true, + enumerable: true, + writable: true + }); + } else {} + if (true) { + checkDuplicateProperties("Methods" /* METHODS */, key); + } + } else if (true) { + warn$1( + `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` + ); + } } - hostRemove(anchor); - }; - const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - isSVG = isSVG || n2.type === "svg"; - if (n1 == null) { - mountElement( - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else { - patchElement( - n1, - n2, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized + } + if (dataOptions) { + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(dataOptions)) { + warn$1( + `The data option must be a function. Plain object usage is no longer supported.` ); } - }; - const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - let el; - let vnodeHook; - const { type, props, shapeFlag, transition, dirs } = vnode; - el = vnode.el = hostCreateElement( - vnode.type, - isSVG, - props && props.is, - props - ); - if (shapeFlag & 8) { - hostSetElementText(el, vnode.children); - } else if (shapeFlag & 16) { - mountChildren( - vnode.children, - el, - null, - parentComponent, - parentSuspense, - isSVG && type !== "foreignObject", - slotScopeIds, - optimized + const data = dataOptions.call(publicThis, publicThis); + if ( true && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(data)) { + warn$1( + `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` ); } - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "created"); - } - setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); - if (props) { - for (const key in props) { - if (key !== "value" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { - hostPatchProp( - el, - key, - null, - props[key], - isSVG, - vnode.children, - parentComponent, - parentSuspense, - unmountChildren - ); + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(data)) { + true && warn$1(`data() should return an object.`); + } else { + instance.data = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.reactive)(data); + if (true) { + for (const key in data) { + checkDuplicateProperties("Data" /* DATA */, key); + if (!isReservedPrefix(key[0])) { + Object.defineProperty(ctx, key, { + configurable: true, + enumerable: true, + get: () => data[key], + set: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP + }); + } } } - if ("value" in props) { - hostPatchProp(el, "value", null, props.value); - } - if (vnodeHook = props.onVnodeBeforeMount) { - invokeVNodeHook(vnodeHook, parentComponent, vnode); - } } - if (true) { - Object.defineProperty(el, "__vnode", { - value: vnode, - enumerable: false + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; + if ( true && get === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { + warn$1(`Computed property "${key}" has no getter.`); + } + const set = !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt.set) ? opt.set.bind(publicThis) : true ? () => { + warn$1( + `Write operation failed: computed property "${key}" is readonly.` + ); + } : 0; + const c = computed({ + get, + set }); - Object.defineProperty(el, "__vueParentComponent", { - value: parentComponent, - enumerable: false + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v }); - } - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); - } - const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; - if (needCallTransitionHooks) { - transition.beforeEnter(el); - } - hostInsert(el, container, anchor); - if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { - queuePostRenderEffect(() => { - vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); - needCallTransitionHooks && transition.enter(el); - dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); - }, parentSuspense); - } - }; - const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { - if (scopeId) { - hostSetScopeId(el, scopeId); - } - if (slotScopeIds) { - for (let i = 0; i < slotScopeIds.length; i++) { - hostSetScopeId(el, slotScopeIds[i]); + if (true) { + checkDuplicateProperties("Computed" /* COMPUTED */, key); } } - if (parentComponent) { - let subTree = parentComponent.subTree; - if ( true && subTree.patchFlag > 0 && subTree.patchFlag & 2048) { - subTree = filterSingleRoot(subTree.children) || subTree; - } - if (vnode === subTree) { - const parentVNode = parentComponent.vnode; - setScopeId( - el, - parentVNode, - parentVNode.scopeId, - parentVNode.slotScopeIds, - parentComponent.parent - ); - } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); } - }; - const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => { - for (let i = start; i < children.length; i++) { - const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); - patch( - null, - child, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } - }; - const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - const el = n2.el = n1.el; - let { patchFlag, dynamicChildren, dirs } = n2; - patchFlag |= n1.patchFlag & 16; - const oldProps = n1.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - const newProps = n2.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - let vnodeHook; - parentComponent && toggleRecurse(parentComponent, false); - if (vnodeHook = newProps.onVnodeBeforeUpdate) { - invokeVNodeHook(vnodeHook, parentComponent, n2, n1); - } - if (dirs) { - invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); - } - parentComponent && toggleRecurse(parentComponent, true); - if ( true && isHmrUpdating) { - patchFlag = 0; - optimized = false; - dynamicChildren = null; + } + if (provideOptions) { + const provides = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); } - const areChildrenSVG = isSVG && n2.type !== "foreignObject"; - if (dynamicChildren) { - patchBlockChildren( - n1.dynamicChildren, - dynamicChildren, - el, - parentComponent, - parentSuspense, - areChildrenSVG, - slotScopeIds - ); - if (true) { - traverseStaticChildren(n1, n2); - } - } else if (!optimized) { - patchChildren( - n1, - n2, - el, - null, - parentComponent, - parentSuspense, - areChildrenSVG, - slotScopeIds, - false - ); + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; } - if (patchFlag > 0) { - if (patchFlag & 16) { - patchProps( - el, - n2, - oldProps, - newProps, - parentComponent, - parentSuspense, - isSVG + } + if (render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) + instance.components = components; + if (directives) + instance.directives = directives; +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true ); } else { - if (patchFlag & 2) { - if (oldProps.class !== newProps.class) { - hostPatchProp(el, "class", null, newProps.class, isSVG); - } - } - if (patchFlag & 4) { - hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG); - } - if (patchFlag & 8) { - const propsToUpdate = n2.dynamicProps; - for (let i = 0; i < propsToUpdate.length; i++) { - const key = propsToUpdate[i]; - const prev = oldProps[key]; - const next = newProps[key]; - if (next !== prev || key === "value") { - hostPatchProp( - el, - key, - prev, - next, - isSVG, - n1.children, - parentComponent, - parentSuspense, - unmountChildren - ); - } - } - } - } - if (patchFlag & 1) { - if (n1.children !== n2.children) { - hostSetElementText(el, n2.children); - } + injected = inject(opt.from || key); } - } else if (!optimized && dynamicChildren == null) { - patchProps( - el, - n2, - oldProps, - newProps, - parentComponent, - parentSuspense, - isSVG - ); - } - if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { - queuePostRenderEffect(() => { - vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); - dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); - }, parentSuspense); + } else { + injected = inject(opt); } - }; - const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => { - for (let i = 0; i < newChildren.length; i++) { - const oldVNode = oldChildren[i]; - const newVNode = newChildren[i]; - const container = ( - // oldVNode may be an errored async setup() component inside Suspense - // which will not have a mounted element - oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent - // of the Fragment itself so it can move its children. - (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement - // which also requires the correct parent container - !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( - // In other cases, the parent container is not actually used so we - // just pass the block element here to avoid a DOM parentNode call. - fallbackContainer - ) - ); - patch( - oldVNode, - newVNode, - container, - null, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - true - ); + if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; } - }; - const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => { - if (oldProps !== newProps) { - if (oldProps !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { - for (const key in oldProps) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key) && !(key in newProps)) { - hostPatchProp( - el, - key, - oldProps[key], - null, - isSVG, - vnode.children, - parentComponent, - parentSuspense, - unmountChildren - ); - } - } - } - for (const key in newProps) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) - continue; - const next = newProps[key]; - const prev = oldProps[key]; - if (next !== prev && key !== "value") { - hostPatchProp( - el, - key, - prev, - next, - isSVG, - vnode.children, - parentComponent, - parentSuspense, - unmountChildren - ); - } - } - if ("value" in newProps) { - hostPatchProp(el, "value", oldProps.value, newProps.value); - } + if (true) { + checkDuplicateProperties("Inject" /* INJECT */, key); } - }; - const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); - const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); - let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; - if ( true && // #5523 dev root fragment may inherit directives - (isHmrUpdating || patchFlag & 2048)) { - patchFlag = 0; - optimized = false; - dynamicChildren = null; - } - if (fragmentSlotScopeIds) { - slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } +} +function callHook(hook, instance, type) { + callWithAsyncErrorHandling( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw)) { + const handler = ctx[raw]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { + watch(getter, handler); + } else if (true) { + warn$1(`Invalid watch handler specified by key "${raw}"`, handler); } - if (n1 == null) { - hostInsert(fragmentStartAnchor, container, anchor); - hostInsert(fragmentEndAnchor, container, anchor); - mountChildren( - n2.children, - container, - fragmentEndAnchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw)) { + watch(getter, raw.bind(publicThis)); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); } else { - if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result - // of renderSlot() with no valid children - n1.dynamicChildren) { - patchBlockChildren( - n1.dynamicChildren, - dynamicChildren, - container, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds - ); - if (true) { - traverseStaticChildren(n1, n2); - } else {} - } else { - patchChildren( - n1, - n2, - container, - fragmentEndAnchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } - } - }; - const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - n2.slotScopeIds = slotScopeIds; - if (n1 == null) { - if (n2.shapeFlag & 512) { - parentComponent.ctx.activate( - n2, - container, - anchor, - isSVG, - optimized - ); - } else { - mountComponent( - n2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - optimized - ); + const handler = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) { + watch(getter, handler, raw); + } else if (true) { + warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); } - } else { - updateComponent(n1, n2, optimized); - } - }; - const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => { - const instance = (initialVNode.component = createComponentInstance( - initialVNode, - parentComponent, - parentSuspense - )); - if ( true && instance.type.__hmrId) { - registerHMR(instance); - } - if (true) { - pushWarningContext(initialVNode); - startMeasure(instance, `mount`); - } - if (isKeepAlive(initialVNode)) { - instance.ctx.renderer = internals; } + } else if (true) { + warn$1(`Invalid watch option: "${key}"`, raw); + } +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { { - if (true) { - startMeasure(instance, `init`); - } - setupComponent(instance); - if (true) { - endMeasure(instance, `init`); - } + resolved = base; } - if (instance.asyncDep) { - parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect); - if (!initialVNode.el) { - const placeholder = instance.subTree = createVNode(Comment); - processCommentNode(null, placeholder, container, anchor); - } - return; + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); } - setupRenderEffect( - instance, - initialVNode, - container, - anchor, - parentSuspense, - isSVG, - optimized + mergeOptions(resolved, base, optionMergeStrategies); + } + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) ); - if (true) { - popWarningContext(); - endMeasure(instance, `mount`); - } - }; - const updateComponent = (n1, n2, optimized) => { - const instance = n2.component = n1.component; - if (shouldUpdateComponent(n1, n2, optimized)) { - if (instance.asyncDep && !instance.asyncResolved) { - if (true) { - pushWarningContext(n2); - } - updateComponentPreRender(instance, n2, optimized); - if (true) { - popWarningContext(); - } - return; - } else { - instance.next = n2; - invalidateJob(instance.update); - instance.update(); - } + } + for (const key in from) { + if (asMixin && key === "expose") { + true && warn$1( + `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` + ); } else { - n2.el = n1.el; - instance.vnode = n2; + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend))( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(to) ? to.call(this, this) : to, + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(from) ? from.call(this, this) : from + ); }; - const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => { - const componentUpdateFn = () => { - if (!instance.isMounted) { - let vnodeHook; - const { el, props } = initialVNode; - const { bm, m, parent } = instance; - const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); - toggleRecurse(instance, false); - if (bm) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bm); +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(to) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) + return from; + if (!from) + return to; + const merged = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} + +function createAppContext() { + return { + app: null, + config: { + isNativeTag: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp(rootComponent, rootProps = null) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(rootComponent)) { + rootComponent = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, rootComponent); + } + if (rootProps != null && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(rootProps)) { + true && warn$1(`root props passed to app.mount() must be an object.`); + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + if (true) { + warn$1( + `app.config cannot be replaced. Modify individual options instead.` + ); } - if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { - invokeVNodeHook(vnodeHook, parent, initialVNode); + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) { + true && warn$1(`Plugin has already been applied to target app.`); + } else if (plugin && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else if (true) { + warn$1( + `A plugin must either be a function or an object with an "install" function.` + ); } - toggleRecurse(instance, true); - if (el && hydrateNode) { - const hydrateSubTree = () => { - if (true) { - startMeasure(instance, `render`); - } - instance.subTree = renderComponentRoot(instance); - if (true) { - endMeasure(instance, `render`); - } - if (true) { - startMeasure(instance, `hydrate`); - } - hydrateNode( - el, - instance.subTree, - instance, - parentSuspense, - null + return app; + }, + mixin(mixin) { + if (true) { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } else if (true) { + warn$1( + "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") ); - if (true) { - endMeasure(instance, `hydrate`); - } - }; - if (isAsyncWrapperVNode) { - initialVNode.type.__asyncLoader().then( - // note: we are moving the render call into an async callback, - // which means it won't track dependencies - but it's ok because - // a server-rendered async wrapper is already in resolved state - // and it will never need to change. - () => !instance.isUnmounted && hydrateSubTree() + } + } else {} + return app; + }, + component(name, component) { + if (true) { + validateComponentName(name, context.config); + } + if (!component) { + return context.components[name]; + } + if ( true && context.components[name]) { + warn$1(`Component "${name}" has already been registered in target app.`); + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + if (true) { + validateDirectiveName(name); + } + if (!directive) { + return context.directives[name]; + } + if ( true && context.directives[name]) { + warn$1(`Directive "${name}" has already been registered in target app.`); + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + if ( true && rootContainer.__vue_app__) { + warn$1( + `There is already an app instance mounted on the host container. + If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` ); - } else { - hydrateSubTree(); } - } else { - if (true) { - startMeasure(instance, `render`); + const vnode = createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; } - const subTree = instance.subTree = renderComponentRoot(instance); if (true) { - endMeasure(instance, `render`); + context.reload = () => { + render( + cloneVNode(vnode), + rootContainer, + namespace + ); + }; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; if (true) { - startMeasure(instance, `patch`); + app._instance = vnode.component; + devtoolsInitApp(app, version); } - patch( - null, - subTree, - container, - anchor, - instance, - parentSuspense, - isSVG + return getExposeProxy(vnode.component) || vnode.component.proxy; + } else if (true) { + warn$1( + `App has already been mounted. +If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` ); + } + }, + unmount() { + if (isMounted) { + render(null, app._container); if (true) { - endMeasure(instance, `patch`); + app._instance = null; + devtoolsUnmountApp(app); } - initialVNode.el = subTree.el; - } - if (m) { - queuePostRenderEffect(m, parentSuspense); + delete app._container.__vue_app__; + } else if (true) { + warn$1(`Cannot unmount an app that is not mounted.`); } - if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { - const scopedInitialVNode = initialVNode; - queuePostRenderEffect( - () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), - parentSuspense + }, + provide(key, value) { + if ( true && key in context.provides) { + warn$1( + `App already provides property with key "${String(key)}". It will be overwritten with the new value.` ); } - if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { - instance.a && queuePostRenderEffect(instance.a, parentSuspense); - } - instance.isMounted = true; - if (true) { - devtoolsComponentAdded(instance); - } - initialVNode = container = anchor = null; - } else { - let { next, bu, u, parent, vnode } = instance; - let originNext = next; - let vnodeHook; - if (true) { - pushWarningContext(next || instance.vnode); - } - toggleRecurse(instance, false); - if (next) { - next.el = vnode.el; - updateComponentPreRender(instance, next, optimized); - } else { - next = vnode; - } - if (bu) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bu); - } - if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { - invokeVNodeHook(vnodeHook, parent, next, vnode); - } - toggleRecurse(instance, true); - if (true) { - startMeasure(instance, `render`); - } - const nextTree = renderComponentRoot(instance); - if (true) { - endMeasure(instance, `render`); - } - const prevTree = instance.subTree; - instance.subTree = nextTree; - if (true) { - startMeasure(instance, `patch`); - } - patch( - prevTree, - nextTree, - // parent may have changed if it's in a teleport - hostParentNode(prevTree.el), - // anchor may have changed if it's in a fragment - getNextHostNode(prevTree), - instance, - parentSuspense, - isSVG - ); - if (true) { - endMeasure(instance, `patch`); - } - next.el = nextTree.el; - if (originNext === null) { - updateHOCHostEl(instance, nextTree.el); - } - if (u) { - queuePostRenderEffect(u, parentSuspense); - } - if (vnodeHook = next.props && next.props.onVnodeUpdated) { - queuePostRenderEffect( - () => invokeVNodeHook(vnodeHook, parent, next, vnode), - parentSuspense - ); - } - if (true) { - devtoolsComponentUpdated(instance); - } - if (true) { - popWarningContext(); + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + currentApp = app; + try { + return fn(); + } finally { + currentApp = null; } } }; - const effect = instance.effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect( - componentUpdateFn, - () => queueJob(update), - instance.scope - // track it in component's effect scope - ); - const update = instance.update = () => effect.run(); - update.id = instance.uid; - toggleRecurse(instance, true); + return app; + }; +} +let currentApp = null; + +function provide(key, value) { + if (!currentInstance) { if (true) { - effect.onTrack = instance.rtc ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtc, e) : void 0; - effect.onTrigger = instance.rtg ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtg, e) : void 0; - update.ownerInstance = instance; + warn$1(`provide() can only be used inside setup().`); } - update(); - }; - const updateComponentPreRender = (instance, nextVNode, optimized) => { - nextVNode.component = instance; - const prevProps = instance.vnode.props; - instance.vnode = nextVNode; - instance.next = null; - updateProps(instance, nextVNode.props, prevProps, optimized); - updateSlots(instance, nextVNode.children, optimized); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - flushPreFlushCbs(); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); - }; - const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => { - const c1 = n1 && n1.children; - const prevShapeFlag = n1 ? n1.shapeFlag : 0; - const c2 = n2.children; - const { patchFlag, shapeFlag } = n2; - if (patchFlag > 0) { - if (patchFlag & 128) { - patchKeyedChildren( - c1, - c2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - return; - } else if (patchFlag & 256) { - patchUnkeyedChildren( - c1, - c2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - return; - } + } else { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); } - if (shapeFlag & 8) { - if (prevShapeFlag & 16) { - unmountChildren(c1, parentComponent, parentSuspense); - } - if (c2 !== c1) { - hostSetElementText(container, c2); - } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = currentInstance || currentRenderingInstance; + if (instance || currentApp) { + const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else if (true) { + warn$1(`injection "${String(key)}" not found.`); + } + } else if (true) { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} +function hasInjectionContext() { + return !!(currentInstance || currentRenderingInstance || currentApp); +} + +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = {}; + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(attrs, InternalObjectKey, 1); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + if (true) { + validateProps(rawProps || {}, props, instance); + } + if (isStateful) { + instance.props = isSSR ? props : (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReactive)(props); + } else { + if (!instance.type.props) { + instance.props = attrs; } else { - if (prevShapeFlag & 16) { - if (shapeFlag & 16) { - patchKeyedChildren( - c1, - c2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else { - unmountChildren(c1, parentComponent, parentSuspense, true); - } - } else { - if (prevShapeFlag & 8) { - hostSetElementText(container, ""); + instance.props = props; + } + } + instance.attrs = attrs; +} +function isInHmrContext(instance) { + while (instance) { + if (instance.type.__hmrId) + return true; + instance = instance.parent; + } +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + !( true && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; } - if (shapeFlag & 16) { - mountChildren( - c2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); + const value = rawProps[key]; + if (options) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } } } } - }; - const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - c1 = c1 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; - c2 = c2 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; - const oldLength = c1.length; - const newLength = c2.length; - const commonLength = Math.min(oldLength, newLength); - let i; - for (i = 0; i < commonLength; i++) { - const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); - patch( - c1[i], - nextChild, - container, - null, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } - if (oldLength > newLength) { - unmountChildren( - c1, - parentComponent, - parentSuspense, - true, - false, - commonLength - ); - } else { - mountChildren( - c2, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized, - commonLength - ); - } - }; - const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { - let i = 0; - const l2 = c2.length; - let e1 = c1.length - 1; - let e2 = l2 - 1; - while (i <= e1 && i <= e2) { - const n1 = c1[i]; - const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); - if (isSameVNodeType(n1, n2)) { - patch( - n1, - n2, - container, - null, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else { - break; - } - i++; - } - while (i <= e1 && i <= e2) { - const n1 = c1[e1]; - const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); - if (isSameVNodeType(n1, n2)) { - patch( - n1, - n2, - container, - null, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else { - break; - } - e1--; - e2--; + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; } - if (i > e1) { - if (i <= e2) { - const nextPos = e2 + 1; - const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; - while (i <= e2) { - patch( - null, - c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - i++; - } - } - } else if (i > e2) { - while (i <= e1) { - unmount(c1[i], parentComponent, parentSuspense, true); - i++; - } - } else { - const s1 = i; - const s2 = i; - const keyToNewIndexMap = /* @__PURE__ */ new Map(); - for (i = s2; i <= e2; i++) { - const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); - if (nextChild.key != null) { - if ( true && keyToNewIndexMap.has(nextChild.key)) { - warn( - `Duplicate keys found during update:`, - JSON.stringify(nextChild.key), - `Make sure keys are unique.` + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) === key || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true ); } - keyToNewIndexMap.set(nextChild.key, i); + } else { + delete props[key]; } } - let j; - let patched = 0; - const toBePatched = e2 - s2 + 1; - let moved = false; - let maxNewIndexSoFar = 0; - const newIndexToOldIndexMap = new Array(toBePatched); - for (i = 0; i < toBePatched; i++) - newIndexToOldIndexMap[i] = 0; - for (i = s1; i <= e1; i++) { - const prevChild = c1[i]; - if (patched >= toBePatched) { - unmount(prevChild, parentComponent, parentSuspense, true); - continue; + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; } - let newIndex; - if (prevChild.key != null) { - newIndex = keyToNewIndexMap.get(prevChild.key); + } + } + } + if (hasAttrsChanged) { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$attrs"); + } + if (true) { + validateProps(rawProps || {}, props, instance); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(options, camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; } else { - for (j = s2; j <= e2; j++) { - if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { - newIndex = j; - break; - } - } + (rawCastValues || (rawCastValues = {}))[camelKey] = value; } - if (newIndex === void 0) { - unmount(prevChild, parentComponent, parentSuspense, true); + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); + const castValues = rawCastValues || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; } else { - newIndexToOldIndexMap[newIndex - s2] = i + 1; - if (newIndex >= maxNewIndexSoFar) { - maxNewIndexSoFar = newIndex; - } else { - moved = true; - } - patch( - prevChild, - c2[newIndex], - container, + setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( null, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized + props ); - patched++; + unsetCurrentInstance(); } + } else { + value = defaultValue; } - const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; - j = increasingNewIndexSequence.length - 1; - for (i = toBePatched - 1; i >= 0; i--) { - const nextIndex = s2 + i; - const nextChild = c2[nextIndex]; - const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; - if (newIndexToOldIndexMap[i] === 0) { - patch( - null, - nextChild, - container, - anchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } else if (moved) { - if (j < 0 || i !== increasingNewIndexSequence[j]) { - move(nextChild, container, anchor, 2); - } else { - j--; - } - } - } - } - }; - const move = (vnode, container, anchor, moveType, parentSuspense = null) => { - const { el, type, transition, children, shapeFlag } = vnode; - if (shapeFlag & 6) { - move(vnode.component.subTree, container, anchor, moveType); - return; - } - if (shapeFlag & 128) { - vnode.suspense.move(container, anchor, moveType); - return; - } - if (shapeFlag & 64) { - type.move(vnode, container, anchor, internals); - return; } - if (type === Fragment) { - hostInsert(el, container, anchor); - for (let i = 0; i < children.length; i++) { - move(children[i], container, anchor, moveType); + if (opt[0 /* shouldCast */]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key))) { + value = true; } - hostInsert(vnode.anchor, container, anchor); - return; - } - if (type === Static) { - moveStaticNode(vnode, container, anchor); - return; } - const needTransition = moveType !== 2 && shapeFlag & 1 && transition; - if (needTransition) { - if (moveType === 0) { - transition.beforeEnter(el); - hostInsert(el, container, anchor); - queuePostRenderEffect(() => transition.enter(el), parentSuspense); - } else { - const { leave, delayLeave, afterLeave } = transition; - const remove2 = () => hostInsert(el, container, anchor); - const performLeave = () => { - leave(el, () => { - remove2(); - afterLeave && afterLeave(); - }); - }; - if (delayLeave) { - delayLeave(el, remove2, performLeave); - } else { - performLeave(); - } - } - } else { - hostInsert(el, container, anchor); + } + return value; +} +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(normalized, props); + if (keys) + needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); } - }; - const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { - const { - type, - props, - ref, - children, - dynamicChildren, - shapeFlag, - patchFlag, - dirs - } = vnode; - if (ref != null) { - setRef(ref, null, parentSuspense, vnode, true); + if (comp.extends) { + extendProps(comp.extends); } - if (shapeFlag & 256) { - parentComponent.ctx.deactivate(vnode); - return; + if (comp.mixins) { + comp.mixins.forEach(extendProps); } - const shouldInvokeDirs = shapeFlag & 1 && dirs; - const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); - let vnodeHook; - if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { - invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + if (!raw && !hasExtends) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { + cache.set(comp, _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR); } - if (shapeFlag & 6) { - unmountComponent(vnode.component, parentSuspense, doRemove); - } else { - if (shapeFlag & 128) { - vnode.suspense.unmount(parentSuspense, doRemove); - return; - } - if (shouldInvokeDirs) { - invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); - } - if (shapeFlag & 64) { - vnode.type.remove( - vnode, - parentComponent, - parentSuspense, - optimized, - internals, - doRemove - ); - } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments - (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { - unmountChildren( - dynamicChildren, - parentComponent, - parentSuspense, - false, - true - ); - } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { - unmountChildren(children, parentComponent, parentSuspense); + return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; + } + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(raw)) { + for (let i = 0; i < raw.length; i++) { + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(raw[i])) { + warn$1(`props must be strings when using array syntax.`, raw[i]); } - if (doRemove) { - remove(vnode); + const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; } } - if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { - queuePostRenderEffect(() => { - vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); - shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); - }, parentSuspense); + } else if (raw) { + if ( true && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(raw)) { + warn$1(`invalid props options`, raw); } - }; - const remove = (vnode) => { - const { type, el, anchor, transition } = vnode; - if (type === Fragment) { - if ( true && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { - vnode.children.forEach((child) => { - if (child.type === Comment) { - hostRemove(child.el); - } else { - remove(child); + for (const key in raw) { + const normalizedKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opt) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(opt) ? { type: opt } : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, opt); + if (prop) { + const booleanIndex = getTypeIndex(Boolean, prop.type); + const stringIndex = getTypeIndex(String, prop.type); + prop[0 /* shouldCast */] = booleanIndex > -1; + prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex; + if (booleanIndex > -1 || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(prop, "default")) { + needCastKeys.push(normalizedKey); } - }); - } else { - removeFragment(el, anchor); + } } + } + } + const res = [normalized, needCastKeys]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$") { + return true; + } else if (true) { + warn$1(`Invalid prop name: "${key}" is a reserved property.`); + } + return false; +} +function getType(ctor) { + const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/); + return match ? match[2] : ctor === null ? "null" : ""; +} +function isSameType(a, b) { + return getType(a) === getType(b); +} +function getTypeIndex(type, expectedTypes) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(expectedTypes)) { + return expectedTypes.findIndex((t) => isSameType(t, type)); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(expectedTypes)) { + return isSameType(expectedTypes, type) ? 0 : -1; + } + return -1; +} +function validateProps(rawProps, props, instance) { + const resolvedValues = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(props); + const options = instance.propsOptions[0]; + for (const key in options) { + let opt = options[key]; + if (opt == null) + continue; + validateProp( + key, + resolvedValues[key], + opt, + true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(resolvedValues) : 0, + !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(rawProps, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)) + ); + } +} +function validateProp(name, value, prop, props, isAbsent) { + const { type, required, validator, skipCheck } = prop; + if (required && isAbsent) { + warn$1('Missing required prop: "' + name + '"'); + return; + } + if (value == null && !required) { + return; + } + if (type != null && type !== true && !skipCheck) { + let isValid = false; + const types = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(type) ? type : [type]; + const expectedTypes = []; + for (let i = 0; i < types.length && !isValid; i++) { + const { valid, expectedType } = assertType(value, types[i]); + expectedTypes.push(expectedType || ""); + isValid = valid; + } + if (!isValid) { + warn$1(getInvalidTypeMessage(name, value, expectedTypes)); return; } - if (type === Static) { - removeStaticNode(vnode); - return; - } - const performRemove = () => { - hostRemove(el); - if (transition && !transition.persisted && transition.afterLeave) { - transition.afterLeave(); - } - }; - if (vnode.shapeFlag & 1 && transition && !transition.persisted) { - const { leave, delayLeave } = transition; - const performLeave = () => leave(el, performRemove); - if (delayLeave) { - delayLeave(vnode.el, performRemove, performLeave); - } else { - performLeave(); - } - } else { - performRemove(); - } - }; - const removeFragment = (cur, end) => { - let next; - while (cur !== end) { - next = hostNextSibling(cur); - hostRemove(cur); - cur = next; - } - hostRemove(end); - }; - const unmountComponent = (instance, parentSuspense, doRemove) => { - if ( true && instance.type.__hmrId) { - unregisterHMR(instance); - } - const { bum, scope, update, subTree, um } = instance; - if (bum) { - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bum); - } - scope.stop(); - if (update) { - update.active = false; - unmount(subTree, instance, parentSuspense, doRemove); - } - if (um) { - queuePostRenderEffect(um, parentSuspense); - } - queuePostRenderEffect(() => { - instance.isUnmounted = true; - }, parentSuspense); - if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { - parentSuspense.deps--; - if (parentSuspense.deps === 0) { - parentSuspense.resolve(); - } - } - if (true) { - devtoolsComponentRemoved(instance); - } - }; - const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { - for (let i = start; i < children.length; i++) { - unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); - } - }; - const getNextHostNode = (vnode) => { - if (vnode.shapeFlag & 6) { - return getNextHostNode(vnode.component.subTree); - } - if (vnode.shapeFlag & 128) { - return vnode.suspense.next(); - } - return hostNextSibling(vnode.anchor || vnode.el); - }; - const render = (vnode, container, isSVG) => { - if (vnode == null) { - if (container._vnode) { - unmount(container._vnode, null, null, true); - } - } else { - patch(container._vnode || null, vnode, container, null, null, null, isSVG); + } + if (validator && !validator(value, props)) { + warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); + } +} +const isSimpleType = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)( + "String,Number,Boolean,Function,Symbol,BigInt" +); +function assertType(value, type) { + let valid; + const expectedType = getType(type); + if (isSimpleType(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === "object") { + valid = value instanceof type; } - flushPreFlushCbs(); - flushPostFlushCbs(); - container._vnode = vnode; - }; - const internals = { - p: patch, - um: unmount, - m: move, - r: remove, - mt: mountComponent, - mc: mountChildren, - pc: patchChildren, - pbc: patchBlockChildren, - n: getNextHostNode, - o: options - }; - let hydrate; - let hydrateNode; - if (createHydrationFns) { - [hydrate, hydrateNode] = createHydrationFns( - internals - ); + } else if (expectedType === "Object") { + valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(value); + } else if (expectedType === "Array") { + valid = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value); + } else if (expectedType === "null") { + valid = value === null; + } else { + valid = value instanceof type; } return { - render, - hydrate, - createApp: createAppAPI(render, hydrate) + valid, + expectedType }; } -function toggleRecurse({ effect, update }, allowed) { - effect.allowRecurse = update.allowRecurse = allowed; -} -function traverseStaticChildren(n1, n2, shallow = false) { - const ch1 = n1.children; - const ch2 = n2.children; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch1) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch2)) { - for (let i = 0; i < ch1.length; i++) { - const c1 = ch1[i]; - let c2 = ch2[i]; - if (c2.shapeFlag & 1 && !c2.dynamicChildren) { - if (c2.patchFlag <= 0 || c2.patchFlag === 32) { - c2 = ch2[i] = cloneIfMounted(ch2[i]); - c2.el = c1.el; - } - if (!shallow) - traverseStaticChildren(c1, c2); - } - if (c2.type === Text) { - c2.el = c1.el; - } - if ( true && c2.type === Comment && !c2.el) { - c2.el = c1.el; - } - } +function getInvalidTypeMessage(name, value, expectedTypes) { + if (expectedTypes.length === 0) { + return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; } -} -function getSequence(arr) { - const p = arr.slice(); - const result = [0]; - let i, j, u, v, c; - const len = arr.length; - for (i = 0; i < len; i++) { - const arrI = arr[i]; - if (arrI !== 0) { - j = result[result.length - 1]; - if (arr[j] < arrI) { - p[i] = j; - result.push(i); - continue; - } - u = 0; - v = result.length - 1; - while (u < v) { - c = u + v >> 1; - if (arr[result[c]] < arrI) { - u = c + 1; - } else { - v = c; - } - } - if (arrI < arr[result[u]]) { - if (u > 0) { - p[i] = result[u - 1]; - } - result[u] = i; - } - } + let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize).join(" | ")}`; + const expectedType = expectedTypes[0]; + const receivedType = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toRawType)(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; } - u = result.length; - v = result[u - 1]; - while (u-- > 0) { - result[u] = v; - v = p[v]; + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; } - return result; + return message; +} +function styleValue(value, type) { + if (type === "String") { + return `"${value}"`; + } else if (type === "Number") { + return `${Number(value)}`; + } else { + return `${value}`; + } +} +function isExplicable(type) { + const explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some((elem) => type.toLowerCase() === elem); +} +function isBoolean(...args) { + return args.some((elem) => elem.toLowerCase() === "boolean"); } -const isTeleport = (type) => type.__isTeleport; -const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); -const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; -const resolveTarget = (props, select) => { - const targetSelector = props && props.to; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(targetSelector)) { - if (!select) { - true && warn( - `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` +const isInternalKey = (key) => key[0] === "_" || key === "$stable"; +const normalizeSlotValue = (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if ( true && currentInstance) { + warn$1( + `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); - return null; - } else { - const target = select(targetSelector); - if (!target) { - true && warn( - `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` - ); - } - return target; - } - } else { - if ( true && !targetSelector && !isTeleportDisabled(props)) { - warn(`Invalid Teleport target: ${targetSelector}`); } - return targetSelector; - } + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; }; -const TeleportImpl = { - __isTeleport: true, - process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) { - const { - mc: mountChildren, - pc: patchChildren, - pbc: patchBlockChildren, - o: { insert, querySelector, createText, createComment } - } = internals; - const disabled = isTeleportDisabled(n2.props); - let { shapeFlag, children, dynamicChildren } = n2; - if ( true && isHmrUpdating) { - optimized = false; - dynamicChildren = null; - } - if (n1 == null) { - const placeholder = n2.el = true ? createComment("teleport start") : 0; - const mainAnchor = n2.anchor = true ? createComment("teleport end") : 0; - insert(placeholder, container, anchor); - insert(mainAnchor, container, anchor); - const target = n2.target = resolveTarget(n2.props, querySelector); - const targetAnchor = n2.targetAnchor = createText(""); - if (target) { - insert(targetAnchor, target); - isSVG = isSVG || isTargetSVG(target); - } else if ( true && !disabled) { - warn("Invalid Teleport target on mount:", target, `(${typeof target})`); - } - const mount = (container2, anchor2) => { - if (shapeFlag & 16) { - mountChildren( - children, - container2, - anchor2, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - optimized - ); - } - }; - if (disabled) { - mount(container, mainAnchor); - } else if (target) { - mount(target, targetAnchor); - } - } else { - n2.el = n1.el; - const mainAnchor = n2.anchor = n1.anchor; - const target = n2.target = n1.target; - const targetAnchor = n2.targetAnchor = n1.targetAnchor; - const wasDisabled = isTeleportDisabled(n1.props); - const currentContainer = wasDisabled ? container : target; - const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; - isSVG = isSVG || isTargetSVG(target); - if (dynamicChildren) { - patchBlockChildren( - n1.dynamicChildren, - dynamicChildren, - currentContainer, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds - ); - traverseStaticChildren(n1, n2, true); - } else if (!optimized) { - patchChildren( - n1, - n2, - currentContainer, - currentAnchor, - parentComponent, - parentSuspense, - isSVG, - slotScopeIds, - false +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) + continue; + const value = rawSlots[key]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + if (true) { + warn$1( + `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` ); } - if (disabled) { - if (!wasDisabled) { - moveTeleport( - n2, - container, - mainAnchor, - internals, - 1 - ); - } + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + if ( true && !isKeepAlive(instance.vnode) && true) { + warn$1( + `Non-function value encountered for default slot. Prefer function slots for better performance.` + ); + } + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const initSlots = (instance, children) => { + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + instance.slots = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(children); + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(children, "_", type); + } else { + normalizeObjectSlots( + children, + instance.slots = {}); + } + } else { + instance.slots = {}; + if (children) { + normalizeVNodeSlots(instance, children); + } + } + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.def)(instance.slots, InternalObjectKey, 1); +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if ( true && isHmrUpdating) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.trigger)(instance, "set", "$slots"); + } else if (optimized && type === 1) { + needDeletionCheck = false; } else { - if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { - const nextTarget = n2.target = resolveTarget( - n2.props, - querySelector - ); - if (nextTarget) { - moveTeleport( - n2, - nextTarget, - null, - internals, - 0 - ); - } else if (true) { - warn( - "Invalid Teleport target on update:", - target, - `(${typeof target})` - ); - } - } else if (wasDisabled) { - moveTeleport( - n2, - target, - targetAnchor, - internals, - 1 - ); + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(slots, children); + if (!optimized && type === 1) { + delete slots._; } } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); } - updateCssVars(n2); - }, - remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) { - const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode; - if (target) { - hostRemove(targetAnchor); - } - if (doRemove || !isTeleportDisabled(props)) { - hostRemove(anchor); - if (shapeFlag & 16) { - for (let i = 0; i < children.length; i++) { - const child = children[i]; - unmount( - child, - parentComponent, - parentSuspense, - true, - !!child.dynamicChildren - ); - } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; } } - }, - move: moveTeleport, - hydrate: hydrateTeleport + } }; -function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { - if (moveType === 0) { - insert(vnode.targetAnchor, container, parentAnchor); + +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; } - const { el, anchor, shapeFlag, children, props } = vnode; - const isReorder = moveType === 2; - if (isReorder) { - insert(el, container, parentAnchor); + if (isAsyncWrapper(vnode) && !isUnmount) { + return; } - if (!isReorder || isTeleportDisabled(props)) { - if (shapeFlag & 16) { - for (let i = 0; i < children.length; i++) { - move( - children[i], - container, - parentAnchor, - 2 - ); + const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref } = rawRef; + if ( true && !owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + if (oldRef != null && oldRef !== ref) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(oldRef)) { + refs[oldRef] = null; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, oldRef)) { + setupState[oldRef] = null; } + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(oldRef)) { + oldRef.value = null; } } - if (isReorder) { - insert(anchor, container, parentAnchor); - } -} -function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { - o: { nextSibling, parentNode, querySelector } -}, hydrateChildren) { - const target = vnode.target = resolveTarget( - vnode.props, - querySelector - ); - if (target) { - const targetNode = target._lpa || target.firstChild; - if (vnode.shapeFlag & 16) { - if (isTeleportDisabled(vnode.props)) { - vnode.anchor = hydrateChildren( - nextSibling(node), - vnode, - parentNode(node), - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - vnode.targetAnchor = targetNode; - } else { - vnode.anchor = nextSibling(node); - let targetAnchor = targetNode; - while (targetAnchor) { - targetAnchor = nextSibling(targetAnchor); - if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") { - vnode.targetAnchor = targetAnchor; - target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); - break; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref)) { + callWithErrorHandling(ref, owner, 12, [value, refs]); + } else { + const _isString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref); + const _isRef = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref) ? setupState[ref] : refs[ref] : ref.value; + if (isUnmount) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.remove)(existing, refValue); + } else { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing)) { + if (_isString) { + refs[ref] = [refValue]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { + setupState[ref] = refs[ref]; + } + } else { + ref.value = [refValue]; + if (rawRef.k) + refs[rawRef.k] = ref.value; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref] = value; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(setupState, ref)) { + setupState[ref] = value; } + } else if (_isRef) { + ref.value = value; + if (rawRef.k) + refs[rawRef.k] = value; + } else if (true) { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); } - hydrateChildren( - targetNode, - vnode, - target, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); + }; + if (value) { + doSet.id = -1; + queuePostRenderEffect(doSet, parentSuspense); + } else { + doSet(); } + } else if (true) { + warn$1("Invalid template ref type:", ref, `(${typeof ref})`); } - updateCssVars(vnode); - } - return vnode.anchor && nextSibling(vnode.anchor); -} -const Teleport = TeleportImpl; -function updateCssVars(vnode) { - const ctx = vnode.ctx; - if (ctx && ctx.ut) { - let node = vnode.children[0].el; - while (node !== vnode.targetAnchor) { - if (node.nodeType === 1) - node.setAttribute("data-v-owner", ctx.uid); - node = node.nextSibling; - } - ctx.ut(); } } -const Fragment = Symbol.for("v-fgt"); -const Text = Symbol.for("v-txt"); -const Comment = Symbol.for("v-cmt"); -const Static = Symbol.for("v-stc"); -const blockStack = []; -let currentBlock = null; -function openBlock(disableTracking = false) { - blockStack.push(currentBlock = disableTracking ? null : []); -} -function closeBlock() { - blockStack.pop(); - currentBlock = blockStack[blockStack.length - 1] || null; -} -let isBlockTreeEnabled = 1; -function setBlockTracking(value) { - isBlockTreeEnabled += value; -} -function setupBlock(vnode) { - vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null; - closeBlock(); - if (isBlockTreeEnabled > 0 && currentBlock) { - currentBlock.push(vnode); - } - return vnode; -} -function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { - return setupBlock( - createBaseVNode( - type, - props, - children, - patchFlag, - dynamicProps, - shapeFlag, - true - /* isBlock */ - ) - ); -} -function createBlock(type, props, children, patchFlag, dynamicProps) { - return setupBlock( - createVNode( - type, - props, - children, - patchFlag, - dynamicProps, - true - /* isBlock: prevent a block from tracking itself */ - ) - ); -} -function isVNode(value) { - return value ? value.__v_isVNode === true : false; -} -function isSameVNodeType(n1, n2) { - if ( true && n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) { - n1.shapeFlag &= ~256; - n2.shapeFlag &= ~512; - return false; - } - return n1.type === n2.type && n1.key === n2.key; -} -let vnodeArgsTransformer; -function transformVNodeArgs(transformer) { - vnodeArgsTransformer = transformer; -} -const createVNodeWithArgsTransform = (...args) => { - return _createVNode( - ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args - ); -}; -const InternalObjectKey = `__vInternal`; -const normalizeKey = ({ key }) => key != null ? key : null; -const normalizeRef = ({ - ref, - ref_key, - ref_for -}) => { - if (typeof ref === "number") { - ref = "" + ref; - } - return ref != null ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; +let hasMismatch = false; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (isSVGContainer(container)) + return "svg"; + if (isMathMLContainer(container)) + return "mathml"; + return void 0; }; -function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { - const vnode = { - __v_isVNode: true, - __v_skip: true, - type, - props, - key: props && normalizeKey(props), - ref: props && normalizeRef(props), - scopeId: currentScopeId, - slotScopeIds: null, - children, - component: null, - suspense: null, - ssContent: null, - ssFallback: null, - dirs: null, - transition: null, - el: null, - anchor: null, - target: null, - targetAnchor: null, - staticCount: 0, - shapeFlag, - patchFlag, - dynamicProps, - dynamicChildren: null, - appContext: null, - ctx: currentRenderingInstance - }; - if (needFullChildrenNormalization) { - normalizeChildren(vnode, children); - if (shapeFlag & 128) { - type.normalize(vnode); - } - } else if (children) { - vnode.shapeFlag |= (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(children) ? 8 : 16; - } - if ( true && vnode.key !== vnode.key) { - warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type); - } - if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself - !isBlockNode && // has current parent block - currentBlock && // presence of a patch flag indicates this node needs patching on updates. - // component nodes also should always be patched, because even if the - // component doesn't need to update, it needs to persist the instance on to - // the next vnode so that it can be properly unmounted later. - (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the - // vnode should not be considered dynamic due to handler caching. - vnode.patchFlag !== 32) { - currentBlock.push(vnode); - } - return vnode; -} -const createVNode = true ? createVNodeWithArgsTransform : 0; -function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { - if (!type || type === NULL_DYNAMIC_COMPONENT) { - if ( true && !type) { - warn(`Invalid vnode type when creating vnode: ${type}.`); +const isComment = (node) => node.nodeType === 8 /* COMMENT */; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp, + createText, + nextSibling, + parentNode, + remove, + insert, + createComment } - type = Comment; - } - if (isVNode(type)) { - const cloned = cloneVNode( - type, - props, - true - /* mergeRef: true */ - ); - if (children) { - normalizeChildren(cloned, children); + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + ( true) && warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; } - if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { - if (cloned.shapeFlag & 6) { - currentBlock[currentBlock.indexOf(type)] = cloned; - } else { - currentBlock.push(cloned); - } - } - cloned.patchFlag |= -2; - return cloned; - } - if (isClassComponent(type)) { - type = type.__vccOpts; - } - if (props) { - props = guardReactiveProps(props); - let { class: klass, style } = props; - if (klass && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(klass)) { - props.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)(klass); - } - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(style)) { - if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(style) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(style)) { - style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, style); - } - props.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)(style); + hasMismatch = false; + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + if (hasMismatch && true) { + console.error(`Hydration completed but contains mismatches.`); } - } - const shapeFlag = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(type) ? 4 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(type) ? 2 : 0; - if ( true && shapeFlag & 4 && (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(type)) { - type = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(type); - warn( - `Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, - ` -Component that was made reactive: `, - type - ); - } - return createBaseVNode( - type, - props, - children, - patchFlag, - dynamicProps, - shapeFlag, - isBlockNode, - true - ); -} -function guardReactiveProps(props) { - if (!props) - return null; - return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(props) || InternalObjectKey in props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, props) : props; -} -function cloneVNode(vnode, extraProps, mergeRef = false) { - const { props, ref, patchFlag, children } = vnode; - const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; - const cloned = { - __v_isVNode: true, - __v_skip: true, - type: vnode.type, - props: mergedProps, - key: mergedProps && normalizeKey(mergedProps), - ref: extraProps && extraProps.ref ? ( - // #2078 in the case of <component :is="vnode" ref="extra"/> - // if the vnode itself already has a ref, cloneVNode will need to merge - // the refs so the single vnode can be set on multiple refs - mergeRef && ref ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) - ) : ref, - scopeId: vnode.scopeId, - slotScopeIds: vnode.slotScopeIds, - children: true && patchFlag === -1 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children) ? children.map(deepCloneVNode) : children, - target: vnode.target, - targetAnchor: vnode.targetAnchor, - staticCount: vnode.staticCount, - shapeFlag: vnode.shapeFlag, - // if the vnode is cloned with extra props, we can no longer assume its - // existing patch flag to be reliable and need to add the FULL_PROPS flag. - // note: preserve flag for fragments since they use the flag for children - // fast paths only. - patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, - dynamicProps: vnode.dynamicProps, - dynamicChildren: vnode.dynamicChildren, - appContext: vnode.appContext, - dirs: vnode.dirs, - transition: vnode.transition, - // These should technically only be non-null on mounted VNodes. However, - // they *should* be copied for kept-alive vnodes. So we just always copy - // them since them being non-null during a mount doesn't affect the logic as - // they will simply be overwritten. - component: vnode.component, - suspense: vnode.suspense, - ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), - ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), - el: vnode.el, - anchor: vnode.anchor, - ctx: vnode.ctx, - ce: vnode.ce }; - return cloned; -} -function deepCloneVNode(vnode) { - const cloned = cloneVNode(vnode); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) { - cloned.children = vnode.children.map(deepCloneVNode); - } - return cloned; -} -function createTextVNode(text = " ", flag = 0) { - return createVNode(Text, null, text, flag); -} -function createStaticVNode(content, numberOfNodes) { - const vnode = createVNode(Static, null, content); - vnode.staticCount = numberOfNodes; - return vnode; -} -function createCommentVNode(text = "", asBlock = false) { - return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); -} -function normalizeVNode(child) { - if (child == null || typeof child === "boolean") { - return createVNode(Comment); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(child)) { - return createVNode( - Fragment, - null, - // #3666, avoid reference pollution when reusing vnode - child.slice() + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart ); - } else if (typeof child === "object") { - return cloneIfMounted(child); - } else { - return createVNode(Text, null, String(child)); - } -} -function cloneIfMounted(child) { - return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); -} -function normalizeChildren(vnode, children) { - let type = 0; - const { shapeFlag } = vnode; - if (children == null) { - children = null; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children)) { - type = 16; - } else if (typeof children === "object") { - if (shapeFlag & (1 | 64)) { - const slot = children.default; - if (slot) { - slot._c && (slot._d = false); - normalizeChildren(vnode, slot()); - slot._c && (slot._d = true); + const { type, ref, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + if (true) { + if (!("__vnode" in node)) { + Object.defineProperty(node, "__vnode", { + value: vnode, + enumerable: false + }); } - return; - } else { - type = 32; - const slotFlag = children._; - if (!slotFlag && !(InternalObjectKey in children)) { - children._ctx = currentRenderingInstance; - } else if (slotFlag === 3 && currentRenderingInstance) { - if (currentRenderingInstance.slots._ === 1) { - children._ = 1; - } else { - children._ = 2; - vnode.patchFlag |= 1024; - } + if (!("__vueParentComponent" in node)) { + Object.defineProperty(node, "__vueParentComponent", { + value: parentComponent, + enumerable: false + }); } } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(children)) { - children = { default: children, _ctx: currentRenderingInstance }; - type = 32; - } else { - children = String(children); - if (shapeFlag & 64) { - type = 16; - children = [createTextVNode(children)]; - } else { - type = 8; + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; } - } - vnode.children = children; - vnode.shapeFlag |= type; -} -function mergeProps(...args) { - const ret = {}; - for (let i = 0; i < args.length; i++) { - const toMerge = args[i]; - for (const key in toMerge) { - if (key === "class") { - if (ret.class !== toMerge.class) { - ret.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)([ret.class, toMerge.class]); + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3 /* TEXT */) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + hasMismatch = true; + ( true) && warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + node.data = vnode.children; + } + nextNode = nextSibling(node); } - } else if (key === "style") { - ret.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)([ret.style, toMerge.style]); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { - const existing = ret[key]; - const incoming = toMerge[key]; - if (incoming && existing !== incoming && !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && existing.includes(incoming))) { - ret[key] = existing ? [].concat(existing, incoming) : incoming; + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 /* COMMENT */ || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode)) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8 /* COMMENT */) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else if (true) { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); } - } else if (key !== "") { - ret[key] = toMerge[key]; - } - } - } - return ret; -} -function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { - callWithAsyncErrorHandling(hook, instance, 7, [ - vnode, - prevVNode - ]); -} - -const emptyAppContext = createAppContext(); -let uid = 0; -function createComponentInstance(vnode, parent, suspense) { - const type = vnode.type; - const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; - const instance = { - uid: uid++, - vnode, - type, - parent, - appContext, - root: null, - // to be immediately set - next: null, - subTree: null, - // will be set synchronously right after creation - effect: null, - update: null, - // will be set synchronously right after creation - scope: new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope( - true - /* detached */ - ), - render: null, - proxy: null, - exposed: null, - exposeProxy: null, - withProxy: null, - provides: parent ? parent.provides : Object.create(appContext.provides), - accessCache: null, - renderCache: [], - // local resolved assets - components: null, - directives: null, - // resolved props and emits options - propsOptions: normalizePropsOptions(type, appContext), - emitsOptions: normalizeEmitsOptions(type, appContext), - // emit - emit: null, - // to be set immediately - emitted: null, - // props default value - propsDefaults: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - // inheritAttrs - inheritAttrs: type.inheritAttrs, - // state - ctx: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - data: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - props: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - attrs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - slots: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - refs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - setupState: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, - setupContext: null, - attrsProxy: null, - slotsProxy: null, - // suspense related - suspense, - suspenseId: suspense ? suspense.pendingId : 0, - asyncDep: null, - asyncResolved: false, - // lifecycle hooks - // not using enums here because it results in computed properties - isMounted: false, - isUnmounted: false, - isDeactivated: false, - bc: null, - c: null, - bm: null, - m: null, - bu: null, - u: null, - um: null, - bum: null, - da: null, - a: null, - rtg: null, - rtc: null, - ec: null, - sp: null - }; - if (true) { - instance.ctx = createDevRenderContext(instance); - } else {} - instance.root = parent ? parent.root : instance; - instance.emit = emit.bind(null, instance); - if (vnode.ce) { - vnode.ce(instance); - } - return instance; -} -let currentInstance = null; -const getCurrentInstance = () => currentInstance || currentRenderingInstance; -let internalSetCurrentInstance; -let globalCurrentInstanceSetters; -let settersKey = "__VUE_INSTANCE_SETTERS__"; -{ - if (!(globalCurrentInstanceSetters = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)()[settersKey])) { - globalCurrentInstanceSetters = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)()[settersKey] = []; - } - globalCurrentInstanceSetters.push((i) => currentInstance = i); - internalSetCurrentInstance = (instance) => { - if (globalCurrentInstanceSetters.length > 1) { - globalCurrentInstanceSetters.forEach((s) => s(instance)); - } else { - globalCurrentInstanceSetters[0](instance); } - }; -} -const setCurrentInstance = (instance) => { - internalSetCurrentInstance(instance); - instance.scope.on(); -}; -const unsetCurrentInstance = () => { - currentInstance && currentInstance.scope.off(); - internalSetCurrentInstance(null); -}; -const isBuiltInTag = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("slot,component"); -function validateComponentName(name, config) { - const appIsNativeTag = config.isNativeTag || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO; - if (isBuiltInTag(name) || appIsNativeTag(name)) { - warn( - "Do not use built-in or reserved HTML elements as component id: " + name - ); - } -} -function isStatefulComponent(instance) { - return instance.vnode.shapeFlag & 4; -} -let isInSSRComponentSetup = false; -function setupComponent(instance, isSSR = false) { - isInSSRComponentSetup = isSSR; - const { props, children } = instance.vnode; - const isStateful = isStatefulComponent(instance); - initProps(instance, props, isStateful, isSSR); - initSlots(instance, children); - const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; - isInSSRComponentSetup = false; - return setupResult; -} -function setupStatefulComponent(instance, isSSR) { - var _a; - const Component = instance.type; - if (true) { - if (Component.name) { - validateComponentName(Component.name, instance.appContext.config); + if (ref != null) { + setRef(ref, null, parentSuspense, vnode); } - if (Component.components) { - const names = Object.keys(Component.components); - for (let i = 0; i < names.length; i++) { - validateComponentName(names[i], instance.appContext.config); + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; + const forcePatch = type === "input" || type === "option"; + if (true) { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); } - } - if (Component.directives) { - const names = Object.keys(Component.directives); - for (let i = 0; i < names.length; i++) { - validateDirectiveName(names[i]); + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; } - } - if (Component.compilerOptions && isRuntimeOnly()) { - warn( - `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` - ); - } - } - instance.accessCache = /* @__PURE__ */ Object.create(null); - instance.proxy = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(new Proxy(instance.ctx, PublicInstanceProxyHandlers)); - if (true) { - exposePropsOnRenderContext(instance); - } - const { setup } = Component; - if (setup) { - const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; - setCurrentInstance(instance); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - const setupResult = callWithErrorHandling( - setup, - instance, - 0, - [ true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(instance.props) : 0, setupContext] - ); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); - unsetCurrentInstance(); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(setupResult)) { - setupResult.then(unsetCurrentInstance, unsetCurrentInstance); - if (isSSR) { - return setupResult.then((resolvedResult) => { - handleSetupResult(instance, resolvedResult, isSSR); - }).catch((e) => { - handleError(e, instance, 0); - }); + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + let hasWarned = false; + while (next) { + hasMismatch = true; + if (( true) && !hasWarned) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + hasWarned = true; + } + const cur = next; + next = next.nextSibling; + remove(cur); + } + } else if (shapeFlag & 8) { + if (el.textContent !== vnode.children) { + hasMismatch = true; + ( true) && warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${el.textContent} + - expected on client: ${vnode.children}` + ); + el.textContent = vnode.children; + } + } + if (props) { + if (true) { + for (const key in props) { + if ( true && propHasMismatch(el, key, props[key], vnode)) { + hasMismatch = true; + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key) || // force hydrate v-bind with .prop modifiers + key[0] === ".") { + patchProp( + el, + key, + null, + props[key], + void 0, + void 0, + parentComponent + ); + } + } + } else {} + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasWarned = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + if (node) { + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (vnode.type === Text && !vnode.children) { + continue; } else { - instance.asyncDep = setupResult; - if ( true && !instance.suspense) { - const name = (_a = Component.name) != null ? _a : "Anonymous"; - warn( - `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + hasMismatch = true; + if (( true) && !hasWarned) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` ); + hasWarned = true; } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); } - } else { - handleSetupResult(instance, setupResult, isSSR); } - } else { - finishComponentSetup(instance, isSSR); - } -} -function handleSetupResult(instance, setupResult, isSSR) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(setupResult)) { - if (instance.type.__ssrInlineRender) { - instance.ssrRender = setupResult; + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); } else { - instance.render = setupResult; + hasMismatch = true; + insert(vnode.anchor = createComment(`]`), container, next); + return next; } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(setupResult)) { - if ( true && isVNode(setupResult)) { - warn( - `setup() should not return VNodes directly - return a render function instead.` - ); + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + hasMismatch = true; + ( true) && warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove(next2); + } else { + break; + } + } } - if (true) { - instance.devtoolsRawSetupState = setupResult; + const next = nextSibling(node); + const container = parentNode(node); + remove(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) + match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } } - instance.setupState = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)(setupResult); - if (true) { - exposeSetupStateOnRenderContext(instance); + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); } - } else if ( true && setupResult !== void 0) { - warn( - `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` - ); - } - finishComponentSetup(instance, isSSR); -} -let compile; -let installWithProxy; -function registerRuntimeCompiler(_compile) { - compile = _compile; - installWithProxy = (i) => { - if (i.render._rc) { - i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; } }; + const isTemplateNode = (node) => { + return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template"; + }; + return [hydrate, hydrateNode]; } -const isRuntimeOnly = () => !compile; -function finishComponentSetup(instance, isSSR, skipOptions) { - const Component = instance.type; - if (!instance.render) { - if (!isSSR && compile && !Component.render) { - const template = Component.template || resolveMergedOptions(instance).template; - if (template) { - if (true) { - startMeasure(instance, `compile`); - } - const { isCustomElement, compilerOptions } = instance.appContext.config; - const { delimiters, compilerOptions: componentCompilerOptions } = Component; - const finalCompilerOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - { - isCustomElement, - delimiters - }, - compilerOptions - ), - componentCompilerOptions - ); - Component.render = compile(template, finalCompilerOptions); - if (true) { - endMeasure(instance, `compile`); +function propHasMismatch(el, key, clientValue, vnode) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + actual = toClassSet(el.getAttribute("class") || ""); + expected = toClassSet((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)(clientValue)); + if (!isSetEqual(actual, expected)) { + mismatchType = mismatchKey = `class`; + } + } else if (key === "style") { + actual = toStyleMap(el.getAttribute("style") || ""); + expected = toStyleMap( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(clientValue) ? clientValue : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.stringifyStyle)((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)(clientValue)) + ); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expected.set("display", "none"); } } } - instance.render = Component.render || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; - if (installWithProxy) { - installWithProxy(instance); + if (!isMapEqual(actual, expected)) { + mismatchType = mismatchKey = "style"; } - } - if (true) { - setCurrentInstance(instance); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); - applyOptions(instance); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); - unsetCurrentInstance(); - } - if ( true && !Component.render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP && !isSSR) { - if (!compile && Component.template) { - warn( - `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` ) - /* should not happen */ - ); - } else { - warn(`Component is missing template or render function.`); + } else if (el instanceof SVGElement && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isKnownSvgAttr)(key) || el instanceof HTMLElement && ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBooleanAttr)(key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isKnownHtmlAttr)(key))) { + actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : ""; + expected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isBooleanAttr)(key) ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue); + if (actual !== expected) { + mismatchType = `attribute`; + mismatchKey = key; } } + if (mismatchType) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + warn$1( + `Hydration ${mismatchType} mismatch on`, + el, + ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.` + ); + return true; + } + return false; } -function getAttrsProxy(instance) { - return instance.attrsProxy || (instance.attrsProxy = new Proxy( - instance.attrs, - true ? { - get(target, key) { - markAttrsAccessed(); - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$attrs"); - return target[key]; - }, - set() { - warn(`setupContext.attrs is readonly.`); - return false; - }, - deleteProperty() { - warn(`setupContext.attrs is readonly.`); - return false; - } - } : 0 - )); +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); } -function getSlotsProxy(instance) { - return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, { - get(target, key) { - (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$slots"); - return target[key]; +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; } - })); + } + return true; } -function createSetupContext(instance) { - const expose = (exposed) => { - if (true) { - if (instance.exposed) { - warn(`expose() should be called only once per setup().`); - } - if (exposed != null) { - let exposedType = typeof exposed; - if (exposedType === "object") { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(exposed)) { - exposedType = "array"; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(exposed)) { - exposedType = "ref"; - } - } - if (exposedType !== "object") { - warn( - `expose() should be passed a plain object, received ${exposedType}.` - ); - } - } +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key == null ? void 0 : key.trim(); + value = value == null ? void 0 : value.trim(); + if (key && value) { + styleMap.set(key, value); } - instance.exposed = exposed || {}; - }; - if (true) { - return Object.freeze({ - get attrs() { - return getAttrsProxy(instance); - }, - get slots() { - return getSlotsProxy(instance); - }, - get emit() { - return (event, ...args) => instance.emit(event, ...args); - }, - expose - }); - } else {} -} -function getExposeProxy(instance) { - if (instance.exposed) { - return instance.exposeProxy || (instance.exposeProxy = new Proxy((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(instance.exposed)), { - get(target, key) { - if (key in target) { - return target[key]; - } else if (key in publicPropertiesMap) { - return publicPropertiesMap[key](instance); - } - }, - has(target, key) { - return key in target || key in publicPropertiesMap; - } - })); } + return styleMap; } -const classifyRE = /(?:^|[-_])(\w)/g; -const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); -function getComponentName(Component, includeInferred = true) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; -} -function formatComponentName(instance, Component, isRoot = false) { - let name = getComponentName(Component); - if (!name && Component.__file) { - const match = Component.__file.match(/([^/\\]+)\.\w+$/); - if (match) { - name = match[1]; +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; } } - if (!name && instance && instance.parent) { - const inferFromRegistry = (registry) => { - for (const key in registry) { - if (registry[key] === Component) { - return key; - } - } - }; - name = inferFromRegistry( - instance.components || instance.parent.type.components - ) || inferFromRegistry(instance.appContext.components); + return true; +} + +let supported; +let perf; +function startMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + perf.mark(`vue-${type}-${instance.uid}`); + } + if (true) { + devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); } - return name ? classify(name) : isRoot ? `App` : `Anonymous`; } -function isClassComponent(value) { - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value) && "__vccOpts" in value; +function endMeasure(instance, type) { + if (instance.appContext.config.performance && isSupported()) { + const startTag = `vue-${type}-${instance.uid}`; + const endTag = startTag + `:end`; + perf.mark(endTag); + perf.measure( + `<${formatComponentName(instance, instance.type)}> ${type}`, + startTag, + endTag + ); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + } + if (true) { + devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); + } } - -const computed = (getterOrOptions, debugOptions) => { - return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.computed)(getterOrOptions, debugOptions, isInSSRComponentSetup); -}; - -function h(type, propsOrChildren, children) { - const l = arguments.length; - if (l === 2) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(propsOrChildren) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(propsOrChildren)) { - if (isVNode(propsOrChildren)) { - return createVNode(type, null, [propsOrChildren]); - } - return createVNode(type, propsOrChildren); - } else { - return createVNode(type, null, propsOrChildren); - } +function isSupported() { + if (supported !== void 0) { + return supported; + } + if (typeof window !== "undefined" && window.performance) { + supported = true; + perf = window.performance; } else { - if (l > 3) { - children = Array.prototype.slice.call(arguments, 2); - } else if (l === 3 && isVNode(children)) { - children = [children]; - } - return createVNode(type, propsOrChildren, children); + supported = false; } + return supported; } -const ssrContextKey = Symbol.for("v-scx"); -const useSSRContext = () => { - { - const ctx = inject(ssrContextKey); - if (!ctx) { - true && warn( - `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` - ); - } - return ctx; +function initFeatureFlags() { + const needWarn = []; + if (false) {} + if (false) {} + if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") { + true && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`); + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false; } -}; + if ( true && needWarn.length) { + const multi = needWarn.length > 1; + console.warn( + `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. -function isShallow(value) { - return !!(value && value["__v_isShallow"]); +For more details, see https://link.vuejs.org/feature-flags.` + ); + } } -function initCustomFormatter() { - if ( false || typeof window === "undefined") { - return; +const queuePostRenderEffect = queueEffectWithSuspense ; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + { + initFeatureFlags(); } - const vueStyle = { style: "color:#3ba776" }; - const numberStyle = { style: "color:#0b1bc9" }; - const stringStyle = { style: "color:#b62e24" }; - const keywordStyle = { style: "color:#9d288c" }; - const formatter = { - header(obj) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { - return null; - } - if (obj.__isVue) { - return ["div", vueStyle, `VueInstance`]; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(obj)) { - return [ - "div", - {}, - ["span", vueStyle, genRefFlag(obj)], - "<", - formatValue(obj.value), - `>` - ]; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(obj)) { - return [ - "div", - {}, - ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], - "<", - formatValue(obj), - `>${(0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj) ? ` (readonly)` : ``}` - ]; - } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj)) { - return [ - "div", - {}, - ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], - "<", - formatValue(obj), - ">" - ]; - } - return null; - }, - hasBody(obj) { - return obj && obj.__isVue; - }, - body(obj) { - if (obj && obj.__isVue) { - return [ - "div", - {}, - ...formatInstance(obj.$) - ]; - } + const target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)(); + target.__VUE__ = true; + if (true) { + setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); + } + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = true && isHmrUpdating ? false : !!n2.dynamicChildren) => { + if (n1 === n2) { + return; } - }; - function formatInstance(instance) { - const blocks = []; - if (instance.type.props && instance.props) { - blocks.push(createInstanceBlock("props", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.props))); + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; } - if (instance.setupState !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { - blocks.push(createInstanceBlock("setup", instance.setupState)); + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; } - if (instance.data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { - blocks.push(createInstanceBlock("data", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.data))); + const { type, ref, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } else if (true) { + patchStaticNode(n1, n2, container, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (true) { + warn$1("Invalid VNode type:", type, `(${typeof type})`); + } } - const computed = extractKeys(instance, "computed"); - if (computed) { - blocks.push(createInstanceBlock("computed", computed)); + if (ref != null && parentComponent) { + setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); } - const injected = extractKeys(instance, "inject"); - if (injected) { - blocks.push(createInstanceBlock("injected", injected)); + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } } - blocks.push([ - "div", - {}, - [ - "span", - { - style: keywordStyle.style + ";opacity:0.66" - }, - "$ (internal): " - ], - ["object", { object: instance }] - ]); - return blocks; - } - function createInstanceBlock(type, target) { - target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, target); - if (!Object.keys(target).length) { - return ["span", {}]; + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; } - return [ - "div", - { style: "line-height:1.25em;margin-bottom:0.6em" }, - [ - "div", - { - style: "color:#476582" - }, - type - ], - [ - "div", - { - style: "padding-left:1.25em" - }, - ...Object.keys(target).map((key) => { - return [ - "div", - {}, - ["span", keywordStyle, key + ": "], - formatValue(target[key], false) - ]; - }) - ] - ]; - } - function formatValue(v, asRaw = true) { - if (typeof v === "number") { - return ["span", numberStyle, v]; - } else if (typeof v === "string") { - return ["span", stringStyle, JSON.stringify(v)]; - } else if (typeof v === "boolean") { - return ["span", keywordStyle, v]; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(v)) { - return ["object", { object: asRaw ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(v) : v }]; + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const patchStaticNode = (n1, n2, container, namespace) => { + if (n2.children !== n1.children) { + const anchor = hostNextSibling(n1.anchor); + removeStaticNode(n1); + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace + ); } else { - return ["span", stringStyle, String(v)]; + n2.el = n1.el; + n2.anchor = n1.anchor; } - } - function extractKeys(instance, type) { - const Comp = instance.type; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Comp)) { - return; + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; } - const extracted = {}; - for (const key in instance.ctx) { - if (isKeyOfType(Comp, key, type)) { - extracted[key] = instance.ctx[key]; - } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; } - return extracted; - } - function isKeyOfType(Comp, key, type) { - const opts = Comp[type]; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opts) && opts.includes(key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opts) && key in opts) { - return true; + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; } - if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { - return true; + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); } - if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { - return true; + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); } - } - function genRefFlag(v) { - if (isShallow(v)) { - return `ShallowRef`; + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); } - if (v.effect) { - return `ComputedRef`; + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) { + hostPatchProp( + el, + key, + null, + props[key], + namespace, + vnode.children, + parentComponent, + parentSuspense, + unmountChildren + ); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } } - return `Ref`; - } - if (window.devtoolsFormatters) { - window.devtoolsFormatters.push(formatter); - } else { - window.devtoolsFormatters = [formatter]; - } -} - -function withMemo(memo, render, cache, index) { - const cached = cache[index]; - if (cached && isMemoSame(cached, memo)) { - return cached; - } - const ret = render(); - ret.memo = memo.slice(); - return cache[index] = ret; -} -function isMemoSame(cached, memo) { - const prev = cached.memo; - if (prev.length != memo.length) { - return false; - } - for (let i = 0; i < prev.length; i++) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(prev[i], memo[i])) { - return false; + if (true) { + Object.defineProperty(el, "__vnode", { + value: vnode, + enumerable: false + }); + Object.defineProperty(el, "__vueParentComponent", { + value: parentComponent, + enumerable: false + }); } - } - if (isBlockTreeEnabled > 0 && currentBlock) { - currentBlock.push(cached); - } - return true; -} - -const version = "3.3.4"; -const _ssrUtils = { - createComponentInstance, - setupComponent, - renderComponentRoot, - setCurrentRenderingInstance, - isVNode: isVNode, - normalizeVNode -}; -const ssrUtils = _ssrUtils ; -const resolveFilter = null; -const compatUtils = null; - - - - -/***/ }), - -/***/ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), -/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), -/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Comment), -/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.EffectScope), -/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment), -/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), -/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), -/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static), -/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Suspense), -/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Teleport), -/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Text), -/* harmony export */ Transition: () => (/* binding */ Transition), -/* harmony export */ TransitionGroup: () => (/* binding */ TransitionGroup), -/* harmony export */ VueElement: () => (/* binding */ VueElement), -/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber), -/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), -/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), -/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.camelize), -/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.capitalize), -/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), -/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.compatUtils), -/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.computed), -/* harmony export */ createApp: () => (/* binding */ createApp), -/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createBlock), -/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), -/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), -/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), -/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), -/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), -/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer), -/* harmony export */ createSSRApp: () => (/* binding */ createSSRApp), -/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createSlots), -/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), -/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), -/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode), -/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.customRef), -/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), -/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent), -/* harmony export */ defineCustomElement: () => (/* binding */ defineCustomElement), -/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineEmits), -/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineExpose), -/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineModel), -/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineOptions), -/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineProps), -/* harmony export */ defineSSRCustomElement: () => (/* binding */ defineSSRCustomElement), -/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineSlots), -/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.devtools), -/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effect), -/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effectScope), -/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), -/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), -/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), -/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), -/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h), -/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.handleError), -/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), -/* harmony export */ hydrate: () => (/* binding */ hydrate), -/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), -/* harmony export */ initDirectivesForSSR: () => (/* binding */ initDirectivesForSSR), -/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.inject), -/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), -/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isProxy), -/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReactive), -/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReadonly), -/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRef), -/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), -/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isShallow), -/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isVNode), -/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.markRaw), -/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), -/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeModels), -/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeProps), -/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick), -/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), -/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), -/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), -/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onActivated), -/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), -/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), -/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), -/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), -/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), -/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted), -/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), -/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), -/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), -/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), -/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), -/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated), -/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.openBlock), -/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.popScopeId), -/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.provide), -/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), -/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), -/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), -/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.reactive), -/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.readonly), -/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ref), -/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), -/* harmony export */ render: () => (/* binding */ render), -/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderList), -/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderSlot), -/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), -/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), -/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), -/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), -/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), -/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), -/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), -/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), -/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), -/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), -/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowRef), -/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), -/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), -/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.stop), -/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), -/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), -/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlers), -/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRaw), -/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRef), -/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRefs), -/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toValue), -/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), -/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.triggerRef), -/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.unref), -/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useAttrs), -/* harmony export */ useCssModule: () => (/* binding */ useCssModule), -/* harmony export */ useCssVars: () => (/* binding */ useCssVars), -/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useModel), -/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), -/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSlots), -/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), -/* harmony export */ vModelCheckbox: () => (/* binding */ vModelCheckbox), -/* harmony export */ vModelDynamic: () => (/* binding */ vModelDynamic), -/* harmony export */ vModelRadio: () => (/* binding */ vModelRadio), -/* harmony export */ vModelSelect: () => (/* binding */ vModelSelect), -/* harmony export */ vModelText: () => (/* binding */ vModelText), -/* harmony export */ vShow: () => (/* binding */ vShow), -/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.version), -/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn), -/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watch), -/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchEffect), -/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), -/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), -/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), -/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withCtx), -/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDefaults), -/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDirectives), -/* harmony export */ withKeys: () => (/* binding */ withKeys), -/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withMemo), -/* harmony export */ withModifiers: () => (/* binding */ withModifiers), -/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withScopeId) -/* harmony export */ }); -/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); -/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); -/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); - - - - -const svgNS = "http://www.w3.org/2000/svg"; -const doc = typeof document !== "undefined" ? document : null; -const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); -const nodeOps = { - insert: (child, parent, anchor) => { - parent.insertBefore(child, anchor || null); - }, - remove: (child) => { - const parent = child.parentNode; - if (parent) { - parent.removeChild(child); - } - }, - createElement: (tag, isSVG, is, props) => { - const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0); - if (tag === "select" && props && props.multiple != null) { - el.setAttribute("multiple", props.multiple); + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } - return el; - }, - createText: (text) => doc.createTextNode(text), - createComment: (text) => doc.createComment(text), - setText: (node, text) => { - node.nodeValue = text; - }, - setElementText: (el, text) => { - el.textContent = text; - }, - parentNode: (node) => node.parentNode, - nextSibling: (node) => node.nextSibling, - querySelector: (selector) => doc.querySelector(selector), - setScopeId(el, id) { - el.setAttribute(id, ""); - }, - // __UNSAFE__ - // Reason: innerHTML. - // Static content here can only come from compiled templates. - // As long as the user only uses trusted templates, this is safe. - insertStaticContent(content, parent, anchor, isSVG, start, end) { - const before = anchor ? anchor.previousSibling : parent.lastChild; - if (start && (start === end || start.nextSibling)) { - while (true) { - parent.insertBefore(start.cloneNode(true), anchor); - if (start === end || !(start = start.nextSibling)) - break; - } - } else { - templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content; - const template = templateContainer.content; - if (isSVG) { - const wrapper = template.firstChild; - while (wrapper.firstChild) { - template.appendChild(wrapper.firstChild); - } - template.removeChild(wrapper); - } - parent.insertBefore(template, anchor); + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); } - return [ - // first - before ? before.nextSibling : parent.firstChild, - // last - anchor ? anchor.previousSibling : parent.lastChild - ]; - } -}; - -function patchClass(el, value, isSVG) { - const transitionClasses = el._vtc; - if (transitionClasses) { - value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); - } - if (value == null) { - el.removeAttribute("class"); - } else if (isSVG) { - el.setAttribute("class", value); - } else { - el.className = value; - } -} - -function patchStyle(el, prev, next) { - const style = el.style; - const isCssString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(next); - if (next && !isCssString) { - if (prev && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(prev)) { - for (const key in prev) { - if (next[key] == null) { - setStyle(style, key, ""); - } - } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); } - for (const key in next) { - setStyle(style, key, next[key]); + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); } - } else { - const currentDisplay = style.display; - if (isCssString) { - if (prev !== next) { - style.cssText = next; + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); } - } else if (prev) { - el.removeAttribute("style"); } - if ("_vod" in el) { - style.display = currentDisplay; - } - } -} -const semicolonRE = /[^\\];\s*$/; -const importantRE = /\s*!important$/; -function setStyle(style, name, val) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(val)) { - val.forEach((v) => setStyle(style, name, v)); - } else { - if (val == null) - val = ""; - if (true) { - if (semicolonRE.test(val)) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `Unexpected semicolon at the end of '${name}' style value: '${val}'` - ); + if (parentComponent) { + let subTree = parentComponent.subTree; + if ( true && subTree.patchFlag > 0 && subTree.patchFlag & 2048) { + subTree = filterSingleRoot(subTree.children) || subTree; } - } - if (name.startsWith("--")) { - style.setProperty(name, val); - } else { - const prefixed = autoPrefix(style, name); - if (importantRE.test(val)) { - style.setProperty( - (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(prefixed), - val.replace(importantRE, ""), - "important" + if (vnode === subTree) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent ); - } else { - style[prefixed] = val; } } - } -} -const prefixes = ["Webkit", "Moz", "ms"]; -const prefixCache = {}; -function autoPrefix(style, rawName) { - const cached = prefixCache[rawName]; - if (cached) { - return cached; - } - let name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(rawName); - if (name !== "filter" && name in style) { - return prefixCache[rawName] = name; - } - name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)(name); - for (let i = 0; i < prefixes.length; i++) { - const prefixed = prefixes[i] + name; - if (prefixed in style) { - return prefixCache[rawName] = prefixed; + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); } - } - return rawName; -} - -const xlinkNS = "http://www.w3.org/1999/xlink"; -function patchAttr(el, key, value, isSVG, instance) { - if (isSVG && key.startsWith("xlink:")) { - if (value == null) { - el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); - } else { - el.setAttributeNS(xlinkNS, key, value); + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + const newProps = n2.props || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); } - } else { - const isBoolean = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSpecialBooleanAttr)(key); - if (value == null || isBoolean && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value)) { - el.removeAttribute(key); - } else { - el.setAttribute(key, isBoolean ? "" : value); + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); } - } -} - -function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) { - if (key === "innerHTML" || key === "textContent") { - if (prevChildren) { - unmountChildren(prevChildren, parentComponent, parentSuspense); + parentComponent && toggleRecurse(parentComponent, true); + if ( true && isHmrUpdating) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; } - el[key] = value == null ? "" : value; - return; - } - const tag = el.tagName; - if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally - !tag.includes("-")) { - el._value = value; - const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value; - const newValue = value == null ? "" : value; - if (oldValue !== newValue) { - el.value = newValue; + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + if (true) { + traverseStaticChildren(n1, n2); + } + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); } - if (value == null) { - el.removeAttribute(key); + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps( + el, + n2, + oldProps, + newProps, + parentComponent, + parentSuspense, + namespace + ); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp( + el, + key, + prev, + next, + namespace, + n1.children, + parentComponent, + parentSuspense, + unmountChildren + ); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps( + el, + n2, + oldProps, + newProps, + parentComponent, + parentSuspense, + namespace + ); } - return; - } - let needRemove = false; - if (value === "" || value == null) { - const type = typeof el[key]; - if (type === "boolean") { - value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value); - } else if (value == null && type === "string") { - value = ""; - needRemove = true; - } else if (type === "number") { - value = 0; - needRemove = true; + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); } - } - try { - el[key] = value; - } catch (e) { - if ( true && !needRemove) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, - e + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true ); } - } - needRemove && el.removeAttribute(key); -} - -function addEventListener(el, event, handler, options) { - el.addEventListener(event, handler, options); -} -function removeEventListener(el, event, handler, options) { - el.removeEventListener(event, handler, options); -} -function patchEvent(el, rawName, prevValue, nextValue, instance = null) { - const invokers = el._vei || (el._vei = {}); - const existingInvoker = invokers[rawName]; - if (nextValue && existingInvoker) { - existingInvoker.value = nextValue; - } else { - const [name, options] = parseName(rawName); - if (nextValue) { - const invoker = invokers[rawName] = createInvoker(nextValue, instance); - addEventListener(el, name, invoker, options); - } else if (existingInvoker) { - removeEventListener(el, name, existingInvoker, options); - invokers[rawName] = void 0; + }; + const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { + for (const key in oldProps) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + vnode.children, + parentComponent, + parentSuspense, + unmountChildren + ); + } + } + } + for (const key in newProps) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isReservedProp)(key)) + continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp( + el, + key, + prev, + next, + namespace, + vnode.children, + parentComponent, + parentSuspense, + unmountChildren + ); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } } - } -} -const optionsModifierRE = /(?:Once|Passive|Capture)$/; -function parseName(name) { - let options; - if (optionsModifierRE.test(name)) { - options = {}; - let m; - while (m = name.match(optionsModifierRE)) { - name = name.slice(0, name.length - m[0].length); - options[m[0].toLowerCase()] = true; + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if ( true && // #5523 dev root fragment may inherit directives + (isHmrUpdating || patchFlag & 2048)) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; } - } - const event = name[2] === ":" ? name.slice(3) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(name.slice(2)); - return [event, options]; -} -let cachedNow = 0; -const p = /* @__PURE__ */ Promise.resolve(); -const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); -function createInvoker(initialValue, instance) { - const invoker = (e) => { - if (!e._vts) { - e._vts = Date.now(); - } else if (e._vts <= invoker.attached) { - return; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling)( - patchStopImmediatePropagation(e, invoker.value), - instance, - 5, - [e] - ); - }; - invoker.value = initialValue; - invoker.attached = getNow(); - return invoker; -} -function patchStopImmediatePropagation(e, value) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - const originalStop = e.stopImmediatePropagation; - e.stopImmediatePropagation = () => { - originalStop.call(e); - e._stopped = true; - }; - return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); - } else { - return value; - } -} - -const nativeOnRE = /^on[a-z]/; -const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => { - if (key === "class") { - patchClass(el, nextValue, isSVG); - } else if (key === "style") { - patchStyle(el, prevValue, nextValue); - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { - patchEvent(el, key, prevValue, nextValue, parentComponent); - } - } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { - patchDOMProp( - el, - key, - nextValue, - prevChildren, - parentComponent, - parentSuspense, - unmountChildren - ); - } else { - if (key === "true-value") { - el._trueValue = nextValue; - } else if (key === "false-value") { - el._falseValue = nextValue; - } - patchAttr(el, key, nextValue, isSVG); - } -}; -function shouldSetAsProp(el, key, value, isSVG) { - if (isSVG) { - if (key === "innerHTML" || key === "textContent") { - return true; - } - if (key in el && nativeOnRE.test(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { - return true; - } - return false; - } - if (key === "spellcheck" || key === "draggable" || key === "translate") { - return false; - } - if (key === "form") { - return false; - } - if (key === "list" && el.tagName === "INPUT") { - return false; - } - if (key === "type" && el.tagName === "TEXTAREA") { - return false; - } - if (nativeOnRE.test(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { - return false; - } - return key in el; -} - -function defineCustomElement(options, hydrate2) { - const Comp = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent)(options); - class VueCustomElement extends VueElement { - constructor(initialProps) { - super(Comp, initialProps, hydrate2); - } - } - VueCustomElement.def = Comp; - return VueCustomElement; -} -const defineSSRCustomElement = (options) => { - return defineCustomElement(options, hydrate); -}; -const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { -}; -class VueElement extends BaseClass { - constructor(_def, _props = {}, hydrate2) { - super(); - this._def = _def; - this._props = _props; - /** - * @internal - */ - this._instance = null; - this._connected = false; - this._resolved = false; - this._numberProps = null; - if (this.shadowRoot && hydrate2) { - hydrate2(this._createVNode(), this.shadowRoot); + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<></>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); } else { - if ( true && this.shadowRoot) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + if (true) { + traverseStaticChildren(n1, n2); + } else {} + } else { + patchChildren( + n1, + n2, + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized ); - } - this.attachShadow({ mode: "open" }); - if (!this._def.__asyncLoader) { - this._resolveProps(this._def); } } - } - connectedCallback() { - this._connected = true; - if (!this._instance) { - if (this._resolved) { - this._update(); + }; + const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + n2.slotScopeIds = slotScopeIds; + if (n1 == null) { + if (n2.shapeFlag & 512) { + parentComponent.ctx.activate( + n2, + container, + anchor, + namespace, + optimized + ); } else { - this._resolveDef(); + mountComponent( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + optimized + ); } + } else { + updateComponent(n1, n2, optimized); } - } - disconnectedCallback() { - this._connected = false; - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => { - if (!this._connected) { - render(null, this.shadowRoot); - this._instance = null; - } - }); - } - /** - * resolve inner component definition (handle possible async component) - */ - _resolveDef() { - this._resolved = true; - for (let i = 0; i < this.attributes.length; i++) { - this._setAttr(this.attributes[i].name); + }; + const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { + const instance = (initialVNode.component = createComponentInstance( + initialVNode, + parentComponent, + parentSuspense + )); + if ( true && instance.type.__hmrId) { + registerHMR(instance); } - new MutationObserver((mutations) => { - for (const m of mutations) { - this._setAttr(m.attributeName); + if (true) { + pushWarningContext(initialVNode); + startMeasure(instance, `mount`); + } + if (isKeepAlive(initialVNode)) { + instance.ctx.renderer = internals; + } + { + if (true) { + startMeasure(instance, `init`); } - }).observe(this, { attributes: true }); - const resolve = (def, isAsync = false) => { - const { props, styles } = def; - let numberProps; - if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props)) { - for (const key in props) { - const opt = props[key]; - if (opt === Number || opt && opt.type === Number) { - if (key in this._props) { - this._props[key] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(this._props[key]); - } - (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key)] = true; - } - } + setupComponent(instance); + if (true) { + endMeasure(instance, `init`); } - this._numberProps = numberProps; - if (isAsync) { - this._resolveProps(def); + } + if (instance.asyncDep) { + parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect); + if (!initialVNode.el) { + const placeholder = instance.subTree = createVNode(Comment); + processCommentNode(null, placeholder, container, anchor); } - this._applyStyles(styles); - this._update(); - }; - const asyncDef = this._def.__asyncLoader; - if (asyncDef) { - asyncDef().then((def) => resolve(def, true)); } else { - resolve(this._def); + setupRenderEffect( + instance, + initialVNode, + container, + anchor, + parentSuspense, + namespace, + optimized + ); } - } - _resolveProps(def) { - const { props } = def; - const declaredPropKeys = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props : Object.keys(props || {}); - for (const key of Object.keys(this)) { - if (key[0] !== "_" && declaredPropKeys.includes(key)) { - this._setProp(key, this[key], true, false); - } + if (true) { + popWarningContext(); + endMeasure(instance, `mount`); } - for (const key of declaredPropKeys.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)) { - Object.defineProperty(this, key, { - get() { - return this._getProp(key); - }, - set(val) { - this._setProp(key, val); + }; + const updateComponent = (n1, n2, optimized) => { + const instance = n2.component = n1.component; + if (shouldUpdateComponent(n1, n2, optimized)) { + if (instance.asyncDep && !instance.asyncResolved) { + if (true) { + pushWarningContext(n2); } - }); - } - } - _setAttr(key) { - let value = this.getAttribute(key); - const camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); - if (this._numberProps && this._numberProps[camelKey]) { - value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(value); - } - this._setProp(camelKey, value, false); - } - /** - * @internal - */ - _getProp(key) { - return this._props[key]; - } - /** - * @internal - */ - _setProp(key, val, shouldReflect = true, shouldUpdate = true) { - if (val !== this._props[key]) { - this._props[key] = val; - if (shouldUpdate && this._instance) { - this._update(); - } - if (shouldReflect) { - if (val === true) { - this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), ""); - } else if (typeof val === "string" || typeof val === "number") { - this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), val + ""); - } else if (!val) { - this.removeAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)); + updateComponentPreRender(instance, n2, optimized); + if (true) { + popWarningContext(); } + return; + } else { + instance.next = n2; + invalidateJob(instance.update); + instance.effect.dirty = true; + instance.update(); } + } else { + n2.el = n1.el; + instance.vnode = n2; } - } - _update() { - render(this._createVNode(), this.shadowRoot); - } - _createVNode() { - const vnode = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(this._def, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, this._props)); - if (!this._instance) { - vnode.ce = (instance) => { - this._instance = instance; - instance.isCE = true; - if (true) { - instance.ceReload = (newStyles) => { - if (this._styles) { - this._styles.forEach((s) => this.shadowRoot.removeChild(s)); - this._styles.length = 0; + }; + const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { + const componentUpdateFn = () => { + if (!instance.isMounted) { + let vnodeHook; + const { el, props } = initialVNode; + const { bm, m, parent } = instance; + const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); + toggleRecurse(instance, false); + if (bm) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bm); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { + invokeVNodeHook(vnodeHook, parent, initialVNode); + } + toggleRecurse(instance, true); + if (el && hydrateNode) { + const hydrateSubTree = () => { + if (true) { + startMeasure(instance, `render`); + } + instance.subTree = renderComponentRoot(instance); + if (true) { + endMeasure(instance, `render`); + } + if (true) { + startMeasure(instance, `hydrate`); + } + hydrateNode( + el, + instance.subTree, + instance, + parentSuspense, + null + ); + if (true) { + endMeasure(instance, `hydrate`); } - this._applyStyles(newStyles); - this._instance = null; - this._update(); }; - } - const dispatch = (event, args) => { - this.dispatchEvent( - new CustomEvent(event, { - detail: args - }) + if (isAsyncWrapperVNode) { + initialVNode.type.__asyncLoader().then( + // note: we are moving the render call into an async callback, + // which means it won't track dependencies - but it's ok because + // a server-rendered async wrapper is already in resolved state + // and it will never need to change. + () => !instance.isUnmounted && hydrateSubTree() + ); + } else { + hydrateSubTree(); + } + } else { + if (true) { + startMeasure(instance, `render`); + } + const subTree = instance.subTree = renderComponentRoot(instance); + if (true) { + endMeasure(instance, `render`); + } + if (true) { + startMeasure(instance, `patch`); + } + patch( + null, + subTree, + container, + anchor, + instance, + parentSuspense, + namespace ); - }; - instance.emit = (event, ...args) => { - dispatch(event, args); - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event) !== event) { - dispatch((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event), args); + if (true) { + endMeasure(instance, `patch`); } - }; - let parent = this; - while (parent = parent && (parent.parentNode || parent.host)) { - if (parent instanceof VueElement) { - instance.parent = parent._instance; - instance.provides = parent._instance.provides; - break; + initialVNode.el = subTree.el; + } + if (m) { + queuePostRenderEffect(m, parentSuspense); + } + if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { + const scopedInitialVNode = initialVNode; + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), + parentSuspense + ); + } + if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { + instance.a && queuePostRenderEffect(instance.a, parentSuspense); + } + instance.isMounted = true; + if (true) { + devtoolsComponentAdded(instance); + } + initialVNode = container = anchor = null; + } else { + let { next, bu, u, parent, vnode } = instance; + { + const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); + if (nonHydratedAsyncRoot) { + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } + nonHydratedAsyncRoot.asyncDep.then(() => { + if (!instance.isUnmounted) { + componentUpdateFn(); + } + }); + return; } } - }; - } - return vnode; - } - _applyStyles(styles) { - if (styles) { - styles.forEach((css) => { - const s = document.createElement("style"); - s.textContent = css; - this.shadowRoot.appendChild(s); + let originNext = next; + let vnodeHook; if (true) { - (this._styles || (this._styles = [])).push(s); + pushWarningContext(next || instance.vnode); } - }); - } - } -} - -function useCssModule(name = "$style") { - { - const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); - if (!instance) { - true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssModule must be called inside setup()`); - return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - } - const modules = instance.type.__cssModules; - if (!modules) { - true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS modules injected.`); - return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - } - const mod = modules[name]; - if (!mod) { - true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS module named "${name}".`); - return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; - } - return mod; - } -} - -function useCssVars(getter) { - const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); - if (!instance) { - true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssVars is called without current active component instance.`); - return; - } - const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { - Array.from( - document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) - ).forEach((node) => setVarsOnNode(node, vars)); - }; - const setVars = () => { - const vars = getter(instance.proxy); - setVarsOnVNode(instance.subTree, vars); - updateTeleports(vars); - }; - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect)(setVars); - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted)(() => { - const ob = new MutationObserver(setVars); - ob.observe(instance.subTree.el.parentNode, { childList: true }); - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted)(() => ob.disconnect()); - }); -} -function setVarsOnVNode(vnode, vars) { - if (vnode.shapeFlag & 128) { - const suspense = vnode.suspense; - vnode = suspense.activeBranch; - if (suspense.pendingBranch && !suspense.isHydrating) { - suspense.effects.push(() => { - setVarsOnVNode(suspense.activeBranch, vars); - }); - } - } - while (vnode.component) { - vnode = vnode.component.subTree; - } - if (vnode.shapeFlag & 1 && vnode.el) { - setVarsOnNode(vnode.el, vars); - } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment) { - vnode.children.forEach((c) => setVarsOnVNode(c, vars)); - } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static) { - let { el, anchor } = vnode; - while (el) { - setVarsOnNode(el, vars); - if (el === anchor) - break; - el = el.nextSibling; - } - } -} -function setVarsOnNode(el, vars) { - if (el.nodeType === 1) { - const style = el.style; - for (const key in vars) { - style.setProperty(`--${key}`, vars[key]); - } - } -} - -const TRANSITION = "transition"; -const ANIMATION = "animation"; -const Transition = (props, { slots }) => (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h)(_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition, resolveTransitionProps(props), slots); -Transition.displayName = "Transition"; -const DOMTransitionPropsValidators = { - name: String, - type: String, - css: { - type: Boolean, - default: true - }, - duration: [String, Number, Object], - enterFromClass: String, - enterActiveClass: String, - enterToClass: String, - appearFromClass: String, - appearActiveClass: String, - appearToClass: String, - leaveFromClass: String, - leaveActiveClass: String, - leaveToClass: String -}; -const TransitionPropsValidators = Transition.props = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( - {}, - _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators, - DOMTransitionPropsValidators -); -const callHook = (hook, args = []) => { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { - hook.forEach((h2) => h2(...args)); - } else if (hook) { - hook(...args); - } -}; -const hasExplicitCallback = (hook) => { - return hook ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; -}; -function resolveTransitionProps(rawProps) { - const baseProps = {}; - for (const key in rawProps) { - if (!(key in DOMTransitionPropsValidators)) { - baseProps[key] = rawProps[key]; - } - } - if (rawProps.css === false) { - return baseProps; - } - const { - name = "v", - type, - duration, - enterFromClass = `${name}-enter-from`, - enterActiveClass = `${name}-enter-active`, - enterToClass = `${name}-enter-to`, - appearFromClass = enterFromClass, - appearActiveClass = enterActiveClass, - appearToClass = enterToClass, - leaveFromClass = `${name}-leave-from`, - leaveActiveClass = `${name}-leave-active`, - leaveToClass = `${name}-leave-to` - } = rawProps; - const durations = normalizeDuration(duration); - const enterDuration = durations && durations[0]; - const leaveDuration = durations && durations[1]; - const { - onBeforeEnter, - onEnter, - onEnterCancelled, - onLeave, - onLeaveCancelled, - onBeforeAppear = onBeforeEnter, - onAppear = onEnter, - onAppearCancelled = onEnterCancelled - } = baseProps; - const finishEnter = (el, isAppear, done) => { - removeTransitionClass(el, isAppear ? appearToClass : enterToClass); - removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); - done && done(); - }; - const finishLeave = (el, done) => { - el._isLeaving = false; - removeTransitionClass(el, leaveFromClass); - removeTransitionClass(el, leaveToClass); - removeTransitionClass(el, leaveActiveClass); - done && done(); - }; - const makeEnterHook = (isAppear) => { - return (el, done) => { - const hook = isAppear ? onAppear : onEnter; - const resolve = () => finishEnter(el, isAppear, done); - callHook(hook, [el, resolve]); - nextFrame(() => { - removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); - addTransitionClass(el, isAppear ? appearToClass : enterToClass); - if (!hasExplicitCallback(hook)) { - whenTransitionEnds(el, type, enterDuration, resolve); + toggleRecurse(instance, false); + if (next) { + next.el = vnode.el; + updateComponentPreRender(instance, next, optimized); + } else { + next = vnode; } - }); - }; - }; - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(baseProps, { - onBeforeEnter(el) { - callHook(onBeforeEnter, [el]); - addTransitionClass(el, enterFromClass); - addTransitionClass(el, enterActiveClass); - }, - onBeforeAppear(el) { - callHook(onBeforeAppear, [el]); - addTransitionClass(el, appearFromClass); - addTransitionClass(el, appearActiveClass); - }, - onEnter: makeEnterHook(false), - onAppear: makeEnterHook(true), - onLeave(el, done) { - el._isLeaving = true; - const resolve = () => finishLeave(el, done); - addTransitionClass(el, leaveFromClass); - forceReflow(); - addTransitionClass(el, leaveActiveClass); - nextFrame(() => { - if (!el._isLeaving) { - return; + if (bu) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bu); } - removeTransitionClass(el, leaveFromClass); - addTransitionClass(el, leaveToClass); - if (!hasExplicitCallback(onLeave)) { - whenTransitionEnds(el, type, leaveDuration, resolve); + if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parent, next, vnode); } - }); - callHook(onLeave, [el, resolve]); - }, - onEnterCancelled(el) { - finishEnter(el, false); - callHook(onEnterCancelled, [el]); - }, - onAppearCancelled(el) { - finishEnter(el, true); - callHook(onAppearCancelled, [el]); - }, - onLeaveCancelled(el) { - finishLeave(el); - callHook(onLeaveCancelled, [el]); - } - }); -} -function normalizeDuration(duration) { - if (duration == null) { - return null; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(duration)) { - return [NumberOf(duration.enter), NumberOf(duration.leave)]; - } else { - const n = NumberOf(duration); - return [n, n]; - } -} -function NumberOf(val) { - const res = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(val); - if (true) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber)(res, "<transition> explicit duration"); - } - return res; -} -function addTransitionClass(el, cls) { - cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); - (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls); -} -function removeTransitionClass(el, cls) { - cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); - const { _vtc } = el; - if (_vtc) { - _vtc.delete(cls); - if (!_vtc.size) { - el._vtc = void 0; - } - } -} -function nextFrame(cb) { - requestAnimationFrame(() => { - requestAnimationFrame(cb); - }); -} -let endId = 0; -function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { - const id = el._endId = ++endId; - const resolveIfNotStale = () => { - if (id === el._endId) { - resolve(); - } - }; - if (explicitTimeout) { - return setTimeout(resolveIfNotStale, explicitTimeout); - } - const { type, timeout, propCount } = getTransitionInfo(el, expectedType); - if (!type) { - return resolve(); - } - const endEvent = type + "end"; - let ended = 0; - const end = () => { - el.removeEventListener(endEvent, onEnd); - resolveIfNotStale(); - }; - const onEnd = (e) => { - if (e.target === el && ++ended >= propCount) { - end(); + toggleRecurse(instance, true); + if (true) { + startMeasure(instance, `render`); + } + const nextTree = renderComponentRoot(instance); + if (true) { + endMeasure(instance, `render`); + } + const prevTree = instance.subTree; + instance.subTree = nextTree; + if (true) { + startMeasure(instance, `patch`); + } + patch( + prevTree, + nextTree, + // parent may have changed if it's in a teleport + hostParentNode(prevTree.el), + // anchor may have changed if it's in a fragment + getNextHostNode(prevTree), + instance, + parentSuspense, + namespace + ); + if (true) { + endMeasure(instance, `patch`); + } + next.el = nextTree.el; + if (originNext === null) { + updateHOCHostEl(instance, nextTree.el); + } + if (u) { + queuePostRenderEffect(u, parentSuspense); + } + if (vnodeHook = next.props && next.props.onVnodeUpdated) { + queuePostRenderEffect( + () => invokeVNodeHook(vnodeHook, parent, next, vnode), + parentSuspense + ); + } + if (true) { + devtoolsComponentUpdated(instance); + } + if (true) { + popWarningContext(); + } + } + }; + const effect = instance.effect = new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect( + componentUpdateFn, + _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP, + () => queueJob(update), + instance.scope + // track it in component's effect scope + ); + const update = instance.update = () => { + if (effect.dirty) { + effect.run(); + } + }; + update.id = instance.uid; + toggleRecurse(instance, true); + if (true) { + effect.onTrack = instance.rtc ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtc, e) : void 0; + effect.onTrigger = instance.rtg ? (e) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(instance.rtg, e) : void 0; + update.ownerInstance = instance; } + update(); }; - setTimeout(() => { - if (ended < propCount) { - end(); - } - }, timeout + 1); - el.addEventListener(endEvent, onEnd); -} -function getTransitionInfo(el, expectedType) { - const styles = window.getComputedStyle(el); - const getStyleProperties = (key) => (styles[key] || "").split(", "); - const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); - const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); - const transitionTimeout = getTimeout(transitionDelays, transitionDurations); - const animationDelays = getStyleProperties(`${ANIMATION}Delay`); - const animationDurations = getStyleProperties(`${ANIMATION}Duration`); - const animationTimeout = getTimeout(animationDelays, animationDurations); - let type = null; - let timeout = 0; - let propCount = 0; - if (expectedType === TRANSITION) { - if (transitionTimeout > 0) { - type = TRANSITION; - timeout = transitionTimeout; - propCount = transitionDurations.length; - } - } else if (expectedType === ANIMATION) { - if (animationTimeout > 0) { - type = ANIMATION; - timeout = animationTimeout; - propCount = animationDurations.length; - } - } else { - timeout = Math.max(transitionTimeout, animationTimeout); - type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; - propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; - } - const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( - getStyleProperties(`${TRANSITION}Property`).toString() - ); - return { - type, - timeout, - propCount, - hasTransform + const updateComponentPreRender = (instance, nextVNode, optimized) => { + nextVNode.component = instance; + const prevProps = instance.vnode.props; + instance.vnode = nextVNode; + instance.next = null; + updateProps(instance, nextVNode.props, prevProps, optimized); + updateSlots(instance, nextVNode.children, optimized); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + flushPreFlushCbs(instance); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); }; -} -function getTimeout(delays, durations) { - while (delays.length < durations.length) { - delays = delays.concat(delays); - } - return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); -} -function toMs(s) { - return Number(s.slice(0, -1).replace(",", ".")) * 1e3; -} -function forceReflow() { - return document.body.offsetHeight; -} - -const positionMap = /* @__PURE__ */ new WeakMap(); -const newPositionMap = /* @__PURE__ */ new WeakMap(); -const TransitionGroupImpl = { - name: "TransitionGroup", - props: /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, TransitionPropsValidators, { - tag: String, - moveClass: String - }), - setup(props, { slots }) { - const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); - const state = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState)(); - let prevChildren; - let children; - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated)(() => { - if (!prevChildren.length) { + const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { + const c1 = n1 && n1.children; + const prevShapeFlag = n1 ? n1.shapeFlag : 0; + const c2 = n2.children; + const { patchFlag, shapeFlag } = n2; + if (patchFlag > 0) { + if (patchFlag & 128) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); return; - } - const moveClass = props.moveClass || `${props.name || "v"}-move`; - if (!hasCSSTransform( - prevChildren[0].el, - instance.vnode.el, - moveClass - )) { + } else if (patchFlag & 256) { + patchUnkeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); return; } - prevChildren.forEach(callPendingCbs); - prevChildren.forEach(recordPosition); - const movedChildren = prevChildren.filter(applyTranslation); - forceReflow(); - movedChildren.forEach((c) => { - const el = c.el; - const style = el.style; - addTransitionClass(el, moveClass); - style.transform = style.webkitTransform = style.transitionDuration = ""; - const cb = el._moveCb = (e) => { - if (e && e.target !== el) { - return; - } - if (!e || /transform$/.test(e.propertyName)) { - el.removeEventListener("transitionend", cb); - el._moveCb = null; - removeTransitionClass(el, moveClass); - } - }; - el.addEventListener("transitionend", cb); - }); - }); - return () => { - const rawProps = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__.toRaw)(props); - const cssTransitionProps = resolveTransitionProps(rawProps); - let tag = rawProps.tag || _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment; - prevChildren = children; - children = slots.default ? (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren)(slots.default()) : []; - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (child.key != null) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( - child, - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) + } + if (shapeFlag & 8) { + if (prevShapeFlag & 16) { + unmountChildren(c1, parentComponent, parentSuspense); + } + if (c2 !== c1) { + hostSetElementText(container, c2); + } + } else { + if (prevShapeFlag & 16) { + if (shapeFlag & 16) { + patchKeyedChildren( + c1, + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized ); - } else if (true) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`<TransitionGroup> children must be keyed.`); + } else { + unmountChildren(c1, parentComponent, parentSuspense, true); } - } - if (prevChildren) { - for (let i = 0; i < prevChildren.length; i++) { - const child = prevChildren[i]; - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( - child, - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) + } else { + if (prevShapeFlag & 8) { + hostSetElementText(container, ""); + } + if (shapeFlag & 16) { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized ); - positionMap.set(child, child.el.getBoundingClientRect()); } } - return (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(tag, null, children); - }; - } -}; -const removeMode = (props) => delete props.mode; -/* @__PURE__ */ removeMode(TransitionGroupImpl.props); -const TransitionGroup = TransitionGroupImpl; -function callPendingCbs(c) { - const el = c.el; - if (el._moveCb) { - el._moveCb(); - } - if (el._enterCb) { - el._enterCb(); - } -} -function recordPosition(c) { - newPositionMap.set(c, c.el.getBoundingClientRect()); -} -function applyTranslation(c) { - const oldPos = positionMap.get(c); - const newPos = newPositionMap.get(c); - const dx = oldPos.left - newPos.left; - const dy = oldPos.top - newPos.top; - if (dx || dy) { - const s = c.el.style; - s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; - s.transitionDuration = "0s"; - return c; - } -} -function hasCSSTransform(el, root, moveClass) { - const clone = el.cloneNode(); - if (el._vtc) { - el._vtc.forEach((cls) => { - cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); - }); - } - moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); - clone.style.display = "none"; - const container = root.nodeType === 1 ? root : root.parentNode; - container.appendChild(clone); - const { hasTransform } = getTransitionInfo(clone); - container.removeChild(clone); - return hasTransform; -} - -const getModelAssigner = (vnode) => { - const fn = vnode.props["onUpdate:modelValue"] || false; - return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn) ? (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(fn, value) : fn; -}; -function onCompositionStart(e) { - e.target.composing = true; -} -function onCompositionEnd(e) { - const target = e.target; - if (target.composing) { - target.composing = false; - target.dispatchEvent(new Event("input")); - } -} -const vModelText = { - created(el, { modifiers: { lazy, trim, number } }, vnode) { - el._assign = getModelAssigner(vnode); - const castToNumber = number || vnode.props && vnode.props.type === "number"; - addEventListener(el, lazy ? "change" : "input", (e) => { - if (e.target.composing) - return; - let domValue = el.value; - if (trim) { - domValue = domValue.trim(); - } - if (castToNumber) { - domValue = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(domValue); + } + }; + const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + c1 = c1 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; + c2 = c2 || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; + const oldLength = c1.length; + const newLength = c2.length; + const commonLength = Math.min(oldLength, newLength); + let i; + for (i = 0; i < commonLength; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + patch( + c1[i], + nextChild, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + if (oldLength > newLength) { + unmountChildren( + c1, + parentComponent, + parentSuspense, + true, + false, + commonLength + ); + } else { + mountChildren( + c2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + commonLength + ); + } + }; + const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let i = 0; + const l2 = c2.length; + let e1 = c1.length - 1; + let e2 = l2 - 1; + while (i <= e1 && i <= e2) { + const n1 = c1[i]; + const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; } - el._assign(domValue); - }); - if (trim) { - addEventListener(el, "change", () => { - el.value = el.value.trim(); - }); + i++; } - if (!lazy) { - addEventListener(el, "compositionstart", onCompositionStart); - addEventListener(el, "compositionend", onCompositionEnd); - addEventListener(el, "change", onCompositionEnd); + while (i <= e1 && i <= e2) { + const n1 = c1[e1]; + const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); + if (isSameVNodeType(n1, n2)) { + patch( + n1, + n2, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + break; + } + e1--; + e2--; } - }, - // set value on mounted so it's after min/max for type="range" - mounted(el, { value }) { - el.value = value == null ? "" : value; - }, - beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) { - el._assign = getModelAssigner(vnode); - if (el.composing) - return; - if (document.activeElement === el && el.type !== "range") { - if (lazy) { - return; + if (i > e1) { + if (i <= e2) { + const nextPos = e2 + 1; + const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; + while (i <= e2) { + patch( + null, + c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + i++; + } } - if (trim && el.value.trim() === value) { - return; + } else if (i > e2) { + while (i <= e1) { + unmount(c1[i], parentComponent, parentSuspense, true); + i++; } - if ((number || el.type === "number") && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(el.value) === value) { - return; + } else { + const s1 = i; + const s2 = i; + const keyToNewIndexMap = /* @__PURE__ */ new Map(); + for (i = s2; i <= e2; i++) { + const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); + if (nextChild.key != null) { + if ( true && keyToNewIndexMap.has(nextChild.key)) { + warn$1( + `Duplicate keys found during update:`, + JSON.stringify(nextChild.key), + `Make sure keys are unique.` + ); + } + keyToNewIndexMap.set(nextChild.key, i); + } } - } - const newValue = value == null ? "" : value; - if (el.value !== newValue) { - el.value = newValue; - } - } -}; -const vModelCheckbox = { - // #4096 array checkboxes need to be deep traversed - deep: true, - created(el, _, vnode) { - el._assign = getModelAssigner(vnode); - addEventListener(el, "change", () => { - const modelValue = el._modelValue; - const elementValue = getValue(el); - const checked = el.checked; - const assign = el._assign; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(modelValue)) { - const index = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(modelValue, elementValue); - const found = index !== -1; - if (checked && !found) { - assign(modelValue.concat(elementValue)); - } else if (!checked && found) { - const filtered = [...modelValue]; - filtered.splice(index, 1); - assign(filtered); + let j; + let patched = 0; + const toBePatched = e2 - s2 + 1; + let moved = false; + let maxNewIndexSoFar = 0; + const newIndexToOldIndexMap = new Array(toBePatched); + for (i = 0; i < toBePatched; i++) + newIndexToOldIndexMap[i] = 0; + for (i = s1; i <= e1; i++) { + const prevChild = c1[i]; + if (patched >= toBePatched) { + unmount(prevChild, parentComponent, parentSuspense, true); + continue; } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(modelValue)) { - const cloned = new Set(modelValue); - if (checked) { - cloned.add(elementValue); + let newIndex; + if (prevChild.key != null) { + newIndex = keyToNewIndexMap.get(prevChild.key); } else { - cloned.delete(elementValue); + for (j = s2; j <= e2; j++) { + if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { + newIndex = j; + break; + } + } + } + if (newIndex === void 0) { + unmount(prevChild, parentComponent, parentSuspense, true); + } else { + newIndexToOldIndexMap[newIndex - s2] = i + 1; + if (newIndex >= maxNewIndexSoFar) { + maxNewIndexSoFar = newIndex; + } else { + moved = true; + } + patch( + prevChild, + c2[newIndex], + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + patched++; } - assign(cloned); - } else { - assign(getCheckboxValue(el, checked)); - } - }); - }, - // set initial checked on mount to wait for true-value/false-value - mounted: setChecked, - beforeUpdate(el, binding, vnode) { - el._assign = getModelAssigner(vnode); - setChecked(el, binding, vnode); - } -}; -function setChecked(el, { value, oldValue }, vnode) { - el._modelValue = value; - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1; - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { - el.checked = value.has(vnode.props.value); - } else if (value !== oldValue) { - el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, getCheckboxValue(el, true)); - } -} -const vModelRadio = { - created(el, { value }, vnode) { - el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); - el._assign = getModelAssigner(vnode); - addEventListener(el, "change", () => { - el._assign(getValue(el)); - }); - }, - beforeUpdate(el, { value, oldValue }, vnode) { - el._assign = getModelAssigner(vnode); - if (value !== oldValue) { - el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); - } - } -}; -const vModelSelect = { - // <select multiple> value need to be deep traversed - deep: true, - created(el, { value, modifiers: { number } }, vnode) { - const isSetModel = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value); - addEventListener(el, "change", () => { - const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( - (o) => number ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(getValue(o)) : getValue(o) - ); - el._assign( - el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] - ); - }); - el._assign = getModelAssigner(vnode); - }, - // set value in mounted & updated because <select> relies on its children - // <option>s. - mounted(el, { value }) { - setSelected(el, value); - }, - beforeUpdate(el, _binding, vnode) { - el._assign = getModelAssigner(vnode); - }, - updated(el, { value }) { - setSelected(el, value); - } -}; -function setSelected(el, value) { - const isMultiple = el.multiple; - if (isMultiple && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { - true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` - ); - return; - } - for (let i = 0, l = el.options.length; i < l; i++) { - const option = el.options[i]; - const optionValue = getValue(option); - if (isMultiple) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - option.selected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, optionValue) > -1; - } else { - option.selected = value.has(optionValue); - } - } else { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(getValue(option), value)) { - if (el.selectedIndex !== i) - el.selectedIndex = i; - return; - } - } - } - if (!isMultiple && el.selectedIndex !== -1) { - el.selectedIndex = -1; - } -} -function getValue(el) { - return "_value" in el ? el._value : el.value; -} -function getCheckboxValue(el, checked) { - const key = checked ? "_trueValue" : "_falseValue"; - return key in el ? el[key] : checked; -} -const vModelDynamic = { - created(el, binding, vnode) { - callModelHook(el, binding, vnode, null, "created"); - }, - mounted(el, binding, vnode) { - callModelHook(el, binding, vnode, null, "mounted"); - }, - beforeUpdate(el, binding, vnode, prevVNode) { - callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); - }, - updated(el, binding, vnode, prevVNode) { - callModelHook(el, binding, vnode, prevVNode, "updated"); - } -}; -function resolveDynamicModel(tagName, type) { - switch (tagName) { - case "SELECT": - return vModelSelect; - case "TEXTAREA": - return vModelText; - default: - switch (type) { - case "checkbox": - return vModelCheckbox; - case "radio": - return vModelRadio; - default: - return vModelText; - } - } -} -function callModelHook(el, binding, vnode, prevVNode, hook) { - const modelToUse = resolveDynamicModel( - el.tagName, - vnode.props && vnode.props.type - ); - const fn = modelToUse[hook]; - fn && fn(el, binding, vnode, prevVNode); -} -function initVModelForSSR() { - vModelText.getSSRProps = ({ value }) => ({ value }); - vModelRadio.getSSRProps = ({ value }, vnode) => { - if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(vnode.props.value, value)) { - return { checked: true }; - } - }; - vModelCheckbox.getSSRProps = ({ value }, vnode) => { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1) { - return { checked: true }; } - } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { - if (vnode.props && value.has(vnode.props.value)) { - return { checked: true }; + const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR; + j = increasingNewIndexSequence.length - 1; + for (i = toBePatched - 1; i >= 0; i--) { + const nextIndex = s2 + i; + const nextChild = c2[nextIndex]; + const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; + if (newIndexToOldIndexMap[i] === 0) { + patch( + null, + nextChild, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (moved) { + if (j < 0 || i !== increasingNewIndexSequence[j]) { + move(nextChild, container, anchor, 2); + } else { + j--; + } + } } - } else if (value) { - return { checked: true }; } }; - vModelDynamic.getSSRProps = (binding, vnode) => { - if (typeof vnode.type !== "string") { + const move = (vnode, container, anchor, moveType, parentSuspense = null) => { + const { el, type, transition, children, shapeFlag } = vnode; + if (shapeFlag & 6) { + move(vnode.component.subTree, container, anchor, moveType); return; } - const modelToUse = resolveDynamicModel( - // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase - vnode.type.toUpperCase(), - vnode.props && vnode.props.type - ); - if (modelToUse.getSSRProps) { - return modelToUse.getSSRProps(binding, vnode); - } - }; -} - -const systemModifiers = ["ctrl", "shift", "alt", "meta"]; -const modifierGuards = { - stop: (e) => e.stopPropagation(), - prevent: (e) => e.preventDefault(), - self: (e) => e.target !== e.currentTarget, - ctrl: (e) => !e.ctrlKey, - shift: (e) => !e.shiftKey, - alt: (e) => !e.altKey, - meta: (e) => !e.metaKey, - left: (e) => "button" in e && e.button !== 0, - middle: (e) => "button" in e && e.button !== 1, - right: (e) => "button" in e && e.button !== 2, - exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) -}; -const withModifiers = (fn, modifiers) => { - return (event, ...args) => { - for (let i = 0; i < modifiers.length; i++) { - const guard = modifierGuards[modifiers[i]]; - if (guard && guard(event, modifiers)) - return; + if (shapeFlag & 128) { + vnode.suspense.move(container, anchor, moveType); + return; } - return fn(event, ...args); - }; -}; -const keyNames = { - esc: "escape", - space: " ", - up: "arrow-up", - left: "arrow-left", - right: "arrow-right", - down: "arrow-down", - delete: "backspace" -}; -const withKeys = (fn, modifiers) => { - return (event) => { - if (!("key" in event)) { + if (shapeFlag & 64) { + type.move(vnode, container, anchor, internals); return; } - const eventKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event.key); - if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) { - return fn(event); + if (type === Fragment) { + hostInsert(el, container, anchor); + for (let i = 0; i < children.length; i++) { + move(children[i], container, anchor, moveType); + } + hostInsert(vnode.anchor, container, anchor); + return; } - }; -}; - -const vShow = { - beforeMount(el, { value }, { transition }) { - el._vod = el.style.display === "none" ? "" : el.style.display; - if (transition && value) { - transition.beforeEnter(el); - } else { - setDisplay(el, value); + if (type === Static) { + moveStaticNode(vnode, container, anchor); + return; } - }, - mounted(el, { value }, { transition }) { - if (transition && value) { - transition.enter(el); - } - }, - updated(el, { value, oldValue }, { transition }) { - if (!value === !oldValue) - return; - if (transition) { - if (value) { + const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; + if (needTransition2) { + if (moveType === 0) { transition.beforeEnter(el); - setDisplay(el, true); - transition.enter(el); + hostInsert(el, container, anchor); + queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { - transition.leave(el, () => { - setDisplay(el, false); - }); + const { leave, delayLeave, afterLeave } = transition; + const remove2 = () => hostInsert(el, container, anchor); + const performLeave = () => { + leave(el, () => { + remove2(); + afterLeave && afterLeave(); + }); + }; + if (delayLeave) { + delayLeave(el, remove2, performLeave); + } else { + performLeave(); + } } } else { - setDisplay(el, value); - } - }, - beforeUnmount(el, { value }) { - setDisplay(el, value); - } -}; -function setDisplay(el, value) { - el.style.display = value ? el._vod : "none"; -} -function initVShowForSSR() { - vShow.getSSRProps = ({ value }) => { - if (!value) { - return { style: { display: "none" } }; + hostInsert(el, container, anchor); } }; -} - -const rendererOptions = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ patchProp }, nodeOps); -let renderer; -let enabledHydration = false; -function ensureRenderer() { - return renderer || (renderer = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer)(rendererOptions)); -} -function ensureHydrationRenderer() { - renderer = enabledHydration ? renderer : (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer)(rendererOptions); - enabledHydration = true; - return renderer; -} -const render = (...args) => { - ensureRenderer().render(...args); -}; -const hydrate = (...args) => { - ensureHydrationRenderer().hydrate(...args); -}; -const createApp = (...args) => { - const app = ensureRenderer().createApp(...args); - if (true) { - injectNativeTagCheck(app); - injectCompilerOptionsCheck(app); - } - const { mount } = app; - app.mount = (containerOrSelector) => { - const container = normalizeContainer(containerOrSelector); - if (!container) + const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { + const { + type, + props, + ref, + children, + dynamicChildren, + shapeFlag, + patchFlag, + dirs + } = vnode; + if (ref != null) { + setRef(ref, null, parentSuspense, vnode, true); + } + if (shapeFlag & 256) { + parentComponent.ctx.deactivate(vnode); return; - const component = app._component; - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(component) && !component.render && !component.template) { - component.template = container.innerHTML; } - container.innerHTML = ""; - const proxy = mount(container, false, container instanceof SVGElement); - if (container instanceof Element) { - container.removeAttribute("v-cloak"); - container.setAttribute("data-v-app", ""); + const shouldInvokeDirs = shapeFlag & 1 && dirs; + const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); + let vnodeHook; + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); } - return proxy; - }; - return app; -}; -const createSSRApp = (...args) => { - const app = ensureHydrationRenderer().createApp(...args); - if (true) { - injectNativeTagCheck(app); - injectCompilerOptionsCheck(app); - } - const { mount } = app; - app.mount = (containerOrSelector) => { - const container = normalizeContainer(containerOrSelector); - if (container) { - return mount(container, true, container instanceof SVGElement); + if (shapeFlag & 6) { + unmountComponent(vnode.component, parentSuspense, doRemove); + } else { + if (shapeFlag & 128) { + vnode.suspense.unmount(parentSuspense, doRemove); + return; + } + if (shouldInvokeDirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); + } + if (shapeFlag & 64) { + vnode.type.remove( + vnode, + parentComponent, + parentSuspense, + optimized, + internals, + doRemove + ); + } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments + (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { + unmountChildren( + dynamicChildren, + parentComponent, + parentSuspense, + false, + true + ); + } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { + unmountChildren(children, parentComponent, parentSuspense); + } + if (doRemove) { + remove(vnode); + } + } + if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); + }, parentSuspense); } }; - return app; -}; -function injectNativeTagCheck(app) { - Object.defineProperty(app.config, "isNativeTag", { - value: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag), - writable: false - }); -} -function injectCompilerOptionsCheck(app) { - if ((0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly)()) { - const isCustomElement = app.config.isCustomElement; - Object.defineProperty(app.config, "isCustomElement", { - get() { - return isCustomElement; - }, - set() { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` - ); + const remove = (vnode) => { + const { type, el, anchor, transition } = vnode; + if (type === Fragment) { + if ( true && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { + vnode.children.forEach((child) => { + if (child.type === Comment) { + hostRemove(child.el); + } else { + remove(child); + } + }); + } else { + removeFragment(el, anchor); } - }); - const compilerOptions = app.config.compilerOptions; - const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. -- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. -- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader -- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; - Object.defineProperty(app.config, "compilerOptions", { - get() { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); - return compilerOptions; - }, - set() { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); + return; + } + if (type === Static) { + removeStaticNode(vnode); + return; + } + const performRemove = () => { + hostRemove(el); + if (transition && !transition.persisted && transition.afterLeave) { + transition.afterLeave(); } - }); - } -} -function normalizeContainer(container) { - if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(container)) { - const res = document.querySelector(container); - if ( true && !res) { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `Failed to mount app: mount target selector "${container}" returned null.` - ); + }; + if (vnode.shapeFlag & 1 && transition && !transition.persisted) { + const { leave, delayLeave } = transition; + const performLeave = () => leave(el, performRemove); + if (delayLeave) { + delayLeave(vnode.el, performRemove, performLeave); + } else { + performLeave(); + } + } else { + performRemove(); } - return res; - } - if ( true && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { - (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( - `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` - ); - } - return container; -} -let ssrDirectiveInitialized = false; -const initDirectivesForSSR = () => { - if (!ssrDirectiveInitialized) { - ssrDirectiveInitialized = true; - initVModelForSSR(); - initVShowForSSR(); - } -} ; - - - - -/***/ }), - -/***/ "./node_modules/@vue/shared/dist/shared.esm-bundler.js": -/*!*************************************************************!*\ - !*** ./node_modules/@vue/shared/dist/shared.esm-bundler.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ EMPTY_ARR: () => (/* binding */ EMPTY_ARR), -/* harmony export */ EMPTY_OBJ: () => (/* binding */ EMPTY_OBJ), -/* harmony export */ NO: () => (/* binding */ NO), -/* harmony export */ NOOP: () => (/* binding */ NOOP), -/* harmony export */ PatchFlagNames: () => (/* binding */ PatchFlagNames), -/* harmony export */ camelize: () => (/* binding */ camelize), -/* harmony export */ capitalize: () => (/* binding */ capitalize), -/* harmony export */ def: () => (/* binding */ def), -/* harmony export */ escapeHtml: () => (/* binding */ escapeHtml), -/* harmony export */ escapeHtmlComment: () => (/* binding */ escapeHtmlComment), -/* harmony export */ extend: () => (/* binding */ extend), -/* harmony export */ genPropsAccessExp: () => (/* binding */ genPropsAccessExp), -/* harmony export */ generateCodeFrame: () => (/* binding */ generateCodeFrame), -/* harmony export */ getGlobalThis: () => (/* binding */ getGlobalThis), -/* harmony export */ hasChanged: () => (/* binding */ hasChanged), -/* harmony export */ hasOwn: () => (/* binding */ hasOwn), -/* harmony export */ hyphenate: () => (/* binding */ hyphenate), -/* harmony export */ includeBooleanAttr: () => (/* binding */ includeBooleanAttr), -/* harmony export */ invokeArrayFns: () => (/* binding */ invokeArrayFns), -/* harmony export */ isArray: () => (/* binding */ isArray), -/* harmony export */ isBooleanAttr: () => (/* binding */ isBooleanAttr), -/* harmony export */ isBuiltInDirective: () => (/* binding */ isBuiltInDirective), -/* harmony export */ isDate: () => (/* binding */ isDate), -/* harmony export */ isFunction: () => (/* binding */ isFunction), -/* harmony export */ isGloballyWhitelisted: () => (/* binding */ isGloballyWhitelisted), -/* harmony export */ isHTMLTag: () => (/* binding */ isHTMLTag), -/* harmony export */ isIntegerKey: () => (/* binding */ isIntegerKey), -/* harmony export */ isKnownHtmlAttr: () => (/* binding */ isKnownHtmlAttr), -/* harmony export */ isKnownSvgAttr: () => (/* binding */ isKnownSvgAttr), -/* harmony export */ isMap: () => (/* binding */ isMap), -/* harmony export */ isModelListener: () => (/* binding */ isModelListener), -/* harmony export */ isObject: () => (/* binding */ isObject), -/* harmony export */ isOn: () => (/* binding */ isOn), -/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), -/* harmony export */ isPromise: () => (/* binding */ isPromise), -/* harmony export */ isRegExp: () => (/* binding */ isRegExp), -/* harmony export */ isReservedProp: () => (/* binding */ isReservedProp), -/* harmony export */ isSSRSafeAttrName: () => (/* binding */ isSSRSafeAttrName), -/* harmony export */ isSVGTag: () => (/* binding */ isSVGTag), -/* harmony export */ isSet: () => (/* binding */ isSet), -/* harmony export */ isSpecialBooleanAttr: () => (/* binding */ isSpecialBooleanAttr), -/* harmony export */ isString: () => (/* binding */ isString), -/* harmony export */ isSymbol: () => (/* binding */ isSymbol), -/* harmony export */ isVoidTag: () => (/* binding */ isVoidTag), -/* harmony export */ looseEqual: () => (/* binding */ looseEqual), -/* harmony export */ looseIndexOf: () => (/* binding */ looseIndexOf), -/* harmony export */ looseToNumber: () => (/* binding */ looseToNumber), -/* harmony export */ makeMap: () => (/* binding */ makeMap), -/* harmony export */ normalizeClass: () => (/* binding */ normalizeClass), -/* harmony export */ normalizeProps: () => (/* binding */ normalizeProps), -/* harmony export */ normalizeStyle: () => (/* binding */ normalizeStyle), -/* harmony export */ objectToString: () => (/* binding */ objectToString), -/* harmony export */ parseStringStyle: () => (/* binding */ parseStringStyle), -/* harmony export */ propsToAttrMap: () => (/* binding */ propsToAttrMap), -/* harmony export */ remove: () => (/* binding */ remove), -/* harmony export */ slotFlagsText: () => (/* binding */ slotFlagsText), -/* harmony export */ stringifyStyle: () => (/* binding */ stringifyStyle), -/* harmony export */ toDisplayString: () => (/* binding */ toDisplayString), -/* harmony export */ toHandlerKey: () => (/* binding */ toHandlerKey), -/* harmony export */ toNumber: () => (/* binding */ toNumber), -/* harmony export */ toRawType: () => (/* binding */ toRawType), -/* harmony export */ toTypeString: () => (/* binding */ toTypeString) -/* harmony export */ }); -function makeMap(str, expectsLowerCase) { - const map = /* @__PURE__ */ Object.create(null); - const list = str.split(","); - for (let i = 0; i < list.length; i++) { - map[list[i]] = true; - } - return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; -} - -const EMPTY_OBJ = true ? Object.freeze({}) : 0; -const EMPTY_ARR = true ? Object.freeze([]) : 0; -const NOOP = () => { -}; -const NO = () => false; -const onRE = /^on[^a-z]/; -const isOn = (key) => onRE.test(key); -const isModelListener = (key) => key.startsWith("onUpdate:"); -const extend = Object.assign; -const remove = (arr, el) => { - const i = arr.indexOf(el); - if (i > -1) { - arr.splice(i, 1); - } -}; -const hasOwnProperty = Object.prototype.hasOwnProperty; -const hasOwn = (val, key) => hasOwnProperty.call(val, key); -const isArray = Array.isArray; -const isMap = (val) => toTypeString(val) === "[object Map]"; -const isSet = (val) => toTypeString(val) === "[object Set]"; -const isDate = (val) => toTypeString(val) === "[object Date]"; -const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; -const isFunction = (val) => typeof val === "function"; -const isString = (val) => typeof val === "string"; -const isSymbol = (val) => typeof val === "symbol"; -const isObject = (val) => val !== null && typeof val === "object"; -const isPromise = (val) => { - return isObject(val) && isFunction(val.then) && isFunction(val.catch); -}; -const objectToString = Object.prototype.toString; -const toTypeString = (value) => objectToString.call(value); -const toRawType = (value) => { - return toTypeString(value).slice(8, -1); -}; -const isPlainObject = (val) => toTypeString(val) === "[object Object]"; -const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; -const isReservedProp = /* @__PURE__ */ makeMap( - // the leading comma is intentional so empty string "" is also included - ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" -); -const isBuiltInDirective = /* @__PURE__ */ makeMap( - "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" -); -const cacheStringFunction = (fn) => { - const cache = /* @__PURE__ */ Object.create(null); - return (str) => { - const hit = cache[str]; - return hit || (cache[str] = fn(str)); }; -}; -const camelizeRE = /-(\w)/g; -const camelize = cacheStringFunction((str) => { - return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); -}); -const hyphenateRE = /\B([A-Z])/g; -const hyphenate = cacheStringFunction( - (str) => str.replace(hyphenateRE, "-$1").toLowerCase() -); -const capitalize = cacheStringFunction( - (str) => str.charAt(0).toUpperCase() + str.slice(1) -); -const toHandlerKey = cacheStringFunction( - (str) => str ? `on${capitalize(str)}` : `` -); -const hasChanged = (value, oldValue) => !Object.is(value, oldValue); -const invokeArrayFns = (fns, arg) => { - for (let i = 0; i < fns.length; i++) { - fns[i](arg); - } -}; -const def = (obj, key, value) => { - Object.defineProperty(obj, key, { - configurable: true, - enumerable: false, - value - }); -}; -const looseToNumber = (val) => { - const n = parseFloat(val); - return isNaN(n) ? val : n; -}; -const toNumber = (val) => { - const n = isString(val) ? Number(val) : NaN; - return isNaN(n) ? val : n; -}; -let _globalThis; -const getGlobalThis = () => { - return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : {}); -}; -const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; -function genPropsAccessExp(name) { - return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; -} - -const PatchFlagNames = { - [1]: `TEXT`, - [2]: `CLASS`, - [4]: `STYLE`, - [8]: `PROPS`, - [16]: `FULL_PROPS`, - [32]: `HYDRATE_EVENTS`, - [64]: `STABLE_FRAGMENT`, - [128]: `KEYED_FRAGMENT`, - [256]: `UNKEYED_FRAGMENT`, - [512]: `NEED_PATCH`, - [1024]: `DYNAMIC_SLOTS`, - [2048]: `DEV_ROOT_FRAGMENT`, - [-1]: `HOISTED`, - [-2]: `BAIL` -}; - -const slotFlagsText = { - [1]: "STABLE", - [2]: "DYNAMIC", - [3]: "FORWARDED" -}; - -const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console"; -const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED); - -const range = 2; -function generateCodeFrame(source, start = 0, end = source.length) { - let lines = source.split(/(\r?\n)/); - const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); - lines = lines.filter((_, idx) => idx % 2 === 0); - let count = 0; - const res = []; - for (let i = 0; i < lines.length; i++) { - count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); - if (count >= start) { - for (let j = i - range; j <= i + range || end > count; j++) { - if (j < 0 || j >= lines.length) - continue; - const line = j + 1; - res.push( - `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` - ); - const lineLength = lines[j].length; - const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; - if (j === i) { - const pad = start - (count - (lineLength + newLineSeqLength)); - const length = Math.max( - 1, - end > count ? lineLength - pad : end - start - ); - res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); - } else if (j > i) { - if (end > count) { - const length = Math.max(Math.min(end - count, lineLength), 1); - res.push(` | ` + "^".repeat(length)); - } - count += lineLength + newLineSeqLength; - } - } - break; + const removeFragment = (cur, end) => { + let next; + while (cur !== end) { + next = hostNextSibling(cur); + hostRemove(cur); + cur = next; } - } - return res.join("\n"); -} - -function normalizeStyle(value) { - if (isArray(value)) { - const res = {}; - for (let i = 0; i < value.length; i++) { - const item = value[i]; - const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); - if (normalized) { - for (const key in normalized) { - res[key] = normalized[key]; - } - } + hostRemove(end); + }; + const unmountComponent = (instance, parentSuspense, doRemove) => { + if ( true && instance.type.__hmrId) { + unregisterHMR(instance); } - return res; - } else if (isString(value)) { - return value; - } else if (isObject(value)) { - return value; - } -} -const listDelimiterRE = /;(?![^(]*\))/g; -const propertyDelimiterRE = /:([^]+)/; -const styleCommentRE = /\/\*[^]*?\*\//g; -function parseStringStyle(cssText) { - const ret = {}; - cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { - if (item) { - const tmp = item.split(propertyDelimiterRE); - tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + const { bum, scope, update, subTree, um } = instance; + if (bum) { + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(bum); } - }); - return ret; -} -function stringifyStyle(styles) { - let ret = ""; - if (!styles || isString(styles)) { - return ret; - } - for (const key in styles) { - const value = styles[key]; - const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); - if (isString(value) || typeof value === "number") { - ret += `${normalizedKey}:${value};`; + scope.stop(); + if (update) { + update.active = false; + unmount(subTree, instance, parentSuspense, doRemove); } - } - return ret; -} -function normalizeClass(value) { - let res = ""; - if (isString(value)) { - res = value; - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - const normalized = normalizeClass(value[i]); - if (normalized) { - res += normalized + " "; + if (um) { + queuePostRenderEffect(um, parentSuspense); + } + queuePostRenderEffect(() => { + instance.isUnmounted = true; + }, parentSuspense); + if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0) { + parentSuspense.resolve(); } } - } else if (isObject(value)) { - for (const name in value) { - if (value[name]) { - res += name + " "; + if (true) { + devtoolsComponentRemoved(instance); + } + }; + const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { + for (let i = start; i < children.length; i++) { + unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); + } + }; + const getNextHostNode = (vnode) => { + if (vnode.shapeFlag & 6) { + return getNextHostNode(vnode.component.subTree); + } + if (vnode.shapeFlag & 128) { + return vnode.suspense.next(); + } + return hostNextSibling(vnode.anchor || vnode.el); + }; + let isFlushing = false; + const render = (vnode, container, namespace) => { + if (vnode == null) { + if (container._vnode) { + unmount(container._vnode, null, null, true); } + } else { + patch( + container._vnode || null, + vnode, + container, + null, + null, + null, + namespace + ); + } + if (!isFlushing) { + isFlushing = true; + flushPreFlushCbs(); + flushPostFlushCbs(); + isFlushing = false; } + container._vnode = vnode; + }; + const internals = { + p: patch, + um: unmount, + m: move, + r: remove, + mt: mountComponent, + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + n: getNextHostNode, + o: options + }; + let hydrate; + let hydrateNode; + if (createHydrationFns) { + [hydrate, hydrateNode] = createHydrationFns( + internals + ); } - return res.trim(); + return { + render, + hydrate, + createApp: createAppAPI(render, hydrate) + }; } -function normalizeProps(props) { - if (!props) - return null; - let { class: klass, style } = props; - if (klass && !isString(klass)) { - props.class = normalizeClass(klass); - } - if (style) { - props.style = normalizeStyle(style); - } - return props; +function resolveChildrenNamespace({ type, props }, currentNamespace) { + return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; } - -const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; -const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; -const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; -const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); -const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); -const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); - -const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; -const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); -const isBooleanAttr = /* @__PURE__ */ makeMap( - specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` -); -function includeBooleanAttr(value) { - return !!value || value === ""; +function toggleRecurse({ effect, update }, allowed) { + effect.allowRecurse = update.allowRecurse = allowed; } -const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; -const attrValidationCache = {}; -function isSSRSafeAttrName(name) { - if (attrValidationCache.hasOwnProperty(name)) { - return attrValidationCache[name]; - } - const isUnsafe = unsafeAttrCharRE.test(name); - if (isUnsafe) { - console.error(`unsafe attribute name: ${name}`); - } - return attrValidationCache[name] = !isUnsafe; +function needTransition(parentSuspense, transition) { + return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; } -const propsToAttrMap = { - acceptCharset: "accept-charset", - className: "class", - htmlFor: "for", - httpEquiv: "http-equiv" -}; -const isKnownHtmlAttr = /* @__PURE__ */ makeMap( - `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` -); -const isKnownSvgAttr = /* @__PURE__ */ makeMap( - `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` -); - -const escapeRE = /["'&<>]/; -function escapeHtml(string) { - const str = "" + string; - const match = escapeRE.exec(str); - if (!match) { - return str; +function traverseStaticChildren(n1, n2, shallow = false) { + const ch1 = n1.children; + const ch2 = n2.children; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch1) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ch2)) { + for (let i = 0; i < ch1.length; i++) { + const c1 = ch1[i]; + let c2 = ch2[i]; + if (c2.shapeFlag & 1 && !c2.dynamicChildren) { + if (c2.patchFlag <= 0 || c2.patchFlag === 32) { + c2 = ch2[i] = cloneIfMounted(ch2[i]); + c2.el = c1.el; + } + if (!shallow) + traverseStaticChildren(c1, c2); + } + if (c2.type === Text) { + c2.el = c1.el; + } + if ( true && c2.type === Comment && !c2.el) { + c2.el = c1.el; + } + } } - let html = ""; - let escaped; - let index; - let lastIndex = 0; - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - escaped = """; - break; - case 38: - escaped = "&"; - break; - case 39: - escaped = "'"; - break; - case 60: - escaped = "<"; - break; - case 62: - escaped = ">"; - break; - default: +} +function getSequence(arr) { + const p = arr.slice(); + const result = [0]; + let i, j, u, v, c; + const len = arr.length; + for (i = 0; i < len; i++) { + const arrI = arr[i]; + if (arrI !== 0) { + j = result[result.length - 1]; + if (arr[j] < arrI) { + p[i] = j; + result.push(i); continue; + } + u = 0; + v = result.length - 1; + while (u < v) { + c = u + v >> 1; + if (arr[result[c]] < arrI) { + u = c + 1; + } else { + v = c; + } + } + if (arrI < arr[result[u]]) { + if (u > 0) { + p[i] = result[u - 1]; + } + result[u] = i; + } } - if (lastIndex !== index) { - html += str.slice(lastIndex, index); + } + u = result.length; + v = result[u - 1]; + while (u-- > 0) { + result[u] = v; + v = p[v]; + } + return result; +} +function locateNonHydratedAsyncRoot(instance) { + const subComponent = instance.subTree.component; + if (subComponent) { + if (subComponent.asyncDep && !subComponent.asyncResolved) { + return subComponent; + } else { + return locateNonHydratedAsyncRoot(subComponent); } - lastIndex = index + 1; - html += escaped; } - return lastIndex !== index ? html + str.slice(lastIndex, index) : html; -} -const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; -function escapeHtmlComment(src) { - return src.replace(commentStripRE, ""); } -function looseCompareArrays(a, b) { - if (a.length !== b.length) - return false; - let equal = true; - for (let i = 0; equal && i < a.length; i++) { - equal = looseEqual(a[i], b[i]); - } - return equal; -} -function looseEqual(a, b) { - if (a === b) - return true; - let aValidType = isDate(a); - let bValidType = isDate(b); - if (aValidType || bValidType) { - return aValidType && bValidType ? a.getTime() === b.getTime() : false; - } - aValidType = isSymbol(a); - bValidType = isSymbol(b); - if (aValidType || bValidType) { - return a === b; - } - aValidType = isArray(a); - bValidType = isArray(b); - if (aValidType || bValidType) { - return aValidType && bValidType ? looseCompareArrays(a, b) : false; - } - aValidType = isObject(a); - bValidType = isObject(b); - if (aValidType || bValidType) { - if (!aValidType || !bValidType) { - return false; - } - const aKeysCount = Object.keys(a).length; - const bKeysCount = Object.keys(b).length; - if (aKeysCount !== bKeysCount) { - return false; - } - for (const key in a) { - const aHasKey = a.hasOwnProperty(key); - const bHasKey = b.hasOwnProperty(key); - if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { - return false; +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(targetSelector)) { + if (!select) { + true && warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!target) { + true && warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); } + return target; } + } else { + if ( true && !targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; } - return String(a) === String(b); -} -function looseIndexOf(arr, val) { - return arr.findIndex((item) => looseEqual(item, val)); -} - -const toDisplayString = (val) => { - return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); -}; -const replacer = (_key, val) => { - if (val && val.__v_isRef) { - return replacer(_key, val.value); - } else if (isMap(val)) { - return { - [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { - entries[`${key} =>`] = val2; - return entries; - }, {}) - }; - } else if (isSet(val)) { - return { - [`Set(${val.size})`]: [...val.values()] - }; - } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { - return String(val); - } - return val; }; - - - - -/***/ }), - -/***/ "./node_modules/axios/index.js": -/*!*************************************!*\ - !*** ./node_modules/axios/index.js ***! - \*************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); - -/***/ }), - -/***/ "./node_modules/axios/lib/adapters/xhr.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/adapters/xhr.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); -var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); -var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); -var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); -var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); -var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { shapeFlag, children, dynamicChildren } = n2; + if ( true && isHmrUpdating) { + optimized = false; + dynamicChildren = null; } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; + if (n1 == null) { + const placeholder = n2.el = true ? createComment("teleport start") : 0; + const mainAnchor = n2.anchor = true ? createComment("teleport end") : 0; + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + const target = n2.target = resolveTarget(n2.props, querySelector); + const targetAnchor = n2.targetAnchor = createText(""); + if (target) { + insert(targetAnchor, target); + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; + } else if ( true && !disabled) { + warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`); + } + const mount = (container2, anchor2) => { + if (shapeFlag & 16) { + mountChildren( + children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; + if (disabled) { + mount(container, mainAnchor); + } else if (target) { + mount(target, targetAnchor); } - reject(createError( - timeoutErrorMessage, - config, - config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; + } else { + n2.el = n1.el; + const mainAnchor = n2.anchor = n1.anchor; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = n2.target = resolveTarget( + n2.props, + querySelector + ); + if (nextTarget) { + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else if (true) { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } } - - if (!requestData) { - requestData = null; + updateCssVars(n2); + }, + remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode; + if (target) { + hostRemove(targetAnchor); } - - // Send the request - request.send(requestData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/axios.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/axios.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); -var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); -var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); -axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); -axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); - -// Expose isAxiosError -axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports["default"] = axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/Cancel.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/cancel/Cancel.js ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); + doRemove && hostRemove(anchor); + if (shapeFlag & 16) { + const shouldRemove = doRemove || !isTeleportDisabled(props); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport }; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/CancelToken.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!isReorder || isTeleportDisabled(props)) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/isCancel.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/cancel/isCancel.js ***! - \***************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/Axios.js": -/*!**********************************************!*\ - !*** ./node_modules/axios/lib/core/Axios.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); -var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); -var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js"); - -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; + if (isReorder) { + insert(anchor, container, parentAnchor); } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - var transitional = config.transitional; - - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') - }, false); - } - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - var promise; - - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; - - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector } +}, hydrateChildren) { + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + if (target) { + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (isTeleportDisabled(vnode.props)) { + vnode.anchor = hydrateChildren( + nextSibling(node), + vnode, + parentNode(node), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + vnode.targetAnchor = targetNode; + } else { + vnode.anchor = nextSibling(node); + let targetAnchor = targetNode; + while (targetAnchor) { + targetAnchor = nextSibling(targetAnchor); + if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + hydrateChildren( + targetNode, + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } } - - return promise; + updateCssVars(vnode); } - - - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node = vnode.children[0].el; + while (node && node !== vnode.targetAnchor) { + if (node.nodeType === 1) + node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; } + ctx.ut(); } +} - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); +const Fragment = Symbol.for("v-fgt"); +const Text = Symbol.for("v-txt"); +const Comment = Symbol.for("v-cmt"); +const Static = Symbol.for("v-stc"); +const blockStack = []; +let currentBlock = null; +function openBlock(disableTracking = false) { + blockStack.push(currentBlock = disableTracking ? null : []); +} +function closeBlock() { + blockStack.pop(); + currentBlock = blockStack[blockStack.length - 1] || null; +} +let isBlockTreeEnabled = 1; +function setBlockTracking(value) { + isBlockTreeEnabled += value; +} +function setupBlock(vnode) { + vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARR : null; + closeBlock(); + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(vnode); } - - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + return vnode; +} +function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { + return setupBlock( + createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + true + ) + ); +} +function createBlock(type, props, children, patchFlag, dynamicProps) { + return setupBlock( + createVNode( + type, + props, + children, + patchFlag, + dynamicProps, + true + ) + ); +} +function isVNode(value) { + return value ? value.__v_isVNode === true : false; +} +function isSameVNodeType(n1, n2) { + if ( true && n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) { + n1.shapeFlag &= ~256; + n2.shapeFlag &= ~512; + return false; } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/InterceptorManager.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function InterceptorManager() { - this.handlers = []; + return n1.type === n2.type && n1.key === n2.key; } - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; +let vnodeArgsTransformer; +function transformVNodeArgs(transformer) { + vnodeArgsTransformer = transformer; +} +const createVNodeWithArgsTransform = (...args) => { + return _createVNode( + ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args + ); }; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; +const InternalObjectKey = `__vInternal`; +const normalizeKey = ({ key }) => key != null ? key : null; +const normalizeRef = ({ + ref, + ref_key, + ref_for +}) => { + if (typeof ref === "number") { + ref = "" + ref; } + return ref != null ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(ref) || (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(ref) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; }; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); +function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { + const vnode = { + __v_isVNode: true, + __v_skip: true, + type, + props, + key: props && normalizeKey(props), + ref: props && normalizeRef(props), + scopeId: currentScopeId, + slotScopeIds: null, + children, + component: null, + suspense: null, + ssContent: null, + ssFallback: null, + dirs: null, + transition: null, + el: null, + anchor: null, + target: null, + targetAnchor: null, + staticCount: 0, + shapeFlag, + patchFlag, + dynamicProps, + dynamicChildren: null, + appContext: null, + ctx: currentRenderingInstance + }; + if (needFullChildrenNormalization) { + normalizeChildren(vnode, children); + if (shapeFlag & 128) { + type.normalize(vnode); } - }); -}; - -module.exports = InterceptorManager; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/buildFullPath.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/buildFullPath.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); -var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); + } else if (children) { + vnode.shapeFlag |= (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(children) ? 8 : 16; } - return requestedURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/createError.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/createError.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/dispatchRequest.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); -var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); -var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); + if ( true && vnode.key !== vnode.key) { + warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); + } + if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself + !isBlockNode && // has current parent block + currentBlock && // presence of a patch flag indicates this node needs patching on updates. + // component nodes also should always be patched, because even if the + // component doesn't need to update, it needs to persist the instance on to + // the next vnode so that it can be properly unmounted later. + (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the + // vnode should not be considered dynamic due to handler caching. + vnode.patchFlag !== 32) { + currentBlock.push(vnode); } + return vnode; } - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; +const createVNode = true ? createVNodeWithArgsTransform : 0; +function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { + if (!type || type === NULL_DYNAMIC_COMPONENT) { + if ( true && !type) { + warn$1(`Invalid vnode type when creating vnode: ${type}.`); } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse + type = Comment; + } + if (isVNode(type)) { + const cloned = cloneVNode( + type, + props, + true + /* mergeRef: true */ ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } + if (children) { + normalizeChildren(cloned, children); } - - return Promise.reject(reason); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/enhanceError.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/core/enhanceError.js ***! - \*****************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/mergeConfig.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/mergeConfig.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); + if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { + if (cloned.shapeFlag & 6) { + currentBlock[currentBlock.indexOf(type)] = cloned; + } else { + currentBlock.push(cloned); + } } - return source; + cloned.patchFlag |= -2; + return cloned; } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } + if (isClassComponent(type)) { + type = type.__vccOpts; } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); + if (props) { + props = guardReactiveProps(props); + let { class: klass, style } = props; + if (klass && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(klass)) { + props.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)(klass); } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(style)) { + if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(style) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(style)) { + style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, style); + } + props.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)(style); } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/settle.js": -/*!***********************************************!*\ - !*** ./node_modules/axios/lib/core/settle.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); } -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/transformData.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/transformData.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - - return data; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/defaults.js": -/*!********************************************!*\ - !*** ./node_modules/axios/lib/defaults.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); -var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; + const shapeFlag = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(type) ? 4 : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(type) ? 2 : 0; + if ( true && shapeFlag & 4 && (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(type)) { + type = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(type); + warn$1( + `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, + ` +Component that was made reactive: `, + type + ); } + return createBaseVNode( + type, + props, + children, + patchFlag, + dynamicProps, + shapeFlag, + isBlockNode, + true + ); } - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); +function guardReactiveProps(props) { + if (!props) + return null; + return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isProxy)(props) || InternalObjectKey in props ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, props) : props; +} +function cloneVNode(vnode, extraProps, mergeRef = false) { + const { props, ref, patchFlag, children } = vnode; + const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; + const cloned = { + __v_isVNode: true, + __v_skip: true, + type: vnode.type, + props: mergedProps, + key: mergedProps && normalizeKey(mergedProps), + ref: extraProps && extraProps.ref ? ( + // #2078 in the case of <component :is="vnode" ref="extra"/> + // if the vnode itself already has a ref, cloneVNode will need to merge + // the refs so the single vnode can be set on multiple refs + mergeRef && ref ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) + ) : ref, + scopeId: vnode.scopeId, + slotScopeIds: vnode.slotScopeIds, + children: true && patchFlag === -1 && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children) ? children.map(deepCloneVNode) : children, + target: vnode.target, + targetAnchor: vnode.targetAnchor, + staticCount: vnode.staticCount, + shapeFlag: vnode.shapeFlag, + // if the vnode is cloned with extra props, we can no longer assume its + // existing patch flag to be reliable and need to add the FULL_PROPS flag. + // note: preserve flag for fragments since they use the flag for children + // fast paths only. + patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, + dynamicProps: vnode.dynamicProps, + dynamicChildren: vnode.dynamicChildren, + appContext: vnode.appContext, + dirs: vnode.dirs, + transition: vnode.transition, + // These should technically only be non-null on mounted VNodes. However, + // they *should* be copied for kept-alive vnodes. So we just always copy + // them since them being non-null during a mount doesn't affect the logic as + // they will simply be overwritten. + component: vnode.component, + suspense: vnode.suspense, + ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), + ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), + el: vnode.el, + anchor: vnode.anchor, + ctx: vnode.ctx, + ce: vnode.ce + }; + return cloned; +} +function deepCloneVNode(vnode) { + const cloned = cloneVNode(vnode); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) { + cloned.children = vnode.children.map(deepCloneVNode); } - return adapter; + return cloned; } - -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } +function createTextVNode(text = " ", flag = 0) { + return createVNode(Text, null, text, flag); +} +function createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +function createCommentVNode(text = "", asBlock = false) { + return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); +} +function normalizeVNode(child) { + if (child == null || typeof child === "boolean") { + return createVNode(Comment); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(child)) { + return createVNode( + Fragment, + null, + // #3666, avoid reference pollution when reusing vnode + child.slice() + ); + } else if (typeof child === "object") { + return cloneIfMounted(child); + } else { + return createVNode(Text, null, String(child)); } - - return (encoder || JSON.stringify)(rawValue); } - -var defaults = { - - transitional: { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }, - - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); +function cloneIfMounted(child) { + return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); +} +function normalizeChildren(vnode, children) { + let type = 0; + const { shapeFlag } = vnode; + if (children == null) { + children = null; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(children)) { + type = 16; + } else if (typeof children === "object") { + if (shapeFlag & (1 | 64)) { + const slot = children.default; + if (slot) { + slot._c && (slot._d = false); + normalizeChildren(vnode, slot()); + slot._c && (slot._d = true); + } + return; + } else { + type = 32; + const slotFlag = children._; + if (!slotFlag && !(InternalObjectKey in children)) { + children._ctx = currentRenderingInstance; + } else if (slotFlag === 3 && currentRenderingInstance) { + if (currentRenderingInstance.slots._ === 1) { + children._ = 1; + } else { + children._ = 2; + vnode.patchFlag |= 1024; + } + } } - if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(children)) { + children = { default: children, _ctx: currentRenderingInstance }; + type = 32; + } else { + children = String(children); + if (shapeFlag & 64) { + type = 16; + children = [createTextVNode(children)]; + } else { + type = 8; } - return data; - }], - - transformResponse: [function transformResponse(data) { - var transitional = this.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; - - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw enhanceError(e, this, 'E_JSON_PARSE'); - } - throw e; + } + vnode.children = children; + vnode.shapeFlag |= type; +} +function mergeProps(...args) { + const ret = {}; + for (let i = 0; i < args.length; i++) { + const toMerge = args[i]; + for (const key in toMerge) { + if (key === "class") { + if (ret.class !== toMerge.class) { + ret.class = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeClass)([ret.class, toMerge.class]); + } + } else if (key === "style") { + ret.style = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.normalizeStyle)([ret.style, toMerge.style]); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { + const existing = ret[key]; + const incoming = toMerge[key]; + if (incoming && existing !== incoming && !((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(existing) && existing.includes(incoming))) { + ret[key] = existing ? [].concat(existing, incoming) : incoming; } + } else if (key !== "") { + ret[key] = toMerge[key]; } } - - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; } -}; + return ret; +} +function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { + callWithAsyncErrorHandling(hook, instance, 7, [ + vnode, + prevVNode + ]); +} -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' +const emptyAppContext = createAppContext(); +let uid = 0; +function createComponentInstance(vnode, parent, suspense) { + const type = vnode.type; + const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; + const instance = { + uid: uid++, + vnode, + type, + parent, + appContext, + root: null, + // to be immediately set + next: null, + subTree: null, + // will be set synchronously right after creation + effect: null, + update: null, + // will be set synchronously right after creation + scope: new _vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.EffectScope( + true + /* detached */ + ), + render: null, + proxy: null, + exposed: null, + exposeProxy: null, + withProxy: null, + provides: parent ? parent.provides : Object.create(appContext.provides), + accessCache: null, + renderCache: [], + // local resolved assets + components: null, + directives: null, + // resolved props and emits options + propsOptions: normalizePropsOptions(type, appContext), + emitsOptions: normalizeEmitsOptions(type, appContext), + // emit + emit: null, + // to be set immediately + emitted: null, + // props default value + propsDefaults: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + // inheritAttrs + inheritAttrs: type.inheritAttrs, + // state + ctx: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + data: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + props: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + attrs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + slots: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + refs: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + setupState: _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, + setupContext: null, + attrsProxy: null, + slotsProxy: null, + // suspense related + suspense, + suspenseId: suspense ? suspense.pendingId : 0, + asyncDep: null, + asyncResolved: false, + // lifecycle hooks + // not using enums here because it results in computed properties + isMounted: false, + isUnmounted: false, + isDeactivated: false, + bc: null, + c: null, + bm: null, + m: null, + bu: null, + u: null, + um: null, + bum: null, + da: null, + a: null, + rtg: null, + rtc: null, + ec: null, + sp: null + }; + if (true) { + instance.ctx = createDevRenderContext(instance); + } else {} + instance.root = parent ? parent.root : instance; + instance.emit = emit.bind(null, instance); + if (vnode.ce) { + vnode.ce(instance); } + return instance; +} +let currentInstance = null; +const getCurrentInstance = () => { + if ( true && isInComputedGetter) { + warn$1( + `getCurrentInstance() called inside a computed getter. This is incorrect usage as computed getters are not guaranteed to be executed with an active component instance. If you are using a composable inside a computed getter, move it ouside to the setup scope.` + ); + } + return currentInstance || currentRenderingInstance; }; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/bind.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/helpers/bind.js ***! - \************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); +let internalSetCurrentInstance; +let setInSSRSetupState; +{ + const g = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.getGlobalThis)(); + const registerGlobalSetter = (key, setter) => { + let setters; + if (!(setters = g[key])) + setters = g[key] = []; + setters.push(setter); + return (v) => { + if (setters.length > 1) + setters.forEach((set) => set(v)); + else + setters[0](v); + }; }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/buildURL.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/buildURL.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); + internalSetCurrentInstance = registerGlobalSetter( + `__VUE_INSTANCE_SETTERS__`, + (v) => currentInstance = v + ); + setInSSRSetupState = registerGlobalSetter( + `__VUE_SSR_SETTERS__`, + (v) => isInSSRComponentSetup = v + ); } - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; +const setCurrentInstance = (instance) => { + internalSetCurrentInstance(instance); + instance.scope.on(); +}; +const unsetCurrentInstance = () => { + currentInstance && currentInstance.scope.off(); + internalSetCurrentInstance(null); +}; +const isBuiltInTag = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.makeMap)("slot,component"); +function validateComponentName(name, config) { + const appIsNativeTag = config.isNativeTag || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NO; + if (isBuiltInTag(name) || appIsNativeTag(name)) { + warn$1( + "Do not use built-in or reserved HTML elements as component id: " + name + ); } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; +} +function isStatefulComponent(instance) { + return instance.vnode.shapeFlag & 4; +} +let isInSSRComponentSetup = false; +function setupComponent(instance, isSSR = false) { + isSSR && setInSSRSetupState(isSSR); + const { props, children } = instance.vnode; + const isStateful = isStatefulComponent(instance); + initProps(instance, props, isStateful, isSSR); + initSlots(instance, children); + const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; + isSSR && setInSSRSetupState(false); + return setupResult; +} +function setupStatefulComponent(instance, isSSR) { + var _a; + const Component = instance.type; + if (true) { + if (Component.name) { + validateComponentName(Component.name, instance.appContext.config); + } + if (Component.components) { + const names = Object.keys(Component.components); + for (let i = 0; i < names.length; i++) { + validateComponentName(names[i], instance.appContext.config); } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; + } + if (Component.directives) { + const names = Object.keys(Component.directives); + for (let i = 0; i < names.length; i++) { + validateDirectiveName(names[i]); } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); + } + if (Component.compilerOptions && isRuntimeOnly()) { + warn$1( + `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` + ); + } } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); + instance.accessCache = /* @__PURE__ */ Object.create(null); + instance.proxy = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(new Proxy(instance.ctx, PublicInstanceProxyHandlers)); + if (true) { + exposePropsOnRenderContext(instance); + } + const { setup } = Component; + if (setup) { + const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; + setCurrentInstance(instance); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + const setupResult = callWithErrorHandling( + setup, + instance, + 0, + [ + true ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly)(instance.props) : 0, + setupContext + ] + ); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); + unsetCurrentInstance(); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(setupResult)) { + setupResult.then(unsetCurrentInstance, unsetCurrentInstance); + if (isSSR) { + return setupResult.then((resolvedResult) => { + handleSetupResult(instance, resolvedResult, isSSR); + }).catch((e) => { + handleError(e, instance, 0); + }); + } else { + instance.asyncDep = setupResult; + if ( true && !instance.suspense) { + const name = (_a = Component.name) != null ? _a : "Anonymous"; + warn$1( + `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` + ); + } + } + } else { + handleSetupResult(instance, setupResult, isSSR); } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } else { + finishComponentSetup(instance, isSSR); } - - return url; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/combineURLs.js": -/*!*******************************************************!*\ - !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! - \*******************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/cookies.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/helpers/cookies.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); +} +function handleSetupResult(instance, setupResult, isSSR) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(setupResult)) { + if (instance.type.__ssrInlineRender) { + instance.ssrRender = setupResult; + } else { + instance.render = setupResult; + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(setupResult)) { + if ( true && isVNode(setupResult)) { + warn$1( + `setup() should not return VNodes directly - return a render function instead.` + ); + } + if (true) { + instance.devtoolsRawSetupState = setupResult; + } + instance.setupState = (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)(setupResult); + if (true) { + exposeSetupStateOnRenderContext(instance); + } + } else if ( true && setupResult !== void 0) { + warn$1( + `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` + ); + } + finishComponentSetup(instance, isSSR); +} +let compile; +let installWithProxy; +function registerRuntimeCompiler(_compile) { + compile = _compile; + installWithProxy = (i) => { + if (i.render._rc) { + i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); + } + }; +} +const isRuntimeOnly = () => !compile; +function finishComponentSetup(instance, isSSR, skipOptions) { + const Component = instance.type; + if (!instance.render) { + if (!isSSR && compile && !Component.render) { + const template = Component.template || resolveMergedOptions(instance).template; + if (template) { + if (true) { + startMeasure(instance, `compile`); } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": -/*!*********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! - \********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; + const { isCustomElement, compilerOptions } = instance.appContext.config; + const { delimiters, compilerOptions: componentCompilerOptions } = Component; + const finalCompilerOptions = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + { + isCustomElement, + delimiters + }, + compilerOptions + ), + componentCompilerOptions + ); + Component.render = compile(template, finalCompilerOptions); + if (true) { + endMeasure(instance, `compile`); } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": -/*!***************************************************************!*\ - !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; } - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } + instance.render = Component.render || _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP; + if (installWithProxy) { + installWithProxy(instance); } - }); - - return parsed; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/spread.js": -/*!**************************************************!*\ - !*** ./node_modules/axios/lib/helpers/spread.js ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/validator.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/validator.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var pkg = __webpack_require__(/*! ./../../package.json */ "./node_modules/axios/package.json"); - -var validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -var deprecatedWarnings = {}; -var currentVerArr = pkg.version.split('.'); - -/** - * Compare package versions - * @param {string} version - * @param {string?} thanVersion - * @returns {boolean} - */ -function isOlderVersion(version, thanVersion) { - var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; - var destVer = version.split('.'); - for (var i = 0; i < 3; i++) { - if (pkgVersionArr[i] > destVer[i]) { - return true; - } else if (pkgVersionArr[i] < destVer[i]) { - return false; + } + if (true) { + setCurrentInstance(instance); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.pauseTracking)(); + try { + applyOptions(instance); + } finally { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.resetTracking)(); + unsetCurrentInstance(); + } + } + if ( true && !Component.render && instance.render === _vue_shared__WEBPACK_IMPORTED_MODULE_1__.NOOP && !isSSR) { + if (!compile && Component.template) { + warn$1( + `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` ) + ); + } else { + warn$1(`Component is missing template or render function.`); } } - return false; } - -/** - * Transitional option validator - * @param {function|boolean?} validator - * @param {string?} version - * @param {string} message - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - var isDeprecated = version && isOlderVersion(version); - - function formatMessage(opt, desc) { - return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); +function getAttrsProxy(instance) { + return instance.attrsProxy || (instance.attrsProxy = new Proxy( + instance.attrs, + true ? { + get(target, key) { + markAttrsAccessed(); + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$attrs"); + return target[key]; + }, + set() { + warn$1(`setupContext.attrs is readonly.`); + return false; + }, + deleteProperty() { + warn$1(`setupContext.attrs is readonly.`); + return false; + } + } : 0 + )); +} +function getSlotsProxy(instance) { + return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, { + get(target, key) { + (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.track)(instance, "get", "$slots"); + return target[key]; + } + })); +} +function createSetupContext(instance) { + const expose = (exposed) => { + if (true) { + if (instance.exposed) { + warn$1(`expose() should be called only once per setup().`); + } + if (exposed != null) { + let exposedType = typeof exposed; + if (exposedType === "object") { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(exposed)) { + exposedType = "array"; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(exposed)) { + exposedType = "ref"; + } + } + if (exposedType !== "object") { + warn$1( + `expose() should be passed a plain object, received ${exposedType}.` + ); + } + } + } + instance.exposed = exposed || {}; + }; + if (true) { + return Object.freeze({ + get attrs() { + return getAttrsProxy(instance); + }, + get slots() { + return getSlotsProxy(instance); + }, + get emit() { + return (event, ...args) => instance.emit(event, ...args); + }, + expose + }); + } else {} +} +function getExposeProxy(instance) { + if (instance.exposed) { + return instance.exposeProxy || (instance.exposeProxy = new Proxy((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.proxyRefs)((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.markRaw)(instance.exposed)), { + get(target, key) { + if (key in target) { + return target[key]; + } else if (key in publicPropertiesMap) { + return publicPropertiesMap[key](instance); + } + }, + has(target, key) { + return key in target || key in publicPropertiesMap; + } + })); } - - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new Error(formatMessage(opt, ' has been removed in ' + version)); +} +const classifyRE = /(?:^|[-_])(\w)/g; +const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); +function getComponentName(Component, includeInferred = true) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function formatComponentName(instance, Component, isRoot = false) { + let name = getComponentName(Component); + if (!name && Component.__file) { + const match = Component.__file.match(/([^/\\]+)\.\w+$/); + if (match) { + name = match[1]; } + } + if (!name && instance && instance.parent) { + const inferFromRegistry = (registry) => { + for (const key in registry) { + if (registry[key] === Component) { + return key; + } + } + }; + name = inferFromRegistry( + instance.components || instance.parent.type.components + ) || inferFromRegistry(instance.appContext.components); + } + return name ? classify(name) : isRoot ? `App` : `Anonymous`; +} +function isClassComponent(value) { + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value) && "__vccOpts" in value; +} - if (isDeprecated && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); +let isInComputedGetter = false; +function wrapComputedGetter(getter) { + return () => { + isInComputedGetter = true; + try { + return getter(); + } finally { + isInComputedGetter = false; } - - return validator ? validator(value, opt, opts) : true; }; +} +const computed = (getterOrOptions, debugOptions) => { + if (true) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(getterOrOptions)) { + getterOrOptions = wrapComputedGetter(getterOrOptions); + } else { + getterOrOptions.get = wrapComputedGetter(getterOrOptions.get); + } + } + return (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.computed)(getterOrOptions, debugOptions, isInSSRComponentSetup); }; -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new TypeError('options must be an object'); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new TypeError('option ' + opt + ' must be ' + result); +function h(type, propsOrChildren, children) { + const l = arguments.length; + if (l === 2) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(propsOrChildren) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(propsOrChildren)) { + if (isVNode(propsOrChildren)) { + return createVNode(type, null, [propsOrChildren]); } - continue; + return createVNode(type, propsOrChildren); + } else { + return createVNode(type, null, propsOrChildren); } - if (allowUnknown !== true) { - throw Error('Unknown option ' + opt); + } else { + if (l > 3) { + children = Array.prototype.slice.call(arguments, 2); + } else if (l === 3 && isVNode(children)) { + children = [children]; } + return createVNode(type, propsOrChildren, children); } } -module.exports = { - isOlderVersion: isOlderVersion, - assertOptions: assertOptions, - validators: validators -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/utils.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/utils.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; +function initCustomFormatter() { + if ( false || typeof window === "undefined") { + return; + } + const vueStyle = { style: "color:#3ba776" }; + const numberStyle = { style: "color:#1677ff" }; + const stringStyle = { style: "color:#f5222d" }; + const keywordStyle = { style: "color:#eb2f96" }; + const formatter = { + header(obj) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj)) { + return null; + } + if (obj.__isVue) { + return ["div", vueStyle, `VueInstance`]; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isRef)(obj)) { + return [ + "div", + {}, + ["span", vueStyle, genRefFlag(obj)], + "<", + formatValue(obj.value), + `>` + ]; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReactive)(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], + "<", + formatValue(obj), + `>${(0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj) ? ` (readonly)` : ``}` + ]; + } else if ((0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.isReadonly)(obj)) { + return [ + "div", + {}, + ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], + "<", + formatValue(obj), + ">" + ]; + } + return null; + }, + hasBody(obj) { + return obj && obj.__isVue; + }, + body(obj) { + if (obj && obj.__isVue) { + return [ + "div", + {}, + ...formatInstance(obj.$) + ]; + } + } + }; + function formatInstance(instance) { + const blocks = []; + if (instance.type.props && instance.props) { + blocks.push(createInstanceBlock("props", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.props))); + } + if (instance.setupState !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { + blocks.push(createInstanceBlock("setup", instance.setupState)); + } + if (instance.data !== _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { + blocks.push(createInstanceBlock("data", (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(instance.data))); + } + const computed = extractKeys(instance, "computed"); + if (computed) { + blocks.push(createInstanceBlock("computed", computed)); + } + const injected = extractKeys(instance, "inject"); + if (injected) { + blocks.push(createInstanceBlock("injected", injected)); + } + blocks.push([ + "div", + {}, + [ + "span", + { + style: keywordStyle.style + ";opacity:0.66" + }, + "$ (internal): " + ], + ["object", { object: instance }] + ]); + return blocks; + } + function createInstanceBlock(type, target) { + target = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, target); + if (!Object.keys(target).length) { + return ["span", {}]; + } + return [ + "div", + { style: "line-height:1.25em;margin-bottom:0.6em" }, + [ + "div", + { + style: "color:#476582" + }, + type + ], + [ + "div", + { + style: "padding-left:1.25em" + }, + ...Object.keys(target).map((key) => { + return [ + "div", + {}, + ["span", keywordStyle, key + ": "], + formatValue(target[key], false) + ]; + }) + ] + ]; + } + function formatValue(v, asRaw = true) { + if (typeof v === "number") { + return ["span", numberStyle, v]; + } else if (typeof v === "string") { + return ["span", stringStyle, JSON.stringify(v)]; + } else if (typeof v === "boolean") { + return ["span", keywordStyle, v]; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(v)) { + return ["object", { object: asRaw ? (0,_vue_reactivity__WEBPACK_IMPORTED_MODULE_0__.toRaw)(v) : v }]; + } else { + return ["span", stringStyle, String(v)]; + } + } + function extractKeys(instance, type) { + const Comp = instance.type; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(Comp)) { + return; + } + const extracted = {}; + for (const key in instance.ctx) { + if (isKeyOfType(Comp, key, type)) { + extracted[key] = instance.ctx[key]; + } + } + return extracted; + } + function isKeyOfType(Comp, key, type) { + const opts = Comp[type]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(opts) && opts.includes(key) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(opts) && key in opts) { + return true; + } + if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { + return true; + } + if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { + return true; + } + } + function genRefFlag(v) { + if (isShallow(v)) { + return `ShallowRef`; + } + if (v.effect) { + return `ComputedRef`; + } + return `Ref`; + } + if (window.devtoolsFormatters) { + window.devtoolsFormatters.push(formatter); + } else { + window.devtoolsFormatters = [formatter]; + } } -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; +function withMemo(memo, render, cache, index) { + const cached = cache[index]; + if (cached && isMemoSame(cached, memo)) { + return cached; + } + const ret = render(); + ret.memo = memo.slice(); + return cache[index] = ret; } - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +function isMemoSame(cached, memo) { + const prev = cached.memo; + if (prev.length != memo.length) { + return false; + } + for (let i = 0; i < prev.length; i++) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hasChanged)(prev[i], memo[i])) { + return false; + } + } + if (isBlockTreeEnabled > 0 && currentBlock) { + currentBlock.push(cached); + } + return true; } -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} +const version = "3.4.6"; +const warn = true ? warn$1 : 0; +const ErrorTypeStrings = ErrorTypeStrings$1 ; +const devtools = true ? devtools$1 : 0; +const setDevtoolsHook = true ? setDevtoolsHook$1 : 0; +const _ssrUtils = { + createComponentInstance, + setupComponent, + renderComponentRoot, + setCurrentRenderingInstance, + isVNode: isVNode, + normalizeVNode +}; +const ssrUtils = _ssrUtils ; +const resolveFilter = null; +const compatUtils = null; +const DeprecationTypes = null; -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; - - -/***/ }), - -/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js": -/*!********************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js ***! - \********************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - props: { - message: { - type: String - } - }, - methods: { - success: function success() { - window.app.notify.success('Copied!'); - } - }, - data: function data() { - return { - copyData: this.message - }; - } -}); /***/ }), -/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa": -/*!************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa ***! - \************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js ***! + \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ render: () => (/* binding */ render) -/* harmony export */ }); -/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); - -function render(_ctx, _cache, $props, $setup, $data, $options) { - return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", { - onClick: _cache[0] || (_cache[0] = function () { - return $options.success && $options.success.apply($options, arguments); - }), - "class": "btn btn-outline-primary" - }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default")])]); -} - -/***/ }), - -/***/ "./resources/js/app.js": -/*!*****************************!*\ - !*** ./resources/js/app.js ***! - \*****************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -__webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js"); - -// Vue Components -__webpack_require__(/*! ./vue-components */ "./resources/js/vue-components.js"); - -// Script Components -__webpack_require__(/*! ./script-components */ "./resources/js/script-components.js"); - -/***/ }), - -/***/ "./resources/js/bootstrap.js": -/*!***********************************!*\ - !*** ./resources/js/bootstrap.js ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js"); -window.clipboard = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/clipboard.js"); -window.bootstrap = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.esm.js"); +/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), +/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), +/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Comment), +/* harmony export */ DeprecationTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.DeprecationTypes), +/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.EffectScope), +/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), +/* harmony export */ ErrorTypeStrings: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ErrorTypeStrings), +/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment), +/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), +/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), +/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static), +/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Suspense), +/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Teleport), +/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Text), +/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), +/* harmony export */ Transition: () => (/* binding */ Transition), +/* harmony export */ TransitionGroup: () => (/* binding */ TransitionGroup), +/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), +/* harmony export */ VueElement: () => (/* binding */ VueElement), +/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber), +/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), +/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), +/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.camelize), +/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.capitalize), +/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), +/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.compatUtils), +/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.computed), +/* harmony export */ createApp: () => (/* binding */ createApp), +/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createBlock), +/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), +/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), +/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), +/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), +/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), +/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer), +/* harmony export */ createSSRApp: () => (/* binding */ createSSRApp), +/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createSlots), +/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), +/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), +/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode), +/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.customRef), +/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), +/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent), +/* harmony export */ defineCustomElement: () => (/* binding */ defineCustomElement), +/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineEmits), +/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineExpose), +/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineModel), +/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineOptions), +/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineProps), +/* harmony export */ defineSSRCustomElement: () => (/* binding */ defineSSRCustomElement), +/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineSlots), +/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.devtools), +/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effect), +/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.effectScope), +/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), +/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), +/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), +/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), +/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h), +/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.handleError), +/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), +/* harmony export */ hydrate: () => (/* binding */ hydrate), +/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), +/* harmony export */ initDirectivesForSSR: () => (/* binding */ initDirectivesForSSR), +/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.inject), +/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), +/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isProxy), +/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReactive), +/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isReadonly), +/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRef), +/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), +/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isShallow), +/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isVNode), +/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.markRaw), +/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), +/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeModels), +/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.mergeProps), +/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick), +/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), +/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), +/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), +/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onActivated), +/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), +/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), +/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), +/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), +/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), +/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted), +/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), +/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), +/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), +/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), +/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), +/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated), +/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.openBlock), +/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.popScopeId), +/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.provide), +/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), +/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), +/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), +/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.reactive), +/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.readonly), +/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ref), +/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), +/* harmony export */ render: () => (/* binding */ render), +/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderList), +/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.renderSlot), +/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), +/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), +/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), +/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), +/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), +/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), +/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), +/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), +/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), +/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), +/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.shallowRef), +/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), +/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), +/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.stop), +/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), +/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), +/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toHandlers), +/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRaw), +/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRef), +/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toRefs), +/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.toValue), +/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), +/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.triggerRef), +/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.unref), +/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useAttrs), +/* harmony export */ useCssModule: () => (/* binding */ useCssModule), +/* harmony export */ useCssVars: () => (/* binding */ useCssVars), +/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useModel), +/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), +/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useSlots), +/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), +/* harmony export */ vModelCheckbox: () => (/* binding */ vModelCheckbox), +/* harmony export */ vModelDynamic: () => (/* binding */ vModelDynamic), +/* harmony export */ vModelRadio: () => (/* binding */ vModelRadio), +/* harmony export */ vModelSelect: () => (/* binding */ vModelSelect), +/* harmony export */ vModelText: () => (/* binding */ vModelText), +/* harmony export */ vShow: () => (/* binding */ vShow), +/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.version), +/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn), +/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watch), +/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchEffect), +/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), +/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), +/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), +/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withCtx), +/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDefaults), +/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withDirectives), +/* harmony export */ withKeys: () => (/* binding */ withKeys), +/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withMemo), +/* harmony export */ withModifiers: () => (/* binding */ withModifiers), +/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.withScopeId) +/* harmony export */ }); +/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); +/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); +/* harmony import */ var _vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js"); -/** - * We'll load the axios HTTP library which allows us to easily issue requests - * to our Laravel back-end. This library automatically handles sending the - * CSRF token as a header based on the value of the "XSRF" token cookie. - */ -window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); -window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -/** - * Next we will register the CSRF Token as a common header with Axios so that - * all outgoing HTTP requests automatically have it attached. This is just - * a simple convenience so we don't have to attach every token manually. - */ -var token = document.head.querySelector('meta[name="csrf-token"]'); -if (token) { - window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; -} else { - console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); -} +const svgNS = "http://www.w3.org/2000/svg"; +const mathmlNS = "http://www.w3.org/1998/Math/MathML"; +const doc = typeof document !== "undefined" ? document : null; +const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); +const nodeOps = { + insert: (child, parent, anchor) => { + parent.insertBefore(child, anchor || null); + }, + remove: (child) => { + const parent = child.parentNode; + if (parent) { + parent.removeChild(child); + } + }, + createElement: (tag, namespace, is, props) => { + const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0); + if (tag === "select" && props && props.multiple != null) { + el.setAttribute("multiple", props.multiple); + } + return el; + }, + createText: (text) => doc.createTextNode(text), + createComment: (text) => doc.createComment(text), + setText: (node, text) => { + node.nodeValue = text; + }, + setElementText: (el, text) => { + el.textContent = text; + }, + parentNode: (node) => node.parentNode, + nextSibling: (node) => node.nextSibling, + querySelector: (selector) => doc.querySelector(selector), + setScopeId(el, id) { + el.setAttribute(id, ""); + }, + // __UNSAFE__ + // Reason: innerHTML. + // Static content here can only come from compiled templates. + // As long as the user only uses trusted templates, this is safe. + insertStaticContent(content, parent, anchor, namespace, start, end) { + const before = anchor ? anchor.previousSibling : parent.lastChild; + if (start && (start === end || start.nextSibling)) { + while (true) { + parent.insertBefore(start.cloneNode(true), anchor); + if (start === end || !(start = start.nextSibling)) + break; + } + } else { + templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content; + const template = templateContainer.content; + if (namespace === "svg" || namespace === "mathml") { + const wrapper = template.firstChild; + while (wrapper.firstChild) { + template.appendChild(wrapper.firstChild); + } + template.removeChild(wrapper); + } + parent.insertBefore(template, anchor); + } + return [ + // first + before ? before.nextSibling : parent.firstChild, + // last + anchor ? anchor.previousSibling : parent.lastChild + ]; + } +}; -/** - * Echo exposes an expressive API for subscribing to channels and listening - * for events that are broadcast by Laravel. Echo and event broadcasting - * allows your team to easily build robust real-time web applications. - */ - - -window.Pusher = __webpack_require__(/*! pusher-js */ "./node_modules/pusher-js/dist/web/pusher.js"); -window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({ - broadcaster: 'pusher', - key: "beda029944f4b5d0809b", - cluster: "mt1", - forceTLS: true -}); - -/***/ }), - -/***/ "./resources/js/script-components.js": -/*!*******************************************!*\ - !*** ./resources/js/script-components.js ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// Low level components -__webpack_require__(/*! ./script-components/core */ "./resources/js/script-components/core.js"); -__webpack_require__(/*! ./script-components/utilities */ "./resources/js/script-components/utilities.js"); -__webpack_require__(/*! ./script-components/app-events */ "./resources/js/script-components/app-events.js"); -__webpack_require__(/*! ./script-components/echo-events */ "./resources/js/script-components/echo-events.js"); -__webpack_require__(/*! ./script-components/online */ "./resources/js/script-components/online.js"); - -// UI functional level components -__webpack_require__(/*! ./script-components/sidebar */ "./resources/js/script-components/sidebar.js"); -// require('./script-components/mobile'); -__webpack_require__(/*! ./script-components/ajax-forms */ "./resources/js/script-components/ajax-forms.js"); - -// UI UX level components -__webpack_require__(/*! ./script-components/tooltips */ "./resources/js/script-components/tooltips.js"); -__webpack_require__(/*! ./script-components/clipboard */ "./resources/js/script-components/clipboard.js"); - -/***/ }), - -/***/ "./resources/js/script-components/ajax-forms.js": -/*!******************************************************!*\ - !*** ./resources/js/script-components/ajax-forms.js ***! - \******************************************************/ -/***/ (() => { - -/** - * Handling Ajax form submissions - */ -window.ajax = function (_event) { - _event.preventDefault(); - var _form = _event.target.closest('form'); - var _button = _event.target; - if (!_button.hasAttribute('data-formsjs-onclick')) { - _button = _button.closest('button'); - } - if (_button) { - var _originalContent2 = _button.innerHTML; - var _processing = '<i class="fas fa-circle-notch fa-spin bmx-fade-in"></i> '; - _button.innerHTML = _processing + _originalContent2; - } - if (_form) { - var _method = _form.method.toLowerCase(); - var _data = new FormData(_form); - window.axios[_method](_form.action, _data, { - headers: { - 'Content-Type': 'multipart/form-data' - } - }).then(function (response) { - var _modalElement = document.getElementById("".concat(_form.getAttribute('id'), "_Modal")); - if (_modalElement) { - window.bootstrap.Modal.getOrCreateInstance(_modalElement).hide(); - } - - // Event handling - var _event = "".concat(_form.getAttribute('id'), ".success"); - window.app.$events.fire(_event, response.data.data); - if (_button) { - _button.innerHTML = _originalContent; - } - })["catch"](function (error) { - // let _event = `${_form.getAttribute('id')}.error`; - // window.app.$events.fire(_event, error.response.data); - if (error.response && error.response.data) { - [error.response.data.errors].forEach(function (key) { - var _fieldKey = Object.keys(key)[0]; - var _errorMessage = document.createElement('div'); - _errorMessage.classList.add('invalid-feedback'); - _errorMessage.innerText = error.response.data.errors[_fieldKey]; - var _fieldKeySelector = "input[name=\"".concat(_fieldKey, "\"]"); - var _field = document.querySelector(_fieldKeySelector); - if (!_field.classList.contains('is-invalid')) { - _field.classList.add('is-invalid'); - _field.parentNode.appendChild(_errorMessage); - } - window.Forms_validation(); - }); - } - if (_button) { - _button.innerHTML = _originalContent; - } - }); - } +const TRANSITION = "transition"; +const ANIMATION = "animation"; +const vtcKey = Symbol("_vtc"); +const Transition = (props, { slots }) => (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.h)(_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransition, resolveTransitionProps(props), slots); +Transition.displayName = "Transition"; +const DOMTransitionPropsValidators = { + name: String, + type: String, + css: { + type: Boolean, + default: true + }, + duration: [String, Number, Object], + enterFromClass: String, + enterActiveClass: String, + enterToClass: String, + appearFromClass: String, + appearActiveClass: String, + appearToClass: String, + leaveFromClass: String, + leaveActiveClass: String, + leaveToClass: String }; -window.ajaxDebounced = window.app.debounce(window.ajax); -window.ajaxWithRefresh = function (event) { - window.ajax(event); - setTimeout(function () { - window.Livewire.dispatch('refresh'); - setTimeout(function () { - window.FormsJS(); - window.turnOnTooltips(); - }, 1000); - }, 1000); +const TransitionPropsValidators = Transition.props = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)( + {}, + _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators, + DOMTransitionPropsValidators +); +const callHook = (hook, args = []) => { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook)) { + hook.forEach((h2) => h2(...args)); + } else if (hook) { + hook(...args); + } }; - -/***/ }), - -/***/ "./resources/js/script-components/app-events.js": -/*!******************************************************!*\ - !*** ./resources/js/script-components/app-events.js ***! - \******************************************************/ -/***/ (() => { - -/** - * Location for handling events from the app. - */ -// document.addEventListener('DOMContentLoaded', (event) => { -// window.app.$events.listen('UserForm.success', () => { -// window.notify.info('WHOA'); -// }); -// }); - -/***/ }), - -/***/ "./resources/js/script-components/clipboard.js": -/*!*****************************************************!*\ - !*** ./resources/js/script-components/clipboard.js ***! - \*****************************************************/ -/***/ (() => { - -window.copyToClipboard = function (_message) { - window.navigator.clipboard.writeText(_message).then(function () { - window.app.notify.success('Copied!'); - }); +const hasExplicitCallback = (hook) => { + return hook ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; }; - -/***/ }), - -/***/ "./resources/js/script-components/core.js": -/*!************************************************!*\ - !*** ./resources/js/script-components/core.js ***! - \************************************************/ -/***/ (() => { - -/** - * The following component is a shared event system - * this means you can trigger events anywhere - * and listen to them anywhere. - */ -window.app.$events = { - _events: {}, - fire: function fire(name) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (!this._events[name]) { - throw new Error("Can't emit an event. Event \"".concat(name, "\" doesn't exits.")); - } - var fireCallbacks = function fireCallbacks(callback) { - callback(data); - }; - this._events[name].forEach(fireCallbacks); - }, - listen: function listen(name, listener) { - if (!this._events[name]) { - this._events[name] = []; - } - this._events[name].push(listener); - }, - removeListener: function removeListener(name, listenerToRemove) { - if (!this._events[name]) { - throw new Error("Can't remove a listener. Event \"".concat(name, "\" doesn't exits.")); +function resolveTransitionProps(rawProps) { + const baseProps = {}; + for (const key in rawProps) { + if (!(key in DOMTransitionPropsValidators)) { + baseProps[key] = rawProps[key]; } - var filterListeners = function filterListeners(listener) { - return listener !== listenerToRemove; - }; - this._events[name] = this._events[name].filter(filterListeners); } -}; - -/***/ }), - -/***/ "./resources/js/script-components/echo-events.js": -/*!*******************************************************!*\ - !*** ./resources/js/script-components/echo-events.js ***! - \*******************************************************/ -/***/ (() => { - -/** - * Location for handling events from Echo. - */ -document.addEventListener('DOMContentLoaded', function (event) { - var generalChannel = window.Echo["private"]('general'); - generalChannel.listen('.general-event', function (data) { - window.app.notify.info(data.data.message); - }); - var userId = window.app.session.user.id; - var userChannel = window.Echo["private"]("App.Models.User.".concat(userId)); - userChannel.listen('.user-event', function (data) { - window.app.notify.info(data.data.message); - }); -}); - -/***/ }), - -/***/ "./resources/js/script-components/online.js": -/*!**************************************************!*\ - !*** ./resources/js/script-components/online.js ***! - \**************************************************/ -/***/ (() => { - -document.addEventListener('DOMContentLoaded', function (event) { - // window.addEventListener('offline', (event) => { - // window.notify.info('The network connection has been lost.'); - // }); - - // window.addEventListener('online', (event) => { - // window.notify.success('The network connection has been restored.'); - // }); -}); - -/***/ }), - -/***/ "./resources/js/script-components/sidebar.js": -/*!***************************************************!*\ - !*** ./resources/js/script-components/sidebar.js ***! - \***************************************************/ -/***/ (() => { - -document.addEventListener('DOMContentLoaded', function (event) { - var _sidebarPreventScroll = function _sidebarPreventScroll(e) { - e.preventDefault(); - e.stopPropagation(); - return false; + if (rawProps.css === false) { + return baseProps; + } + const { + name = "v", + type, + duration, + enterFromClass = `${name}-enter-from`, + enterActiveClass = `${name}-enter-active`, + enterToClass = `${name}-enter-to`, + appearFromClass = enterFromClass, + appearActiveClass = enterActiveClass, + appearToClass = enterToClass, + leaveFromClass = `${name}-leave-from`, + leaveActiveClass = `${name}-leave-active`, + leaveToClass = `${name}-leave-to` + } = rawProps; + const durations = normalizeDuration(duration); + const enterDuration = durations && durations[0]; + const leaveDuration = durations && durations[1]; + const { + onBeforeEnter, + onEnter, + onEnterCancelled, + onLeave, + onLeaveCancelled, + onBeforeAppear = onBeforeEnter, + onAppear = onEnter, + onAppearCancelled = onEnterCancelled + } = baseProps; + const finishEnter = (el, isAppear, done) => { + removeTransitionClass(el, isAppear ? appearToClass : enterToClass); + removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); + done && done(); }; - if (document.querySelector('.sidebar-toggle')) { - document.querySelector('.sidebar-toggle').onclick = function () { - document.querySelector('.sidebar').classList.toggle('toggled'); - document.querySelector('.sidebar-overlay').classList.toggle('toggled'); - document.querySelector('.sidebar-toggle i').classList.toggle('fa-times'); - if (document.querySelector('.sidebar').classList.contains('toggled')) { - document.querySelector('main').addEventListener('wheel', _sidebarPreventScroll, { - passive: false - }); - window.app.destroyPullToRefresh(); - } - if (!document.querySelector('.sidebar').classList.contains('toggled')) { - document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { - passive: false - }); - window.app.pullToRefresh(); - } + const finishLeave = (el, done) => { + el._isLeaving = false; + removeTransitionClass(el, leaveFromClass); + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + done && done(); + }; + const makeEnterHook = (isAppear) => { + return (el, done) => { + const hook = isAppear ? onAppear : onEnter; + const resolve = () => finishEnter(el, isAppear, done); + callHook(hook, [el, resolve]); + nextFrame(() => { + removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); + addTransitionClass(el, isAppear ? appearToClass : enterToClass); + if (!hasExplicitCallback(hook)) { + whenTransitionEnds(el, type, enterDuration, resolve); + } + }); }; - window.addEventListener('resize', function () { - document.querySelector('.sidebar').classList.remove('toggled'); - document.querySelector('.sidebar-overlay').classList.remove('toggled'); - document.querySelector('.sidebar-toggle i').classList.remove('fa-times'); - document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { - passive: false + }; + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)(baseProps, { + onBeforeEnter(el) { + callHook(onBeforeEnter, [el]); + addTransitionClass(el, enterFromClass); + addTransitionClass(el, enterActiveClass); + }, + onBeforeAppear(el) { + callHook(onBeforeAppear, [el]); + addTransitionClass(el, appearFromClass); + addTransitionClass(el, appearActiveClass); + }, + onEnter: makeEnterHook(false), + onAppear: makeEnterHook(true), + onLeave(el, done) { + el._isLeaving = true; + const resolve = () => finishLeave(el, done); + addTransitionClass(el, leaveFromClass); + forceReflow(); + addTransitionClass(el, leaveActiveClass); + nextFrame(() => { + if (!el._isLeaving) { + return; + } + removeTransitionClass(el, leaveFromClass); + addTransitionClass(el, leaveToClass); + if (!hasExplicitCallback(onLeave)) { + whenTransitionEnds(el, type, leaveDuration, resolve); + } }); - }); + callHook(onLeave, [el, resolve]); + }, + onEnterCancelled(el) { + finishEnter(el, false); + callHook(onEnterCancelled, [el]); + }, + onAppearCancelled(el) { + finishEnter(el, true); + callHook(onAppearCancelled, [el]); + }, + onLeaveCancelled(el) { + finishLeave(el); + callHook(onLeaveCancelled, [el]); + } + }); +} +function normalizeDuration(duration) { + if (duration == null) { + return null; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isObject)(duration)) { + return [NumberOf(duration.enter), NumberOf(duration.leave)]; + } else { + const n = NumberOf(duration); + return [n, n]; } - if (window.innerWidth < 990) { - if (document.querySelector('.sidebar-overlay')) { - document.querySelector('.sidebar-overlay').onclick = function () { - document.querySelector('.sidebar').classList.remove('toggled'); - document.querySelector('.sidebar-overlay').classList.remove('toggled'); - document.querySelector('.sidebar-toggle i').classList.remove('fa-times'); - document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { - passive: false - }); - window.app.pullToRefresh(); - }; +} +function NumberOf(val) { + const res = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(val); + if (true) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.assertNumber)(res, "<transition> explicit duration"); + } + return res; +} +function addTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); + (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); +} +function removeTransitionClass(el, cls) { + cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.delete(cls); + if (!_vtc.size) { + el[vtcKey] = void 0; } } -}); - -/***/ }), - -/***/ "./resources/js/script-components/tooltips.js": -/*!****************************************************!*\ - !*** ./resources/js/script-components/tooltips.js ***! - \****************************************************/ -/***/ (() => { - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -window.turnOnTooltips = function () { - var tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); - _toConsumableArray(tooltipTriggerList).map(function (tooltipTriggerEl) { - return new window.bootstrap.Tooltip(tooltipTriggerEl); +} +function nextFrame(cb) { + requestAnimationFrame(() => { + requestAnimationFrame(cb); }); -}; -window.addEventListener('DOMContentLoaded', function () { - window.turnOnTooltips(); -}); - -/***/ }), - -/***/ "./resources/js/script-components/utilities.js": -/*!*****************************************************!*\ - !*** ./resources/js/script-components/utilities.js ***! - \*****************************************************/ -/***/ (() => { - -/* -|-------------------------------------------------------------------------- -| For debouncing needs -|-------------------------------------------------------------------------- -*/ -window.app.debounce = function (func) { - var _this = this; - var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; - var timer; - return function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; +} +let endId = 0; +function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { + const id = el._endId = ++endId; + const resolveIfNotStale = () => { + if (id === el._endId) { + resolve(); } - clearTimeout(timer); - timer = setTimeout(function () { - func.apply(_this, args); - }, timeout); }; -}; - -/***/ }), - -/***/ "./resources/js/vue-components.js": -/*!****************************************!*\ - !*** ./resources/js/vue-components.js ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); - - -// External Components - -// Internal Components -// import CopyButton from './vue-components/CopyButton.vue'; - -// Define App -var vueApp = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createApp)({}); - -// Add Components -vueApp.component('CopyButton', (__webpack_require__(/*! ./vue-components/CopyButton.vue */ "./resources/js/vue-components/CopyButton.vue")["default"])); - -// Mount App -vueApp.mount('#app'); -window.app.vue = vueApp; - -/***/ }), - -/***/ "./node_modules/bootstrap/dist/js/bootstrap.esm.js": -/*!*********************************************************!*\ - !*** ./node_modules/bootstrap/dist/js/bootstrap.esm.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Alert: () => (/* binding */ Alert), -/* harmony export */ Button: () => (/* binding */ Button), -/* harmony export */ Carousel: () => (/* binding */ Carousel), -/* harmony export */ Collapse: () => (/* binding */ Collapse), -/* harmony export */ Dropdown: () => (/* binding */ Dropdown), -/* harmony export */ Modal: () => (/* binding */ Modal), -/* harmony export */ Offcanvas: () => (/* binding */ Offcanvas), -/* harmony export */ Popover: () => (/* binding */ Popover), -/* harmony export */ ScrollSpy: () => (/* binding */ ScrollSpy), -/* harmony export */ Tab: () => (/* binding */ Tab), -/* harmony export */ Toast: () => (/* binding */ Toast), -/* harmony export */ Tooltip: () => (/* binding */ Tooltip) -/* harmony export */ }); -/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/index.js"); -/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/popper.js"); -/*! - * Bootstrap v5.3.1 (https://getbootstrap.com/) - * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ - - -/** - * -------------------------------------------------------------------------- - * Bootstrap dom/data.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - -/** - * Constants - */ - -const elementMap = new Map(); -const Data = { - set(element, key, instance) { - if (!elementMap.has(element)) { - elementMap.set(element, new Map()); - } - const instanceMap = elementMap.get(element); - - // make it clear we only want one instance per element - // can be removed later when multiple key/instances are fine to be used - if (!instanceMap.has(key) && instanceMap.size !== 0) { - // eslint-disable-next-line no-console - console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); - return; + if (explicitTimeout) { + return setTimeout(resolveIfNotStale, explicitTimeout); + } + const { type, timeout, propCount } = getTransitionInfo(el, expectedType); + if (!type) { + return resolve(); + } + const endEvent = type + "end"; + let ended = 0; + const end = () => { + el.removeEventListener(endEvent, onEnd); + resolveIfNotStale(); + }; + const onEnd = (e) => { + if (e.target === el && ++ended >= propCount) { + end(); } - instanceMap.set(key, instance); - }, - get(element, key) { - if (elementMap.has(element)) { - return elementMap.get(element).get(key) || null; + }; + setTimeout(() => { + if (ended < propCount) { + end(); } - return null; - }, - remove(element, key) { - if (!elementMap.has(element)) { - return; + }, timeout + 1); + el.addEventListener(endEvent, onEnd); +} +function getTransitionInfo(el, expectedType) { + const styles = window.getComputedStyle(el); + const getStyleProperties = (key) => (styles[key] || "").split(", "); + const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); + const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); + const transitionTimeout = getTimeout(transitionDelays, transitionDurations); + const animationDelays = getStyleProperties(`${ANIMATION}Delay`); + const animationDurations = getStyleProperties(`${ANIMATION}Duration`); + const animationTimeout = getTimeout(animationDelays, animationDurations); + let type = null; + let timeout = 0; + let propCount = 0; + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; } - const instanceMap = elementMap.get(element); - instanceMap.delete(key); - - // free up element references if there are no instances left for an element - if (instanceMap.size === 0) { - elementMap.delete(element); + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; + propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; } -}; - -/** - * -------------------------------------------------------------------------- - * Bootstrap util/index.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - -const MAX_UID = 1000000; -const MILLISECONDS_MULTIPLIER = 1000; -const TRANSITION_END = 'transitionend'; - -/** - * Properly escape IDs selectors to handle weird IDs - * @param {string} selector - * @returns {string} - */ -const parseSelector = selector => { - if (selector && window.CSS && window.CSS.escape) { - // document.querySelector needs escaping to handle IDs (html5+) containing for instance / - selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); + const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( + getStyleProperties(`${TRANSITION}Property`).toString() + ); + return { + type, + timeout, + propCount, + hasTransform + }; +} +function getTimeout(delays, durations) { + while (delays.length < durations.length) { + delays = delays.concat(delays); } - return selector; -}; + return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); +} +function toMs(s) { + if (s === "auto") + return 0; + return Number(s.slice(0, -1).replace(",", ".")) * 1e3; +} +function forceReflow() { + return document.body.offsetHeight; +} -// Shout-out Angus Croll (https://goo.gl/pxwQGp) -const toType = object => { - if (object === null || object === undefined) { - return `${object}`; +function patchClass(el, value, isSVG) { + const transitionClasses = el[vtcKey]; + if (transitionClasses) { + value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); } - return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); -}; - -/** - * Public Util API - */ - -const getUID = prefix => { - do { - prefix += Math.floor(Math.random() * MAX_UID); - } while (document.getElementById(prefix)); - return prefix; -}; -const getTransitionDurationFromElement = element => { - if (!element) { - return 0; + if (value == null) { + el.removeAttribute("class"); + } else if (isSVG) { + el.setAttribute("class", value); + } else { + el.className = value; } +} - // Get transition-duration of the element - let { - transitionDuration, - transitionDelay - } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); - - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0; +const vShowOldKey = Symbol("_vod"); +const vShow = { + beforeMount(el, { value }, { transition }) { + el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display; + if (transition && value) { + transition.beforeEnter(el); + } else { + setDisplay(el, value); + } + }, + mounted(el, { value }, { transition }) { + if (transition && value) { + transition.enter(el); + } + }, + updated(el, { value, oldValue }, { transition }) { + if (!value === !oldValue) + return; + if (transition) { + if (value) { + transition.beforeEnter(el); + setDisplay(el, true); + transition.enter(el); + } else { + transition.leave(el, () => { + setDisplay(el, false); + }); + } + } else { + setDisplay(el, value); + } + }, + beforeUnmount(el, { value }) { + setDisplay(el, value); } - - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; }; -const triggerTransitionEnd = element => { - element.dispatchEvent(new Event(TRANSITION_END)); -}; -const isElement = object => { - if (!object || typeof object !== 'object') { - return false; +if (true) { + vShow.name = "show"; +} +function setDisplay(el, value) { + el.style.display = value ? el[vShowOldKey] : "none"; +} +function initVShowForSSR() { + vShow.getSSRProps = ({ value }) => { + if (!value) { + return { style: { display: "none" } }; + } + }; +} + +const CSS_VAR_TEXT = Symbol( true ? "CSS_VAR_TEXT" : 0); +function useCssVars(getter) { + const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); + if (!instance) { + true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssVars is called without current active component instance.`); + return; } - if (typeof object.jquery !== 'undefined') { - object = object[0]; + const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => { + Array.from( + document.querySelectorAll(`[data-v-owner="${instance.uid}"]`) + ).forEach((node) => setVarsOnNode(node, vars)); + }; + const setVars = () => { + const vars = getter(instance.proxy); + setVarsOnVNode(instance.subTree, vars); + updateTeleports(vars); + }; + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect)(setVars); + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onMounted)(() => { + const ob = new MutationObserver(setVars); + ob.observe(instance.subTree.el.parentNode, { childList: true }); + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUnmounted)(() => ob.disconnect()); + }); +} +function setVarsOnVNode(vnode, vars) { + if (vnode.shapeFlag & 128) { + const suspense = vnode.suspense; + vnode = suspense.activeBranch; + if (suspense.pendingBranch && !suspense.isHydrating) { + suspense.effects.push(() => { + setVarsOnVNode(suspense.activeBranch, vars); + }); + } } - return typeof object.nodeType !== 'undefined'; -}; -const getElement = object => { - // it's a jQuery object or a node element - if (isElement(object)) { - return object.jquery ? object[0] : object; + while (vnode.component) { + vnode = vnode.component.subTree; } - if (typeof object === 'string' && object.length > 0) { - return document.querySelector(parseSelector(object)); + if (vnode.shapeFlag & 1 && vnode.el) { + setVarsOnNode(vnode.el, vars); + } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment) { + vnode.children.forEach((c) => setVarsOnVNode(c, vars)); + } else if (vnode.type === _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Static) { + let { el, anchor } = vnode; + while (el) { + setVarsOnNode(el, vars); + if (el === anchor) + break; + el = el.nextSibling; + } } - return null; -}; -const isVisible = element => { - if (!isElement(element) || element.getClientRects().length === 0) { - return false; +} +function setVarsOnNode(el, vars) { + if (el.nodeType === 1) { + const style = el.style; + let cssText = ""; + for (const key in vars) { + style.setProperty(`--${key}`, vars[key]); + cssText += `--${key}: ${vars[key]};`; + } + style[CSS_VAR_TEXT] = cssText; } - const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; - // Handle `details` element as its content may falsie appear visible when it is closed - const closedDetails = element.closest('details:not([open])'); - if (!closedDetails) { - return elementIsVisible; +} + +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(next); + if (next && !isCssString) { + if (prev && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(prev)) { + for (const key in prev) { + if (next[key] == null) { + setStyle(style, key, ""); + } + } + } + for (const key in next) { + setStyle(style, key, next[key]); + } + } else { + const currentDisplay = style.display; + if (isCssString) { + if (prev !== next) { + const cssVarText = style[CSS_VAR_TEXT]; + if (cssVarText) { + next += ";" + cssVarText; + } + style.cssText = next; + } + } else if (prev) { + el.removeAttribute("style"); + } + if (vShowOldKey in el) { + style.display = currentDisplay; + } } - if (closedDetails !== element) { - const summary = element.closest('summary'); - if (summary && summary.parentNode !== closedDetails) { - return false; +} +const semicolonRE = /[^\\];\s*$/; +const importantRE = /\s*!important$/; +function setStyle(style, name, val) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(val)) { + val.forEach((v) => setStyle(style, name, v)); + } else { + if (val == null) + val = ""; + if (true) { + if (semicolonRE.test(val)) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `Unexpected semicolon at the end of '${name}' style value: '${val}'` + ); + } } - if (summary === null) { - return false; + if (name.startsWith("--")) { + style.setProperty(name, val); + } else { + const prefixed = autoPrefix(style, name); + if (importantRE.test(val)) { + style.setProperty( + (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(prefixed), + val.replace(importantRE, ""), + "important" + ); + } else { + style[prefixed] = val; + } } } - return elementIsVisible; -}; -const isDisabled = element => { - if (!element || element.nodeType !== Node.ELEMENT_NODE) { - return true; +} +const prefixes = ["Webkit", "Moz", "ms"]; +const prefixCache = {}; +function autoPrefix(style, rawName) { + const cached = prefixCache[rawName]; + if (cached) { + return cached; } - if (element.classList.contains('disabled')) { - return true; + let name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(rawName); + if (name !== "filter" && name in style) { + return prefixCache[rawName] = name; } - if (typeof element.disabled !== 'undefined') { - return element.disabled; + name = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.capitalize)(name); + for (let i = 0; i < prefixes.length; i++) { + const prefixed = prefixes[i] + name; + if (prefixed in style) { + return prefixCache[rawName] = prefixed; + } } - return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; -}; -const findShadowRoot = element => { - if (!document.documentElement.attachShadow) { - return null; + return rawName; +} + +const xlinkNS = "http://www.w3.org/1999/xlink"; +function patchAttr(el, key, value, isSVG, instance) { + if (isSVG && key.startsWith("xlink:")) { + if (value == null) { + el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + const isBoolean = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSpecialBooleanAttr)(key); + if (value == null || isBoolean && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value)) { + el.removeAttribute(key); + } else { + el.setAttribute(key, isBoolean ? "" : value); + } } +} - // Can find the shadow root otherwise it'll return the document - if (typeof element.getRootNode === 'function') { - const root = element.getRootNode(); - return root instanceof ShadowRoot ? root : null; +function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) { + if (key === "innerHTML" || key === "textContent") { + if (prevChildren) { + unmountChildren(prevChildren, parentComponent, parentSuspense); + } + el[key] = value == null ? "" : value; + return; } - if (element instanceof ShadowRoot) { - return element; + const tag = el.tagName; + if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally + !tag.includes("-")) { + el._value = value; + const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value; + const newValue = value == null ? "" : value; + if (oldValue !== newValue) { + el.value = newValue; + } + if (value == null) { + el.removeAttribute(key); + } + return; } - - // when we don't find a shadow root - if (!element.parentNode) { - return null; + let needRemove = false; + if (value === "" || value == null) { + const type = typeof el[key]; + if (type === "boolean") { + value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.includeBooleanAttr)(value); + } else if (value == null && type === "string") { + value = ""; + needRemove = true; + } else if (type === "number") { + value = 0; + needRemove = true; + } } - return findShadowRoot(element.parentNode); -}; -const noop = () => {}; + try { + el[key] = value; + } catch (e) { + if ( true && !needRemove) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, + e + ); + } + } + needRemove && el.removeAttribute(key); +} -/** - * Trick to restart an element's animation - * - * @param {HTMLElement} element - * @return void - * - * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation - */ -const reflow = element => { - element.offsetHeight; // eslint-disable-line no-unused-expressions -}; - -const getjQuery = () => { - if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { - return window.jQuery; - } - return null; -}; -const DOMContentLoadedCallbacks = []; -const onDOMContentLoaded = callback => { - if (document.readyState === 'loading') { - // add listener on the first call when the document is in loading state - if (!DOMContentLoadedCallbacks.length) { - document.addEventListener('DOMContentLoaded', () => { - for (const callback of DOMContentLoadedCallbacks) { - callback(); - } - }); - } - DOMContentLoadedCallbacks.push(callback); +function addEventListener(el, event, handler, options) { + el.addEventListener(event, handler, options); +} +function removeEventListener(el, event, handler, options) { + el.removeEventListener(event, handler, options); +} +const veiKey = Symbol("_vei"); +function patchEvent(el, rawName, prevValue, nextValue, instance = null) { + const invokers = el[veiKey] || (el[veiKey] = {}); + const existingInvoker = invokers[rawName]; + if (nextValue && existingInvoker) { + existingInvoker.value = nextValue; } else { - callback(); + const [name, options] = parseName(rawName); + if (nextValue) { + const invoker = invokers[rawName] = createInvoker(nextValue, instance); + addEventListener(el, name, invoker, options); + } else if (existingInvoker) { + removeEventListener(el, name, existingInvoker, options); + invokers[rawName] = void 0; + } } -}; -const isRTL = () => document.documentElement.dir === 'rtl'; -const defineJQueryPlugin = plugin => { - onDOMContentLoaded(() => { - const $ = getjQuery(); - /* istanbul ignore if */ - if ($) { - const name = plugin.NAME; - const JQUERY_NO_CONFLICT = $.fn[name]; - $.fn[name] = plugin.jQueryInterface; - $.fn[name].Constructor = plugin; - $.fn[name].noConflict = () => { - $.fn[name] = JQUERY_NO_CONFLICT; - return plugin.jQueryInterface; - }; +} +const optionsModifierRE = /(?:Once|Passive|Capture)$/; +function parseName(name) { + let options; + if (optionsModifierRE.test(name)) { + options = {}; + let m; + while (m = name.match(optionsModifierRE)) { + name = name.slice(0, name.length - m[0].length); + options[m[0].toLowerCase()] = true; } - }); -}; -const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { - return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue; -}; -const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { - if (!waitForTransition) { - execute(callback); - return; } - const durationPadding = 5; - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; - let called = false; - const handler = ({ - target - }) => { - if (target !== transitionElement) { + const event = name[2] === ":" ? name.slice(3) : (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(name.slice(2)); + return [event, options]; +} +let cachedNow = 0; +const p = /* @__PURE__ */ Promise.resolve(); +const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); +function createInvoker(initialValue, instance) { + const invoker = (e) => { + if (!e._vts) { + e._vts = Date.now(); + } else if (e._vts <= invoker.attached) { return; } - called = true; - transitionElement.removeEventListener(TRANSITION_END, handler); - execute(callback); + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling)( + patchStopImmediatePropagation(e, invoker.value), + instance, + 5, + [e] + ); }; - transitionElement.addEventListener(TRANSITION_END, handler); - setTimeout(() => { - if (!called) { - triggerTransitionEnd(transitionElement); + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function patchStopImmediatePropagation(e, value) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); + } else { + return value; + } +} + +const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter +key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; +const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => { + const isSVG = namespace === "svg"; + if (key === "class") { + patchClass(el, nextValue, isSVG); + } else if (key === "style") { + patchStyle(el, prevValue, nextValue); + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isOn)(key)) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isModelListener)(key)) { + patchEvent(el, key, prevValue, nextValue, parentComponent); } - }, emulatedDuration); + } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { + patchDOMProp( + el, + key, + nextValue, + prevChildren, + parentComponent, + parentSuspense, + unmountChildren + ); + } else { + if (key === "true-value") { + el._trueValue = nextValue; + } else if (key === "false-value") { + el._falseValue = nextValue; + } + patchAttr(el, key, nextValue, isSVG); + } }; - -/** - * Return the previous/next element of a list. - * - * @param {array} list The list of elements - * @param activeElement The active element - * @param shouldGetNext Choose to get next or previous element - * @param isCycleAllowed - * @return {Element|elem} The proper element - */ -const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { - const listLength = list.length; - let index = list.indexOf(activeElement); - - // if the element does not exist in the list return an element - // depending on the direction and if cycle is allowed - if (index === -1) { - return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]; +function shouldSetAsProp(el, key, value, isSVG) { + if (isSVG) { + if (key === "innerHTML" || key === "textContent") { + return true; + } + if (key in el && isNativeOn(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(value)) { + return true; + } + return false; } - index += shouldGetNext ? 1 : -1; - if (isCycleAllowed) { - index = (index + listLength) % listLength; + if (key === "spellcheck" || key === "draggable" || key === "translate") { + return false; } - return list[Math.max(0, Math.min(index, listLength - 1))]; -}; - -/** - * -------------------------------------------------------------------------- - * Bootstrap dom/event-handler.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const namespaceRegex = /[^.]*(?=\..*)\.|.*/; -const stripNameRegex = /\..*/; -const stripUidRegex = /::\d+$/; -const eventRegistry = {}; // Events storage -let uidEvent = 1; -const customEvents = { - mouseenter: 'mouseover', - mouseleave: 'mouseout' -}; -const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); - -/** - * Private methods - */ - -function makeEventUid(element, uid) { - return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; -} -function getElementEvents(element) { - const uid = makeEventUid(element); - element.uidEvent = uid; - eventRegistry[uid] = eventRegistry[uid] || {}; - return eventRegistry[uid]; -} -function bootstrapHandler(element, fn) { - return function handler(event) { - hydrateObj(event, { - delegateTarget: element - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, fn); + if (key === "form") { + return false; + } + if (key === "list" && el.tagName === "INPUT") { + return false; + } + if (key === "type" && el.tagName === "TEXTAREA") { + return false; + } + if (key === "width" || key === "height") { + const tag = el.tagName; + if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { + return false; } - return fn.apply(element, [event]); - }; + } + if (isNativeOn(key) && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) { + return false; + } + return key in el; } -function bootstrapDelegationHandler(element, selector, fn) { - return function handler(event) { - const domElements = element.querySelectorAll(selector); - for (let { - target - } = event; target && target !== this; target = target.parentNode) { - for (const domElement of domElements) { - if (domElement !== target) { - continue; - } - hydrateObj(event, { - delegateTarget: target - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, selector, fn); - } - return fn.apply(target, [event]); - } - } - }; -} -function findHandler(events, callable, delegationSelector = null) { - return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); -} -function normalizeParameters(originalTypeEvent, handler, delegationFunction) { - const isDelegated = typeof handler === 'string'; - // TODO: tooltip passes `false` instead of selector, so we need to check - const callable = isDelegated ? delegationFunction : handler || delegationFunction; - let typeEvent = getTypeEvent(originalTypeEvent); - if (!nativeEvents.has(typeEvent)) { - typeEvent = originalTypeEvent; - } - return [isDelegated, callable, typeEvent]; -} -function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) { - if (typeof originalTypeEvent !== 'string' || !element) { - return; - } - let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position - // this prevents the handler from being dispatched the same way as mouseover or mouseout does - if (originalTypeEvent in customEvents) { - const wrapFunction = fn => { - return function (event) { - if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { - return fn.call(this, event); - } - }; - }; - callable = wrapFunction(callable); - } - const events = getElementEvents(element); - const handlers = events[typeEvent] || (events[typeEvent] = {}); - const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); - if (previousFunction) { - previousFunction.oneOff = previousFunction.oneOff && oneOff; - return; - } - const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); - const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); - fn.delegationSelector = isDelegated ? handler : null; - fn.callable = callable; - fn.oneOff = oneOff; - fn.uidEvent = uid; - handlers[uid] = fn; - element.addEventListener(typeEvent, fn, isDelegated); -} -function removeHandler(element, events, typeEvent, handler, delegationSelector) { - const fn = findHandler(events[typeEvent], handler, delegationSelector); - if (!fn) { - return; - } - element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); - delete events[typeEvent][fn.uidEvent]; -} -function removeNamespacedHandlers(element, events, typeEvent, namespace) { - const storeElementEvent = events[typeEvent] || {}; - for (const [handlerKey, event] of Object.entries(storeElementEvent)) { - if (handlerKey.includes(namespace)) { - removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineCustomElement(options, hydrate2) { + const Comp = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.defineComponent)(options); + class VueCustomElement extends VueElement { + constructor(initialProps) { + super(Comp, initialProps, hydrate2); } } + VueCustomElement.def = Comp; + return VueCustomElement; } -function getTypeEvent(event) { - // allow to get the native events from namespaced events ('click.bs.button' --> 'click') - event = event.replace(stripNameRegex, ''); - return customEvents[event] || event; -} -const EventHandler = { - on(element, event, handler, delegationFunction) { - addHandler(element, event, handler, delegationFunction, false); - }, - one(element, event, handler, delegationFunction) { - addHandler(element, event, handler, delegationFunction, true); - }, - off(element, originalTypeEvent, handler, delegationFunction) { - if (typeof originalTypeEvent !== 'string' || !element) { - return; - } - const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - const inNamespace = typeEvent !== originalTypeEvent; - const events = getElementEvents(element); - const storeElementEvent = events[typeEvent] || {}; - const isNamespace = originalTypeEvent.startsWith('.'); - if (typeof callable !== 'undefined') { - // Simplest case: handler is passed, remove that listener ONLY. - if (!Object.keys(storeElementEvent).length) { - return; +/*! #__NO_SIDE_EFFECTS__ */ +const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => { + return /* @__PURE__ */ defineCustomElement(options, hydrate); +}; +const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { +}; +class VueElement extends BaseClass { + constructor(_def, _props = {}, hydrate2) { + super(); + this._def = _def; + this._props = _props; + /** + * @internal + */ + this._instance = null; + this._connected = false; + this._resolved = false; + this._numberProps = null; + this._ob = null; + if (this.shadowRoot && hydrate2) { + hydrate2(this._createVNode(), this.shadowRoot); + } else { + if ( true && this.shadowRoot) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` + ); } - removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null); - return; - } - if (isNamespace) { - for (const elementEvent of Object.keys(events)) { - removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); + this.attachShadow({ mode: "open" }); + if (!this._def.__asyncLoader) { + this._resolveProps(this._def); } } - for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { - const handlerKey = keyHandlers.replace(stripUidRegex, ''); - if (!inNamespace || originalTypeEvent.includes(handlerKey)) { - removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); + } + connectedCallback() { + this._connected = true; + if (!this._instance) { + if (this._resolved) { + this._update(); + } else { + this._resolveDef(); } } - }, - trigger(element, event, args) { - if (typeof event !== 'string' || !element) { - return null; - } - const $ = getjQuery(); - const typeEvent = getTypeEvent(event); - const inNamespace = event !== typeEvent; - let jQueryEvent = null; - let bubbles = true; - let nativeDispatch = true; - let defaultPrevented = false; - if (inNamespace && $) { - jQueryEvent = $.Event(event, args); - $(element).trigger(jQueryEvent); - bubbles = !jQueryEvent.isPropagationStopped(); - nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); - defaultPrevented = jQueryEvent.isDefaultPrevented(); - } - const evt = hydrateObj(new Event(event, { - bubbles, - cancelable: true - }), args); - if (defaultPrevented) { - evt.preventDefault(); + } + disconnectedCallback() { + this._connected = false; + if (this._ob) { + this._ob.disconnect(); + this._ob = null; } - if (nativeDispatch) { - element.dispatchEvent(evt); + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => { + if (!this._connected) { + render(null, this.shadowRoot); + this._instance = null; + } + }); + } + /** + * resolve inner component definition (handle possible async component) + */ + _resolveDef() { + this._resolved = true; + for (let i = 0; i < this.attributes.length; i++) { + this._setAttr(this.attributes[i].name); } - if (evt.defaultPrevented && jQueryEvent) { - jQueryEvent.preventDefault(); + this._ob = new MutationObserver((mutations) => { + for (const m of mutations) { + this._setAttr(m.attributeName); + } + }); + this._ob.observe(this, { attributes: true }); + const resolve = (def, isAsync = false) => { + const { props, styles } = def; + let numberProps; + if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props)) { + for (const key in props) { + const opt = props[key]; + if (opt === Number || opt && opt.type === Number) { + if (key in this._props) { + this._props[key] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(this._props[key]); + } + (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key)] = true; + } + } + } + this._numberProps = numberProps; + if (isAsync) { + this._resolveProps(def); + } + this._applyStyles(styles); + this._update(); + }; + const asyncDef = this._def.__asyncLoader; + if (asyncDef) { + asyncDef().then((def) => resolve(def, true)); + } else { + resolve(this._def); } - return evt; } -}; -function hydrateObj(obj, meta = {}) { - for (const [key, value] of Object.entries(meta)) { - try { - obj[key] = value; - } catch (_unused) { - Object.defineProperty(obj, key, { - configurable: true, + _resolveProps(def) { + const { props } = def; + const declaredPropKeys = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props : Object.keys(props || {}); + for (const key of Object.keys(this)) { + if (key[0] !== "_" && declaredPropKeys.includes(key)) { + this._setProp(key, this[key], true, false); + } + } + for (const key of declaredPropKeys.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)) { + Object.defineProperty(this, key, { get() { - return value; + return this._getProp(key); + }, + set(val) { + this._setProp(key, val); } }); } } - return obj; -} - -/** - * -------------------------------------------------------------------------- - * Bootstrap dom/manipulator.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - -function normalizeData(value) { - if (value === 'true') { - return true; - } - if (value === 'false') { - return false; - } - if (value === Number(value).toString()) { - return Number(value); - } - if (value === '' || value === 'null') { - return null; - } - if (typeof value !== 'string') { - return value; - } - try { - return JSON.parse(decodeURIComponent(value)); - } catch (_unused) { - return value; - } -} -function normalizeDataKey(key) { - return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); -} -const Manipulator = { - setDataAttribute(element, key, value) { - element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); - }, - removeDataAttribute(element, key) { - element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); - }, - getDataAttributes(element) { - if (!element) { - return {}; - } - const attributes = {}; - const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); - for (const key of bsKeys) { - let pureKey = key.replace(/^bs/, ''); - pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); - attributes[pureKey] = normalizeData(element.dataset[key]); + _setAttr(key) { + let value = this.getAttribute(key); + const camelKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key); + if (this._numberProps && this._numberProps[camelKey]) { + value = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(value); } - return attributes; - }, - getDataAttribute(element, key) { - return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); - } -}; - -/** - * -------------------------------------------------------------------------- - * Bootstrap util/config.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Class definition - */ - -class Config { - // Getters - static get Default() { - return {}; - } - static get DefaultType() { - return {}; + this._setProp(camelKey, value, false); } - static get NAME() { - throw new Error('You have to implement the static method "NAME", for each component!'); + /** + * @internal + */ + _getProp(key) { + return this._props[key]; } - _getConfig(config) { - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; + /** + * @internal + */ + _setProp(key, val, shouldReflect = true, shouldUpdate = true) { + if (val !== this._props[key]) { + this._props[key] = val; + if (shouldUpdate && this._instance) { + this._update(); + } + if (shouldReflect) { + if (val === true) { + this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), ""); + } else if (typeof val === "string" || typeof val === "number") { + this.setAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key), val + ""); + } else if (!val) { + this.removeAttribute((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(key)); + } + } + } } - _configAfterMerge(config) { - return config; + _update() { + render(this._createVNode(), this.shadowRoot); } - _mergeConfigObj(config, element) { - const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse - - return { - ...this.constructor.Default, - ...(typeof jsonConfig === 'object' ? jsonConfig : {}), - ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}), - ...(typeof config === 'object' ? config : {}) - }; + _createVNode() { + const vnode = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(this._def, (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, this._props)); + if (!this._instance) { + vnode.ce = (instance) => { + this._instance = instance; + instance.isCE = true; + if (true) { + instance.ceReload = (newStyles) => { + if (this._styles) { + this._styles.forEach((s) => this.shadowRoot.removeChild(s)); + this._styles.length = 0; + } + this._applyStyles(newStyles); + this._instance = null; + this._update(); + }; + } + const dispatch = (event, args) => { + this.dispatchEvent( + new CustomEvent(event, { + detail: args + }) + ); + }; + instance.emit = (event, ...args) => { + dispatch(event, args); + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event) !== event) { + dispatch((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event), args); + } + }; + let parent = this; + while (parent = parent && (parent.parentNode || parent.host)) { + if (parent instanceof VueElement) { + instance.parent = parent._instance; + instance.provides = parent._instance.provides; + break; + } + } + }; + } + return vnode; } - _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { - for (const [property, expectedTypes] of Object.entries(configTypes)) { - const value = config[property]; - const valueType = isElement(value) ? 'element' : toType(value); - if (!new RegExp(expectedTypes).test(valueType)) { - throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); - } + _applyStyles(styles) { + if (styles) { + styles.forEach((css) => { + const s = document.createElement("style"); + s.textContent = css; + this.shadowRoot.appendChild(s); + if (true) { + (this._styles || (this._styles = [])).push(s); + } + }); } } } -/** - * -------------------------------------------------------------------------- - * Bootstrap base-component.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const VERSION = '5.3.1'; - -/** - * Class definition - */ - -class BaseComponent extends Config { - constructor(element, config) { - super(); - element = getElement(element); - if (!element) { - return; +function useCssModule(name = "$style") { + { + const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); + if (!instance) { + true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`useCssModule must be called inside setup()`); + return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; } - this._element = element; - this._config = this._getConfig(config); - Data.set(this._element, this.constructor.DATA_KEY, this); - } - - // Public - dispose() { - Data.remove(this._element, this.constructor.DATA_KEY); - EventHandler.off(this._element, this.constructor.EVENT_KEY); - for (const propertyName of Object.getOwnPropertyNames(this)) { - this[propertyName] = null; + const modules = instance.type.__cssModules; + if (!modules) { + true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS modules injected.`); + return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; } + const mod = modules[name]; + if (!mod) { + true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`Current instance does not have CSS module named "${name}".`); + return _vue_shared__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; + } + return mod; } - _queueCallback(callback, element, isAnimated = true) { - executeAfterTransition(callback, element, isAnimated); - } - _getConfig(config) { - config = this._mergeConfigObj(config, this._element); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } +} - // Static - static getInstance(element) { - return Data.get(getElement(element), this.DATA_KEY); - } - static getOrCreateInstance(element, config = {}) { - return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); - } - static get VERSION() { - return VERSION; - } - static get DATA_KEY() { - return `bs.${this.NAME}`; - } - static get EVENT_KEY() { - return `.${this.DATA_KEY}`; - } - static eventName(name) { - return `${name}${this.EVENT_KEY}`; +const positionMap = /* @__PURE__ */ new WeakMap(); +const newPositionMap = /* @__PURE__ */ new WeakMap(); +const moveCbKey = Symbol("_moveCb"); +const enterCbKey = Symbol("_enterCb"); +const TransitionGroupImpl = { + name: "TransitionGroup", + props: /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({}, TransitionPropsValidators, { + tag: String, + moveClass: String + }), + setup(props, { slots }) { + const instance = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)(); + const state = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.useTransitionState)(); + let prevChildren; + let children; + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.onUpdated)(() => { + if (!prevChildren.length) { + return; + } + const moveClass = props.moveClass || `${props.name || "v"}-move`; + if (!hasCSSTransform( + prevChildren[0].el, + instance.vnode.el, + moveClass + )) { + return; + } + prevChildren.forEach(callPendingCbs); + prevChildren.forEach(recordPosition); + const movedChildren = prevChildren.filter(applyTranslation); + forceReflow(); + movedChildren.forEach((c) => { + const el = c.el; + const style = el.style; + addTransitionClass(el, moveClass); + style.transform = style.webkitTransform = style.transitionDuration = ""; + const cb = el[moveCbKey] = (e) => { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener("transitionend", cb); + el[moveCbKey] = null; + removeTransitionClass(el, moveClass); + } + }; + el.addEventListener("transitionend", cb); + }); + }); + return () => { + const rawProps = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_2__.toRaw)(props); + const cssTransitionProps = resolveTransitionProps(rawProps); + let tag = rawProps.tag || _vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.Fragment; + prevChildren = children; + children = slots.default ? (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren)(slots.default()) : []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.key != null) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( + child, + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) + ); + } else if (true) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(`<TransitionGroup> children must be keyed.`); + } + } + if (prevChildren) { + for (let i = 0; i < prevChildren.length; i++) { + const child = prevChildren[i]; + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks)( + child, + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks)(child, cssTransitionProps, state, instance) + ); + positionMap.set(child, child.el.getBoundingClientRect()); + } + } + return (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createVNode)(tag, null, children); + }; + } +}; +const removeMode = (props) => delete props.mode; +/* @__PURE__ */ removeMode(TransitionGroupImpl.props); +const TransitionGroup = TransitionGroupImpl; +function callPendingCbs(c) { + const el = c.el; + if (el[moveCbKey]) { + el[moveCbKey](); + } + if (el[enterCbKey]) { + el[enterCbKey](); } } +function recordPosition(c) { + newPositionMap.set(c, c.el.getBoundingClientRect()); +} +function applyTranslation(c) { + const oldPos = positionMap.get(c); + const newPos = newPositionMap.get(c); + const dx = oldPos.left - newPos.left; + const dy = oldPos.top - newPos.top; + if (dx || dy) { + const s = c.el.style; + s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; + s.transitionDuration = "0s"; + return c; + } +} +function hasCSSTransform(el, root, moveClass) { + const clone = el.cloneNode(); + const _vtc = el[vtcKey]; + if (_vtc) { + _vtc.forEach((cls) => { + cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); + }); + } + moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); + clone.style.display = "none"; + const container = root.nodeType === 1 ? root : root.parentNode; + container.appendChild(clone); + const { hasTransform } = getTransitionInfo(clone); + container.removeChild(clone); + return hasTransform; +} -/** - * -------------------------------------------------------------------------- - * Bootstrap dom/selector-engine.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - -const getSelector = element => { - let selector = element.getAttribute('data-bs-target'); - if (!selector || selector === '#') { - let hrefAttribute = element.getAttribute('href'); - - // The only valid content that could double as a selector are IDs or classes, - // so everything starting with `#` or `.`. If a "real" URL is used as the selector, - // `document.querySelector` will rightfully complain it is invalid. - // See https://github.com/twbs/bootstrap/issues/32273 - if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) { - return null; +const getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn) ? (value) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.invokeArrayFns)(fn, value) : fn; +}; +function onCompositionStart(e) { + e.target.composing = true; +} +function onCompositionEnd(e) { + const target = e.target; + if (target.composing) { + target.composing = false; + target.dispatchEvent(new Event("input")); + } +} +const assignKey = Symbol("_assign"); +const vModelText = { + created(el, { modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + const castToNumber = number || vnode.props && vnode.props.type === "number"; + addEventListener(el, lazy ? "change" : "input", (e) => { + if (e.target.composing) + return; + let domValue = el.value; + if (trim) { + domValue = domValue.trim(); + } + if (castToNumber) { + domValue = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(domValue); + } + el[assignKey](domValue); + }); + if (trim) { + addEventListener(el, "change", () => { + el.value = el.value.trim(); + }); } - - // Just in case some CMS puts out a full URL with the anchor appended - if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { - hrefAttribute = `#${hrefAttribute.split('#')[1]}`; + if (!lazy) { + addEventListener(el, "compositionstart", onCompositionStart); + addEventListener(el, "compositionend", onCompositionEnd); + addEventListener(el, "change", onCompositionEnd); } - selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; - } - return parseSelector(selector); -}; -const SelectorEngine = { - find(selector, element = document.documentElement) { - return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); - }, - findOne(selector, element = document.documentElement) { - return Element.prototype.querySelector.call(element, selector); }, - children(element, selector) { - return [].concat(...element.children).filter(child => child.matches(selector)); + // set value on mounted so it's after min/max for type="range" + mounted(el, { value }) { + el.value = value == null ? "" : value; }, - parents(element, selector) { - const parents = []; - let ancestor = element.parentNode.closest(selector); - while (ancestor) { - parents.push(ancestor); - ancestor = ancestor.parentNode.closest(selector); + beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (el.composing) + return; + const elValue = number || el.type === "number" ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(el.value) : el.value; + const newValue = value == null ? "" : value; + if (elValue === newValue) { + return; } - return parents; - }, - prev(element, selector) { - let previous = element.previousElementSibling; - while (previous) { - if (previous.matches(selector)) { - return [previous]; + if (document.activeElement === el && el.type !== "range") { + if (lazy) { + return; } - previous = previous.previousElementSibling; - } - return []; - }, - // TODO: this is now unused; remove later along with prev() - next(element, selector) { - let next = element.nextElementSibling; - while (next) { - if (next.matches(selector)) { - return [next]; + if (trim && el.value.trim() === newValue) { + return; } - next = next.nextElementSibling; - } - return []; - }, - focusableChildren(element) { - const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); - return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); - }, - getSelectorFromElement(element) { - const selector = getSelector(element); - if (selector) { - return SelectorEngine.findOne(selector) ? selector : null; } - return null; - }, - getElementFromSelector(element) { - const selector = getSelector(element); - return selector ? SelectorEngine.findOne(selector) : null; - }, - getMultipleElementsFromSelector(element) { - const selector = getSelector(element); - return selector ? SelectorEngine.find(selector) : []; + el.value = newValue; } }; - -/** - * -------------------------------------------------------------------------- - * Bootstrap util/component-functions.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - -const enableDismissTrigger = (component, method = 'hide') => { - const clickEvent = `click.dismiss${component.EVENT_KEY}`; - const name = component.NAME; - EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - if (isDisabled(this)) { - return; - } - const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); - const instance = component.getOrCreateInstance(target); - - // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method - instance[method](); - }); +const vModelCheckbox = { + // #4096 array checkboxes need to be deep traversed + deep: true, + created(el, _, vnode) { + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + const modelValue = el._modelValue; + const elementValue = getValue(el); + const checked = el.checked; + const assign = el[assignKey]; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(modelValue)) { + const index = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(modelValue, elementValue); + const found = index !== -1; + if (checked && !found) { + assign(modelValue.concat(elementValue)); + } else if (!checked && found) { + const filtered = [...modelValue]; + filtered.splice(index, 1); + assign(filtered); + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(modelValue)) { + const cloned = new Set(modelValue); + if (checked) { + cloned.add(elementValue); + } else { + cloned.delete(elementValue); + } + assign(cloned); + } else { + assign(getCheckboxValue(el, checked)); + } + }); + }, + // set initial checked on mount to wait for true-value/false-value + mounted: setChecked, + beforeUpdate(el, binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + setChecked(el, binding, vnode); + } }; - -/** - * -------------------------------------------------------------------------- - * Bootstrap alert.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const NAME$f = 'alert'; -const DATA_KEY$a = 'bs.alert'; -const EVENT_KEY$b = `.${DATA_KEY$a}`; -const EVENT_CLOSE = `close${EVENT_KEY$b}`; -const EVENT_CLOSED = `closed${EVENT_KEY$b}`; -const CLASS_NAME_FADE$5 = 'fade'; -const CLASS_NAME_SHOW$8 = 'show'; - -/** - * Class definition - */ - -class Alert extends BaseComponent { - // Getters - static get NAME() { - return NAME$f; +function setChecked(el, { value, oldValue }, vnode) { + el._modelValue = value; + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { + el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1; + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { + el.checked = value.has(vnode.props.value); + } else if (value !== oldValue) { + el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, getCheckboxValue(el, true)); } - - // Public - close() { - const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); - if (closeEvent.defaultPrevented) { - return; +} +const vModelRadio = { + created(el, { value }, vnode) { + el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); + el[assignKey] = getModelAssigner(vnode); + addEventListener(el, "change", () => { + el[assignKey](getValue(el)); + }); + }, + beforeUpdate(el, { value, oldValue }, vnode) { + el[assignKey] = getModelAssigner(vnode); + if (value !== oldValue) { + el.checked = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(value, vnode.props.value); } - this._element.classList.remove(CLASS_NAME_SHOW$8); - const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); - this._queueCallback(() => this._destroyElement(), this._element, isAnimated); } - - // Private - _destroyElement() { - this._element.remove(); - EventHandler.trigger(this._element, EVENT_CLOSED); - this.dispose(); +}; +const vModelSelect = { + // <select multiple> value need to be deep traversed + deep: true, + created(el, { value, modifiers: { number } }, vnode) { + const isSetModel = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value); + addEventListener(el, "change", () => { + const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( + (o) => number ? (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseToNumber)(getValue(o)) : getValue(o) + ); + el[assignKey]( + el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] + ); + }); + el[assignKey] = getModelAssigner(vnode); + }, + // set value in mounted & updated because <select> relies on its children + // <option>s. + mounted(el, { value }) { + setSelected(el, value); + }, + beforeUpdate(el, _binding, vnode) { + el[assignKey] = getModelAssigner(vnode); + }, + updated(el, { value }) { + setSelected(el, value); } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Alert.getOrCreateInstance(this); - if (typeof config !== 'string') { - return; +}; +function setSelected(el, value) { + const isMultiple = el.multiple; + if (isMultiple && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { + true && (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` + ); + return; + } + for (let i = 0, l = el.options.length; i < l; i++) { + const option = el.options[i]; + const optionValue = getValue(option); + if (isMultiple) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { + option.selected = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, optionValue) > -1; + } else { + option.selected = value.has(optionValue); } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); + } else { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(getValue(option), value)) { + if (el.selectedIndex !== i) + el.selectedIndex = i; + return; } - data[config](this); - }); + } } -} - -/** - * Data API implementation - */ - -enableDismissTrigger(Alert, 'close'); - -/** - * jQuery - */ - -defineJQueryPlugin(Alert); - -/** - * -------------------------------------------------------------------------- - * Bootstrap button.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const NAME$e = 'button'; -const DATA_KEY$9 = 'bs.button'; -const EVENT_KEY$a = `.${DATA_KEY$9}`; -const DATA_API_KEY$6 = '.data-api'; -const CLASS_NAME_ACTIVE$3 = 'active'; -const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; -const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; - -/** - * Class definition - */ - -class Button extends BaseComponent { - // Getters - static get NAME() { - return NAME$e; + if (!isMultiple && el.selectedIndex !== -1) { + el.selectedIndex = -1; } - - // Public - toggle() { - // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method - this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); +} +function getValue(el) { + return "_value" in el ? el._value : el.value; +} +function getCheckboxValue(el, checked) { + const key = checked ? "_trueValue" : "_falseValue"; + return key in el ? el[key] : checked; +} +const vModelDynamic = { + created(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "created"); + }, + mounted(el, binding, vnode) { + callModelHook(el, binding, vnode, null, "mounted"); + }, + beforeUpdate(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); + }, + updated(el, binding, vnode, prevVNode) { + callModelHook(el, binding, vnode, prevVNode, "updated"); } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Button.getOrCreateInstance(this); - if (config === 'toggle') { - data[config](); +}; +function resolveDynamicModel(tagName, type) { + switch (tagName) { + case "SELECT": + return vModelSelect; + case "TEXTAREA": + return vModelText; + default: + switch (type) { + case "checkbox": + return vModelCheckbox; + case "radio": + return vModelRadio; + default: + return vModelText; } - }); } } - -/** - * Data API implementation - */ - -EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { - event.preventDefault(); - const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); - const data = Button.getOrCreateInstance(button); - data.toggle(); -}); - -/** - * jQuery - */ - -defineJQueryPlugin(Button); - -/** - * -------------------------------------------------------------------------- - * Bootstrap util/swipe.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const NAME$d = 'swipe'; -const EVENT_KEY$9 = '.bs.swipe'; -const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; -const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; -const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; -const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; -const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; -const POINTER_TYPE_TOUCH = 'touch'; -const POINTER_TYPE_PEN = 'pen'; -const CLASS_NAME_POINTER_EVENT = 'pointer-event'; -const SWIPE_THRESHOLD = 40; -const Default$c = { - endCallback: null, - leftCallback: null, - rightCallback: null -}; -const DefaultType$c = { - endCallback: '(function|null)', - leftCallback: '(function|null)', - rightCallback: '(function|null)' -}; - -/** - * Class definition - */ - -class Swipe extends Config { - constructor(element, config) { - super(); - this._element = element; - if (!element || !Swipe.isSupported()) { +function callModelHook(el, binding, vnode, prevVNode, hook) { + const modelToUse = resolveDynamicModel( + el.tagName, + vnode.props && vnode.props.type + ); + const fn = modelToUse[hook]; + fn && fn(el, binding, vnode, prevVNode); +} +function initVModelForSSR() { + vModelText.getSSRProps = ({ value }) => ({ value }); + vModelRadio.getSSRProps = ({ value }, vnode) => { + if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseEqual)(vnode.props.value, value)) { + return { checked: true }; + } + }; + vModelCheckbox.getSSRProps = ({ value }, vnode) => { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { + if (vnode.props && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.looseIndexOf)(value, vnode.props.value) > -1) { + return { checked: true }; + } + } else if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { + if (vnode.props && value.has(vnode.props.value)) { + return { checked: true }; + } + } else if (value) { + return { checked: true }; + } + }; + vModelDynamic.getSSRProps = (binding, vnode) => { + if (typeof vnode.type !== "string") { return; } - this._config = this._getConfig(config); - this._deltaX = 0; - this._supportPointerEvents = Boolean(window.PointerEvent); - this._initEvents(); - } - - // Getters - static get Default() { - return Default$c; - } - static get DefaultType() { - return DefaultType$c; - } - static get NAME() { - return NAME$d; - } - - // Public - dispose() { - EventHandler.off(this._element, EVENT_KEY$9); - } + const modelToUse = resolveDynamicModel( + // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase + vnode.type.toUpperCase(), + vnode.props && vnode.props.type + ); + if (modelToUse.getSSRProps) { + return modelToUse.getSSRProps(binding, vnode); + } + }; +} - // Private - _start(event) { - if (!this._supportPointerEvents) { - this._deltaX = event.touches[0].clientX; - return; +const systemModifiers = ["ctrl", "shift", "alt", "meta"]; +const modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +const withModifiers = (fn, modifiers) => { + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) + return; } - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX; + return fn(event, ...args); + }); +}; +const keyNames = { + esc: "escape", + space: " ", + up: "arrow-up", + left: "arrow-left", + right: "arrow-right", + down: "arrow-down", + delete: "backspace" +}; +const withKeys = (fn, modifiers) => { + const cache = fn._withKeys || (fn._withKeys = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = (event) => { + if (!("key" in event)) { + return; } - } - _end(event) { - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX - this._deltaX; + const eventKey = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.hyphenate)(event.key); + if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) { + return fn(event); } - this._handleSwipe(); - execute(this._config.endCallback); - } - _move(event) { - this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; + }); +}; + +const rendererOptions = /* @__PURE__ */ (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.extend)({ patchProp }, nodeOps); +let renderer; +let enabledHydration = false; +function ensureRenderer() { + return renderer || (renderer = (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createRenderer)(rendererOptions)); +} +function ensureHydrationRenderer() { + renderer = enabledHydration ? renderer : (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer)(rendererOptions); + enabledHydration = true; + return renderer; +} +const render = (...args) => { + ensureRenderer().render(...args); +}; +const hydrate = (...args) => { + ensureHydrationRenderer().hydrate(...args); +}; +const createApp = (...args) => { + const app = ensureRenderer().createApp(...args); + if (true) { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); } - _handleSwipe() { - const absDeltaX = Math.abs(this._deltaX); - if (absDeltaX <= SWIPE_THRESHOLD) { + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (!container) return; + const component = app._component; + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(component) && !component.render && !component.template) { + component.template = container.innerHTML; } - const direction = absDeltaX / this._deltaX; - this._deltaX = 0; - if (!direction) { - return; + container.innerHTML = ""; + const proxy = mount(container, false, resolveRootNamespace(container)); + if (container instanceof Element) { + container.removeAttribute("v-cloak"); + container.setAttribute("data-v-app", ""); } - execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); + return proxy; + }; + return app; +}; +const createSSRApp = (...args) => { + const app = ensureHydrationRenderer().createApp(...args); + if (true) { + injectNativeTagCheck(app); + injectCompilerOptionsCheck(app); } - _initEvents() { - if (this._supportPointerEvents) { - EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); - EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); - this._element.classList.add(CLASS_NAME_POINTER_EVENT); - } else { - EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); - EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); - EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); + const { mount } = app; + app.mount = (containerOrSelector) => { + const container = normalizeContainer(containerOrSelector); + if (container) { + return mount(container, true, resolveRootNamespace(container)); } + }; + return app; +}; +function resolveRootNamespace(container) { + if (container instanceof SVGElement) { + return "svg"; } - _eventIsPointerPenTouch(event) { - return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); - } - - // Static - static isSupported() { - return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; + if (typeof MathMLElement === "function" && container instanceof MathMLElement) { + return "mathml"; } } - -/** - * -------------------------------------------------------------------------- - * Bootstrap carousel.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const NAME$c = 'carousel'; -const DATA_KEY$8 = 'bs.carousel'; -const EVENT_KEY$8 = `.${DATA_KEY$8}`; -const DATA_API_KEY$5 = '.data-api'; -const ARROW_LEFT_KEY$1 = 'ArrowLeft'; -const ARROW_RIGHT_KEY$1 = 'ArrowRight'; -const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch - -const ORDER_NEXT = 'next'; -const ORDER_PREV = 'prev'; -const DIRECTION_LEFT = 'left'; -const DIRECTION_RIGHT = 'right'; -const EVENT_SLIDE = `slide${EVENT_KEY$8}`; -const EVENT_SLID = `slid${EVENT_KEY$8}`; -const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; -const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; -const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; -const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; -const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; -const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; -const CLASS_NAME_CAROUSEL = 'carousel'; -const CLASS_NAME_ACTIVE$2 = 'active'; -const CLASS_NAME_SLIDE = 'slide'; -const CLASS_NAME_END = 'carousel-item-end'; -const CLASS_NAME_START = 'carousel-item-start'; -const CLASS_NAME_NEXT = 'carousel-item-next'; -const CLASS_NAME_PREV = 'carousel-item-prev'; -const SELECTOR_ACTIVE = '.active'; -const SELECTOR_ITEM = '.carousel-item'; -const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; -const SELECTOR_ITEM_IMG = '.carousel-item img'; -const SELECTOR_INDICATORS = '.carousel-indicators'; -const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; -const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; -const KEY_TO_DIRECTION = { - [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, - [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT -}; -const Default$b = { - interval: 5000, - keyboard: true, - pause: 'hover', - ride: false, - touch: true, - wrap: true -}; -const DefaultType$b = { - interval: '(number|boolean)', - // TODO:v6 remove boolean support - keyboard: 'boolean', - pause: '(string|boolean)', - ride: '(boolean|string)', - touch: 'boolean', - wrap: 'boolean' -}; - -/** - * Class definition - */ - -class Carousel extends BaseComponent { - constructor(element, config) { - super(element, config); - this._interval = null; - this._activeElement = null; - this._isSliding = false; - this.touchTimeout = null; - this._swipeHelper = null; - this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); - this._addEventListeners(); - if (this._config.ride === CLASS_NAME_CAROUSEL) { - this.cycle(); - } - } - - // Getters - static get Default() { - return Default$b; - } - static get DefaultType() { - return DefaultType$b; - } - static get NAME() { - return NAME$c; - } - - // Public - next() { - this._slide(ORDER_NEXT); - } - nextWhenVisible() { - // FIXME TODO use `document.visibilityState` - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && isVisible(this._element)) { - this.next(); - } - } - prev() { - this._slide(ORDER_PREV); - } - pause() { - if (this._isSliding) { - triggerTransitionEnd(this._element); - } - this._clearInterval(); - } - cycle() { - this._clearInterval(); - this._updateInterval(); - this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); +function injectNativeTagCheck(app) { + Object.defineProperty(app.config, "isNativeTag", { + value: (tag) => (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isHTMLTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isSVGTag)(tag) || (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isMathMLTag)(tag), + writable: false + }); +} +function injectCompilerOptionsCheck(app) { + if ((0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly)()) { + const isCustomElement = app.config.isCustomElement; + Object.defineProperty(app.config, "isCustomElement", { + get() { + return isCustomElement; + }, + set() { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` + ); + } + }); + const compilerOptions = app.config.compilerOptions; + const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. +- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. +- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader +- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; + Object.defineProperty(app.config, "compilerOptions", { + get() { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); + return compilerOptions; + }, + set() { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)(msg); + } + }); } - _maybeEnableCycle() { - if (!this._config.ride) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); - return; +} +function normalizeContainer(container) { + if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isString)(container)) { + const res = document.querySelector(container); + if ( true && !res) { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `Failed to mount app: mount target selector "${container}" returned null.` + ); } - this.cycle(); + return res; } - to(index) { - const items = this._getItems(); - if (index > items.length - 1 || index < 0) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); - return; - } - const activeIndex = this._getItemIndex(this._getActive()); - if (activeIndex === index) { - return; - } - const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; - this._slide(order, items[index]); + if ( true && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { + (0,_vue_runtime_core__WEBPACK_IMPORTED_MODULE_0__.warn)( + `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` + ); } - dispose() { - if (this._swipeHelper) { - this._swipeHelper.dispose(); - } - super.dispose(); + return container; +} +let ssrDirectiveInitialized = false; +const initDirectivesForSSR = () => { + if (!ssrDirectiveInitialized) { + ssrDirectiveInitialized = true; + initVModelForSSR(); + initVShowForSSR(); } +} ; - // Private - _configAfterMerge(config) { - config.defaultInterval = config.interval; - return config; - } - _addEventListeners() { - if (this._config.keyboard) { - EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); - } - if (this._config.pause === 'hover') { - EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); - EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); - } - if (this._config.touch && Swipe.isSupported()) { - this._addTouchEventListeners(); - } - } - _addTouchEventListeners() { - for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { - EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); - } - const endCallBack = () => { - if (this._config.pause !== 'hover') { - return; - } - // If it's a touch-enabled device, mouseenter/leave are fired as - // part of the mouse compatibility events on first tap - the carousel - // would stop cycling until user tapped out of it; - // here, we listen for touchend, explicitly pause the carousel - // (as if it's the second time we tap on it, mouseenter compat event - // is NOT fired) and after a timeout (to allow for mouse compatibility - // events to fire) we explicitly restart cycling - this.pause(); - if (this.touchTimeout) { - clearTimeout(this.touchTimeout); - } - this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); - }; - const swipeConfig = { - leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), - rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), - endCallback: endCallBack - }; - this._swipeHelper = new Swipe(this._element, swipeConfig); - } - _keydown(event) { - if (/input|textarea/i.test(event.target.tagName)) { - return; - } - const direction = KEY_TO_DIRECTION[event.key]; - if (direction) { - event.preventDefault(); - this._slide(this._directionToOrder(direction)); - } - } - _getItemIndex(element) { - return this._getItems().indexOf(element); - } - _setActiveIndicatorElement(index) { - if (!this._indicatorsElement) { - return; - } - const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); - activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); - activeIndicator.removeAttribute('aria-current'); - const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); - if (newActiveIndicator) { - newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); - newActiveIndicator.setAttribute('aria-current', 'true'); - } - } - _updateInterval() { - const element = this._activeElement || this._getActive(); - if (!element) { - return; - } - const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); - this._config.interval = elementInterval || this._config.defaultInterval; - } - _slide(order, element = null) { - if (this._isSliding) { - return; - } - const activeElement = this._getActive(); - const isNext = order === ORDER_NEXT; - const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); - if (nextElement === activeElement) { - return; - } - const nextElementIndex = this._getItemIndex(nextElement); - const triggerEvent = eventName => { - return EventHandler.trigger(this._element, eventName, { - relatedTarget: nextElement, - direction: this._orderToDirection(order), - from: this._getItemIndex(activeElement), - to: nextElementIndex - }); - }; - const slideEvent = triggerEvent(EVENT_SLIDE); - if (slideEvent.defaultPrevented) { - return; - } - if (!activeElement || !nextElement) { - // Some weirdness is happening, so we bail - // TODO: change tests that use empty divs to avoid this check - return; - } - const isCycling = Boolean(this._interval); - this.pause(); - this._isSliding = true; - this._setActiveIndicatorElement(nextElementIndex); - this._activeElement = nextElement; - const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; - const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; - nextElement.classList.add(orderClassName); - reflow(nextElement); - activeElement.classList.add(directionalClassName); - nextElement.classList.add(directionalClassName); - const completeCallBack = () => { - nextElement.classList.remove(directionalClassName, orderClassName); - nextElement.classList.add(CLASS_NAME_ACTIVE$2); - activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); - this._isSliding = false; - triggerEvent(EVENT_SLID); - }; - this._queueCallback(completeCallBack, activeElement, this._isAnimated()); - if (isCycling) { - this.cycle(); - } - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_SLIDE); - } - _getActive() { - return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); - } - _getItems() { - return SelectorEngine.find(SELECTOR_ITEM, this._element); - } - _clearInterval() { - if (this._interval) { - clearInterval(this._interval); - this._interval = null; - } - } - _directionToOrder(direction) { - if (isRTL()) { - return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; - } - return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; - } - _orderToDirection(order) { - if (isRTL()) { - return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; - } - return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Carousel.getOrCreateInstance(this, config); - if (typeof config === 'number') { - data.to(config); - return; - } - if (typeof config === 'string') { - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - } - }); - } -} - -/** - * Data API implementation - */ - -EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { - return; - } - event.preventDefault(); - const carousel = Carousel.getOrCreateInstance(target); - const slideIndex = this.getAttribute('data-bs-slide-to'); - if (slideIndex) { - carousel.to(slideIndex); - carousel._maybeEnableCycle(); - return; - } - if (Manipulator.getDataAttribute(this, 'slide') === 'next') { - carousel.next(); - carousel._maybeEnableCycle(); - return; - } - carousel.prev(); - carousel._maybeEnableCycle(); -}); -EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { - const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); - for (const carousel of carousels) { - Carousel.getOrCreateInstance(carousel); - } -}); - -/** - * jQuery - */ - -defineJQueryPlugin(Carousel); -/** - * -------------------------------------------------------------------------- - * Bootstrap collapse.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ +/***/ }), +/***/ "./node_modules/@vue/shared/dist/shared.esm-bundler.js": +/*!*************************************************************!*\ + !*** ./node_modules/@vue/shared/dist/shared.esm-bundler.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -/** - * Constants - */ +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ EMPTY_ARR: () => (/* binding */ EMPTY_ARR), +/* harmony export */ EMPTY_OBJ: () => (/* binding */ EMPTY_OBJ), +/* harmony export */ NO: () => (/* binding */ NO), +/* harmony export */ NOOP: () => (/* binding */ NOOP), +/* harmony export */ PatchFlagNames: () => (/* binding */ PatchFlagNames), +/* harmony export */ PatchFlags: () => (/* binding */ PatchFlags), +/* harmony export */ ShapeFlags: () => (/* binding */ ShapeFlags), +/* harmony export */ SlotFlags: () => (/* binding */ SlotFlags), +/* harmony export */ camelize: () => (/* binding */ camelize), +/* harmony export */ capitalize: () => (/* binding */ capitalize), +/* harmony export */ def: () => (/* binding */ def), +/* harmony export */ escapeHtml: () => (/* binding */ escapeHtml), +/* harmony export */ escapeHtmlComment: () => (/* binding */ escapeHtmlComment), +/* harmony export */ extend: () => (/* binding */ extend), +/* harmony export */ genPropsAccessExp: () => (/* binding */ genPropsAccessExp), +/* harmony export */ generateCodeFrame: () => (/* binding */ generateCodeFrame), +/* harmony export */ getGlobalThis: () => (/* binding */ getGlobalThis), +/* harmony export */ hasChanged: () => (/* binding */ hasChanged), +/* harmony export */ hasOwn: () => (/* binding */ hasOwn), +/* harmony export */ hyphenate: () => (/* binding */ hyphenate), +/* harmony export */ includeBooleanAttr: () => (/* binding */ includeBooleanAttr), +/* harmony export */ invokeArrayFns: () => (/* binding */ invokeArrayFns), +/* harmony export */ isArray: () => (/* binding */ isArray), +/* harmony export */ isBooleanAttr: () => (/* binding */ isBooleanAttr), +/* harmony export */ isBuiltInDirective: () => (/* binding */ isBuiltInDirective), +/* harmony export */ isDate: () => (/* binding */ isDate), +/* harmony export */ isFunction: () => (/* binding */ isFunction), +/* harmony export */ isGloballyAllowed: () => (/* binding */ isGloballyAllowed), +/* harmony export */ isGloballyWhitelisted: () => (/* binding */ isGloballyWhitelisted), +/* harmony export */ isHTMLTag: () => (/* binding */ isHTMLTag), +/* harmony export */ isIntegerKey: () => (/* binding */ isIntegerKey), +/* harmony export */ isKnownHtmlAttr: () => (/* binding */ isKnownHtmlAttr), +/* harmony export */ isKnownSvgAttr: () => (/* binding */ isKnownSvgAttr), +/* harmony export */ isMap: () => (/* binding */ isMap), +/* harmony export */ isMathMLTag: () => (/* binding */ isMathMLTag), +/* harmony export */ isModelListener: () => (/* binding */ isModelListener), +/* harmony export */ isObject: () => (/* binding */ isObject), +/* harmony export */ isOn: () => (/* binding */ isOn), +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), +/* harmony export */ isPromise: () => (/* binding */ isPromise), +/* harmony export */ isRegExp: () => (/* binding */ isRegExp), +/* harmony export */ isReservedProp: () => (/* binding */ isReservedProp), +/* harmony export */ isSSRSafeAttrName: () => (/* binding */ isSSRSafeAttrName), +/* harmony export */ isSVGTag: () => (/* binding */ isSVGTag), +/* harmony export */ isSet: () => (/* binding */ isSet), +/* harmony export */ isSpecialBooleanAttr: () => (/* binding */ isSpecialBooleanAttr), +/* harmony export */ isString: () => (/* binding */ isString), +/* harmony export */ isSymbol: () => (/* binding */ isSymbol), +/* harmony export */ isVoidTag: () => (/* binding */ isVoidTag), +/* harmony export */ looseEqual: () => (/* binding */ looseEqual), +/* harmony export */ looseIndexOf: () => (/* binding */ looseIndexOf), +/* harmony export */ looseToNumber: () => (/* binding */ looseToNumber), +/* harmony export */ makeMap: () => (/* binding */ makeMap), +/* harmony export */ normalizeClass: () => (/* binding */ normalizeClass), +/* harmony export */ normalizeProps: () => (/* binding */ normalizeProps), +/* harmony export */ normalizeStyle: () => (/* binding */ normalizeStyle), +/* harmony export */ objectToString: () => (/* binding */ objectToString), +/* harmony export */ parseStringStyle: () => (/* binding */ parseStringStyle), +/* harmony export */ propsToAttrMap: () => (/* binding */ propsToAttrMap), +/* harmony export */ remove: () => (/* binding */ remove), +/* harmony export */ slotFlagsText: () => (/* binding */ slotFlagsText), +/* harmony export */ stringifyStyle: () => (/* binding */ stringifyStyle), +/* harmony export */ toDisplayString: () => (/* binding */ toDisplayString), +/* harmony export */ toHandlerKey: () => (/* binding */ toHandlerKey), +/* harmony export */ toNumber: () => (/* binding */ toNumber), +/* harmony export */ toRawType: () => (/* binding */ toRawType), +/* harmony export */ toTypeString: () => (/* binding */ toTypeString) +/* harmony export */ }); +function makeMap(str, expectsLowerCase) { + const set = new Set(str.split(",")); + return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val); +} -const NAME$b = 'collapse'; -const DATA_KEY$7 = 'bs.collapse'; -const EVENT_KEY$7 = `.${DATA_KEY$7}`; -const DATA_API_KEY$4 = '.data-api'; -const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; -const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; -const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; -const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; -const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; -const CLASS_NAME_SHOW$7 = 'show'; -const CLASS_NAME_COLLAPSE = 'collapse'; -const CLASS_NAME_COLLAPSING = 'collapsing'; -const CLASS_NAME_COLLAPSED = 'collapsed'; -const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; -const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; -const WIDTH = 'width'; -const HEIGHT = 'height'; -const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; -const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; -const Default$a = { - parent: null, - toggle: true +const EMPTY_OBJ = true ? Object.freeze({}) : 0; +const EMPTY_ARR = true ? Object.freeze([]) : 0; +const NOOP = () => { }; -const DefaultType$a = { - parent: '(null|element)', - toggle: 'boolean' +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); +}); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction((str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; +}); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](arg); + } +}; +const def = (obj, key, value) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : {}); }; +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name) { + return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; +} -/** - * Class definition - */ +const PatchFlags = { + "TEXT": 1, + "1": "TEXT", + "CLASS": 2, + "2": "CLASS", + "STYLE": 4, + "4": "STYLE", + "PROPS": 8, + "8": "PROPS", + "FULL_PROPS": 16, + "16": "FULL_PROPS", + "NEED_HYDRATION": 32, + "32": "NEED_HYDRATION", + "STABLE_FRAGMENT": 64, + "64": "STABLE_FRAGMENT", + "KEYED_FRAGMENT": 128, + "128": "KEYED_FRAGMENT", + "UNKEYED_FRAGMENT": 256, + "256": "UNKEYED_FRAGMENT", + "NEED_PATCH": 512, + "512": "NEED_PATCH", + "DYNAMIC_SLOTS": 1024, + "1024": "DYNAMIC_SLOTS", + "DEV_ROOT_FRAGMENT": 2048, + "2048": "DEV_ROOT_FRAGMENT", + "HOISTED": -1, + "-1": "HOISTED", + "BAIL": -2, + "-2": "BAIL" +}; +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; -class Collapse extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isTransitioning = false; - this._triggerArray = []; - const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); - for (const elem of toggleList) { - const selector = SelectorEngine.getSelectorFromElement(elem); - const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); - if (selector !== null && filterElement.length) { - this._triggerArray.push(elem); +const ShapeFlags = { + "ELEMENT": 1, + "1": "ELEMENT", + "FUNCTIONAL_COMPONENT": 2, + "2": "FUNCTIONAL_COMPONENT", + "STATEFUL_COMPONENT": 4, + "4": "STATEFUL_COMPONENT", + "TEXT_CHILDREN": 8, + "8": "TEXT_CHILDREN", + "ARRAY_CHILDREN": 16, + "16": "ARRAY_CHILDREN", + "SLOTS_CHILDREN": 32, + "32": "SLOTS_CHILDREN", + "TELEPORT": 64, + "64": "TELEPORT", + "SUSPENSE": 128, + "128": "SUSPENSE", + "COMPONENT_SHOULD_KEEP_ALIVE": 256, + "256": "COMPONENT_SHOULD_KEEP_ALIVE", + "COMPONENT_KEPT_ALIVE": 512, + "512": "COMPONENT_KEPT_ALIVE", + "COMPONENT": 6, + "6": "COMPONENT" +}; + +const SlotFlags = { + "STABLE": 1, + "1": "STABLE", + "DYNAMIC": 2, + "2": "DYNAMIC", + "FORWARDED": 3, + "3": "FORWARDED" +}; +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); +const isGloballyWhitelisted = isGloballyAllowed; + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) + continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } } - } - this._initializeChildren(); - if (!this._config.parent) { - this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); - } - if (this._config.toggle) { - this.toggle(); + break; } } + return res.join("\n"); +} - // Getters - static get Default() { - return Default$a; - } - static get DefaultType() { - return DefaultType$a; - } - static get NAME() { - return NAME$b; +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; } - - // Public - toggle() { - if (this._isShown()) { - this.hide(); - } else { - this.show(); +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } + }); + return ret; +} +function stringifyStyle(styles) { + let ret = ""; + if (!styles || isString(styles)) { + return ret; } - show() { - if (this._isTransitioning || this._isShown()) { - return; + for (const key in styles) { + const value = styles[key]; + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + if (isString(value) || typeof value === "number") { + ret += `${normalizedKey}:${value};`; } - let activeChildren = []; - - // find active children - if (this._config.parent) { - activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { - toggle: false - })); + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } } - if (activeChildren.length && activeChildren[0]._isTransitioning) { - return; + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } } - const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); - if (startEvent.defaultPrevented) { - return; - } - for (const activeInstance of activeChildren) { - activeInstance.hide(); - } - const dimension = this._getDimension(); - this._element.classList.remove(CLASS_NAME_COLLAPSE); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.style[dimension] = 0; - this._addAriaAndCollapsedClass(this._triggerArray, true); - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - this._element.style[dimension] = ''; - EventHandler.trigger(this._element, EVENT_SHOWN$6); - }; - const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - const scrollSize = `scroll${capitalizedDimension}`; - this._queueCallback(complete, this._element, true); - this._element.style[dimension] = `${this._element[scrollSize]}px`; } - hide() { - if (this._isTransitioning || !this._isShown()) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); - if (startEvent.defaultPrevented) { - return; - } - const dimension = this._getDimension(); - this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; - reflow(this._element); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - for (const trigger of this._triggerArray) { - const element = SelectorEngine.getElementFromSelector(trigger); - if (element && !this._isShown(element)) { - this._addAriaAndCollapsedClass([trigger], false); - } - } - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE); - EventHandler.trigger(this._element, EVENT_HIDDEN$6); - }; - this._element.style[dimension] = ''; - this._queueCallback(complete, this._element, true); + return res.trim(); +} +function normalizeProps(props) { + if (!props) + return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); } - _isShown(element = this._element) { - return element.classList.contains(CLASS_NAME_SHOW$7); + if (style) { + props.style = normalizeStyle(style); } + return props; +} - // Private - _configAfterMerge(config) { - config.toggle = Boolean(config.toggle); // Coerce string values - config.parent = getElement(config.parent); - return config; - } - _getDimension() { - return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; } - _initializeChildren() { - if (!this._config.parent) { - return; - } - const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); - for (const element of children) { - const selected = SelectorEngine.getElementFromSelector(element); - if (selected) { - this._addAriaAndCollapsedClass([element], this._isShown(selected)); - } - } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); } - _getFirstLevelChildren(selector) { - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - // remove children if greater depth - return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); + return attrValidationCache[name] = !isUnsafe; +} +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); + +const escapeRE = /["'&<>]/; +function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; } - _addAriaAndCollapsedClass(triggerArray, isOpen) { - if (!triggerArray.length) { - return; + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; } - for (const element of triggerArray) { - element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); - element.setAttribute('aria-expanded', isOpen); + if (lastIndex !== index) { + html += str.slice(lastIndex, index); } + lastIndex = index + 1; + html += escaped; } + return lastIndex !== index ? html + str.slice(lastIndex, index) : html; +} +const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); +} - // Static - static jQueryInterface(config) { - const _config = {}; - if (typeof config === 'string' && /show|hide/.test(config)) { - _config.toggle = false; +function looseCompareArrays(a, b) { + if (a.length !== b.length) + return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) + return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; } - return this.each(function () { - const data = Collapse.getOrCreateInstance(this, _config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; } - }); + } } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); } -/** - * Data API implementation - */ - -EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { - // preventDefault only for <a> elements (which change the URL) not inside the collapsible element - if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { - event.preventDefault(); +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (val && val.__v_isRef) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); } - for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { - Collapse.getOrCreateInstance(element, { - toggle: false - }).toggle(); + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v; +}; + + + + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js": +/*!********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js ***! + \********************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + props: { + message: { + type: String + } + }, + methods: { + success: function success() { + window.app.notify.success('Copied!'); + } + }, + data: function data() { + return { + copyData: this.message + }; } }); +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa": +/*!************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa ***! + \************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ render: () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", { + onClick: _cache[0] || (_cache[0] = function () { + return $options.success && $options.success.apply($options, arguments); + }), + "class": "btn btn-outline-primary" + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default")])]); +} + +/***/ }), + +/***/ "./resources/js/app.js": +/*!*****************************!*\ + !*** ./resources/js/app.js ***! + \*****************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +__webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js"); + +// Vue Components +__webpack_require__(/*! ./vue-components */ "./resources/js/vue-components.js"); + +// Script Components +__webpack_require__(/*! ./script-components */ "./resources/js/script-components.js"); + +/***/ }), + +/***/ "./resources/js/bootstrap.js": +/*!***********************************!*\ + !*** ./resources/js/bootstrap.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js"); +window.clipboard = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/clipboard.js"); +window.bootstrap = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.esm.js"); + /** - * jQuery + * We'll load the axios HTTP library which allows us to easily issue requests + * to our Laravel back-end. This library automatically handles sending the + * CSRF token as a header based on the value of the "XSRF" token cookie. */ -defineJQueryPlugin(Collapse); +window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/dist/browser/axios.cjs"); +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /** - * -------------------------------------------------------------------------- - * Bootstrap dropdown.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- + * Next we will register the CSRF Token as a common header with Axios so that + * all outgoing HTTP requests automatically have it attached. This is just + * a simple convenience so we don't have to attach every token manually. */ +var token = document.head.querySelector('meta[name="csrf-token"]'); +if (token) { + window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; +} else { + console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); +} /** - * Constants + * Echo exposes an expressive API for subscribing to channels and listening + * for events that are broadcast by Laravel. Echo and event broadcasting + * allows your team to easily build robust real-time web applications. */ -const NAME$a = 'dropdown'; -const DATA_KEY$6 = 'bs.dropdown'; -const EVENT_KEY$6 = `.${DATA_KEY$6}`; -const DATA_API_KEY$3 = '.data-api'; -const ESCAPE_KEY$2 = 'Escape'; -const TAB_KEY$1 = 'Tab'; -const ARROW_UP_KEY$1 = 'ArrowUp'; -const ARROW_DOWN_KEY$1 = 'ArrowDown'; -const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button -const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; -const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; -const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; -const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; -const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; -const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; -const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; -const CLASS_NAME_SHOW$6 = 'show'; -const CLASS_NAME_DROPUP = 'dropup'; -const CLASS_NAME_DROPEND = 'dropend'; -const CLASS_NAME_DROPSTART = 'dropstart'; -const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; -const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; -const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; -const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; -const SELECTOR_MENU = '.dropdown-menu'; -const SELECTOR_NAVBAR = '.navbar'; -const SELECTOR_NAVBAR_NAV = '.navbar-nav'; -const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; -const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; -const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; -const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; -const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; -const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; -const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; -const PLACEMENT_TOPCENTER = 'top'; -const PLACEMENT_BOTTOMCENTER = 'bottom'; -const Default$9 = { - autoClose: true, - boundary: 'clippingParents', - display: 'dynamic', - offset: [0, 2], - popperConfig: null, - reference: 'toggle' -}; -const DefaultType$9 = { - autoClose: '(boolean|string)', - boundary: '(string|element)', - display: 'string', - offset: '(array|string|function)', - popperConfig: '(null|object|function)', - reference: '(string|element|object)' -}; +window.Pusher = __webpack_require__(/*! pusher-js */ "./node_modules/pusher-js/dist/web/pusher.js"); +window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({ + broadcaster: 'pusher', + key: "beda029944f4b5d0809b", + cluster: "mt1", + forceTLS: true +}); -/** - * Class definition - */ +/***/ }), -class Dropdown extends BaseComponent { - constructor(element, config) { - super(element, config); - this._popper = null; - this._parent = this._element.parentNode; // dropdown wrapper - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); - this._inNavbar = this._detectNavbar(); - } +/***/ "./resources/js/script-components.js": +/*!*******************************************!*\ + !*** ./resources/js/script-components.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - // Getters - static get Default() { - return Default$9; - } - static get DefaultType() { - return DefaultType$9; +// Low level components +__webpack_require__(/*! ./script-components/core */ "./resources/js/script-components/core.js"); +__webpack_require__(/*! ./script-components/utilities */ "./resources/js/script-components/utilities.js"); +__webpack_require__(/*! ./script-components/app-events */ "./resources/js/script-components/app-events.js"); +__webpack_require__(/*! ./script-components/echo-events */ "./resources/js/script-components/echo-events.js"); +__webpack_require__(/*! ./script-components/livewire-events */ "./resources/js/script-components/livewire-events.js"); +__webpack_require__(/*! ./script-components/online */ "./resources/js/script-components/online.js"); + +// UI functional level components +__webpack_require__(/*! ./script-components/sidebar */ "./resources/js/script-components/sidebar.js"); +// require('./script-components/mobile'); +__webpack_require__(/*! ./script-components/ajax-forms */ "./resources/js/script-components/ajax-forms.js"); + +// UI UX level components +__webpack_require__(/*! ./script-components/tooltips */ "./resources/js/script-components/tooltips.js"); +__webpack_require__(/*! ./script-components/clipboard */ "./resources/js/script-components/clipboard.js"); + +/***/ }), + +/***/ "./resources/js/script-components/ajax-forms.js": +/*!******************************************************!*\ + !*** ./resources/js/script-components/ajax-forms.js ***! + \******************************************************/ +/***/ (() => { + +/** + * Handling Ajax form submissions + */ +window.ajax = function (_event) { + var _originalContent = null; + _event.preventDefault(); + var _form = _event.target.closest('form'); + var _button = _event.target; + if (!_button.hasAttribute('data-formsjs-onclick')) { + _button = _button.closest('button'); } - static get NAME() { - return NAME$a; + if (_button) { + _originalContent = _button.innerHTML; + var _processing = '<i class="fas fa-circle-notch fa-spin bmx-fade-in"></i> '; + _button.innerHTML = _processing + _originalContent; } + if (_form) { + var _method = _form.method.toLowerCase(); + var _data = new FormData(_form); + window.axios[_method](_form.action, _data, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }).then(function (response) { + var _modalElement = document.getElementById("".concat(_form.getAttribute('id'), "_Modal")); + if (_modalElement) { + window.bootstrap.Modal.getOrCreateInstance(_modalElement).hide(); + } - // Public - toggle() { - return this._isShown() ? this.hide() : this.show(); - } - show() { - if (isDisabled(this._element) || this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); - if (showEvent.defaultPrevented) { - return; - } - this._createPopper(); - - // If this is a touch-enabled device we add extra - // empty mouseover listeners to the body's immediate children; - // only needed because of broken event delegation on iOS - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); + // Event handling + var _event = "".concat(_form.getAttribute('id'), ".success"); + window.app.$events.fire(_event, response.data.data); + if (_button) { + _button.innerHTML = _originalContent; } - } - this._element.focus(); - this._element.setAttribute('aria-expanded', true); - this._menu.classList.add(CLASS_NAME_SHOW$6); - this._element.classList.add(CLASS_NAME_SHOW$6); - EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); - } - hide() { - if (isDisabled(this._element) || !this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - this._completeHide(relatedTarget); + })["catch"](function (error) { + // let _event = `${_form.getAttribute('id')}.error`; + // window.app.$events.fire(_event, error.response.data); + if (error.response && error.response.data) { + [error.response.data.errors].forEach(function (key) { + var _fieldKey = Object.keys(key)[0]; + var _errorMessage = document.createElement('div'); + _errorMessage.classList.add('invalid-feedback'); + _errorMessage.innerText = error.response.data.errors[_fieldKey]; + var _fieldKeySelector = "input[name=\"".concat(_fieldKey, "\"]"); + var _field = document.querySelector(_fieldKeySelector); + if (!_field) { + // means its a select... I guess + _fieldKeySelector = "select[name=\"".concat(_fieldKey, "\"]"); + _field = document.querySelector(_fieldKeySelector); + } + if (!_field) { + // means its a textarea... I guess + _fieldKeySelector = "textarea[name=\"".concat(_fieldKey, "\"]"); + _field = document.querySelector(_fieldKeySelector); + } + if (!_field.classList.contains('is-invalid')) { + _field.classList.add('is-invalid'); + _field.parentNode.appendChild(_errorMessage); + } + window.FormsJS_validation(); + }); + } + if (_button && _originalContent) { + _button.innerHTML = _originalContent; + } + }); } - dispose() { - if (this._popper) { - this._popper.destroy(); - } - super.dispose(); +}; +window.ajaxDebounced = window.app.debounce(window.ajax); +window.FormsJS_submit_debounce = window.app.debounce(function (event) { + if (event.target.form) { + event.target.form.submit(); } - update() { - this._inNavbar = this._detectNavbar(); - if (this._popper) { - this._popper.update(); - } + if (event.target.tagName === 'FORM') { + event.target.submit(); } +}); +window.ajaxWithRefresh = function (event) { + window.ajax(event); + setTimeout(function () { + window.Livewire.dispatch('refresh'); + setTimeout(function () { + var _form = event.target.closest('form'); + if (_form) { + _form.reset(); + } + }, 1000); + }, 1000); +}; - // Private - _completeHide(relatedTarget) { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); - if (hideEvent.defaultPrevented) { - return; - } +/***/ }), - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); - } - } - if (this._popper) { - this._popper.destroy(); - } - this._menu.classList.remove(CLASS_NAME_SHOW$6); - this._element.classList.remove(CLASS_NAME_SHOW$6); - this._element.setAttribute('aria-expanded', 'false'); - Manipulator.removeDataAttribute(this._menu, 'popper'); - EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); - } - _getConfig(config) { - config = super._getConfig(config); - if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { - // Popper virtual elements require a getBoundingClientRect method - throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); - } - return config; - } - _createPopper() { - if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') { - throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); - } - let referenceElement = this._element; - if (this._config.reference === 'parent') { - referenceElement = this._parent; - } else if (isElement(this._config.reference)) { - referenceElement = getElement(this._config.reference); - } else if (typeof this._config.reference === 'object') { - referenceElement = this._config.reference; - } - const popperConfig = this._getPopperConfig(); - this._popper = _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(referenceElement, this._menu, popperConfig); - } - _isShown() { - return this._menu.classList.contains(CLASS_NAME_SHOW$6); - } - _getPlacement() { - const parentDropdown = this._parent; - if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { - return PLACEMENT_RIGHT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { - return PLACEMENT_LEFT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { - return PLACEMENT_TOPCENTER; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { - return PLACEMENT_BOTTOMCENTER; - } +/***/ "./resources/js/script-components/app-events.js": +/*!******************************************************!*\ + !*** ./resources/js/script-components/app-events.js ***! + \******************************************************/ +/***/ (() => { - // We need to trim the value because custom properties can also include spaces - const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { - return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; - } - return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; - } - _detectNavbar() { - return this._element.closest(SELECTOR_NAVBAR) !== null; - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); +/** + * Location for handling events from the app. + */ +// document.addEventListener('DOMContentLoaded', (event) => { +// window.app.$events.listen('UserForm.success', () => { +// window.notify.info('WHOA'); +// }); +// }); + +/***/ }), + +/***/ "./resources/js/script-components/clipboard.js": +/*!*****************************************************!*\ + !*** ./resources/js/script-components/clipboard.js ***! + \*****************************************************/ +/***/ (() => { + +window.copyToClipboard = function (_message) { + window.navigator.clipboard.writeText(_message).then(function () { + window.app.notify.success('Copied!'); + }); +}; + +/***/ }), + +/***/ "./resources/js/script-components/core.js": +/*!************************************************!*\ + !*** ./resources/js/script-components/core.js ***! + \************************************************/ +/***/ (() => { + +/** + * The following component is a shared event system + * this means you can trigger events anywhere + * and listen to them anywhere. + */ +window.app.$events = { + _events: {}, + fire: function fire(name) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + if (!this._events[name]) { + throw new Error("Can't emit an event. Event \"".concat(name, "\" doesn't exits.")); } - return offset; - } - _getPopperConfig() { - const defaultBsPopperConfig = { - placement: this._getPlacement(), - modifiers: [{ - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }] + var fireCallbacks = function fireCallbacks(callback) { + callback(data); }; - - // Disable Popper if we have a static display or Dropdown is in Navbar - if (this._inNavbar || this._config.display === 'static') { - Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove - defaultBsPopperConfig.modifiers = [{ - name: 'applyStyles', - enabled: false - }]; + this._events[name].forEach(fireCallbacks); + }, + listen: function listen(name, listener) { + if (!this._events[name]) { + this._events[name] = []; } - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) + this._events[name].push(listener); + }, + removeListener: function removeListener(name, listenerToRemove) { + if (!this._events[name]) { + throw new Error("Can't remove a listener. Event \"".concat(name, "\" doesn't exits.")); + } + var filterListeners = function filterListeners(listener) { + return listener !== listenerToRemove; }; + this._events[name] = this._events[name].filter(filterListeners); } - _selectMenuItem({ - key, - target - }) { - const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); - if (!items.length) { - return; - } - - // if target isn't included in items (e.g. when expanding the dropdown) - // allow cycling to get the last item in case key equals ARROW_UP_KEY - getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Dropdown.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } - static clearMenus(event) { - if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { - return; - } - const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); - for (const toggle of openToggles) { - const context = Dropdown.getInstance(toggle); - if (!context || context._config.autoClose === false) { - continue; - } - const composedPath = event.composedPath(); - const isMenuTarget = composedPath.includes(context._menu); - if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { - continue; - } - - // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu - if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { - continue; - } - const relatedTarget = { - relatedTarget: context._element - }; - if (event.type === 'click') { - relatedTarget.clickEvent = event; - } - context._completeHide(relatedTarget); - } - } - static dataApiKeydownHandler(event) { - // If not an UP | DOWN | ESCAPE key => not a dropdown command - // If input/textarea && if key is other than ESCAPE => not a dropdown command +}; - const isInput = /input|textarea/i.test(event.target.tagName); - const isEscapeEvent = event.key === ESCAPE_KEY$2; - const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); - if (!isUpOrDownEvent && !isEscapeEvent) { - return; - } - if (isInput && !isEscapeEvent) { - return; - } - event.preventDefault(); +/***/ }), - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); - const instance = Dropdown.getOrCreateInstance(getToggleButton); - if (isUpOrDownEvent) { - event.stopPropagation(); - instance.show(); - instance._selectMenuItem(event); - return; - } - if (instance._isShown()) { - // else is escape and we check if it is shown - event.stopPropagation(); - instance.hide(); - getToggleButton.focus(); - } - } -} +/***/ "./resources/js/script-components/echo-events.js": +/*!*******************************************************!*\ + !*** ./resources/js/script-components/echo-events.js ***! + \*******************************************************/ +/***/ (() => { /** - * Data API implementation + * Location for handling events from Echo. */ - -EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); -EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); -EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); -EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); -EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { - event.preventDefault(); - Dropdown.getOrCreateInstance(this).toggle(); +document.addEventListener('DOMContentLoaded', function (event) { + var generalChannel = window.Echo["private"]('general'); + generalChannel.listen('.general-event', function (data) { + window.app.notify.info(data.data.message); + }); + var userId = window.app.session.user.id; + var userChannel = window.Echo["private"]("App.Models.User.".concat(userId)); + userChannel.listen('.user-event', function (data) { + window.app.notify.info(data.data.message); + }); }); -/** - * jQuery - */ - -defineJQueryPlugin(Dropdown); +/***/ }), -/** - * -------------------------------------------------------------------------- - * Bootstrap util/backdrop.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ +/***/ "./resources/js/script-components/livewire-events.js": +/*!***********************************************************!*\ + !*** ./resources/js/script-components/livewire-events.js ***! + \***********************************************************/ +/***/ (() => { +window.Livewire.on('loadMore', function () { + setTimeout(function () { + window.FormsJS(); + window.turnOnTooltips(); + window.turnOnPopovers(); + }, 250); +}); +window.Livewire.on('refresh', function () { + setTimeout(function () { + window.FormsJS(); + window.turnOnTooltips(); + window.turnOnPopovers(); + }, 250); +}); -/** - * Constants - */ +/***/ }), -const NAME$9 = 'backdrop'; -const CLASS_NAME_FADE$4 = 'fade'; -const CLASS_NAME_SHOW$5 = 'show'; -const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; -const Default$8 = { - className: 'modal-backdrop', - clickCallback: null, - isAnimated: false, - isVisible: true, - // if false, we use the backdrop helper without adding any element to the dom - rootElement: 'body' // give the choice to place backdrop under different elements -}; +/***/ "./resources/js/script-components/online.js": +/*!**************************************************!*\ + !*** ./resources/js/script-components/online.js ***! + \**************************************************/ +/***/ (() => { -const DefaultType$8 = { - className: 'string', - clickCallback: '(function|null)', - isAnimated: 'boolean', - isVisible: 'boolean', - rootElement: '(element|string)' -}; +document.addEventListener('DOMContentLoaded', function (event) { + // window.addEventListener('offline', (event) => { + // window.notify.info('The network connection has been lost.'); + // }); -/** - * Class definition - */ + // window.addEventListener('online', (event) => { + // window.notify.success('The network connection has been restored.'); + // }); +}); -class Backdrop extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isAppended = false; - this._element = null; - } +/***/ }), - // Getters - static get Default() { - return Default$8; - } - static get DefaultType() { - return DefaultType$8; - } - static get NAME() { - return NAME$9; - } +/***/ "./resources/js/script-components/sidebar.js": +/*!***************************************************!*\ + !*** ./resources/js/script-components/sidebar.js ***! + \***************************************************/ +/***/ (() => { - // Public - show(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._append(); - const element = this._getElement(); - if (this._config.isAnimated) { - reflow(element); - } - element.classList.add(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - execute(callback); +document.addEventListener('DOMContentLoaded', function (event) { + var _sidebarPreventScroll = function _sidebarPreventScroll(e) { + e.preventDefault(); + e.stopPropagation(); + return false; + }; + if (document.querySelector('.sidebar-toggle')) { + document.querySelector('.sidebar-toggle').onclick = function () { + document.querySelector('.sidebar').classList.toggle('toggled'); + document.querySelector('.sidebar-overlay').classList.toggle('toggled'); + document.querySelector('.sidebar-toggle i').classList.toggle('fa-times'); + if (document.querySelector('.sidebar').classList.contains('toggled')) { + document.querySelector('main').addEventListener('wheel', _sidebarPreventScroll, { + passive: false + }); + window.app.destroyPullToRefresh(); + } + if (!document.querySelector('.sidebar').classList.contains('toggled')) { + document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { + passive: false + }); + window.app.pullToRefresh(); + } + }; + window.addEventListener('resize', function () { + document.querySelector('.sidebar').classList.remove('toggled'); + document.querySelector('.sidebar-overlay').classList.remove('toggled'); + document.querySelector('.sidebar-toggle i').classList.remove('fa-times'); + document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { + passive: false + }); }); } - hide(callback) { - if (!this._config.isVisible) { - execute(callback); - return; + if (window.innerWidth < 990) { + if (document.querySelector('.sidebar-overlay')) { + document.querySelector('.sidebar-overlay').onclick = function () { + document.querySelector('.sidebar').classList.remove('toggled'); + document.querySelector('.sidebar-overlay').classList.remove('toggled'); + document.querySelector('.sidebar-toggle i').classList.remove('fa-times'); + document.querySelector('main').removeEventListener('wheel', _sidebarPreventScroll, { + passive: false + }); + window.app.pullToRefresh(); + }; } - this._getElement().classList.remove(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - this.dispose(); - execute(callback); - }); - } - dispose() { - if (!this._isAppended) { - return; - } - EventHandler.off(this._element, EVENT_MOUSEDOWN); - this._element.remove(); - this._isAppended = false; } +}); - // Private - _getElement() { - if (!this._element) { - const backdrop = document.createElement('div'); - backdrop.className = this._config.className; - if (this._config.isAnimated) { - backdrop.classList.add(CLASS_NAME_FADE$4); - } - this._element = backdrop; - } - return this._element; - } - _configAfterMerge(config) { - // use getElement() with the default "body" to get a fresh Element on each instantiation - config.rootElement = getElement(config.rootElement); - return config; - } - _append() { - if (this._isAppended) { - return; - } - const element = this._getElement(); - this._config.rootElement.append(element); - EventHandler.on(element, EVENT_MOUSEDOWN, () => { - execute(this._config.clickCallback); +/***/ }), + +/***/ "./resources/js/script-components/tooltips.js": +/*!****************************************************!*\ + !*** ./resources/js/script-components/tooltips.js ***! + \****************************************************/ +/***/ (() => { + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +window.turnOnTooltips = function () { + var tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); + _toConsumableArray(tooltipTriggerList).map(function (tooltipTriggerEl) { + return new window.bootstrap.Tooltip(tooltipTriggerEl); + }); +}; +window.turnOnPopovers = function () { + var popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]'); + _toConsumableArray(popoverTriggerList).map(function (popoverTriggerEl) { + return new window.bootstrap.Popover(popoverTriggerEl, { + html: true }); - this._isAppended = true; - } - _emulateAnimation(callback) { - executeAfterTransition(callback, this._getElement(), this._config.isAnimated); + }); +}; +window.addEventListener('DOMContentLoaded', function () { + window.turnOnTooltips(); + window.turnOnPopovers(); +}); + +/***/ }), + +/***/ "./resources/js/script-components/utilities.js": +/*!*****************************************************!*\ + !*** ./resources/js/script-components/utilities.js ***! + \*****************************************************/ +/***/ (() => { + +/* +|-------------------------------------------------------------------------- +| For debouncing needs +|-------------------------------------------------------------------------- +*/ +window.app.debounce = function (func) { + var _this = this; + var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + var timer; + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + clearTimeout(timer); + timer = setTimeout(function () { + func.apply(_this, args); + }, timeout); + }; +}; + +/***/ }), + +/***/ "./resources/js/vue-components.js": +/*!****************************************!*\ + !*** ./resources/js/vue-components.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); + + +// External Components + +// Internal Components +// import CopyButton from './vue-components/CopyButton.vue'; + +// Define App +var vueApp = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createApp)({}); + +// Add Components +vueApp.component('CopyButton', (__webpack_require__(/*! ./vue-components/CopyButton.vue */ "./resources/js/vue-components/CopyButton.vue")["default"])); + +// Mount App +vueApp.mount('#app'); +window.app.vue = vueApp; + +/***/ }), + +/***/ "./node_modules/base64-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/base64-js/index.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] } -/** - * -------------------------------------------------------------------------- - * Bootstrap util/focustrap.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} -/** - * Constants - */ +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] -const NAME$8 = 'focustrap'; -const DATA_KEY$5 = 'bs.focustrap'; -const EVENT_KEY$5 = `.${DATA_KEY$5}`; -const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; -const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; -const TAB_KEY = 'Tab'; -const TAB_NAV_FORWARD = 'forward'; -const TAB_NAV_BACKWARD = 'backward'; -const Default$7 = { - autofocus: true, - trapElement: null // The element to trap focus inside of -}; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) -const DefaultType$7 = { - autofocus: 'boolean', - trapElement: 'element' -}; + var curByte = 0 -/** - * Class definition - */ + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen -class FocusTrap extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isActive = false; - this._lastTabNavDirection = null; + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } - // Getters - static get Default() { - return Default$7; - } - static get DefaultType() { - return DefaultType$7; - } - static get NAME() { - return NAME$8; + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF } - // Public - activate() { - if (this._isActive) { - return; - } - if (this._config.autofocus) { - this._config.trapElement.focus(); - } - EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop - EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); - EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); - this._isActive = true; - } - deactivate() { - if (!this._isActive) { - return; - } - this._isActive = false; - EventHandler.off(document, EVENT_KEY$5); + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } - // Private - _handleFocusin(event) { - const { - trapElement - } = this._config; - if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { - return; - } - const elements = SelectorEngine.focusableChildren(trapElement); - if (elements.length === 0) { - trapElement.focus(); - } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { - elements[elements.length - 1].focus(); - } else { - elements[0].focus(); - } - } - _handleKeydown(event) { - if (event.key !== TAB_KEY) { - return; - } - this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) } + return output.join('') } -/** - * -------------------------------------------------------------------------- - * Bootstrap util/scrollBar.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } -/** - * Constants - */ + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } -const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; -const SELECTOR_STICKY_CONTENT = '.sticky-top'; -const PROPERTY_PADDING = 'padding-right'; -const PROPERTY_MARGIN = 'margin-right'; + return parts.join('') +} -/** - * Class definition - */ -class ScrollBarHelper { - constructor() { - this._element = document.body; - } +/***/ }), - // Public - getWidth() { - // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes - const documentWidth = document.documentElement.clientWidth; - return Math.abs(window.innerWidth - documentWidth); - } - hide() { - const width = this.getWidth(); - this._disableOverFlow(); - // give padding to element to balance the hidden scrollbar width - this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); - } - reset() { - this._resetElementAttributes(this._element, 'overflow'); - this._resetElementAttributes(this._element, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); - } - isOverflowing() { - return this.getWidth() > 0; - } +/***/ "./node_modules/bootstrap/dist/js/bootstrap.esm.js": +/*!*********************************************************!*\ + !*** ./node_modules/bootstrap/dist/js/bootstrap.esm.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - // Private - _disableOverFlow() { - this._saveInitialAttribute(this._element, 'overflow'); - this._element.style.overflow = 'hidden'; - } - _setElementAttributes(selector, styleProperty, callback) { - const scrollbarWidth = this.getWidth(); - const manipulationCallBack = element => { - if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { - return; - } - this._saveInitialAttribute(element, styleProperty); - const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); - element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _saveInitialAttribute(element, styleProperty) { - const actualValue = element.style.getPropertyValue(styleProperty); - if (actualValue) { - Manipulator.setDataAttribute(element, styleProperty, actualValue); +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Alert: () => (/* binding */ Alert), +/* harmony export */ Button: () => (/* binding */ Button), +/* harmony export */ Carousel: () => (/* binding */ Carousel), +/* harmony export */ Collapse: () => (/* binding */ Collapse), +/* harmony export */ Dropdown: () => (/* binding */ Dropdown), +/* harmony export */ Modal: () => (/* binding */ Modal), +/* harmony export */ Offcanvas: () => (/* binding */ Offcanvas), +/* harmony export */ Popover: () => (/* binding */ Popover), +/* harmony export */ ScrollSpy: () => (/* binding */ ScrollSpy), +/* harmony export */ Tab: () => (/* binding */ Tab), +/* harmony export */ Toast: () => (/* binding */ Toast), +/* harmony export */ Tooltip: () => (/* binding */ Tooltip) +/* harmony export */ }); +/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/index.js"); +/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/popper.js"); +/*! + * Bootstrap v5.3.2 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ + + +/** + * -------------------------------------------------------------------------- + * Bootstrap dom/data.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + +/** + * Constants + */ + +const elementMap = new Map(); +const Data = { + set(element, key, instance) { + if (!elementMap.has(element)) { + elementMap.set(element, new Map()); } - } - _resetElementAttributes(selector, styleProperty) { - const manipulationCallBack = element => { - const value = Manipulator.getDataAttribute(element, styleProperty); - // We only want to remove the property if the value is `null`; the value can also be zero - if (value === null) { - element.style.removeProperty(styleProperty); - return; - } - Manipulator.removeDataAttribute(element, styleProperty); - element.style.setProperty(styleProperty, value); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _applyManipulationCallback(selector, callBack) { - if (isElement(selector)) { - callBack(selector); + const instanceMap = elementMap.get(element); + + // make it clear we only want one instance per element + // can be removed later when multiple key/instances are fine to be used + if (!instanceMap.has(key) && instanceMap.size !== 0) { + // eslint-disable-next-line no-console + console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); return; } - for (const sel of SelectorEngine.find(selector, this._element)) { - callBack(sel); + instanceMap.set(key, instance); + }, + get(element, key) { + if (elementMap.has(element)) { + return elementMap.get(element).get(key) || null; + } + return null; + }, + remove(element, key) { + if (!elementMap.has(element)) { + return; + } + const instanceMap = elementMap.get(element); + instanceMap.delete(key); + + // free up element references if there are no instances left for an element + if (instanceMap.size === 0) { + elementMap.delete(element); } } -} +}; /** * -------------------------------------------------------------------------- - * Bootstrap modal.js + * Bootstrap util/index.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ +const MAX_UID = 1000000; +const MILLISECONDS_MULTIPLIER = 1000; +const TRANSITION_END = 'transitionend'; /** - * Constants + * Properly escape IDs selectors to handle weird IDs + * @param {string} selector + * @returns {string} */ - -const NAME$7 = 'modal'; -const DATA_KEY$4 = 'bs.modal'; -const EVENT_KEY$4 = `.${DATA_KEY$4}`; -const DATA_API_KEY$2 = '.data-api'; -const ESCAPE_KEY$1 = 'Escape'; -const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; -const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; -const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; -const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; -const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; -const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; -const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`; -const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; -const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; -const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; -const CLASS_NAME_OPEN = 'modal-open'; -const CLASS_NAME_FADE$3 = 'fade'; -const CLASS_NAME_SHOW$4 = 'show'; -const CLASS_NAME_STATIC = 'modal-static'; -const OPEN_SELECTOR$1 = '.modal.show'; -const SELECTOR_DIALOG = '.modal-dialog'; -const SELECTOR_MODAL_BODY = '.modal-body'; -const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; -const Default$6 = { - backdrop: true, - focus: true, - keyboard: true +const parseSelector = selector => { + if (selector && window.CSS && window.CSS.escape) { + // document.querySelector needs escaping to handle IDs (html5+) containing for instance / + selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); + } + return selector; }; -const DefaultType$6 = { - backdrop: '(boolean|string)', - focus: 'boolean', - keyboard: 'boolean' + +// Shout-out Angus Croll (https://goo.gl/pxwQGp) +const toType = object => { + if (object === null || object === undefined) { + return `${object}`; + } + return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); }; /** - * Class definition + * Public Util API */ -class Modal extends BaseComponent { - constructor(element, config) { - super(element, config); - this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._isShown = false; - this._isTransitioning = false; - this._scrollBar = new ScrollBarHelper(); - this._addEventListeners(); +const getUID = prefix => { + do { + prefix += Math.floor(Math.random() * MAX_UID); + } while (document.getElementById(prefix)); + return prefix; +}; +const getTransitionDurationFromElement = element => { + if (!element) { + return 0; } - // Getters - static get Default() { - return Default$6; + // Get transition-duration of the element + let { + transitionDuration, + transitionDelay + } = window.getComputedStyle(element); + const floatTransitionDuration = Number.parseFloat(transitionDuration); + const floatTransitionDelay = Number.parseFloat(transitionDelay); + + // Return 0 if element or transition duration is not found + if (!floatTransitionDuration && !floatTransitionDelay) { + return 0; } - static get DefaultType() { - return DefaultType$6; + + // If multiple durations are defined, take the first + transitionDuration = transitionDuration.split(',')[0]; + transitionDelay = transitionDelay.split(',')[0]; + return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; +}; +const triggerTransitionEnd = element => { + element.dispatchEvent(new Event(TRANSITION_END)); +}; +const isElement = object => { + if (!object || typeof object !== 'object') { + return false; } - static get NAME() { - return NAME$7; + if (typeof object.jquery !== 'undefined') { + object = object[0]; } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); + return typeof object.nodeType !== 'undefined'; +}; +const getElement = object => { + // it's a jQuery object or a node element + if (isElement(object)) { + return object.jquery ? object[0] : object; } - show(relatedTarget) { - if (this._isShown || this._isTransitioning) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._isTransitioning = true; - this._scrollBar.hide(); - document.body.classList.add(CLASS_NAME_OPEN); - this._adjustDialog(); - this._backdrop.show(() => this._showElement(relatedTarget)); - } - hide() { - if (!this._isShown || this._isTransitioning) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); - if (hideEvent.defaultPrevented) { - return; - } - this._isShown = false; - this._isTransitioning = true; - this._focustrap.deactivate(); - this._element.classList.remove(CLASS_NAME_SHOW$4); - this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); - } - dispose() { - EventHandler.off(window, EVENT_KEY$4); - EventHandler.off(this._dialog, EVENT_KEY$4); - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - handleUpdate() { - this._adjustDialog(); + if (typeof object === 'string' && object.length > 0) { + return document.querySelector(parseSelector(object)); } - - // Private - _initializeBackDrop() { - return new Backdrop({ - isVisible: Boolean(this._config.backdrop), - // 'static' option will be translated to true, and booleans will keep their value, - isAnimated: this._isAnimated() - }); + return null; +}; +const isVisible = element => { + if (!isElement(element) || element.getClientRects().length === 0) { + return false; } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); + const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; + // Handle `details` element as its content may falsie appear visible when it is closed + const closedDetails = element.closest('details:not([open])'); + if (!closedDetails) { + return elementIsVisible; } - _showElement(relatedTarget) { - // try to append dynamic modal - if (!document.body.contains(this._element)) { - document.body.append(this._element); + if (closedDetails !== element) { + const summary = element.closest('summary'); + if (summary && summary.parentNode !== closedDetails) { + return false; } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.scrollTop = 0; - const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); - if (modalBody) { - modalBody.scrollTop = 0; + if (summary === null) { + return false; } - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW$4); - const transitionComplete = () => { - if (this._config.focus) { - this._focustrap.activate(); - } - this._isTransitioning = false; - EventHandler.trigger(this._element, EVENT_SHOWN$4, { - relatedTarget - }); - }; - this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { - if (event.key !== ESCAPE_KEY$1) { - return; - } - if (this._config.keyboard) { - this.hide(); - return; - } - this._triggerBackdropTransition(); - }); - EventHandler.on(window, EVENT_RESIZE$1, () => { - if (this._isShown && !this._isTransitioning) { - this._adjustDialog(); - } - }); - EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { - // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks - EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { - if (this._element !== event.target || this._element !== event2.target) { - return; - } - if (this._config.backdrop === 'static') { - this._triggerBackdropTransition(); - return; - } - if (this._config.backdrop) { - this.hide(); - } - }); - }); + return elementIsVisible; +}; +const isDisabled = element => { + if (!element || element.nodeType !== Node.ELEMENT_NODE) { + return true; } - _hideModal() { - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', true); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - this._isTransitioning = false; - this._backdrop.hide(() => { - document.body.classList.remove(CLASS_NAME_OPEN); - this._resetAdjustments(); - this._scrollBar.reset(); - EventHandler.trigger(this._element, EVENT_HIDDEN$4); - }); + if (element.classList.contains('disabled')) { + return true; } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_FADE$3); + if (typeof element.disabled !== 'undefined') { + return element.disabled; } - _triggerBackdropTransition() { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); - if (hideEvent.defaultPrevented) { - return; - } - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const initialOverflowY = this._element.style.overflowY; - // return if the following background transition hasn't yet completed - if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { - return; - } - if (!isModalOverflowing) { - this._element.style.overflowY = 'hidden'; - } - this._element.classList.add(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.classList.remove(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.style.overflowY = initialOverflowY; - }, this._dialog); - }, this._dialog); - this._element.focus(); + return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; +}; +const findShadowRoot = element => { + if (!document.documentElement.attachShadow) { + return null; } - /** - * The following methods are used to handle overflowing modals - */ - - _adjustDialog() { - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const scrollbarWidth = this._scrollBar.getWidth(); - const isBodyOverflowing = scrollbarWidth > 0; - if (isBodyOverflowing && !isModalOverflowing) { - const property = isRTL() ? 'paddingLeft' : 'paddingRight'; - this._element.style[property] = `${scrollbarWidth}px`; - } - if (!isBodyOverflowing && isModalOverflowing) { - const property = isRTL() ? 'paddingRight' : 'paddingLeft'; - this._element.style[property] = `${scrollbarWidth}px`; - } + // Can find the shadow root otherwise it'll return the document + if (typeof element.getRootNode === 'function') { + const root = element.getRootNode(); + return root instanceof ShadowRoot ? root : null; } - _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; + if (element instanceof ShadowRoot) { + return element; } - // Static - static jQueryInterface(config, relatedTarget) { - return this.each(function () { - const data = Modal.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](relatedTarget); - }); + // when we don't find a shadow root + if (!element.parentNode) { + return null; } -} + return findShadowRoot(element.parentNode); +}; +const noop = () => {}; /** - * Data API implementation + * Trick to restart an element's animation + * + * @param {HTMLElement} element + * @return void + * + * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation */ +const reflow = element => { + element.offsetHeight; // eslint-disable-line no-unused-expressions +}; -EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); +const getjQuery = () => { + if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { + return window.jQuery; } - EventHandler.one(target, EVENT_SHOW$4, showEvent => { - if (showEvent.defaultPrevented) { - // only register focus restorer if modal will actually get shown - return; + return null; +}; +const DOMContentLoadedCallbacks = []; +const onDOMContentLoaded = callback => { + if (document.readyState === 'loading') { + // add listener on the first call when the document is in loading state + if (!DOMContentLoadedCallbacks.length) { + document.addEventListener('DOMContentLoaded', () => { + for (const callback of DOMContentLoadedCallbacks) { + callback(); + } + }); } - EventHandler.one(target, EVENT_HIDDEN$4, () => { - if (isVisible(this)) { - this.focus(); - } - }); - }); - - // avoid conflict when clicking modal toggler while another one is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); - if (alreadyOpen) { - Modal.getInstance(alreadyOpen).hide(); - } - const data = Modal.getOrCreateInstance(target); - data.toggle(this); -}); -enableDismissTrigger(Modal); + DOMContentLoadedCallbacks.push(callback); + } else { + callback(); + } +}; +const isRTL = () => document.documentElement.dir === 'rtl'; +const defineJQueryPlugin = plugin => { + onDOMContentLoaded(() => { + const $ = getjQuery(); + /* istanbul ignore if */ + if ($) { + const name = plugin.NAME; + const JQUERY_NO_CONFLICT = $.fn[name]; + $.fn[name] = plugin.jQueryInterface; + $.fn[name].Constructor = plugin; + $.fn[name].noConflict = () => { + $.fn[name] = JQUERY_NO_CONFLICT; + return plugin.jQueryInterface; + }; + } + }); +}; +const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { + return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue; +}; +const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { + if (!waitForTransition) { + execute(callback); + return; + } + const durationPadding = 5; + const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; + let called = false; + const handler = ({ + target + }) => { + if (target !== transitionElement) { + return; + } + called = true; + transitionElement.removeEventListener(TRANSITION_END, handler); + execute(callback); + }; + transitionElement.addEventListener(TRANSITION_END, handler); + setTimeout(() => { + if (!called) { + triggerTransitionEnd(transitionElement); + } + }, emulatedDuration); +}; /** - * jQuery + * Return the previous/next element of a list. + * + * @param {array} list The list of elements + * @param activeElement The active element + * @param shouldGetNext Choose to get next or previous element + * @param isCycleAllowed + * @return {Element|elem} The proper element */ +const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { + const listLength = list.length; + let index = list.indexOf(activeElement); -defineJQueryPlugin(Modal); + // if the element does not exist in the list return an element + // depending on the direction and if cycle is allowed + if (index === -1) { + return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]; + } + index += shouldGetNext ? 1 : -1; + if (isCycleAllowed) { + index = (index + listLength) % listLength; + } + return list[Math.max(0, Math.min(index, listLength - 1))]; +}; /** * -------------------------------------------------------------------------- - * Bootstrap offcanvas.js + * Bootstrap dom/event-handler.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -25047,321 +22348,329 @@ defineJQueryPlugin(Modal); * Constants */ -const NAME$6 = 'offcanvas'; -const DATA_KEY$3 = 'bs.offcanvas'; -const EVENT_KEY$3 = `.${DATA_KEY$3}`; -const DATA_API_KEY$1 = '.data-api'; -const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; -const ESCAPE_KEY = 'Escape'; -const CLASS_NAME_SHOW$3 = 'show'; -const CLASS_NAME_SHOWING$1 = 'showing'; -const CLASS_NAME_HIDING = 'hiding'; -const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; -const OPEN_SELECTOR = '.offcanvas.show'; -const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; -const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; -const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; -const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; -const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; -const EVENT_RESIZE = `resize${EVENT_KEY$3}`; -const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; -const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; -const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; -const Default$5 = { - backdrop: true, - keyboard: true, - scroll: false -}; -const DefaultType$5 = { - backdrop: '(boolean|string)', - keyboard: 'boolean', - scroll: 'boolean' +const namespaceRegex = /[^.]*(?=\..*)\.|.*/; +const stripNameRegex = /\..*/; +const stripUidRegex = /::\d+$/; +const eventRegistry = {}; // Events storage +let uidEvent = 1; +const customEvents = { + mouseenter: 'mouseover', + mouseleave: 'mouseout' }; +const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); /** - * Class definition + * Private methods */ -class Offcanvas extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isShown = false; - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._addEventListeners(); +function makeEventUid(element, uid) { + return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; +} +function getElementEvents(element) { + const uid = makeEventUid(element); + element.uidEvent = uid; + eventRegistry[uid] = eventRegistry[uid] || {}; + return eventRegistry[uid]; +} +function bootstrapHandler(element, fn) { + return function handler(event) { + hydrateObj(event, { + delegateTarget: element + }); + if (handler.oneOff) { + EventHandler.off(element, event.type, fn); + } + return fn.apply(element, [event]); + }; +} +function bootstrapDelegationHandler(element, selector, fn) { + return function handler(event) { + const domElements = element.querySelectorAll(selector); + for (let { + target + } = event; target && target !== this; target = target.parentNode) { + for (const domElement of domElements) { + if (domElement !== target) { + continue; + } + hydrateObj(event, { + delegateTarget: target + }); + if (handler.oneOff) { + EventHandler.off(element, event.type, selector, fn); + } + return fn.apply(target, [event]); + } + } + }; +} +function findHandler(events, callable, delegationSelector = null) { + return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); +} +function normalizeParameters(originalTypeEvent, handler, delegationFunction) { + const isDelegated = typeof handler === 'string'; + // TODO: tooltip passes `false` instead of selector, so we need to check + const callable = isDelegated ? delegationFunction : handler || delegationFunction; + let typeEvent = getTypeEvent(originalTypeEvent); + if (!nativeEvents.has(typeEvent)) { + typeEvent = originalTypeEvent; } - - // Getters - static get Default() { - return Default$5; + return [isDelegated, callable, typeEvent]; +} +function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) { + if (typeof originalTypeEvent !== 'string' || !element) { + return; } - static get DefaultType() { - return DefaultType$5; + let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); + + // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position + // this prevents the handler from being dispatched the same way as mouseover or mouseout does + if (originalTypeEvent in customEvents) { + const wrapFunction = fn => { + return function (event) { + if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { + return fn.call(this, event); + } + }; + }; + callable = wrapFunction(callable); } - static get NAME() { - return NAME$6; + const events = getElementEvents(element); + const handlers = events[typeEvent] || (events[typeEvent] = {}); + const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); + if (previousFunction) { + previousFunction.oneOff = previousFunction.oneOff && oneOff; + return; } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); + const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); + const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); + fn.delegationSelector = isDelegated ? handler : null; + fn.callable = callable; + fn.oneOff = oneOff; + fn.uidEvent = uid; + handlers[uid] = fn; + element.addEventListener(typeEvent, fn, isDelegated); +} +function removeHandler(element, events, typeEvent, handler, delegationSelector) { + const fn = findHandler(events[typeEvent], handler, delegationSelector); + if (!fn) { + return; } - show(relatedTarget) { - if (this._isShown) { - return; + element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); + delete events[typeEvent][fn.uidEvent]; +} +function removeNamespacedHandlers(element, events, typeEvent, namespace) { + const storeElementEvent = events[typeEvent] || {}; + for (const [handlerKey, event] of Object.entries(storeElementEvent)) { + if (handlerKey.includes(namespace)) { + removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { - relatedTarget - }); - if (showEvent.defaultPrevented) { + } +} +function getTypeEvent(event) { + // allow to get the native events from namespaced events ('click.bs.button' --> 'click') + event = event.replace(stripNameRegex, ''); + return customEvents[event] || event; +} +const EventHandler = { + on(element, event, handler, delegationFunction) { + addHandler(element, event, handler, delegationFunction, false); + }, + one(element, event, handler, delegationFunction) { + addHandler(element, event, handler, delegationFunction, true); + }, + off(element, originalTypeEvent, handler, delegationFunction) { + if (typeof originalTypeEvent !== 'string' || !element) { return; } - this._isShown = true; - this._backdrop.show(); - if (!this._config.scroll) { - new ScrollBarHelper().hide(); - } - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.classList.add(CLASS_NAME_SHOWING$1); - const completeCallBack = () => { - if (!this._config.scroll || this._config.backdrop) { - this._focustrap.activate(); + const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); + const inNamespace = typeEvent !== originalTypeEvent; + const events = getElementEvents(element); + const storeElementEvent = events[typeEvent] || {}; + const isNamespace = originalTypeEvent.startsWith('.'); + if (typeof callable !== 'undefined') { + // Simplest case: handler is passed, remove that listener ONLY. + if (!Object.keys(storeElementEvent).length) { + return; } - this._element.classList.add(CLASS_NAME_SHOW$3); - this._element.classList.remove(CLASS_NAME_SHOWING$1); - EventHandler.trigger(this._element, EVENT_SHOWN$3, { - relatedTarget - }); - }; - this._queueCallback(completeCallBack, this._element, true); - } - hide() { - if (!this._isShown) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); - if (hideEvent.defaultPrevented) { + removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null); return; } - this._focustrap.deactivate(); - this._element.blur(); - this._isShown = false; - this._element.classList.add(CLASS_NAME_HIDING); - this._backdrop.hide(); - const completeCallback = () => { - this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - if (!this._config.scroll) { - new ScrollBarHelper().reset(); - } - EventHandler.trigger(this._element, EVENT_HIDDEN$3); - }; - this._queueCallback(completeCallback, this._element, true); - } - dispose() { - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - - // Private - _initializeBackDrop() { - const clickCallback = () => { - if (this._config.backdrop === 'static') { - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - return; - } - this.hide(); - }; - - // 'static' option will be translated to true, and booleans will keep their value - const isVisible = Boolean(this._config.backdrop); - return new Backdrop({ - className: CLASS_NAME_BACKDROP, - isVisible, - isAnimated: true, - rootElement: this._element.parentNode, - clickCallback: isVisible ? clickCallback : null - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { - if (event.key !== ESCAPE_KEY) { - return; + if (isNamespace) { + for (const elementEvent of Object.keys(events)) { + removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); } - if (this._config.keyboard) { - this.hide(); - return; + } + for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { + const handlerKey = keyHandlers.replace(stripUidRegex, ''); + if (!inNamespace || originalTypeEvent.includes(handlerKey)) { + removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - }); + } + }, + trigger(element, event, args) { + if (typeof event !== 'string' || !element) { + return null; + } + const $ = getjQuery(); + const typeEvent = getTypeEvent(event); + const inNamespace = event !== typeEvent; + let jQueryEvent = null; + let bubbles = true; + let nativeDispatch = true; + let defaultPrevented = false; + if (inNamespace && $) { + jQueryEvent = $.Event(event, args); + $(element).trigger(jQueryEvent); + bubbles = !jQueryEvent.isPropagationStopped(); + nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); + defaultPrevented = jQueryEvent.isDefaultPrevented(); + } + const evt = hydrateObj(new Event(event, { + bubbles, + cancelable: true + }), args); + if (defaultPrevented) { + evt.preventDefault(); + } + if (nativeDispatch) { + element.dispatchEvent(evt); + } + if (evt.defaultPrevented && jQueryEvent) { + jQueryEvent.preventDefault(); + } + return evt; } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Offcanvas.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - }); +}; +function hydrateObj(obj, meta = {}) { + for (const [key, value] of Object.entries(meta)) { + try { + obj[key] = value; + } catch (_unused) { + Object.defineProperty(obj, key, { + configurable: true, + get() { + return value; + } + }); + } } + return obj; } /** - * Data API implementation + * -------------------------------------------------------------------------- + * Bootstrap dom/manipulator.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); +function normalizeData(value) { + if (value === 'true') { + return true; } - if (isDisabled(this)) { - return; + if (value === 'false') { + return false; } - EventHandler.one(target, EVENT_HIDDEN$3, () => { - // focus on trigger when it is closed - if (isVisible(this)) { - this.focus(); - } - }); - - // avoid conflict when clicking a toggler of an offcanvas, while another is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); - if (alreadyOpen && alreadyOpen !== target) { - Offcanvas.getInstance(alreadyOpen).hide(); + if (value === Number(value).toString()) { + return Number(value); } - const data = Offcanvas.getOrCreateInstance(target); - data.toggle(this); -}); -EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { - for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { - Offcanvas.getOrCreateInstance(selector).show(); + if (value === '' || value === 'null') { + return null; } -}); -EventHandler.on(window, EVENT_RESIZE, () => { - for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { - if (getComputedStyle(element).position !== 'fixed') { - Offcanvas.getOrCreateInstance(element).hide(); + if (typeof value !== 'string') { + return value; + } + try { + return JSON.parse(decodeURIComponent(value)); + } catch (_unused) { + return value; + } +} +function normalizeDataKey(key) { + return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); +} +const Manipulator = { + setDataAttribute(element, key, value) { + element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); + }, + removeDataAttribute(element, key) { + element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); + }, + getDataAttributes(element) { + if (!element) { + return {}; } + const attributes = {}; + const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); + for (const key of bsKeys) { + let pureKey = key.replace(/^bs/, ''); + pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); + attributes[pureKey] = normalizeData(element.dataset[key]); + } + return attributes; + }, + getDataAttribute(element, key) { + return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); } -}); -enableDismissTrigger(Offcanvas); +}; /** - * jQuery + * -------------------------------------------------------------------------- + * Bootstrap util/config.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -defineJQueryPlugin(Offcanvas); /** - * -------------------------------------------------------------------------- - * Bootstrap util/sanitizer.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- + * Class definition */ -// js-docs-start allow-list -const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; -const DefaultAllowlist = { - // Global attributes allowed on any supplied element below. - '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], - a: ['target', 'href', 'title', 'rel'], - area: [], - b: [], - br: [], - col: [], - code: [], - div: [], - em: [], - hr: [], - h1: [], - h2: [], - h3: [], - h4: [], - h5: [], - h6: [], - i: [], - img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], - li: [], - ol: [], - p: [], - pre: [], - s: [], - small: [], - span: [], - sub: [], - sup: [], - strong: [], - u: [], - ul: [] -}; -// js-docs-end allow-list - -const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); - -/** - * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation - * contexts. - * - * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 - */ -// eslint-disable-next-line unicorn/better-regex -const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; -const allowedAttribute = (attribute, allowedAttributeList) => { - const attributeName = attribute.nodeName.toLowerCase(); - if (allowedAttributeList.includes(attributeName)) { - if (uriAttributes.has(attributeName)) { - return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); - } - return true; +class Config { + // Getters + static get Default() { + return {}; } - - // Check if a regular expression validates the attribute. - return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); -}; -function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { - if (!unsafeHtml.length) { - return unsafeHtml; + static get DefaultType() { + return {}; } - if (sanitizeFunction && typeof sanitizeFunction === 'function') { - return sanitizeFunction(unsafeHtml); + static get NAME() { + throw new Error('You have to implement the static method "NAME", for each component!'); } - const domParser = new window.DOMParser(); - const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); - const elements = [].concat(...createdDocument.body.querySelectorAll('*')); - for (const element of elements) { - const elementName = element.nodeName.toLowerCase(); - if (!Object.keys(allowList).includes(elementName)) { - element.remove(); - continue; - } - const attributeList = [].concat(...element.attributes); - const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); - for (const attribute of attributeList) { - if (!allowedAttribute(attribute, allowedAttributes)) { - element.removeAttribute(attribute.nodeName); + _getConfig(config) { + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + _configAfterMerge(config) { + return config; + } + _mergeConfigObj(config, element) { + const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse + + return { + ...this.constructor.Default, + ...(typeof jsonConfig === 'object' ? jsonConfig : {}), + ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}), + ...(typeof config === 'object' ? config : {}) + }; + } + _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { + for (const [property, expectedTypes] of Object.entries(configTypes)) { + const value = config[property]; + const valueType = isElement(value) ? 'element' : toType(value); + if (!new RegExp(expectedTypes).test(valueType)) { + throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); } } } - return createdDocument.body.innerHTML; } /** * -------------------------------------------------------------------------- - * Bootstrap util/template-factory.js + * Bootstrap base-component.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -25371,645 +22680,439 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { * Constants */ -const NAME$5 = 'TemplateFactory'; -const Default$4 = { - allowList: DefaultAllowlist, - content: {}, - // { selector : text , selector2 : text2 , } - extraClass: '', - html: false, - sanitize: true, - sanitizeFn: null, - template: '<div></div>' -}; -const DefaultType$4 = { - allowList: 'object', - content: 'object', - extraClass: '(string|function)', - html: 'boolean', - sanitize: 'boolean', - sanitizeFn: '(null|function)', - template: 'string' -}; -const DefaultContentType = { - entry: '(string|element|function|null)', - selector: '(string|element)' -}; +const VERSION = '5.3.2'; /** * Class definition */ -class TemplateFactory extends Config { - constructor(config) { +class BaseComponent extends Config { + constructor(element, config) { super(); + element = getElement(element); + if (!element) { + return; + } + this._element = element; this._config = this._getConfig(config); - } - - // Getters - static get Default() { - return Default$4; - } - static get DefaultType() { - return DefaultType$4; - } - static get NAME() { - return NAME$5; + Data.set(this._element, this.constructor.DATA_KEY, this); } // Public - getContent() { - return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); - } - hasContent() { - return this.getContent().length > 0; + dispose() { + Data.remove(this._element, this.constructor.DATA_KEY); + EventHandler.off(this._element, this.constructor.EVENT_KEY); + for (const propertyName of Object.getOwnPropertyNames(this)) { + this[propertyName] = null; + } } - changeContent(content) { - this._checkContent(content); - this._config.content = { - ...this._config.content, - ...content - }; - return this; + _queueCallback(callback, element, isAnimated = true) { + executeAfterTransition(callback, element, isAnimated); } - toHtml() { - const templateWrapper = document.createElement('div'); - templateWrapper.innerHTML = this._maybeSanitize(this._config.template); - for (const [selector, text] of Object.entries(this._config.content)) { - this._setContent(templateWrapper, text, selector); - } - const template = templateWrapper.children[0]; - const extraClass = this._resolvePossibleFunction(this._config.extraClass); - if (extraClass) { - template.classList.add(...extraClass.split(' ')); - } - return template; + _getConfig(config) { + config = this._mergeConfigObj(config, this._element); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; } - // Private - _typeCheckConfig(config) { - super._typeCheckConfig(config); - this._checkContent(config.content); + // Static + static getInstance(element) { + return Data.get(getElement(element), this.DATA_KEY); } - _checkContent(arg) { - for (const [selector, content] of Object.entries(arg)) { - super._typeCheckConfig({ - selector, - entry: content - }, DefaultContentType); - } + static getOrCreateInstance(element, config = {}) { + return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); } - _setContent(template, content, selector) { - const templateElement = SelectorEngine.findOne(selector, template); - if (!templateElement) { - return; - } - content = this._resolvePossibleFunction(content); - if (!content) { - templateElement.remove(); - return; - } - if (isElement(content)) { - this._putElementInTemplate(getElement(content), templateElement); - return; - } - if (this._config.html) { - templateElement.innerHTML = this._maybeSanitize(content); - return; - } - templateElement.textContent = content; + static get VERSION() { + return VERSION; } - _maybeSanitize(arg) { - return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; + static get DATA_KEY() { + return `bs.${this.NAME}`; } - _resolvePossibleFunction(arg) { - return execute(arg, [this]); + static get EVENT_KEY() { + return `.${this.DATA_KEY}`; } - _putElementInTemplate(element, templateElement) { - if (this._config.html) { - templateElement.innerHTML = ''; - templateElement.append(element); - return; - } - templateElement.textContent = element.textContent; + static eventName(name) { + return `${name}${this.EVENT_KEY}`; } } /** * -------------------------------------------------------------------------- - * Bootstrap tooltip.js + * Bootstrap dom/selector-engine.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ +const getSelector = element => { + let selector = element.getAttribute('data-bs-target'); + if (!selector || selector === '#') { + let hrefAttribute = element.getAttribute('href'); -/** - * Constants - */ - -const NAME$4 = 'tooltip'; -const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); -const CLASS_NAME_FADE$2 = 'fade'; -const CLASS_NAME_MODAL = 'modal'; -const CLASS_NAME_SHOW$2 = 'show'; -const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; -const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; -const EVENT_MODAL_HIDE = 'hide.bs.modal'; -const TRIGGER_HOVER = 'hover'; -const TRIGGER_FOCUS = 'focus'; -const TRIGGER_CLICK = 'click'; -const TRIGGER_MANUAL = 'manual'; -const EVENT_HIDE$2 = 'hide'; -const EVENT_HIDDEN$2 = 'hidden'; -const EVENT_SHOW$2 = 'show'; -const EVENT_SHOWN$2 = 'shown'; -const EVENT_INSERTED = 'inserted'; -const EVENT_CLICK$1 = 'click'; -const EVENT_FOCUSIN$1 = 'focusin'; -const EVENT_FOCUSOUT$1 = 'focusout'; -const EVENT_MOUSEENTER = 'mouseenter'; -const EVENT_MOUSELEAVE = 'mouseleave'; -const AttachmentMap = { - AUTO: 'auto', - TOP: 'top', - RIGHT: isRTL() ? 'left' : 'right', - BOTTOM: 'bottom', - LEFT: isRTL() ? 'right' : 'left' -}; -const Default$3 = { - allowList: DefaultAllowlist, - animation: true, - boundary: 'clippingParents', - container: false, - customClass: '', - delay: 0, - fallbackPlacements: ['top', 'right', 'bottom', 'left'], - html: false, - offset: [0, 6], - placement: 'top', - popperConfig: null, - sanitize: true, - sanitizeFn: null, - selector: false, - template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', - title: '', - trigger: 'hover focus' + // The only valid content that could double as a selector are IDs or classes, + // so everything starting with `#` or `.`. If a "real" URL is used as the selector, + // `document.querySelector` will rightfully complain it is invalid. + // See https://github.com/twbs/bootstrap/issues/32273 + if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) { + return null; + } + + // Just in case some CMS puts out a full URL with the anchor appended + if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { + hrefAttribute = `#${hrefAttribute.split('#')[1]}`; + } + selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null; + } + return selector; }; -const DefaultType$3 = { - allowList: 'object', - animation: 'boolean', - boundary: '(string|element)', - container: '(string|element|boolean)', - customClass: '(string|function)', - delay: '(number|object)', - fallbackPlacements: 'array', - html: 'boolean', - offset: '(array|string|function)', - placement: '(string|function)', - popperConfig: '(null|object|function)', - sanitize: 'boolean', - sanitizeFn: '(null|function)', - selector: '(string|boolean)', - template: 'string', - title: '(string|element|function)', - trigger: 'string' +const SelectorEngine = { + find(selector, element = document.documentElement) { + return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); + }, + findOne(selector, element = document.documentElement) { + return Element.prototype.querySelector.call(element, selector); + }, + children(element, selector) { + return [].concat(...element.children).filter(child => child.matches(selector)); + }, + parents(element, selector) { + const parents = []; + let ancestor = element.parentNode.closest(selector); + while (ancestor) { + parents.push(ancestor); + ancestor = ancestor.parentNode.closest(selector); + } + return parents; + }, + prev(element, selector) { + let previous = element.previousElementSibling; + while (previous) { + if (previous.matches(selector)) { + return [previous]; + } + previous = previous.previousElementSibling; + } + return []; + }, + // TODO: this is now unused; remove later along with prev() + next(element, selector) { + let next = element.nextElementSibling; + while (next) { + if (next.matches(selector)) { + return [next]; + } + next = next.nextElementSibling; + } + return []; + }, + focusableChildren(element) { + const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); + return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); + }, + getSelectorFromElement(element) { + const selector = getSelector(element); + if (selector) { + return SelectorEngine.findOne(selector) ? selector : null; + } + return null; + }, + getElementFromSelector(element) { + const selector = getSelector(element); + return selector ? SelectorEngine.findOne(selector) : null; + }, + getMultipleElementsFromSelector(element) { + const selector = getSelector(element); + return selector ? SelectorEngine.find(selector) : []; + } }; /** - * Class definition + * -------------------------------------------------------------------------- + * Bootstrap util/component-functions.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -class Tooltip extends BaseComponent { - constructor(element, config) { - if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') { - throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); +const enableDismissTrigger = (component, method = 'hide') => { + const clickEvent = `click.dismiss${component.EVENT_KEY}`; + const name = component.NAME; + EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { + if (['A', 'AREA'].includes(this.tagName)) { + event.preventDefault(); } - super(element, config); + if (isDisabled(this)) { + return; + } + const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); + const instance = component.getOrCreateInstance(target); - // Private - this._isEnabled = true; - this._timeout = 0; - this._isHovered = null; - this._activeTrigger = {}; - this._popper = null; - this._templateFactory = null; - this._newContent = null; + // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method + instance[method](); + }); +}; - // Protected - this.tip = null; - this._setListeners(); - if (!this._config.selector) { - this._fixTitle(); - } - } +/** + * -------------------------------------------------------------------------- + * Bootstrap alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + + +/** + * Constants + */ + +const NAME$f = 'alert'; +const DATA_KEY$a = 'bs.alert'; +const EVENT_KEY$b = `.${DATA_KEY$a}`; +const EVENT_CLOSE = `close${EVENT_KEY$b}`; +const EVENT_CLOSED = `closed${EVENT_KEY$b}`; +const CLASS_NAME_FADE$5 = 'fade'; +const CLASS_NAME_SHOW$8 = 'show'; + +/** + * Class definition + */ +class Alert extends BaseComponent { // Getters - static get Default() { - return Default$3; - } - static get DefaultType() { - return DefaultType$3; - } static get NAME() { - return NAME$4; + return NAME$f; } // Public - enable() { - this._isEnabled = true; - } - disable() { - this._isEnabled = false; - } - toggleEnabled() { - this._isEnabled = !this._isEnabled; - } - toggle() { - if (!this._isEnabled) { - return; - } - this._activeTrigger.click = !this._activeTrigger.click; - if (this._isShown()) { - this._leave(); + close() { + const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); + if (closeEvent.defaultPrevented) { return; } - this._enter(); + this._element.classList.remove(CLASS_NAME_SHOW$8); + const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); + this._queueCallback(() => this._destroyElement(), this._element, isAnimated); } - dispose() { - clearTimeout(this._timeout); - EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - if (this._element.getAttribute('data-bs-original-title')) { - this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); - } - this._disposePopper(); - super.dispose(); + + // Private + _destroyElement() { + this._element.remove(); + EventHandler.trigger(this._element, EVENT_CLOSED); + this.dispose(); } - show() { - if (this._element.style.display === 'none') { - throw new Error('Please use show on visible elements'); - } - if (!(this._isWithContent() && this._isEnabled)) { - return; - } - const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); - const shadowRoot = findShadowRoot(this._element); - const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); - if (showEvent.defaultPrevented || !isInTheDom) { - return; - } - // TODO: v6 remove this or make it optional - this._disposePopper(); - const tip = this._getTipElement(); - this._element.setAttribute('aria-describedby', tip.getAttribute('id')); - const { - container - } = this._config; - if (!this._element.ownerDocument.documentElement.contains(this.tip)) { - container.append(tip); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); - } - this._popper = this._createPopper(tip); - tip.classList.add(CLASS_NAME_SHOW$2); - - // If this is a touch-enabled device we add extra - // empty mouseover listeners to the body's immediate children; - // only needed because of broken event delegation on iOS - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Alert.getOrCreateInstance(this); + if (typeof config !== 'string') { + return; } - } - const complete = () => { - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); - if (this._isHovered === false) { - this._leave(); + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError(`No method named "${config}"`); } - this._isHovered = false; - }; - this._queueCallback(complete, this.tip, this._isAnimated()); + data[config](this); + }); } - hide() { - if (!this._isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); - if (hideEvent.defaultPrevented) { - return; - } - const tip = this._getTipElement(); - tip.classList.remove(CLASS_NAME_SHOW$2); +} - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); - } - } - this._activeTrigger[TRIGGER_CLICK] = false; - this._activeTrigger[TRIGGER_FOCUS] = false; - this._activeTrigger[TRIGGER_HOVER] = false; - this._isHovered = null; // it is a trick to support manual triggering +/** + * Data API implementation + */ - const complete = () => { - if (this._isWithActiveTrigger()) { - return; - } - if (!this._isHovered) { - this._disposePopper(); - } - this._element.removeAttribute('aria-describedby'); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - update() { - if (this._popper) { - this._popper.update(); - } +enableDismissTrigger(Alert, 'close'); + +/** + * jQuery + */ + +defineJQueryPlugin(Alert); + +/** + * -------------------------------------------------------------------------- + * Bootstrap button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + + +/** + * Constants + */ + +const NAME$e = 'button'; +const DATA_KEY$9 = 'bs.button'; +const EVENT_KEY$a = `.${DATA_KEY$9}`; +const DATA_API_KEY$6 = '.data-api'; +const CLASS_NAME_ACTIVE$3 = 'active'; +const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; +const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; + +/** + * Class definition + */ + +class Button extends BaseComponent { + // Getters + static get NAME() { + return NAME$e; } - // Protected - _isWithContent() { - return Boolean(this._getTitle()); + // Public + toggle() { + // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method + this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); } - _getTipElement() { - if (!this.tip) { - this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); - } - return this.tip; + + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Button.getOrCreateInstance(this); + if (config === 'toggle') { + data[config](); + } + }); } - _createTipElement(content) { - const tip = this._getTemplateFactory(content).toHtml(); +} - // TODO: remove this check in v6 - if (!tip) { - return null; - } - tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); - // TODO: v6 the following can be achieved with CSS only - tip.classList.add(`bs-${this.constructor.NAME}-auto`); - const tipId = getUID(this.constructor.NAME).toString(); - tip.setAttribute('id', tipId); - if (this._isAnimated()) { - tip.classList.add(CLASS_NAME_FADE$2); +/** + * Data API implementation + */ + +EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { + event.preventDefault(); + const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); + const data = Button.getOrCreateInstance(button); + data.toggle(); +}); + +/** + * jQuery + */ + +defineJQueryPlugin(Button); + +/** + * -------------------------------------------------------------------------- + * Bootstrap util/swipe.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ + + +/** + * Constants + */ + +const NAME$d = 'swipe'; +const EVENT_KEY$9 = '.bs.swipe'; +const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; +const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; +const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; +const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; +const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; +const POINTER_TYPE_TOUCH = 'touch'; +const POINTER_TYPE_PEN = 'pen'; +const CLASS_NAME_POINTER_EVENT = 'pointer-event'; +const SWIPE_THRESHOLD = 40; +const Default$c = { + endCallback: null, + leftCallback: null, + rightCallback: null +}; +const DefaultType$c = { + endCallback: '(function|null)', + leftCallback: '(function|null)', + rightCallback: '(function|null)' +}; + +/** + * Class definition + */ + +class Swipe extends Config { + constructor(element, config) { + super(); + this._element = element; + if (!element || !Swipe.isSupported()) { + return; } - return tip; + this._config = this._getConfig(config); + this._deltaX = 0; + this._supportPointerEvents = Boolean(window.PointerEvent); + this._initEvents(); } - setContent(content) { - this._newContent = content; - if (this._isShown()) { - this._disposePopper(); - this.show(); - } + + // Getters + static get Default() { + return Default$c; } - _getTemplateFactory(content) { - if (this._templateFactory) { - this._templateFactory.changeContent(content); - } else { - this._templateFactory = new TemplateFactory({ - ...this._config, - // the `content` var has to be after `this._config` - // to override config.content in case of popover - content, - extraClass: this._resolvePossibleFunction(this._config.customClass) - }); - } - return this._templateFactory; + static get DefaultType() { + return DefaultType$c; } - _getContentForTemplate() { - return { - [SELECTOR_TOOLTIP_INNER]: this._getTitle() - }; + static get NAME() { + return NAME$d; } - _getTitle() { - return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); + + // Public + dispose() { + EventHandler.off(this._element, EVENT_KEY$9); } // Private - _initializeOnDelegatedTarget(event) { - return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); - } - _isAnimated() { - return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); - } - _isShown() { - return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); - } - _createPopper(tip) { - const placement = execute(this._config.placement, [this, tip, this._element]); - const attachment = AttachmentMap[placement.toUpperCase()]; - return _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(this._element, tip, this._getPopperConfig(attachment)); - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); + _start(event) { + if (!this._supportPointerEvents) { + this._deltaX = event.touches[0].clientX; + return; } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX; } - return offset; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this._element]); - } - _getPopperConfig(attachment) { - const defaultBsPopperConfig = { - placement: attachment, - modifiers: [{ - name: 'flip', - options: { - fallbackPlacements: this._config.fallbackPlacements - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }, { - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'arrow', - options: { - element: `.${this.constructor.NAME}-arrow` - } - }, { - name: 'preSetPlacement', - enabled: true, - phase: 'beforeMain', - fn: data => { - // Pre-set Popper's placement attribute in order to read the arrow sizes properly. - // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement - this._getTipElement().setAttribute('data-popper-placement', data.state.placement); - } - }] - }; - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; } - _setListeners() { - const triggers = this._config.trigger.split(' '); - for (const trigger of triggers) { - if (trigger === 'click') { - EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context.toggle(); - }); - } else if (trigger !== TRIGGER_MANUAL) { - const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); - const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); - EventHandler.on(this._element, eventIn, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; - context._enter(); - }); - EventHandler.on(this._element, eventOut, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); - context._leave(); - }); - } + _end(event) { + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX - this._deltaX; } - this._hideModalHandler = () => { - if (this._element) { - this.hide(); - } - }; - EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + this._handleSwipe(); + execute(this._config.endCallback); } - _fixTitle() { - const title = this._element.getAttribute('title'); - if (!title) { - return; - } - if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { - this._element.setAttribute('aria-label', title); - } - this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility - this._element.removeAttribute('title'); + _move(event) { + this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; } - _enter() { - if (this._isShown() || this._isHovered) { - this._isHovered = true; + _handleSwipe() { + const absDeltaX = Math.abs(this._deltaX); + if (absDeltaX <= SWIPE_THRESHOLD) { return; } - this._isHovered = true; - this._setTimeout(() => { - if (this._isHovered) { - this.show(); - } - }, this._config.delay.show); - } - _leave() { - if (this._isWithActiveTrigger()) { + const direction = absDeltaX / this._deltaX; + this._deltaX = 0; + if (!direction) { return; } - this._isHovered = false; - this._setTimeout(() => { - if (!this._isHovered) { - this.hide(); - } - }, this._config.delay.hide); - } - _setTimeout(handler, timeout) { - clearTimeout(this._timeout); - this._timeout = setTimeout(handler, timeout); - } - _isWithActiveTrigger() { - return Object.values(this._activeTrigger).includes(true); - } - _getConfig(config) { - const dataAttributes = Manipulator.getDataAttributes(this._element); - for (const dataAttribute of Object.keys(dataAttributes)) { - if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { - delete dataAttributes[dataAttribute]; - } - } - config = { - ...dataAttributes, - ...(typeof config === 'object' && config ? config : {}) - }; - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - config.container = config.container === false ? document.body : getElement(config.container); - if (typeof config.delay === 'number') { - config.delay = { - show: config.delay, - hide: config.delay - }; - } - if (typeof config.title === 'number') { - config.title = config.title.toString(); - } - if (typeof config.content === 'number') { - config.content = config.content.toString(); - } - return config; + execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); } - _getDelegateConfig() { - const config = {}; - for (const [key, value] of Object.entries(this._config)) { - if (this.constructor.Default[key] !== value) { - config[key] = value; - } + _initEvents() { + if (this._supportPointerEvents) { + EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); + EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); + this._element.classList.add(CLASS_NAME_POINTER_EVENT); + } else { + EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); + EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); + EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); } - config.selector = false; - config.trigger = 'manual'; - - // In the future can be replaced with: - // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) - // `Object.fromEntries(keysWithDifferentValues)` - return config; } - _disposePopper() { - if (this._popper) { - this._popper.destroy(); - this._popper = null; - } - if (this.tip) { - this.tip.remove(); - this.tip = null; - } + _eventIsPointerPenTouch(event) { + return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); } // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Tooltip.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); + static isSupported() { + return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } } -/** - * jQuery - */ - -defineJQueryPlugin(Tooltip); - /** * -------------------------------------------------------------------------- - * Bootstrap popover.js + * Bootstrap carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -26019,315 +23122,325 @@ defineJQueryPlugin(Tooltip); * Constants */ -const NAME$3 = 'popover'; -const SELECTOR_TITLE = '.popover-header'; -const SELECTOR_CONTENT = '.popover-body'; -const Default$2 = { - ...Tooltip.Default, - content: '', - offset: [0, 8], - placement: 'right', - template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>', - trigger: 'click' -}; -const DefaultType$2 = { - ...Tooltip.DefaultType, - content: '(null|string|element|function)' -}; +const NAME$c = 'carousel'; +const DATA_KEY$8 = 'bs.carousel'; +const EVENT_KEY$8 = `.${DATA_KEY$8}`; +const DATA_API_KEY$5 = '.data-api'; +const ARROW_LEFT_KEY$1 = 'ArrowLeft'; +const ARROW_RIGHT_KEY$1 = 'ArrowRight'; +const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch -/** - * Class definition - */ - -class Popover extends Tooltip { - // Getters - static get Default() { - return Default$2; - } - static get DefaultType() { - return DefaultType$2; - } - static get NAME() { - return NAME$3; - } - - // Overrides - _isWithContent() { - return this._getTitle() || this._getContent(); - } - - // Private - _getContentForTemplate() { - return { - [SELECTOR_TITLE]: this._getTitle(), - [SELECTOR_CONTENT]: this._getContent() - }; - } - _getContent() { - return this._resolvePossibleFunction(this._config.content); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Popover.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } -} - -/** - * jQuery - */ - -defineJQueryPlugin(Popover); - -/** - * -------------------------------------------------------------------------- - * Bootstrap scrollspy.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - -/** - * Constants - */ - -const NAME$2 = 'scrollspy'; -const DATA_KEY$2 = 'bs.scrollspy'; -const EVENT_KEY$2 = `.${DATA_KEY$2}`; -const DATA_API_KEY = '.data-api'; -const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; -const EVENT_CLICK = `click${EVENT_KEY$2}`; -const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`; -const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; -const CLASS_NAME_ACTIVE$1 = 'active'; -const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; -const SELECTOR_TARGET_LINKS = '[href]'; -const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; -const SELECTOR_NAV_LINKS = '.nav-link'; -const SELECTOR_NAV_ITEMS = '.nav-item'; -const SELECTOR_LIST_ITEMS = '.list-group-item'; -const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; -const SELECTOR_DROPDOWN = '.dropdown'; -const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; -const Default$1 = { - offset: null, - // TODO: v6 @deprecated, keep it for backwards compatibility reasons - rootMargin: '0px 0px -25%', - smoothScroll: false, - target: null, - threshold: [0.1, 0.5, 1] +const ORDER_NEXT = 'next'; +const ORDER_PREV = 'prev'; +const DIRECTION_LEFT = 'left'; +const DIRECTION_RIGHT = 'right'; +const EVENT_SLIDE = `slide${EVENT_KEY$8}`; +const EVENT_SLID = `slid${EVENT_KEY$8}`; +const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; +const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; +const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; +const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; +const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; +const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; +const CLASS_NAME_CAROUSEL = 'carousel'; +const CLASS_NAME_ACTIVE$2 = 'active'; +const CLASS_NAME_SLIDE = 'slide'; +const CLASS_NAME_END = 'carousel-item-end'; +const CLASS_NAME_START = 'carousel-item-start'; +const CLASS_NAME_NEXT = 'carousel-item-next'; +const CLASS_NAME_PREV = 'carousel-item-prev'; +const SELECTOR_ACTIVE = '.active'; +const SELECTOR_ITEM = '.carousel-item'; +const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; +const SELECTOR_ITEM_IMG = '.carousel-item img'; +const SELECTOR_INDICATORS = '.carousel-indicators'; +const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; +const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; +const KEY_TO_DIRECTION = { + [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, + [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT }; -const DefaultType$1 = { - offset: '(number|null)', - // TODO v6 @deprecated, keep it for backwards compatibility reasons - rootMargin: 'string', - smoothScroll: 'boolean', - target: 'element', - threshold: 'array' +const Default$b = { + interval: 5000, + keyboard: true, + pause: 'hover', + ride: false, + touch: true, + wrap: true +}; +const DefaultType$b = { + interval: '(number|boolean)', + // TODO:v6 remove boolean support + keyboard: 'boolean', + pause: '(string|boolean)', + ride: '(boolean|string)', + touch: 'boolean', + wrap: 'boolean' }; /** * Class definition */ -class ScrollSpy extends BaseComponent { +class Carousel extends BaseComponent { constructor(element, config) { super(element, config); - - // this._element is the observablesContainer and config.target the menu links wrapper - this._targetLinks = new Map(); - this._observableSections = new Map(); - this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; - this._activeTarget = null; - this._observer = null; - this._previousScrollData = { - visibleEntryTop: 0, - parentScrollTop: 0 - }; - this.refresh(); // initialize + this._interval = null; + this._activeElement = null; + this._isSliding = false; + this.touchTimeout = null; + this._swipeHelper = null; + this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); + this._addEventListeners(); + if (this._config.ride === CLASS_NAME_CAROUSEL) { + this.cycle(); + } } // Getters static get Default() { - return Default$1; + return Default$b; } static get DefaultType() { - return DefaultType$1; + return DefaultType$b; } static get NAME() { - return NAME$2; + return NAME$c; } // Public - refresh() { - this._initializeTargetsAndObservables(); - this._maybeEnableSmoothScroll(); - if (this._observer) { - this._observer.disconnect(); - } else { - this._observer = this._getNewObserver(); + next() { + this._slide(ORDER_NEXT); + } + nextWhenVisible() { + // FIXME TODO use `document.visibilityState` + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && isVisible(this._element)) { + this.next(); } - for (const section of this._observableSections.values()) { - this._observer.observe(section); + } + prev() { + this._slide(ORDER_PREV); + } + pause() { + if (this._isSliding) { + triggerTransitionEnd(this._element); + } + this._clearInterval(); + } + cycle() { + this._clearInterval(); + this._updateInterval(); + this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); + } + _maybeEnableCycle() { + if (!this._config.ride) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); + return; + } + this.cycle(); + } + to(index) { + const items = this._getItems(); + if (index > items.length - 1 || index < 0) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); + return; + } + const activeIndex = this._getItemIndex(this._getActive()); + if (activeIndex === index) { + return; } + const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; + this._slide(order, items[index]); } dispose() { - this._observer.disconnect(); + if (this._swipeHelper) { + this._swipeHelper.dispose(); + } super.dispose(); } // Private _configAfterMerge(config) { - // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case - config.target = getElement(config.target) || document.body; - - // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only - config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; - if (typeof config.threshold === 'string') { - config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); - } + config.defaultInterval = config.interval; return config; } - _maybeEnableSmoothScroll() { - if (!this._config.smoothScroll) { - return; + _addEventListeners() { + if (this._config.keyboard) { + EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); + } + if (this._config.pause === 'hover') { + EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); + EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); + } + if (this._config.touch && Swipe.isSupported()) { + this._addTouchEventListeners(); } - - // unregister any previous listeners - EventHandler.off(this._config.target, EVENT_CLICK); - EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { - const observableSection = this._observableSections.get(event.target.hash); - if (observableSection) { - event.preventDefault(); - const root = this._rootElement || window; - const height = observableSection.offsetTop - this._element.offsetTop; - if (root.scrollTo) { - root.scrollTo({ - top: height, - behavior: 'smooth' - }); - return; - } - - // Chrome 60 doesn't support `scrollTo` - root.scrollTop = height; - } - }); - } - _getNewObserver() { - const options = { - root: this._rootElement, - threshold: this._config.threshold, - rootMargin: this._config.rootMargin - }; - return new IntersectionObserver(entries => this._observerCallback(entries), options); } - - // The logic of selection - _observerCallback(entries) { - const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); - const activate = entry => { - this._previousScrollData.visibleEntryTop = entry.target.offsetTop; - this._process(targetElement(entry)); - }; - const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; - const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; - this._previousScrollData.parentScrollTop = parentScrollTop; - for (const entry of entries) { - if (!entry.isIntersecting) { - this._activeTarget = null; - this._clearActiveClass(targetElement(entry)); - continue; - } - const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; - // if we are scrolling down, pick the bigger offsetTop - if (userScrollsDown && entryIsLowerThanPrevious) { - activate(entry); - // if parent isn't scrolled, let's keep the first visible item, breaking the iteration - if (!parentScrollTop) { - return; - } - continue; + _addTouchEventListeners() { + for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { + EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); + } + const endCallBack = () => { + if (this._config.pause !== 'hover') { + return; } - // if we are scrolling up, pick the smallest offsetTop - if (!userScrollsDown && !entryIsLowerThanPrevious) { - activate(entry); + // If it's a touch-enabled device, mouseenter/leave are fired as + // part of the mouse compatibility events on first tap - the carousel + // would stop cycling until user tapped out of it; + // here, we listen for touchend, explicitly pause the carousel + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + + this.pause(); + if (this.touchTimeout) { + clearTimeout(this.touchTimeout); } + this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); + }; + const swipeConfig = { + leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), + rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), + endCallback: endCallBack + }; + this._swipeHelper = new Swipe(this._element, swipeConfig); + } + _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + const direction = KEY_TO_DIRECTION[event.key]; + if (direction) { + event.preventDefault(); + this._slide(this._directionToOrder(direction)); } } - _initializeTargetsAndObservables() { - this._targetLinks = new Map(); - this._observableSections = new Map(); - const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); - for (const anchor of targetLinks) { - // ensure that the anchor has an id and is not disabled - if (!anchor.hash || isDisabled(anchor)) { - continue; - } - const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); - - // ensure that the observableSection exists & is visible - if (isVisible(observableSection)) { - this._targetLinks.set(decodeURI(anchor.hash), anchor); - this._observableSections.set(anchor.hash, observableSection); - } + _getItemIndex(element) { + return this._getItems().indexOf(element); + } + _setActiveIndicatorElement(index) { + if (!this._indicatorsElement) { + return; + } + const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); + activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); + activeIndicator.removeAttribute('aria-current'); + const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); + if (newActiveIndicator) { + newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); + newActiveIndicator.setAttribute('aria-current', 'true'); } } - _process(target) { - if (this._activeTarget === target) { + _updateInterval() { + const element = this._activeElement || this._getActive(); + if (!element) { return; } - this._clearActiveClass(this._config.target); - this._activeTarget = target; - target.classList.add(CLASS_NAME_ACTIVE$1); - this._activateParents(target); - EventHandler.trigger(this._element, EVENT_ACTIVATE, { - relatedTarget: target - }); + const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); + this._config.interval = elementInterval || this._config.defaultInterval; } - _activateParents(target) { - // Activate dropdown parents - if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { - SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); + _slide(order, element = null) { + if (this._isSliding) { return; } - for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { - // Set triggered links parents as active - // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor - for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) { - item.classList.add(CLASS_NAME_ACTIVE$1); - } + const activeElement = this._getActive(); + const isNext = order === ORDER_NEXT; + const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); + if (nextElement === activeElement) { + return; + } + const nextElementIndex = this._getItemIndex(nextElement); + const triggerEvent = eventName => { + return EventHandler.trigger(this._element, eventName, { + relatedTarget: nextElement, + direction: this._orderToDirection(order), + from: this._getItemIndex(activeElement), + to: nextElementIndex + }); + }; + const slideEvent = triggerEvent(EVENT_SLIDE); + if (slideEvent.defaultPrevented) { + return; + } + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + // TODO: change tests that use empty divs to avoid this check + return; + } + const isCycling = Boolean(this._interval); + this.pause(); + this._isSliding = true; + this._setActiveIndicatorElement(nextElementIndex); + this._activeElement = nextElement; + const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; + const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; + nextElement.classList.add(orderClassName); + reflow(nextElement); + activeElement.classList.add(directionalClassName); + nextElement.classList.add(directionalClassName); + const completeCallBack = () => { + nextElement.classList.remove(directionalClassName, orderClassName); + nextElement.classList.add(CLASS_NAME_ACTIVE$2); + activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); + this._isSliding = false; + triggerEvent(EVENT_SLID); + }; + this._queueCallback(completeCallBack, activeElement, this._isAnimated()); + if (isCycling) { + this.cycle(); } } - _clearActiveClass(parent) { - parent.classList.remove(CLASS_NAME_ACTIVE$1); - const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent); - for (const node of activeNodes) { - node.classList.remove(CLASS_NAME_ACTIVE$1); + _isAnimated() { + return this._element.classList.contains(CLASS_NAME_SLIDE); + } + _getActive() { + return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + } + _getItems() { + return SelectorEngine.find(SELECTOR_ITEM, this._element); + } + _clearInterval() { + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } + } + _directionToOrder(direction) { + if (isRTL()) { + return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; + } + return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; + } + _orderToDirection(order) { + if (isRTL()) { + return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; } + return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; } // Static static jQueryInterface(config) { return this.each(function () { - const data = ScrollSpy.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + const data = Carousel.getOrCreateInstance(this, config); + if (typeof config === 'number') { + data.to(config); return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); + if (typeof config === 'string') { + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); } - data[config](); }); } } @@ -26336,9 +23449,31 @@ class ScrollSpy extends BaseComponent { * Data API implementation */ -EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => { - for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) { - ScrollSpy.getOrCreateInstance(spy); +EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { + const target = SelectorEngine.getElementFromSelector(this); + if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { + return; + } + event.preventDefault(); + const carousel = Carousel.getOrCreateInstance(target); + const slideIndex = this.getAttribute('data-bs-slide-to'); + if (slideIndex) { + carousel.to(slideIndex); + carousel._maybeEnableCycle(); + return; + } + if (Manipulator.getDataAttribute(this, 'slide') === 'next') { + carousel.next(); + carousel._maybeEnableCycle(); + return; + } + carousel.prev(); + carousel._maybeEnableCycle(); +}); +EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { + const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); + for (const carousel of carousels) { + Carousel.getOrCreateInstance(carousel); } }); @@ -26346,11 +23481,11 @@ EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => { * jQuery */ -defineJQueryPlugin(ScrollSpy); +defineJQueryPlugin(Carousel); /** * -------------------------------------------------------------------------- - * Bootstrap tab.js + * Bootstrap collapse.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -26360,232 +23495,202 @@ defineJQueryPlugin(ScrollSpy); * Constants */ -const NAME$1 = 'tab'; -const DATA_KEY$1 = 'bs.tab'; -const EVENT_KEY$1 = `.${DATA_KEY$1}`; -const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`; -const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`; -const EVENT_SHOW$1 = `show${EVENT_KEY$1}`; -const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`; -const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`; -const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`; -const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`; -const ARROW_LEFT_KEY = 'ArrowLeft'; -const ARROW_RIGHT_KEY = 'ArrowRight'; -const ARROW_UP_KEY = 'ArrowUp'; -const ARROW_DOWN_KEY = 'ArrowDown'; -const HOME_KEY = 'Home'; -const END_KEY = 'End'; -const CLASS_NAME_ACTIVE = 'active'; -const CLASS_NAME_FADE$1 = 'fade'; -const CLASS_NAME_SHOW$1 = 'show'; -const CLASS_DROPDOWN = 'dropdown'; -const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; -const SELECTOR_DROPDOWN_MENU = '.dropdown-menu'; -const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)'; -const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'; -const SELECTOR_OUTER = '.nav-item, .list-group-item'; -const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`; -const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6 -const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`; -const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`; +const NAME$b = 'collapse'; +const DATA_KEY$7 = 'bs.collapse'; +const EVENT_KEY$7 = `.${DATA_KEY$7}`; +const DATA_API_KEY$4 = '.data-api'; +const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; +const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; +const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; +const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; +const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; +const CLASS_NAME_SHOW$7 = 'show'; +const CLASS_NAME_COLLAPSE = 'collapse'; +const CLASS_NAME_COLLAPSING = 'collapsing'; +const CLASS_NAME_COLLAPSED = 'collapsed'; +const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; +const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; +const WIDTH = 'width'; +const HEIGHT = 'height'; +const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; +const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; +const Default$a = { + parent: null, + toggle: true +}; +const DefaultType$a = { + parent: '(null|element)', + toggle: 'boolean' +}; /** * Class definition */ -class Tab extends BaseComponent { - constructor(element) { - super(element); - this._parent = this._element.closest(SELECTOR_TAB_PANEL); - if (!this._parent) { - return; - // TODO: should throw exception in v6 - // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`) +class Collapse extends BaseComponent { + constructor(element, config) { + super(element, config); + this._isTransitioning = false; + this._triggerArray = []; + const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); + for (const elem of toggleList) { + const selector = SelectorEngine.getSelectorFromElement(elem); + const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); + if (selector !== null && filterElement.length) { + this._triggerArray.push(elem); + } + } + this._initializeChildren(); + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); + } + if (this._config.toggle) { + this.toggle(); } - - // Set up initial aria attributes - this._setInitialAttributes(this._parent, this._getChildren()); - EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); } // Getters + static get Default() { + return Default$a; + } + static get DefaultType() { + return DefaultType$a; + } static get NAME() { - return NAME$1; + return NAME$b; } // Public + toggle() { + if (this._isShown()) { + this.hide(); + } else { + this.show(); + } + } show() { - // Shows this elem and deactivate the active sibling if exists - const innerElem = this._element; - if (this._elemIsActive(innerElem)) { + if (this._isTransitioning || this._isShown()) { return; } + let activeChildren = []; - // Search for active tab on same parent to deactivate it - const active = this._getActiveElem(); - const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, { - relatedTarget: innerElem - }) : null; - const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, { - relatedTarget: active - }); - if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) { - return; + // find active children + if (this._config.parent) { + activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { + toggle: false + })); } - this._deactivate(active, innerElem); - this._activate(innerElem, active); - } - - // Private - _activate(element, relatedElem) { - if (!element) { + if (activeChildren.length && activeChildren[0]._isTransitioning) { return; } - element.classList.add(CLASS_NAME_ACTIVE); - this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section - - const complete = () => { - if (element.getAttribute('role') !== 'tab') { - element.classList.add(CLASS_NAME_SHOW$1); - return; - } - element.removeAttribute('tabindex'); - element.setAttribute('aria-selected', true); - this._toggleDropDown(element, true); - EventHandler.trigger(element, EVENT_SHOWN$1, { - relatedTarget: relatedElem - }); - }; - this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); - } - _deactivate(element, relatedElem) { - if (!element) { + const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); + if (startEvent.defaultPrevented) { return; } - element.classList.remove(CLASS_NAME_ACTIVE); - element.blur(); - this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too - + for (const activeInstance of activeChildren) { + activeInstance.hide(); + } + const dimension = this._getDimension(); + this._element.classList.remove(CLASS_NAME_COLLAPSE); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.style[dimension] = 0; + this._addAriaAndCollapsedClass(this._triggerArray, true); + this._isTransitioning = true; const complete = () => { - if (element.getAttribute('role') !== 'tab') { - element.classList.remove(CLASS_NAME_SHOW$1); - return; - } - element.setAttribute('aria-selected', false); - element.setAttribute('tabindex', '-1'); - this._toggleDropDown(element, false); - EventHandler.trigger(element, EVENT_HIDDEN$1, { - relatedTarget: relatedElem - }); + this._isTransitioning = false; + this._element.classList.remove(CLASS_NAME_COLLAPSING); + this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + this._element.style[dimension] = ''; + EventHandler.trigger(this._element, EVENT_SHOWN$6); }; - this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); + const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + const scrollSize = `scroll${capitalizedDimension}`; + this._queueCallback(complete, this._element, true); + this._element.style[dimension] = `${this._element[scrollSize]}px`; } - _keydown(event) { - if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) { + hide() { + if (this._isTransitioning || !this._isShown()) { return; } - event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page - event.preventDefault(); - const children = this._getChildren().filter(element => !isDisabled(element)); - let nextActiveElement; - if ([HOME_KEY, END_KEY].includes(event.key)) { - nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]; - } else { - const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key); - nextActiveElement = getNextActiveElement(children, event.target, isNext, true); + const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); + if (startEvent.defaultPrevented) { + return; } - if (nextActiveElement) { - nextActiveElement.focus({ - preventScroll: true - }); - Tab.getOrCreateInstance(nextActiveElement).show(); + const dimension = this._getDimension(); + this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; + reflow(this._element); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + for (const trigger of this._triggerArray) { + const element = SelectorEngine.getElementFromSelector(trigger); + if (element && !this._isShown(element)) { + this._addAriaAndCollapsedClass([trigger], false); + } } + this._isTransitioning = true; + const complete = () => { + this._isTransitioning = false; + this._element.classList.remove(CLASS_NAME_COLLAPSING); + this._element.classList.add(CLASS_NAME_COLLAPSE); + EventHandler.trigger(this._element, EVENT_HIDDEN$6); + }; + this._element.style[dimension] = ''; + this._queueCallback(complete, this._element, true); } - _getChildren() { - // collection of inner elements - return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent); + _isShown(element = this._element) { + return element.classList.contains(CLASS_NAME_SHOW$7); } - _getActiveElem() { - return this._getChildren().find(child => this._elemIsActive(child)) || null; + + // Private + _configAfterMerge(config) { + config.toggle = Boolean(config.toggle); // Coerce string values + config.parent = getElement(config.parent); + return config; } - _setInitialAttributes(parent, children) { - this._setAttributeIfNotExists(parent, 'role', 'tablist'); - for (const child of children) { - this._setInitialAttributesOnChild(child); - } + _getDimension() { + return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; } - _setInitialAttributesOnChild(child) { - child = this._getInnerElement(child); - const isActive = this._elemIsActive(child); - const outerElem = this._getOuterElement(child); - child.setAttribute('aria-selected', isActive); - if (outerElem !== child) { - this._setAttributeIfNotExists(outerElem, 'role', 'presentation'); - } - if (!isActive) { - child.setAttribute('tabindex', '-1'); - } - this._setAttributeIfNotExists(child, 'role', 'tab'); - - // set attributes to the related panel too - this._setInitialAttributesOnTargetPanel(child); - } - _setInitialAttributesOnTargetPanel(child) { - const target = SelectorEngine.getElementFromSelector(child); - if (!target) { + _initializeChildren() { + if (!this._config.parent) { return; } - this._setAttributeIfNotExists(target, 'role', 'tabpanel'); - if (child.id) { - this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`); + const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); + for (const element of children) { + const selected = SelectorEngine.getElementFromSelector(element); + if (selected) { + this._addAriaAndCollapsedClass([element], this._isShown(selected)); + } } } - _toggleDropDown(element, open) { - const outerElem = this._getOuterElement(element); - if (!outerElem.classList.contains(CLASS_DROPDOWN)) { + _getFirstLevelChildren(selector) { + const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); + // remove children if greater depth + return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); + } + _addAriaAndCollapsedClass(triggerArray, isOpen) { + if (!triggerArray.length) { return; } - const toggle = (selector, className) => { - const element = SelectorEngine.findOne(selector, outerElem); - if (element) { - element.classList.toggle(className, open); - } - }; - toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE); - toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1); - outerElem.setAttribute('aria-expanded', open); - } - _setAttributeIfNotExists(element, attribute, value) { - if (!element.hasAttribute(attribute)) { - element.setAttribute(attribute, value); + for (const element of triggerArray) { + element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); + element.setAttribute('aria-expanded', isOpen); } } - _elemIsActive(elem) { - return elem.classList.contains(CLASS_NAME_ACTIVE); - } - - // Try to get the inner element (usually the .nav-link) - _getInnerElement(elem) { - return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem); - } - - // Try to get the outer element (usually the .nav-item) - _getOuterElement(elem) { - return elem.closest(SELECTOR_OUTER) || elem; - } // Static static jQueryInterface(config) { + const _config = {}; + if (typeof config === 'string' && /show|hide/.test(config)) { + _config.toggle = false; + } return this.each(function () { - const data = Tab.getOrCreateInstance(this); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); + const data = Collapse.getOrCreateInstance(this, _config); + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); } - data[config](); }); } } @@ -26594,33 +23699,27 @@ class Tab extends BaseComponent { * Data API implementation */ -EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { - if (['A', 'AREA'].includes(this.tagName)) { +EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { + // preventDefault only for <a> elements (which change the URL) not inside the collapsible element + if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { event.preventDefault(); } - if (isDisabled(this)) { - return; + for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { + Collapse.getOrCreateInstance(element, { + toggle: false + }).toggle(); } - Tab.getOrCreateInstance(this).show(); }); -/** - * Initialize on focus - */ -EventHandler.on(window, EVENT_LOAD_DATA_API, () => { - for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) { - Tab.getOrCreateInstance(element); - } -}); /** * jQuery */ -defineJQueryPlugin(Tab); +defineJQueryPlugin(Collapse); /** * -------------------------------------------------------------------------- - * Bootstrap toast.js + * Bootstrap dropdown.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -26630,8298 +23729,15846 @@ defineJQueryPlugin(Tab); * Constants */ -const NAME = 'toast'; -const DATA_KEY = 'bs.toast'; -const EVENT_KEY = `.${DATA_KEY}`; -const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; -const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; -const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; -const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; -const EVENT_HIDE = `hide${EVENT_KEY}`; -const EVENT_HIDDEN = `hidden${EVENT_KEY}`; -const EVENT_SHOW = `show${EVENT_KEY}`; -const EVENT_SHOWN = `shown${EVENT_KEY}`; -const CLASS_NAME_FADE = 'fade'; -const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility -const CLASS_NAME_SHOW = 'show'; -const CLASS_NAME_SHOWING = 'showing'; -const DefaultType = { - animation: 'boolean', - autohide: 'boolean', - delay: 'number' +const NAME$a = 'dropdown'; +const DATA_KEY$6 = 'bs.dropdown'; +const EVENT_KEY$6 = `.${DATA_KEY$6}`; +const DATA_API_KEY$3 = '.data-api'; +const ESCAPE_KEY$2 = 'Escape'; +const TAB_KEY$1 = 'Tab'; +const ARROW_UP_KEY$1 = 'ArrowUp'; +const ARROW_DOWN_KEY$1 = 'ArrowDown'; +const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button + +const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; +const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; +const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; +const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; +const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; +const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; +const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; +const CLASS_NAME_SHOW$6 = 'show'; +const CLASS_NAME_DROPUP = 'dropup'; +const CLASS_NAME_DROPEND = 'dropend'; +const CLASS_NAME_DROPSTART = 'dropstart'; +const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; +const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; +const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; +const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; +const SELECTOR_MENU = '.dropdown-menu'; +const SELECTOR_NAVBAR = '.navbar'; +const SELECTOR_NAVBAR_NAV = '.navbar-nav'; +const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; +const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; +const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; +const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; +const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; +const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; +const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; +const PLACEMENT_TOPCENTER = 'top'; +const PLACEMENT_BOTTOMCENTER = 'bottom'; +const Default$9 = { + autoClose: true, + boundary: 'clippingParents', + display: 'dynamic', + offset: [0, 2], + popperConfig: null, + reference: 'toggle' }; -const Default = { - animation: true, - autohide: true, - delay: 5000 +const DefaultType$9 = { + autoClose: '(boolean|string)', + boundary: '(string|element)', + display: 'string', + offset: '(array|string|function)', + popperConfig: '(null|object|function)', + reference: '(string|element|object)' }; /** * Class definition */ -class Toast extends BaseComponent { +class Dropdown extends BaseComponent { constructor(element, config) { super(element, config); - this._timeout = null; - this._hasMouseInteraction = false; - this._hasKeyboardInteraction = false; - this._setListeners(); + this._popper = null; + this._parent = this._element.parentNode; // dropdown wrapper + // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ + this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); + this._inNavbar = this._detectNavbar(); } // Getters static get Default() { - return Default; + return Default$9; } static get DefaultType() { - return DefaultType; + return DefaultType$9; } static get NAME() { - return NAME; + return NAME$a; } // Public + toggle() { + return this._isShown() ? this.hide() : this.show(); + } show() { - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); + if (isDisabled(this._element) || this._isShown()) { + return; + } + const relatedTarget = { + relatedTarget: this._element + }; + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); if (showEvent.defaultPrevented) { return; } - this._clearTimeout(); - if (this._config.animation) { - this._element.classList.add(CLASS_NAME_FADE); + this._createPopper(); + + // If this is a touch-enabled device we add extra + // empty mouseover listeners to the body's immediate children; + // only needed because of broken event delegation on iOS + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { + for (const element of [].concat(...document.body.children)) { + EventHandler.on(element, 'mouseover', noop); + } } - const complete = () => { - this._element.classList.remove(CLASS_NAME_SHOWING); - EventHandler.trigger(this._element, EVENT_SHOWN); - this._maybeScheduleHide(); - }; - this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING); - this._queueCallback(complete, this._element, this._config.animation); + this._element.focus(); + this._element.setAttribute('aria-expanded', true); + this._menu.classList.add(CLASS_NAME_SHOW$6); + this._element.classList.add(CLASS_NAME_SHOW$6); + EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); } hide() { - if (!this.isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); - if (hideEvent.defaultPrevented) { + if (isDisabled(this._element) || !this._isShown()) { return; } - const complete = () => { - this._element.classList.add(CLASS_NAME_HIDE); // @deprecated - this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW); - EventHandler.trigger(this._element, EVENT_HIDDEN); + const relatedTarget = { + relatedTarget: this._element }; - this._element.classList.add(CLASS_NAME_SHOWING); - this._queueCallback(complete, this._element, this._config.animation); + this._completeHide(relatedTarget); } dispose() { - this._clearTimeout(); - if (this.isShown()) { - this._element.classList.remove(CLASS_NAME_SHOW); + if (this._popper) { + this._popper.destroy(); } super.dispose(); } - isShown() { - return this._element.classList.contains(CLASS_NAME_SHOW); + update() { + this._inNavbar = this._detectNavbar(); + if (this._popper) { + this._popper.update(); + } } // Private - - _maybeScheduleHide() { - if (!this._config.autohide) { + _completeHide(relatedTarget) { + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); + if (hideEvent.defaultPrevented) { return; } - if (this._hasMouseInteraction || this._hasKeyboardInteraction) { - return; + + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + for (const element of [].concat(...document.body.children)) { + EventHandler.off(element, 'mouseover', noop); + } } - this._timeout = setTimeout(() => { - this.hide(); - }, this._config.delay); + if (this._popper) { + this._popper.destroy(); + } + this._menu.classList.remove(CLASS_NAME_SHOW$6); + this._element.classList.remove(CLASS_NAME_SHOW$6); + this._element.setAttribute('aria-expanded', 'false'); + Manipulator.removeDataAttribute(this._menu, 'popper'); + EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); } - _onInteraction(event, isInteracting) { - switch (event.type) { - case 'mouseover': - case 'mouseout': - { - this._hasMouseInteraction = isInteracting; - break; - } - case 'focusin': - case 'focusout': - { - this._hasKeyboardInteraction = isInteracting; - break; - } + _getConfig(config) { + config = super._getConfig(config); + if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { + // Popper virtual elements require a getBoundingClientRect method + throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); } - if (isInteracting) { - this._clearTimeout(); - return; + return config; + } + _createPopper() { + if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') { + throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); } - const nextElement = event.relatedTarget; - if (this._element === nextElement || this._element.contains(nextElement)) { - return; + let referenceElement = this._element; + if (this._config.reference === 'parent') { + referenceElement = this._parent; + } else if (isElement(this._config.reference)) { + referenceElement = getElement(this._config.reference); + } else if (typeof this._config.reference === 'object') { + referenceElement = this._config.reference; } - this._maybeScheduleHide(); + const popperConfig = this._getPopperConfig(); + this._popper = _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(referenceElement, this._menu, popperConfig); } - _setListeners() { - EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); - EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); - EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); - EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); + _isShown() { + return this._menu.classList.contains(CLASS_NAME_SHOW$6); } - _clearTimeout() { - clearTimeout(this._timeout); - this._timeout = null; + _getPlacement() { + const parentDropdown = this._parent; + if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { + return PLACEMENT_RIGHT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { + return PLACEMENT_LEFT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { + return PLACEMENT_TOPCENTER; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { + return PLACEMENT_BOTTOMCENTER; + } + + // We need to trim the value because custom properties can also include spaces + const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { + return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; + } + return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; + } + _detectNavbar() { + return this._element.closest(SELECTOR_NAVBAR) !== null; + } + _getOffset() { + const { + offset + } = this._config; + if (typeof offset === 'string') { + return offset.split(',').map(value => Number.parseInt(value, 10)); + } + if (typeof offset === 'function') { + return popperData => offset(popperData, this._element); + } + return offset; + } + _getPopperConfig() { + const defaultBsPopperConfig = { + placement: this._getPlacement(), + modifiers: [{ + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }] + }; + + // Disable Popper if we have a static display or Dropdown is in Navbar + if (this._inNavbar || this._config.display === 'static') { + Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove + defaultBsPopperConfig.modifiers = [{ + name: 'applyStyles', + enabled: false + }]; + } + return { + ...defaultBsPopperConfig, + ...execute(this._config.popperConfig, [defaultBsPopperConfig]) + }; + } + _selectMenuItem({ + key, + target + }) { + const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); + if (!items.length) { + return; + } + + // if target isn't included in items (e.g. when expanding the dropdown) + // allow cycling to get the last item in case key equals ARROW_UP_KEY + getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); } // Static static jQueryInterface(config) { return this.each(function () { - const data = Toast.getOrCreateInstance(this, config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); + const data = Dropdown.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); } + data[config](); }); } + static clearMenus(event) { + if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { + return; + } + const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); + for (const toggle of openToggles) { + const context = Dropdown.getInstance(toggle); + if (!context || context._config.autoClose === false) { + continue; + } + const composedPath = event.composedPath(); + const isMenuTarget = composedPath.includes(context._menu); + if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { + continue; + } + + // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu + if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { + continue; + } + const relatedTarget = { + relatedTarget: context._element + }; + if (event.type === 'click') { + relatedTarget.clickEvent = event; + } + context._completeHide(relatedTarget); + } + } + static dataApiKeydownHandler(event) { + // If not an UP | DOWN | ESCAPE key => not a dropdown command + // If input/textarea && if key is other than ESCAPE => not a dropdown command + + const isInput = /input|textarea/i.test(event.target.tagName); + const isEscapeEvent = event.key === ESCAPE_KEY$2; + const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); + if (!isUpOrDownEvent && !isEscapeEvent) { + return; + } + if (isInput && !isEscapeEvent) { + return; + } + event.preventDefault(); + + // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ + const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); + const instance = Dropdown.getOrCreateInstance(getToggleButton); + if (isUpOrDownEvent) { + event.stopPropagation(); + instance.show(); + instance._selectMenuItem(event); + return; + } + if (instance._isShown()) { + // else is escape and we check if it is shown + event.stopPropagation(); + instance.hide(); + getToggleButton.focus(); + } + } } /** * Data API implementation */ -enableDismissTrigger(Toast); +EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); +EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); +EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); +EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); +EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { + event.preventDefault(); + Dropdown.getOrCreateInstance(this).toggle(); +}); /** * jQuery */ -defineJQueryPlugin(Toast); +defineJQueryPlugin(Dropdown); +/** + * -------------------------------------------------------------------------- + * Bootstrap util/backdrop.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ -//# sourceMappingURL=bootstrap.esm.js.map +/** + * Constants + */ -/***/ }), +const NAME$9 = 'backdrop'; +const CLASS_NAME_FADE$4 = 'fade'; +const CLASS_NAME_SHOW$5 = 'show'; +const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; +const Default$8 = { + className: 'modal-backdrop', + clickCallback: null, + isAnimated: false, + isVisible: true, + // if false, we use the backdrop helper without adding any element to the dom + rootElement: 'body' // give the choice to place backdrop under different elements +}; -/***/ "./node_modules/clipboard/dist/clipboard.js": -/*!**************************************************!*\ - !*** ./node_modules/clipboard/dist/clipboard.js ***! - \**************************************************/ -/***/ (function(module) { +const DefaultType$8 = { + className: 'string', + clickCallback: '(function|null)', + isAnimated: 'boolean', + isVisible: 'boolean', + rootElement: '(element|string)' +}; -/*! - * clipboard.js v2.0.11 - * https://clipboardjs.com/ - * - * Licensed MIT © Zeno Rocha +/** + * Class definition */ -(function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else {} -})(this, function() { -return /******/ (function() { // webpackBootstrap -/******/ var __webpack_modules__ = ({ -/***/ 686: -/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) { +class Backdrop extends Config { + constructor(config) { + super(); + this._config = this._getConfig(config); + this._isAppended = false; + this._element = null; + } -"use strict"; + // Getters + static get Default() { + return Default$8; + } + static get DefaultType() { + return DefaultType$8; + } + static get NAME() { + return NAME$9; + } -// EXPORTS -__nested_webpack_require_623__.d(__nested_webpack_exports__, { - "default": function() { return /* binding */ clipboard; } -}); + // Public + show(callback) { + if (!this._config.isVisible) { + execute(callback); + return; + } + this._append(); + const element = this._getElement(); + if (this._config.isAnimated) { + reflow(element); + } + element.classList.add(CLASS_NAME_SHOW$5); + this._emulateAnimation(() => { + execute(callback); + }); + } + hide(callback) { + if (!this._config.isVisible) { + execute(callback); + return; + } + this._getElement().classList.remove(CLASS_NAME_SHOW$5); + this._emulateAnimation(() => { + this.dispose(); + execute(callback); + }); + } + dispose() { + if (!this._isAppended) { + return; + } + EventHandler.off(this._element, EVENT_MOUSEDOWN); + this._element.remove(); + this._isAppended = false; + } -// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js -var tiny_emitter = __nested_webpack_require_623__(279); -var tiny_emitter_default = /*#__PURE__*/__nested_webpack_require_623__.n(tiny_emitter); -// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js -var listen = __nested_webpack_require_623__(370); -var listen_default = /*#__PURE__*/__nested_webpack_require_623__.n(listen); -// EXTERNAL MODULE: ./node_modules/select/src/select.js -var src_select = __nested_webpack_require_623__(817); -var select_default = /*#__PURE__*/__nested_webpack_require_623__.n(src_select); -;// CONCATENATED MODULE: ./src/common/command.js -/** - * Executes a given operation type. - * @param {String} type - * @return {Boolean} - */ -function command(type) { - try { - return document.execCommand(type); - } catch (err) { - return false; + // Private + _getElement() { + if (!this._element) { + const backdrop = document.createElement('div'); + backdrop.className = this._config.className; + if (this._config.isAnimated) { + backdrop.classList.add(CLASS_NAME_FADE$4); + } + this._element = backdrop; + } + return this._element; + } + _configAfterMerge(config) { + // use getElement() with the default "body" to get a fresh Element on each instantiation + config.rootElement = getElement(config.rootElement); + return config; + } + _append() { + if (this._isAppended) { + return; + } + const element = this._getElement(); + this._config.rootElement.append(element); + EventHandler.on(element, EVENT_MOUSEDOWN, () => { + execute(this._config.clickCallback); + }); + this._isAppended = true; + } + _emulateAnimation(callback) { + executeAfterTransition(callback, this._getElement(), this._config.isAnimated); } } -;// CONCATENATED MODULE: ./src/actions/cut.js - /** - * Cut action wrapper. - * @param {String|HTMLElement} target - * @return {String} + * -------------------------------------------------------------------------- + * Bootstrap util/focustrap.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -var ClipboardActionCut = function ClipboardActionCut(target) { - var selectedText = select_default()(target); - command('cut'); - return selectedText; -}; -/* harmony default export */ var actions_cut = (ClipboardActionCut); -;// CONCATENATED MODULE: ./src/common/create-fake-element.js /** - * Creates a fake textarea element with a value. - * @param {String} value - * @return {HTMLElement} + * Constants */ -function createFakeElement(value) { - var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; - var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS - - fakeElement.style.fontSize = '12pt'; // Reset box model - - fakeElement.style.border = '0'; - fakeElement.style.padding = '0'; - fakeElement.style.margin = '0'; // Move element out of screen horizontally - fakeElement.style.position = 'absolute'; - fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically - - var yPosition = window.pageYOffset || document.documentElement.scrollTop; - fakeElement.style.top = "".concat(yPosition, "px"); - fakeElement.setAttribute('readonly', ''); - fakeElement.value = value; - return fakeElement; -} -;// CONCATENATED MODULE: ./src/actions/copy.js - - - -/** - * Create fake copy action wrapper using a fake element. - * @param {String} target - * @param {Object} options - * @return {String} - */ +const NAME$8 = 'focustrap'; +const DATA_KEY$5 = 'bs.focustrap'; +const EVENT_KEY$5 = `.${DATA_KEY$5}`; +const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; +const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; +const TAB_KEY = 'Tab'; +const TAB_NAV_FORWARD = 'forward'; +const TAB_NAV_BACKWARD = 'backward'; +const Default$7 = { + autofocus: true, + trapElement: null // The element to trap focus inside of +}; -var fakeCopyAction = function fakeCopyAction(value, options) { - var fakeElement = createFakeElement(value); - options.container.appendChild(fakeElement); - var selectedText = select_default()(fakeElement); - command('copy'); - fakeElement.remove(); - return selectedText; +const DefaultType$7 = { + autofocus: 'boolean', + trapElement: 'element' }; + /** - * Copy action wrapper. - * @param {String|HTMLElement} target - * @param {Object} options - * @return {String} + * Class definition */ - -var ClipboardActionCopy = function ClipboardActionCopy(target) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - container: document.body - }; - var selectedText = ''; - - if (typeof target === 'string') { - selectedText = fakeCopyAction(target, options); - } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) { - // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange - selectedText = fakeCopyAction(target.value, options); - } else { - selectedText = select_default()(target); - command('copy'); +class FocusTrap extends Config { + constructor(config) { + super(); + this._config = this._getConfig(config); + this._isActive = false; + this._lastTabNavDirection = null; } - return selectedText; -}; + // Getters + static get Default() { + return Default$7; + } + static get DefaultType() { + return DefaultType$7; + } + static get NAME() { + return NAME$8; + } -/* harmony default export */ var actions_copy = (ClipboardActionCopy); -;// CONCATENATED MODULE: ./src/actions/default.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + // Public + activate() { + if (this._isActive) { + return; + } + if (this._config.autofocus) { + this._config.trapElement.focus(); + } + EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop + EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); + EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); + this._isActive = true; + } + deactivate() { + if (!this._isActive) { + return; + } + this._isActive = false; + EventHandler.off(document, EVENT_KEY$5); + } + + // Private + _handleFocusin(event) { + const { + trapElement + } = this._config; + if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { + return; + } + const elements = SelectorEngine.focusableChildren(trapElement); + if (elements.length === 0) { + trapElement.focus(); + } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { + elements[elements.length - 1].focus(); + } else { + elements[0].focus(); + } + } + _handleKeydown(event) { + if (event.key !== TAB_KEY) { + return; + } + this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; + } +} +/** + * -------------------------------------------------------------------------- + * Bootstrap util/scrollBar.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ /** - * Inner function which performs selection from either `text` or `target` - * properties and then executes copy or cut operations. - * @param {Object} options + * Constants */ -var ClipboardActionDefault = function ClipboardActionDefault() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - // Defines base properties passed from constructor. - var _options$action = options.action, - action = _options$action === void 0 ? 'copy' : _options$action, - container = options.container, - target = options.target, - text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. +const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; +const SELECTOR_STICKY_CONTENT = '.sticky-top'; +const PROPERTY_PADDING = 'padding-right'; +const PROPERTY_MARGIN = 'margin-right'; - if (action !== 'copy' && action !== 'cut') { - throw new Error('Invalid "action" value, use either "copy" or "cut"'); - } // Sets the `target` property using an element that will be have its content copied. +/** + * Class definition + */ +class ScrollBarHelper { + constructor() { + this._element = document.body; + } - if (target !== undefined) { - if (target && _typeof(target) === 'object' && target.nodeType === 1) { - if (action === 'copy' && target.hasAttribute('disabled')) { - throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - } + // Public + getWidth() { + // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes + const documentWidth = document.documentElement.clientWidth; + return Math.abs(window.innerWidth - documentWidth); + } + hide() { + const width = this.getWidth(); + this._disableOverFlow(); + // give padding to element to balance the hidden scrollbar width + this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); + // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth + this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); + this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); + } + reset() { + this._resetElementAttributes(this._element, 'overflow'); + this._resetElementAttributes(this._element, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); + } + isOverflowing() { + return this.getWidth() > 0; + } - if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { - throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + // Private + _disableOverFlow() { + this._saveInitialAttribute(this._element, 'overflow'); + this._element.style.overflow = 'hidden'; + } + _setElementAttributes(selector, styleProperty, callback) { + const scrollbarWidth = this.getWidth(); + const manipulationCallBack = element => { + if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { + return; } - } else { - throw new Error('Invalid "target" value, use a valid Element'); + this._saveInitialAttribute(element, styleProperty); + const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); + element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + _saveInitialAttribute(element, styleProperty) { + const actualValue = element.style.getPropertyValue(styleProperty); + if (actualValue) { + Manipulator.setDataAttribute(element, styleProperty, actualValue); } - } // Define selection strategy based on `text` property. - - - if (text) { - return actions_copy(text, { - container: container - }); - } // Defines which selection strategy based on `target` property. - - - if (target) { - return action === 'cut' ? actions_cut(target) : actions_copy(target, { - container: container - }); } -}; - -/* harmony default export */ var actions_default = (ClipboardActionDefault); -;// CONCATENATED MODULE: ./src/clipboard.js -function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - - - + _resetElementAttributes(selector, styleProperty) { + const manipulationCallBack = element => { + const value = Manipulator.getDataAttribute(element, styleProperty); + // We only want to remove the property if the value is `null`; the value can also be zero + if (value === null) { + element.style.removeProperty(styleProperty); + return; + } + Manipulator.removeDataAttribute(element, styleProperty); + element.style.setProperty(styleProperty, value); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + _applyManipulationCallback(selector, callBack) { + if (isElement(selector)) { + callBack(selector); + return; + } + for (const sel of SelectorEngine.find(selector, this._element)) { + callBack(sel); + } + } +} /** - * Helper function to retrieve attribute value. - * @param {String} suffix - * @param {Element} element + * -------------------------------------------------------------------------- + * Bootstrap modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -function getAttributeValue(suffix, element) { - var attribute = "data-clipboard-".concat(suffix); - - if (!element.hasAttribute(attribute)) { - return; - } - return element.getAttribute(attribute); -} /** - * Base class which takes one or more elements, adds event listeners to them, - * and instantiates a new `ClipboardAction` on each click. + * Constants */ +const NAME$7 = 'modal'; +const DATA_KEY$4 = 'bs.modal'; +const EVENT_KEY$4 = `.${DATA_KEY$4}`; +const DATA_API_KEY$2 = '.data-api'; +const ESCAPE_KEY$1 = 'Escape'; +const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; +const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; +const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; +const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; +const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; +const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; +const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`; +const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; +const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; +const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; +const CLASS_NAME_OPEN = 'modal-open'; +const CLASS_NAME_FADE$3 = 'fade'; +const CLASS_NAME_SHOW$4 = 'show'; +const CLASS_NAME_STATIC = 'modal-static'; +const OPEN_SELECTOR$1 = '.modal.show'; +const SELECTOR_DIALOG = '.modal-dialog'; +const SELECTOR_MODAL_BODY = '.modal-body'; +const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; +const Default$6 = { + backdrop: true, + focus: true, + keyboard: true +}; +const DefaultType$6 = { + backdrop: '(boolean|string)', + focus: 'boolean', + keyboard: 'boolean' +}; -var Clipboard = /*#__PURE__*/function (_Emitter) { - _inherits(Clipboard, _Emitter); +/** + * Class definition + */ - var _super = _createSuper(Clipboard); - - /** - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - * @param {Object} options - */ - function Clipboard(trigger, options) { - var _this; - - _classCallCheck(this, Clipboard); - - _this = _super.call(this); - - _this.resolveOptions(options); - - _this.listenClick(trigger); - - return _this; +class Modal extends BaseComponent { + constructor(element, config) { + super(element, config); + this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); + this._backdrop = this._initializeBackDrop(); + this._focustrap = this._initializeFocusTrap(); + this._isShown = false; + this._isTransitioning = false; + this._scrollBar = new ScrollBarHelper(); + this._addEventListeners(); } - /** - * Defines if attributes would be resolved using internal setter functions - * or custom functions that were passed in the constructor. - * @param {Object} options - */ - - - _createClass(Clipboard, [{ - key: "resolveOptions", - value: function resolveOptions() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.action = typeof options.action === 'function' ? options.action : this.defaultAction; - this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; - this.text = typeof options.text === 'function' ? options.text : this.defaultText; - this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body; - } - /** - * Adds a click event listener to the passed trigger. - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - */ - - }, { - key: "listenClick", - value: function listenClick(trigger) { - var _this2 = this; - - this.listener = listen_default()(trigger, 'click', function (e) { - return _this2.onClick(e); - }); - } - /** - * Defines a new `ClipboardAction` on each click event. - * @param {Event} e - */ - - }, { - key: "onClick", - value: function onClick(e) { - var trigger = e.delegateTarget || e.currentTarget; - var action = this.action(trigger) || 'copy'; - var text = actions_default({ - action: action, - container: this.container, - target: this.target(trigger), - text: this.text(trigger) - }); // Fires an event based on the copy operation result. - this.emit(text ? 'success' : 'error', { - action: action, - text: text, - trigger: trigger, - clearSelection: function clearSelection() { - if (trigger) { - trigger.focus(); - } + // Getters + static get Default() { + return Default$6; + } + static get DefaultType() { + return DefaultType$6; + } + static get NAME() { + return NAME$7; + } - window.getSelection().removeAllRanges(); - } - }); + // Public + toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + show(relatedTarget) { + if (this._isShown || this._isTransitioning) { + return; } - /** - * Default `action` lookup function. - * @param {Element} trigger - */ - - }, { - key: "defaultAction", - value: function defaultAction(trigger) { - return getAttributeValue('action', trigger); + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { + relatedTarget + }); + if (showEvent.defaultPrevented) { + return; } - /** - * Default `target` lookup function. - * @param {Element} trigger - */ - - }, { - key: "defaultTarget", - value: function defaultTarget(trigger) { - var selector = getAttributeValue('target', trigger); - - if (selector) { - return document.querySelector(selector); - } + this._isShown = true; + this._isTransitioning = true; + this._scrollBar.hide(); + document.body.classList.add(CLASS_NAME_OPEN); + this._adjustDialog(); + this._backdrop.show(() => this._showElement(relatedTarget)); + } + hide() { + if (!this._isShown || this._isTransitioning) { + return; } - /** - * Allow fire programmatically a copy action - * @param {String|HTMLElement} target - * @param {Object} options - * @returns Text copied. - */ - - }, { - key: "defaultText", - - /** - * Default `text` lookup function. - * @param {Element} trigger - */ - value: function defaultText(trigger) { - return getAttributeValue('text', trigger); + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); + if (hideEvent.defaultPrevented) { + return; } - /** - * Destroy lifecycle. - */ + this._isShown = false; + this._isTransitioning = true; + this._focustrap.deactivate(); + this._element.classList.remove(CLASS_NAME_SHOW$4); + this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); + } + dispose() { + EventHandler.off(window, EVENT_KEY$4); + EventHandler.off(this._dialog, EVENT_KEY$4); + this._backdrop.dispose(); + this._focustrap.deactivate(); + super.dispose(); + } + handleUpdate() { + this._adjustDialog(); + } - }, { - key: "destroy", - value: function destroy() { - this.listener.destroy(); - } - }], [{ - key: "copy", - value: function copy(target) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - container: document.body - }; - return actions_copy(target, options); + // Private + _initializeBackDrop() { + return new Backdrop({ + isVisible: Boolean(this._config.backdrop), + // 'static' option will be translated to true, and booleans will keep their value, + isAnimated: this._isAnimated() + }); + } + _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + _showElement(relatedTarget) { + // try to append dynamic modal + if (!document.body.contains(this._element)) { + document.body.append(this._element); } - /** - * Allow fire programmatically a cut action - * @param {String|HTMLElement} target - * @returns Text cutted. - */ - - }, { - key: "cut", - value: function cut(target) { - return actions_cut(target); + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.scrollTop = 0; + const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); + if (modalBody) { + modalBody.scrollTop = 0; } - /** - * Returns the support of the given action, or all actions if no action is - * given. - * @param {String} [action] - */ - - }, { - key: "isSupported", - value: function isSupported() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; - var actions = typeof action === 'string' ? [action] : action; - var support = !!document.queryCommandSupported; - actions.forEach(function (action) { - support = support && !!document.queryCommandSupported(action); + reflow(this._element); + this._element.classList.add(CLASS_NAME_SHOW$4); + const transitionComplete = () => { + if (this._config.focus) { + this._focustrap.activate(); + } + this._isTransitioning = false; + EventHandler.trigger(this._element, EVENT_SHOWN$4, { + relatedTarget }); - return support; - } - }]); - - return Clipboard; -}((tiny_emitter_default())); - -/* harmony default export */ var clipboard = (Clipboard); - -/***/ }), - -/***/ 828: -/***/ (function(module) { - -var DOCUMENT_NODE_TYPE = 9; - -/** - * A polyfill for Element.matches() - */ -if (typeof Element !== 'undefined' && !Element.prototype.matches) { - var proto = Element.prototype; - - proto.matches = proto.matchesSelector || - proto.mozMatchesSelector || - proto.msMatchesSelector || - proto.oMatchesSelector || - proto.webkitMatchesSelector; -} - -/** - * Finds the closest parent that matches a selector. - * - * @param {Element} element - * @param {String} selector - * @return {Function} - */ -function closest (element, selector) { - while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { - if (typeof element.matches === 'function' && - element.matches(selector)) { - return element; + }; + this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); + } + _addEventListeners() { + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { + if (event.key !== ESCAPE_KEY$1) { + return; + } + if (this._config.keyboard) { + this.hide(); + return; + } + this._triggerBackdropTransition(); + }); + EventHandler.on(window, EVENT_RESIZE$1, () => { + if (this._isShown && !this._isTransitioning) { + this._adjustDialog(); + } + }); + EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { + // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks + EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { + if (this._element !== event.target || this._element !== event2.target) { + return; } - element = element.parentNode; - } -} - -module.exports = closest; - - -/***/ }), - -/***/ 438: -/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) { - -var closest = __nested_webpack_require_15749__(828); - -/** - * Delegates event to a selector. - * - * @param {Element} element - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @param {Boolean} useCapture - * @return {Object} - */ -function _delegate(element, selector, type, callback, useCapture) { - var listenerFn = listener.apply(this, arguments); - - element.addEventListener(type, listenerFn, useCapture); - - return { - destroy: function() { - element.removeEventListener(type, listenerFn, useCapture); + if (this._config.backdrop === 'static') { + this._triggerBackdropTransition(); + return; + } + if (this._config.backdrop) { + this.hide(); } + }); + }); + } + _hideModal() { + this._element.style.display = 'none'; + this._element.setAttribute('aria-hidden', true); + this._element.removeAttribute('aria-modal'); + this._element.removeAttribute('role'); + this._isTransitioning = false; + this._backdrop.hide(() => { + document.body.classList.remove(CLASS_NAME_OPEN); + this._resetAdjustments(); + this._scrollBar.reset(); + EventHandler.trigger(this._element, EVENT_HIDDEN$4); + }); + } + _isAnimated() { + return this._element.classList.contains(CLASS_NAME_FADE$3); + } + _triggerBackdropTransition() { + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); + if (hideEvent.defaultPrevented) { + return; } -} - -/** - * Delegates event to a selector. - * - * @param {Element|String|Array} [elements] - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @param {Boolean} useCapture - * @return {Object} - */ -function delegate(elements, selector, type, callback, useCapture) { - // Handle the regular Element usage - if (typeof elements.addEventListener === 'function') { - return _delegate.apply(null, arguments); + const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + const initialOverflowY = this._element.style.overflowY; + // return if the following background transition hasn't yet completed + if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { + return; } - - // Handle Element-less usage, it defaults to global delegation - if (typeof type === 'function') { - // Use `document` as the first parameter, then apply arguments - // This is a short way to .unshift `arguments` without running into deoptimizations - return _delegate.bind(null, document).apply(null, arguments); + if (!isModalOverflowing) { + this._element.style.overflowY = 'hidden'; } + this._element.classList.add(CLASS_NAME_STATIC); + this._queueCallback(() => { + this._element.classList.remove(CLASS_NAME_STATIC); + this._queueCallback(() => { + this._element.style.overflowY = initialOverflowY; + }, this._dialog); + }, this._dialog); + this._element.focus(); + } - // Handle Selector-based usage - if (typeof elements === 'string') { - elements = document.querySelectorAll(elements); + /** + * The following methods are used to handle overflowing modals + */ + + _adjustDialog() { + const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + const scrollbarWidth = this._scrollBar.getWidth(); + const isBodyOverflowing = scrollbarWidth > 0; + if (isBodyOverflowing && !isModalOverflowing) { + const property = isRTL() ? 'paddingLeft' : 'paddingRight'; + this._element.style[property] = `${scrollbarWidth}px`; + } + if (!isBodyOverflowing && isModalOverflowing) { + const property = isRTL() ? 'paddingRight' : 'paddingLeft'; + this._element.style[property] = `${scrollbarWidth}px`; } + } + _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } - // Handle Array-like based usage - return Array.prototype.map.call(elements, function (element) { - return _delegate(element, selector, type, callback, useCapture); + // Static + static jQueryInterface(config, relatedTarget) { + return this.each(function () { + const data = Modal.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); + } + data[config](relatedTarget); }); + } } /** - * Finds closest match and invokes callback. - * - * @param {Element} element - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @return {Function} + * Data API implementation */ -function listener(element, selector, type, callback) { - return function(e) { - e.delegateTarget = closest(e.target, selector); - if (e.delegateTarget) { - callback.call(element, e); - } +EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { + const target = SelectorEngine.getElementFromSelector(this); + if (['A', 'AREA'].includes(this.tagName)) { + event.preventDefault(); + } + EventHandler.one(target, EVENT_SHOW$4, showEvent => { + if (showEvent.defaultPrevented) { + // only register focus restorer if modal will actually get shown + return; } -} - -module.exports = delegate; + EventHandler.one(target, EVENT_HIDDEN$4, () => { + if (isVisible(this)) { + this.focus(); + } + }); + }); + // avoid conflict when clicking modal toggler while another one is open + const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); + if (alreadyOpen) { + Modal.getInstance(alreadyOpen).hide(); + } + const data = Modal.getOrCreateInstance(target); + data.toggle(this); +}); +enableDismissTrigger(Modal); -/***/ }), +/** + * jQuery + */ -/***/ 879: -/***/ (function(__unused_webpack_module, exports) { +defineJQueryPlugin(Modal); /** - * Check if argument is a HTML element. - * - * @param {Object} value - * @return {Boolean} + * -------------------------------------------------------------------------- + * Bootstrap offcanvas.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -exports.node = function(value) { - return value !== undefined - && value instanceof HTMLElement - && value.nodeType === 1; -}; + /** - * Check if argument is a list of HTML elements. - * - * @param {Object} value - * @return {Boolean} + * Constants */ -exports.nodeList = function(value) { - var type = Object.prototype.toString.call(value); - return value !== undefined - && (type === '[object NodeList]' || type === '[object HTMLCollection]') - && ('length' in value) - && (value.length === 0 || exports.node(value[0])); +const NAME$6 = 'offcanvas'; +const DATA_KEY$3 = 'bs.offcanvas'; +const EVENT_KEY$3 = `.${DATA_KEY$3}`; +const DATA_API_KEY$1 = '.data-api'; +const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; +const ESCAPE_KEY = 'Escape'; +const CLASS_NAME_SHOW$3 = 'show'; +const CLASS_NAME_SHOWING$1 = 'showing'; +const CLASS_NAME_HIDING = 'hiding'; +const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; +const OPEN_SELECTOR = '.offcanvas.show'; +const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; +const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; +const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; +const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; +const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; +const EVENT_RESIZE = `resize${EVENT_KEY$3}`; +const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; +const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; +const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; +const Default$5 = { + backdrop: true, + keyboard: true, + scroll: false }; - -/** - * Check if argument is a string. - * - * @param {Object} value - * @return {Boolean} - */ -exports.string = function(value) { - return typeof value === 'string' - || value instanceof String; +const DefaultType$5 = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + scroll: 'boolean' }; /** - * Check if argument is a function. - * - * @param {Object} value - * @return {Boolean} + * Class definition */ -exports.fn = function(value) { - var type = Object.prototype.toString.call(value); - - return type === '[object Function]'; -}; - - -/***/ }), - -/***/ 370: -/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) { -var is = __nested_webpack_require_19113__(879); -var delegate = __nested_webpack_require_19113__(438); - -/** - * Validates all params and calls the right - * listener function based on its target type. - * - * @param {String|HTMLElement|HTMLCollection|NodeList} target - * @param {String} type - * @param {Function} callback - * @return {Object} - */ -function listen(target, type, callback) { - if (!target && !type && !callback) { - throw new Error('Missing required arguments'); - } +class Offcanvas extends BaseComponent { + constructor(element, config) { + super(element, config); + this._isShown = false; + this._backdrop = this._initializeBackDrop(); + this._focustrap = this._initializeFocusTrap(); + this._addEventListeners(); + } - if (!is.string(type)) { - throw new TypeError('Second argument must be a String'); - } + // Getters + static get Default() { + return Default$5; + } + static get DefaultType() { + return DefaultType$5; + } + static get NAME() { + return NAME$6; + } - if (!is.fn(callback)) { - throw new TypeError('Third argument must be a Function'); + // Public + toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + show(relatedTarget) { + if (this._isShown) { + return; } - - if (is.node(target)) { - return listenNode(target, type, callback); + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { + relatedTarget + }); + if (showEvent.defaultPrevented) { + return; } - else if (is.nodeList(target)) { - return listenNodeList(target, type, callback); + this._isShown = true; + this._backdrop.show(); + if (!this._config.scroll) { + new ScrollBarHelper().hide(); } - else if (is.string(target)) { - return listenSelector(target, type, callback); + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.classList.add(CLASS_NAME_SHOWING$1); + const completeCallBack = () => { + if (!this._config.scroll || this._config.backdrop) { + this._focustrap.activate(); + } + this._element.classList.add(CLASS_NAME_SHOW$3); + this._element.classList.remove(CLASS_NAME_SHOWING$1); + EventHandler.trigger(this._element, EVENT_SHOWN$3, { + relatedTarget + }); + }; + this._queueCallback(completeCallBack, this._element, true); + } + hide() { + if (!this._isShown) { + return; } - else { - throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); + if (hideEvent.defaultPrevented) { + return; } -} - -/** - * Adds an event listener to a HTML element - * and returns a remove listener function. - * - * @param {HTMLElement} node - * @param {String} type - * @param {Function} callback - * @return {Object} - */ -function listenNode(node, type, callback) { - node.addEventListener(type, callback); + this._focustrap.deactivate(); + this._element.blur(); + this._isShown = false; + this._element.classList.add(CLASS_NAME_HIDING); + this._backdrop.hide(); + const completeCallback = () => { + this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); + this._element.removeAttribute('aria-modal'); + this._element.removeAttribute('role'); + if (!this._config.scroll) { + new ScrollBarHelper().reset(); + } + EventHandler.trigger(this._element, EVENT_HIDDEN$3); + }; + this._queueCallback(completeCallback, this._element, true); + } + dispose() { + this._backdrop.dispose(); + this._focustrap.deactivate(); + super.dispose(); + } - return { - destroy: function() { - node.removeEventListener(type, callback); - } - } -} + // Private + _initializeBackDrop() { + const clickCallback = () => { + if (this._config.backdrop === 'static') { + EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); + return; + } + this.hide(); + }; -/** - * Add an event listener to a list of HTML elements - * and returns a remove listener function. - * - * @param {NodeList|HTMLCollection} nodeList - * @param {String} type - * @param {Function} callback - * @return {Object} - */ -function listenNodeList(nodeList, type, callback) { - Array.prototype.forEach.call(nodeList, function(node) { - node.addEventListener(type, callback); + // 'static' option will be translated to true, and booleans will keep their value + const isVisible = Boolean(this._config.backdrop); + return new Backdrop({ + className: CLASS_NAME_BACKDROP, + isVisible, + isAnimated: true, + rootElement: this._element.parentNode, + clickCallback: isVisible ? clickCallback : null + }); + } + _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + _addEventListeners() { + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { + if (event.key !== ESCAPE_KEY) { + return; + } + if (this._config.keyboard) { + this.hide(); + return; + } + EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); }); + } - return { - destroy: function() { - Array.prototype.forEach.call(nodeList, function(node) { - node.removeEventListener(type, callback); - }); - } - } + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Offcanvas.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError(`No method named "${config}"`); + } + data[config](this); + }); + } } /** - * Add an event listener to a selector - * and returns a remove listener function. - * - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @return {Object} + * Data API implementation */ -function listenSelector(selector, type, callback) { - return delegate(document.body, selector, type, callback); -} - -module.exports = listen; - - -/***/ }), -/***/ 817: -/***/ (function(module) { - -function select(element) { - var selectedText; - - if (element.nodeName === 'SELECT') { - element.focus(); - - selectedText = element.value; +EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { + const target = SelectorEngine.getElementFromSelector(this); + if (['A', 'AREA'].includes(this.tagName)) { + event.preventDefault(); + } + if (isDisabled(this)) { + return; + } + EventHandler.one(target, EVENT_HIDDEN$3, () => { + // focus on trigger when it is closed + if (isVisible(this)) { + this.focus(); } - else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { - var isReadOnly = element.hasAttribute('readonly'); + }); - if (!isReadOnly) { - element.setAttribute('readonly', ''); - } + // avoid conflict when clicking a toggler of an offcanvas, while another is open + const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); + if (alreadyOpen && alreadyOpen !== target) { + Offcanvas.getInstance(alreadyOpen).hide(); + } + const data = Offcanvas.getOrCreateInstance(target); + data.toggle(this); +}); +EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { + for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { + Offcanvas.getOrCreateInstance(selector).show(); + } +}); +EventHandler.on(window, EVENT_RESIZE, () => { + for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { + if (getComputedStyle(element).position !== 'fixed') { + Offcanvas.getOrCreateInstance(element).hide(); + } + } +}); +enableDismissTrigger(Offcanvas); - element.select(); - element.setSelectionRange(0, element.value.length); +/** + * jQuery + */ - if (!isReadOnly) { - element.removeAttribute('readonly'); - } +defineJQueryPlugin(Offcanvas); - selectedText = element.value; - } - else { - if (element.hasAttribute('contenteditable')) { - element.focus(); - } +/** + * -------------------------------------------------------------------------- + * Bootstrap util/sanitizer.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ - var selection = window.getSelection(); - var range = document.createRange(); +// js-docs-start allow-list +const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; +const DefaultAllowlist = { + // Global attributes allowed on any supplied element below. + '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], + a: ['target', 'href', 'title', 'rel'], + area: [], + b: [], + br: [], + col: [], + code: [], + div: [], + em: [], + hr: [], + h1: [], + h2: [], + h3: [], + h4: [], + h5: [], + h6: [], + i: [], + img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], + li: [], + ol: [], + p: [], + pre: [], + s: [], + small: [], + span: [], + sub: [], + sup: [], + strong: [], + u: [], + ul: [] +}; +// js-docs-end allow-list - range.selectNodeContents(element); - selection.removeAllRanges(); - selection.addRange(range); +const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); - selectedText = selection.toString(); +/** + * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation + * contexts. + * + * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 + */ +// eslint-disable-next-line unicorn/better-regex +const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; +const allowedAttribute = (attribute, allowedAttributeList) => { + const attributeName = attribute.nodeName.toLowerCase(); + if (allowedAttributeList.includes(attributeName)) { + if (uriAttributes.has(attributeName)) { + return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); } + return true; + } - return selectedText; + // Check if a regular expression validates the attribute. + return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); +}; +function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { + if (!unsafeHtml.length) { + return unsafeHtml; + } + if (sanitizeFunction && typeof sanitizeFunction === 'function') { + return sanitizeFunction(unsafeHtml); + } + const domParser = new window.DOMParser(); + const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); + const elements = [].concat(...createdDocument.body.querySelectorAll('*')); + for (const element of elements) { + const elementName = element.nodeName.toLowerCase(); + if (!Object.keys(allowList).includes(elementName)) { + element.remove(); + continue; + } + const attributeList = [].concat(...element.attributes); + const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); + for (const attribute of attributeList) { + if (!allowedAttribute(attribute, allowedAttributes)) { + element.removeAttribute(attribute.nodeName); + } + } + } + return createdDocument.body.innerHTML; } -module.exports = select; +/** + * -------------------------------------------------------------------------- + * Bootstrap util/template-factory.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ -/***/ }), +/** + * Constants + */ -/***/ 279: -/***/ (function(module) { +const NAME$5 = 'TemplateFactory'; +const Default$4 = { + allowList: DefaultAllowlist, + content: {}, + // { selector : text , selector2 : text2 , } + extraClass: '', + html: false, + sanitize: true, + sanitizeFn: null, + template: '<div></div>' +}; +const DefaultType$4 = { + allowList: 'object', + content: 'object', + extraClass: '(string|function)', + html: 'boolean', + sanitize: 'boolean', + sanitizeFn: '(null|function)', + template: 'string' +}; +const DefaultContentType = { + entry: '(string|element|function|null)', + selector: '(string|element)' +}; -function E () { - // Keep this empty so it's easier to inherit from - // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) -} +/** + * Class definition + */ -E.prototype = { - on: function (name, callback, ctx) { - var e = this.e || (this.e = {}); +class TemplateFactory extends Config { + constructor(config) { + super(); + this._config = this._getConfig(config); + } - (e[name] || (e[name] = [])).push({ - fn: callback, - ctx: ctx - }); + // Getters + static get Default() { + return Default$4; + } + static get DefaultType() { + return DefaultType$4; + } + static get NAME() { + return NAME$5; + } + // Public + getContent() { + return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); + } + hasContent() { + return this.getContent().length > 0; + } + changeContent(content) { + this._checkContent(content); + this._config.content = { + ...this._config.content, + ...content + }; return this; - }, - - once: function (name, callback, ctx) { - var self = this; - function listener () { - self.off(name, listener); - callback.apply(ctx, arguments); - }; + } + toHtml() { + const templateWrapper = document.createElement('div'); + templateWrapper.innerHTML = this._maybeSanitize(this._config.template); + for (const [selector, text] of Object.entries(this._config.content)) { + this._setContent(templateWrapper, text, selector); + } + const template = templateWrapper.children[0]; + const extraClass = this._resolvePossibleFunction(this._config.extraClass); + if (extraClass) { + template.classList.add(...extraClass.split(' ')); + } + return template; + } - listener._ = callback - return this.on(name, listener, ctx); - }, + // Private + _typeCheckConfig(config) { + super._typeCheckConfig(config); + this._checkContent(config.content); + } + _checkContent(arg) { + for (const [selector, content] of Object.entries(arg)) { + super._typeCheckConfig({ + selector, + entry: content + }, DefaultContentType); + } + } + _setContent(template, content, selector) { + const templateElement = SelectorEngine.findOne(selector, template); + if (!templateElement) { + return; + } + content = this._resolvePossibleFunction(content); + if (!content) { + templateElement.remove(); + return; + } + if (isElement(content)) { + this._putElementInTemplate(getElement(content), templateElement); + return; + } + if (this._config.html) { + templateElement.innerHTML = this._maybeSanitize(content); + return; + } + templateElement.textContent = content; + } + _maybeSanitize(arg) { + return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; + } + _resolvePossibleFunction(arg) { + return execute(arg, [this]); + } + _putElementInTemplate(element, templateElement) { + if (this._config.html) { + templateElement.innerHTML = ''; + templateElement.append(element); + return; + } + templateElement.textContent = element.textContent; + } +} - emit: function (name) { - var data = [].slice.call(arguments, 1); - var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); - var i = 0; - var len = evtArr.length; +/** + * -------------------------------------------------------------------------- + * Bootstrap tooltip.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } - return this; - }, +/** + * Constants + */ - off: function (name, callback) { - var e = this.e || (this.e = {}); - var evts = e[name]; - var liveEvents = []; +const NAME$4 = 'tooltip'; +const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); +const CLASS_NAME_FADE$2 = 'fade'; +const CLASS_NAME_MODAL = 'modal'; +const CLASS_NAME_SHOW$2 = 'show'; +const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; +const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; +const EVENT_MODAL_HIDE = 'hide.bs.modal'; +const TRIGGER_HOVER = 'hover'; +const TRIGGER_FOCUS = 'focus'; +const TRIGGER_CLICK = 'click'; +const TRIGGER_MANUAL = 'manual'; +const EVENT_HIDE$2 = 'hide'; +const EVENT_HIDDEN$2 = 'hidden'; +const EVENT_SHOW$2 = 'show'; +const EVENT_SHOWN$2 = 'shown'; +const EVENT_INSERTED = 'inserted'; +const EVENT_CLICK$1 = 'click'; +const EVENT_FOCUSIN$1 = 'focusin'; +const EVENT_FOCUSOUT$1 = 'focusout'; +const EVENT_MOUSEENTER = 'mouseenter'; +const EVENT_MOUSELEAVE = 'mouseleave'; +const AttachmentMap = { + AUTO: 'auto', + TOP: 'top', + RIGHT: isRTL() ? 'left' : 'right', + BOTTOM: 'bottom', + LEFT: isRTL() ? 'right' : 'left' +}; +const Default$3 = { + allowList: DefaultAllowlist, + animation: true, + boundary: 'clippingParents', + container: false, + customClass: '', + delay: 0, + fallbackPlacements: ['top', 'right', 'bottom', 'left'], + html: false, + offset: [0, 6], + placement: 'top', + popperConfig: null, + sanitize: true, + sanitizeFn: null, + selector: false, + template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', + title: '', + trigger: 'hover focus' +}; +const DefaultType$3 = { + allowList: 'object', + animation: 'boolean', + boundary: '(string|element)', + container: '(string|element|boolean)', + customClass: '(string|function)', + delay: '(number|object)', + fallbackPlacements: 'array', + html: 'boolean', + offset: '(array|string|function)', + placement: '(string|function)', + popperConfig: '(null|object|function)', + sanitize: 'boolean', + sanitizeFn: '(null|function)', + selector: '(string|boolean)', + template: 'string', + title: '(string|element|function)', + trigger: 'string' +}; - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if (evts[i].fn !== callback && evts[i].fn._ !== callback) - liveEvents.push(evts[i]); - } - } +/** + * Class definition + */ - // Remove event from queue to prevent memory leak - // Suggested by https://github.com/lazd - // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 +class Tooltip extends BaseComponent { + constructor(element, config) { + if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ === 'undefined') { + throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); + } + super(element, config); - (liveEvents.length) - ? e[name] = liveEvents - : delete e[name]; + // Private + this._isEnabled = true; + this._timeout = 0; + this._isHovered = null; + this._activeTrigger = {}; + this._popper = null; + this._templateFactory = null; + this._newContent = null; - return this; + // Protected + this.tip = null; + this._setListeners(); + if (!this._config.selector) { + this._fixTitle(); + } } -}; - -module.exports = E; -module.exports.TinyEmitter = E; + // Getters + static get Default() { + return Default$3; + } + static get DefaultType() { + return DefaultType$3; + } + static get NAME() { + return NAME$4; + } -/***/ }) + // Public + enable() { + this._isEnabled = true; + } + disable() { + this._isEnabled = false; + } + toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + toggle() { + if (!this._isEnabled) { + return; + } + this._activeTrigger.click = !this._activeTrigger.click; + if (this._isShown()) { + this._leave(); + return; + } + this._enter(); + } + dispose() { + clearTimeout(this._timeout); + EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + if (this._element.getAttribute('data-bs-original-title')) { + this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); + } + this._disposePopper(); + super.dispose(); + } + show() { + if (this._element.style.display === 'none') { + throw new Error('Please use show on visible elements'); + } + if (!(this._isWithContent() && this._isEnabled)) { + return; + } + const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); + const shadowRoot = findShadowRoot(this._element); + const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); + if (showEvent.defaultPrevented || !isInTheDom) { + return; + } -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nested_webpack_require_24495__(moduleId) { -/******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_24495__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ !function() { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __nested_webpack_require_24495__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; -/******/ __nested_webpack_require_24495__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __nested_webpack_require_24495__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__nested_webpack_require_24495__.o(definition, key) && !__nested_webpack_require_24495__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __nested_webpack_require_24495__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/************************************************************************/ -/******/ // module exports must be returned from runtime so entry inlining is disabled -/******/ // startup -/******/ // Load entry module and return exports -/******/ return __nested_webpack_require_24495__(686); -/******/ })() -.default; -}); - -/***/ }), - -/***/ "./node_modules/laravel-echo/dist/echo.js": -/*!************************************************!*\ - !*** ./node_modules/laravel-echo/dist/echo.js ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Channel: () => (/* binding */ Channel), -/* harmony export */ "default": () => (/* binding */ Echo) -/* harmony export */ }); -function _typeof(obj) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }, _typeof(obj); -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} + // TODO: v6 remove this or make it optional + this._disposePopper(); + const tip = this._getTipElement(); + this._element.setAttribute('aria-describedby', tip.getAttribute('id')); + const { + container + } = this._config; + if (!this._element.ownerDocument.documentElement.contains(this.tip)) { + container.append(tip); + EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); + } + this._popper = this._createPopper(tip); + tip.classList.add(CLASS_NAME_SHOW$2); -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); + // If this is a touch-enabled device we add extra + // empty mouseover listeners to the body's immediate children; + // only needed because of broken event delegation on iOS + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + if ('ontouchstart' in document.documentElement) { + for (const element of [].concat(...document.body.children)) { + EventHandler.on(element, 'mouseover', noop); + } + } + const complete = () => { + EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); + if (this._isHovered === false) { + this._leave(); + } + this._isHovered = false; + }; + this._queueCallback(complete, this.tip, this._isAnimated()); } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; + hide() { + if (!this._isShown()) { + return; + } + const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); + if (hideEvent.defaultPrevented) { + return; + } + const tip = this._getTipElement(); + tip.classList.remove(CLASS_NAME_SHOW$2); - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + for (const element of [].concat(...document.body.children)) { + EventHandler.off(element, 'mouseover', noop); } } + this._activeTrigger[TRIGGER_CLICK] = false; + this._activeTrigger[TRIGGER_FOCUS] = false; + this._activeTrigger[TRIGGER_HOVER] = false; + this._isHovered = null; // it is a trick to support manual triggering - return target; - }; - - return _extends.apply(this, arguments); -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + const complete = () => { + if (this._isWithActiveTrigger()) { + return; + } + if (!this._isHovered) { + this._disposePopper(); + } + this._element.removeAttribute('aria-describedby'); + EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); + }; + this._queueCallback(complete, this.tip, this._isAnimated()); } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true + update() { + if (this._popper) { + this._popper.update(); } - }); - Object.defineProperty(subClass, "prototype", { - writable: false - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); - return true; - } catch (e) { - return false; } -} -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + // Protected + _isWithContent() { + return Boolean(this._getTitle()); } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } else if (call !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); + _getTipElement() { + if (!this.tip) { + this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); + } + return this.tip; } + _createTipElement(content) { + const tip = this._getTemplateFactory(content).toHtml(); - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn(this, result); - }; -} - -/** - * This class represents a basic channel. - */ -var Channel = /*#__PURE__*/function () { - function Channel() { - _classCallCheck(this, Channel); - } - - _createClass(Channel, [{ - key: "listenForWhisper", - value: - /** - * Listen for a whisper event on the channel instance. - */ - function listenForWhisper(event, callback) { - return this.listen('.client-' + event, callback); - } - /** - * Listen for an event on the channel instance. - */ - - }, { - key: "notification", - value: function notification(callback) { - return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback); + // TODO: remove this check in v6 + if (!tip) { + return null; } - /** - * Stop listening for a whisper event on the channel instance. - */ - - }, { - key: "stopListeningForWhisper", - value: function stopListeningForWhisper(event, callback) { - return this.stopListening('.client-' + event, callback); + tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); + // TODO: v6 the following can be achieved with CSS only + tip.classList.add(`bs-${this.constructor.NAME}-auto`); + const tipId = getUID(this.constructor.NAME).toString(); + tip.setAttribute('id', tipId); + if (this._isAnimated()) { + tip.classList.add(CLASS_NAME_FADE$2); } - }]); - - return Channel; -}(); - -/** - * Event name formatter - */ -var EventFormatter = /*#__PURE__*/function () { - /** - * Create a new class instance. - */ - function EventFormatter(namespace) { - _classCallCheck(this, EventFormatter); - - this.namespace = namespace; // + return tip; } - /** - * Format the given event name. - */ - - - _createClass(EventFormatter, [{ - key: "format", - value: function format(event) { - if (event.charAt(0) === '.' || event.charAt(0) === '\\') { - return event.substr(1); - } else if (this.namespace) { - event = this.namespace + '.' + event; - } - - return event.replace(/\./g, '\\'); - } - /** - * Set the event namespace. - */ - - }, { - key: "setNamespace", - value: function setNamespace(value) { - this.namespace = value; + setContent(content) { + this._newContent = content; + if (this._isShown()) { + this._disposePopper(); + this.show(); } - }]); - - return EventFormatter; -}(); - -/** - * This class represents a Pusher channel. - */ - -var PusherChannel = /*#__PURE__*/function (_Channel) { - _inherits(PusherChannel, _Channel); - - var _super = _createSuper(PusherChannel); - - /** - * Create a new class instance. - */ - function PusherChannel(pusher, name, options) { - var _this; - - _classCallCheck(this, PusherChannel); - - _this = _super.call(this); - _this.name = name; - _this.pusher = pusher; - _this.options = options; - _this.eventFormatter = new EventFormatter(_this.options.namespace); - - _this.subscribe(); - - return _this; } - /** - * Subscribe to a Pusher channel. - */ - - - _createClass(PusherChannel, [{ - key: "subscribe", - value: function subscribe() { - this.subscription = this.pusher.subscribe(this.name); - } - /** - * Unsubscribe from a Pusher channel. - */ - - }, { - key: "unsubscribe", - value: function unsubscribe() { - this.pusher.unsubscribe(this.name); - } - /** - * Listen for an event on the channel instance. - */ - - }, { - key: "listen", - value: function listen(event, callback) { - this.on(this.eventFormatter.format(event), callback); - return this; - } - /** - * Listen for all events on the channel instance. - */ - - }, { - key: "listenToAll", - value: function listenToAll(callback) { - var _this2 = this; - - this.subscription.bind_global(function (event, data) { - if (event.startsWith('pusher:')) { - return; - } - - var namespace = _this2.options.namespace.replace(/\./g, '\\'); - - var formattedEvent = event.startsWith(namespace) ? event.substring(namespace.length + 1) : '.' + event; - callback(formattedEvent, data); + _getTemplateFactory(content) { + if (this._templateFactory) { + this._templateFactory.changeContent(content); + } else { + this._templateFactory = new TemplateFactory({ + ...this._config, + // the `content` var has to be after `this._config` + // to override config.content in case of popover + content, + extraClass: this._resolvePossibleFunction(this._config.customClass) }); - return this; } - /** - * Stop listening for an event on the channel instance. - */ - - }, { - key: "stopListening", - value: function stopListening(event, callback) { - if (callback) { - this.subscription.unbind(this.eventFormatter.format(event), callback); - } else { - this.subscription.unbind(this.eventFormatter.format(event)); - } + return this._templateFactory; + } + _getContentForTemplate() { + return { + [SELECTOR_TOOLTIP_INNER]: this._getTitle() + }; + } + _getTitle() { + return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); + } - return this; + // Private + _initializeOnDelegatedTarget(event) { + return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); + } + _isAnimated() { + return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); + } + _isShown() { + return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); + } + _createPopper(tip) { + const placement = execute(this._config.placement, [this, tip, this._element]); + const attachment = AttachmentMap[placement.toUpperCase()]; + return _popperjs_core__WEBPACK_IMPORTED_MODULE_1__.createPopper(this._element, tip, this._getPopperConfig(attachment)); + } + _getOffset() { + const { + offset + } = this._config; + if (typeof offset === 'string') { + return offset.split(',').map(value => Number.parseInt(value, 10)); } - /** - * Stop listening for all events on the channel instance. - */ - - }, { - key: "stopListeningToAll", - value: function stopListeningToAll(callback) { - if (callback) { - this.subscription.unbind_global(callback); - } else { - this.subscription.unbind_global(); - } - - return this; + if (typeof offset === 'function') { + return popperData => offset(popperData, this._element); } - /** - * Register a callback to be called anytime a subscription succeeds. - */ - - }, { - key: "subscribed", - value: function subscribed(callback) { - this.on('pusher:subscription_succeeded', function () { - callback(); - }); - return this; + return offset; + } + _resolvePossibleFunction(arg) { + return execute(arg, [this._element]); + } + _getPopperConfig(attachment) { + const defaultBsPopperConfig = { + placement: attachment, + modifiers: [{ + name: 'flip', + options: { + fallbackPlacements: this._config.fallbackPlacements + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }, { + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'arrow', + options: { + element: `.${this.constructor.NAME}-arrow` + } + }, { + name: 'preSetPlacement', + enabled: true, + phase: 'beforeMain', + fn: data => { + // Pre-set Popper's placement attribute in order to read the arrow sizes properly. + // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement + this._getTipElement().setAttribute('data-popper-placement', data.state.placement); + } + }] + }; + return { + ...defaultBsPopperConfig, + ...execute(this._config.popperConfig, [defaultBsPopperConfig]) + }; + } + _setListeners() { + const triggers = this._config.trigger.split(' '); + for (const trigger of triggers) { + if (trigger === 'click') { + EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => { + const context = this._initializeOnDelegatedTarget(event); + context.toggle(); + }); + } else if (trigger !== TRIGGER_MANUAL) { + const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); + const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); + EventHandler.on(this._element, eventIn, this._config.selector, event => { + const context = this._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; + context._enter(); + }); + EventHandler.on(this._element, eventOut, this._config.selector, event => { + const context = this._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); + context._leave(); + }); + } } - /** - * Register a callback to be called anytime a subscription error occurs. - */ - - }, { - key: "error", - value: function error(callback) { - this.on('pusher:subscription_error', function (status) { - callback(status); - }); - return this; + this._hideModalHandler = () => { + if (this._element) { + this.hide(); + } + }; + EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + } + _fixTitle() { + const title = this._element.getAttribute('title'); + if (!title) { + return; } - /** - * Bind a channel to an event. - */ + if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { + this._element.setAttribute('aria-label', title); + } + this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility + this._element.removeAttribute('title'); + } + _enter() { + if (this._isShown() || this._isHovered) { + this._isHovered = true; + return; + } + this._isHovered = true; + this._setTimeout(() => { + if (this._isHovered) { + this.show(); + } + }, this._config.delay.show); + } + _leave() { + if (this._isWithActiveTrigger()) { + return; + } + this._isHovered = false; + this._setTimeout(() => { + if (!this._isHovered) { + this.hide(); + } + }, this._config.delay.hide); + } + _setTimeout(handler, timeout) { + clearTimeout(this._timeout); + this._timeout = setTimeout(handler, timeout); + } + _isWithActiveTrigger() { + return Object.values(this._activeTrigger).includes(true); + } + _getConfig(config) { + const dataAttributes = Manipulator.getDataAttributes(this._element); + for (const dataAttribute of Object.keys(dataAttributes)) { + if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { + delete dataAttributes[dataAttribute]; + } + } + config = { + ...dataAttributes, + ...(typeof config === 'object' && config ? config : {}) + }; + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + _configAfterMerge(config) { + config.container = config.container === false ? document.body : getElement(config.container); + if (typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } + if (typeof config.title === 'number') { + config.title = config.title.toString(); + } + if (typeof config.content === 'number') { + config.content = config.content.toString(); + } + return config; + } + _getDelegateConfig() { + const config = {}; + for (const [key, value] of Object.entries(this._config)) { + if (this.constructor.Default[key] !== value) { + config[key] = value; + } + } + config.selector = false; + config.trigger = 'manual'; - }, { - key: "on", - value: function on(event, callback) { - this.subscription.bind(event, callback); - return this; + // In the future can be replaced with: + // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) + // `Object.fromEntries(keysWithDifferentValues)` + return config; + } + _disposePopper() { + if (this._popper) { + this._popper.destroy(); + this._popper = null; } - }]); + if (this.tip) { + this.tip.remove(); + this.tip = null; + } + } - return PusherChannel; -}(Channel); + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Tooltip.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); + }); + } +} /** - * This class represents a Pusher private channel. + * jQuery */ -var PusherPrivateChannel = /*#__PURE__*/function (_PusherChannel) { - _inherits(PusherPrivateChannel, _PusherChannel); - - var _super = _createSuper(PusherPrivateChannel); - - function PusherPrivateChannel() { - _classCallCheck(this, PusherPrivateChannel); - - return _super.apply(this, arguments); - } - - _createClass(PusherPrivateChannel, [{ - key: "whisper", - value: - /** - * Send a whisper event to other clients in the channel. - */ - function whisper(eventName, data) { - this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); - return this; - } - }]); - - return PusherPrivateChannel; -}(PusherChannel); +defineJQueryPlugin(Tooltip); /** - * This class represents a Pusher private channel. + * -------------------------------------------------------------------------- + * Bootstrap popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -var PusherEncryptedPrivateChannel = /*#__PURE__*/function (_PusherChannel) { - _inherits(PusherEncryptedPrivateChannel, _PusherChannel); - - var _super = _createSuper(PusherEncryptedPrivateChannel); - function PusherEncryptedPrivateChannel() { - _classCallCheck(this, PusherEncryptedPrivateChannel); +/** + * Constants + */ - return _super.apply(this, arguments); - } - - _createClass(PusherEncryptedPrivateChannel, [{ - key: "whisper", - value: - /** - * Send a whisper event to other clients in the channel. - */ - function whisper(eventName, data) { - this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); - return this; - } - }]); - - return PusherEncryptedPrivateChannel; -}(PusherChannel); +const NAME$3 = 'popover'; +const SELECTOR_TITLE = '.popover-header'; +const SELECTOR_CONTENT = '.popover-body'; +const Default$2 = { + ...Tooltip.Default, + content: '', + offset: [0, 8], + placement: 'right', + template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>', + trigger: 'click' +}; +const DefaultType$2 = { + ...Tooltip.DefaultType, + content: '(null|string|element|function)' +}; /** - * This class represents a Pusher presence channel. + * Class definition */ -var PusherPresenceChannel = /*#__PURE__*/function (_PusherChannel) { - _inherits(PusherPresenceChannel, _PusherChannel); - - var _super = _createSuper(PusherPresenceChannel); - - function PusherPresenceChannel() { - _classCallCheck(this, PusherPresenceChannel); - - return _super.apply(this, arguments); +class Popover extends Tooltip { + // Getters + static get Default() { + return Default$2; + } + static get DefaultType() { + return DefaultType$2; + } + static get NAME() { + return NAME$3; } - _createClass(PusherPresenceChannel, [{ - key: "here", - value: - /** - * Register a callback to be called anytime the member list changes. - */ - function here(callback) { - this.on('pusher:subscription_succeeded', function (data) { - callback(Object.keys(data.members).map(function (k) { - return data.members[k]; - })); - }); - return this; - } - /** - * Listen for someone joining the channel. - */ + // Overrides + _isWithContent() { + return this._getTitle() || this._getContent(); + } - }, { - key: "joining", - value: function joining(callback) { - this.on('pusher:member_added', function (member) { - callback(member.info); - }); - return this; - } - /** - * Send a whisper event to other clients in the channel. - */ + // Private + _getContentForTemplate() { + return { + [SELECTOR_TITLE]: this._getTitle(), + [SELECTOR_CONTENT]: this._getContent() + }; + } + _getContent() { + return this._resolvePossibleFunction(this._config.content); + } - }, { - key: "whisper", - value: function whisper(eventName, data) { - this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); - return this; - } - /** - * Listen for someone leaving the channel. - */ + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Popover.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); + }); + } +} - }, { - key: "leaving", - value: function leaving(callback) { - this.on('pusher:member_removed', function (member) { - callback(member.info); - }); - return this; - } - }]); +/** + * jQuery + */ - return PusherPresenceChannel; -}(PusherChannel); +defineJQueryPlugin(Popover); /** - * This class represents a Socket.io channel. + * -------------------------------------------------------------------------- + * Bootstrap scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- */ -var SocketIoChannel = /*#__PURE__*/function (_Channel) { - _inherits(SocketIoChannel, _Channel); - - var _super = _createSuper(SocketIoChannel); - /** - * Create a new class instance. - */ - function SocketIoChannel(socket, name, options) { - var _this; +/** + * Constants + */ - _classCallCheck(this, SocketIoChannel); +const NAME$2 = 'scrollspy'; +const DATA_KEY$2 = 'bs.scrollspy'; +const EVENT_KEY$2 = `.${DATA_KEY$2}`; +const DATA_API_KEY = '.data-api'; +const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; +const EVENT_CLICK = `click${EVENT_KEY$2}`; +const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`; +const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; +const CLASS_NAME_ACTIVE$1 = 'active'; +const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; +const SELECTOR_TARGET_LINKS = '[href]'; +const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; +const SELECTOR_NAV_LINKS = '.nav-link'; +const SELECTOR_NAV_ITEMS = '.nav-item'; +const SELECTOR_LIST_ITEMS = '.list-group-item'; +const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; +const SELECTOR_DROPDOWN = '.dropdown'; +const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; +const Default$1 = { + offset: null, + // TODO: v6 @deprecated, keep it for backwards compatibility reasons + rootMargin: '0px 0px -25%', + smoothScroll: false, + target: null, + threshold: [0.1, 0.5, 1] +}; +const DefaultType$1 = { + offset: '(number|null)', + // TODO v6 @deprecated, keep it for backwards compatibility reasons + rootMargin: 'string', + smoothScroll: 'boolean', + target: 'element', + threshold: 'array' +}; - _this = _super.call(this); - /** - * The event callbacks applied to the socket. - */ +/** + * Class definition + */ - _this.events = {}; - /** - * User supplied callbacks for events on this channel. - */ +class ScrollSpy extends BaseComponent { + constructor(element, config) { + super(element, config); - _this.listeners = {}; - _this.name = name; - _this.socket = socket; - _this.options = options; - _this.eventFormatter = new EventFormatter(_this.options.namespace); + // this._element is the observablesContainer and config.target the menu links wrapper + this._targetLinks = new Map(); + this._observableSections = new Map(); + this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; + this._activeTarget = null; + this._observer = null; + this._previousScrollData = { + visibleEntryTop: 0, + parentScrollTop: 0 + }; + this.refresh(); // initialize + } - _this.subscribe(); + // Getters + static get Default() { + return Default$1; + } + static get DefaultType() { + return DefaultType$1; + } + static get NAME() { + return NAME$2; + } - return _this; + // Public + refresh() { + this._initializeTargetsAndObservables(); + this._maybeEnableSmoothScroll(); + if (this._observer) { + this._observer.disconnect(); + } else { + this._observer = this._getNewObserver(); + } + for (const section of this._observableSections.values()) { + this._observer.observe(section); + } + } + dispose() { + this._observer.disconnect(); + super.dispose(); } - /** - * Subscribe to a Socket.io channel. - */ + // Private + _configAfterMerge(config) { + // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case + config.target = getElement(config.target) || document.body; - _createClass(SocketIoChannel, [{ - key: "subscribe", - value: function subscribe() { - this.socket.emit('subscribe', { - channel: this.name, - auth: this.options.auth || {} - }); + // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only + config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; + if (typeof config.threshold === 'string') { + config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); } - /** - * Unsubscribe from channel and ubind event callbacks. - */ - - }, { - key: "unsubscribe", - value: function unsubscribe() { - this.unbind(); - this.socket.emit('unsubscribe', { - channel: this.name, - auth: this.options.auth || {} - }); + return config; + } + _maybeEnableSmoothScroll() { + if (!this._config.smoothScroll) { + return; } - /** - * Listen for an event on the channel instance. - */ - }, { - key: "listen", - value: function listen(event, callback) { - this.on(this.eventFormatter.format(event), callback); - return this; - } - /** - * Stop listening for an event on the channel instance. - */ + // unregister any previous listeners + EventHandler.off(this._config.target, EVENT_CLICK); + EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { + const observableSection = this._observableSections.get(event.target.hash); + if (observableSection) { + event.preventDefault(); + const root = this._rootElement || window; + const height = observableSection.offsetTop - this._element.offsetTop; + if (root.scrollTo) { + root.scrollTo({ + top: height, + behavior: 'smooth' + }); + return; + } - }, { - key: "stopListening", - value: function stopListening(event, callback) { - this.unbindEvent(this.eventFormatter.format(event), callback); - return this; - } - /** - * Register a callback to be called anytime a subscription succeeds. - */ + // Chrome 60 doesn't support `scrollTo` + root.scrollTop = height; + } + }); + } + _getNewObserver() { + const options = { + root: this._rootElement, + threshold: this._config.threshold, + rootMargin: this._config.rootMargin + }; + return new IntersectionObserver(entries => this._observerCallback(entries), options); + } - }, { - key: "subscribed", - value: function subscribed(callback) { - this.on('connect', function (socket) { - callback(socket); - }); - return this; - } - /** - * Register a callback to be called anytime an error occurs. - */ + // The logic of selection + _observerCallback(entries) { + const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); + const activate = entry => { + this._previousScrollData.visibleEntryTop = entry.target.offsetTop; + this._process(targetElement(entry)); + }; + const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; + const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; + this._previousScrollData.parentScrollTop = parentScrollTop; + for (const entry of entries) { + if (!entry.isIntersecting) { + this._activeTarget = null; + this._clearActiveClass(targetElement(entry)); + continue; + } + const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; + // if we are scrolling down, pick the bigger offsetTop + if (userScrollsDown && entryIsLowerThanPrevious) { + activate(entry); + // if parent isn't scrolled, let's keep the first visible item, breaking the iteration + if (!parentScrollTop) { + return; + } + continue; + } - }, { - key: "error", - value: function error(callback) { - return this; + // if we are scrolling up, pick the smallest offsetTop + if (!userScrollsDown && !entryIsLowerThanPrevious) { + activate(entry); + } } - /** - * Bind the channel's socket to an event and store the callback. - */ - - }, { - key: "on", - value: function on(event, callback) { - var _this2 = this; - - this.listeners[event] = this.listeners[event] || []; - - if (!this.events[event]) { - this.events[event] = function (channel, data) { - if (_this2.name === channel && _this2.listeners[event]) { - _this2.listeners[event].forEach(function (cb) { - return cb(data); - }); - } - }; - - this.socket.on(event, this.events[event]); + } + _initializeTargetsAndObservables() { + this._targetLinks = new Map(); + this._observableSections = new Map(); + const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); + for (const anchor of targetLinks) { + // ensure that the anchor has an id and is not disabled + if (!anchor.hash || isDisabled(anchor)) { + continue; } + const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); - this.listeners[event].push(callback); - return this; + // ensure that the observableSection exists & is visible + if (isVisible(observableSection)) { + this._targetLinks.set(decodeURI(anchor.hash), anchor); + this._observableSections.set(anchor.hash, observableSection); + } } - /** - * Unbind the channel's socket from all stored event callbacks. - */ - - }, { - key: "unbind", - value: function unbind() { - var _this3 = this; - - Object.keys(this.events).forEach(function (event) { - _this3.unbindEvent(event); - }); + } + _process(target) { + if (this._activeTarget === target) { + return; } - /** - * Unbind the listeners for the given event. - */ - - }, { - key: "unbindEvent", - value: function unbindEvent(event, callback) { - this.listeners[event] = this.listeners[event] || []; - - if (callback) { - this.listeners[event] = this.listeners[event].filter(function (cb) { - return cb !== callback; - }); - } - - if (!callback || this.listeners[event].length === 0) { - if (this.events[event]) { - this.socket.removeListener(event, this.events[event]); - delete this.events[event]; - } - - delete this.listeners[event]; + this._clearActiveClass(this._config.target); + this._activeTarget = target; + target.classList.add(CLASS_NAME_ACTIVE$1); + this._activateParents(target); + EventHandler.trigger(this._element, EVENT_ACTIVATE, { + relatedTarget: target + }); + } + _activateParents(target) { + // Activate dropdown parents + if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { + SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); + return; + } + for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { + // Set triggered links parents as active + // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor + for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) { + item.classList.add(CLASS_NAME_ACTIVE$1); } } - }]); + } + _clearActiveClass(parent) { + parent.classList.remove(CLASS_NAME_ACTIVE$1); + const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent); + for (const node of activeNodes) { + node.classList.remove(CLASS_NAME_ACTIVE$1); + } + } - return SocketIoChannel; -}(Channel); + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = ScrollSpy.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); + }); + } +} /** - * This class represents a Socket.io private channel. + * Data API implementation */ -var SocketIoPrivateChannel = /*#__PURE__*/function (_SocketIoChannel) { - _inherits(SocketIoPrivateChannel, _SocketIoChannel); - - var _super = _createSuper(SocketIoPrivateChannel); +EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => { + for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) { + ScrollSpy.getOrCreateInstance(spy); + } +}); - function SocketIoPrivateChannel() { - _classCallCheck(this, SocketIoPrivateChannel); +/** + * jQuery + */ - return _super.apply(this, arguments); - } +defineJQueryPlugin(ScrollSpy); - _createClass(SocketIoPrivateChannel, [{ - key: "whisper", - value: - /** - * Send a whisper event to other clients in the channel. - */ - function whisper(eventName, data) { - this.socket.emit('client event', { - channel: this.name, - event: "client-".concat(eventName), - data: data - }); - return this; - } - }]); +/** + * -------------------------------------------------------------------------- + * Bootstrap tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ - return SocketIoPrivateChannel; -}(SocketIoChannel); /** - * This class represents a Socket.io presence channel. + * Constants */ -var SocketIoPresenceChannel = /*#__PURE__*/function (_SocketIoPrivateChann) { - _inherits(SocketIoPresenceChannel, _SocketIoPrivateChann); +const NAME$1 = 'tab'; +const DATA_KEY$1 = 'bs.tab'; +const EVENT_KEY$1 = `.${DATA_KEY$1}`; +const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`; +const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`; +const EVENT_SHOW$1 = `show${EVENT_KEY$1}`; +const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`; +const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`; +const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`; +const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`; +const ARROW_LEFT_KEY = 'ArrowLeft'; +const ARROW_RIGHT_KEY = 'ArrowRight'; +const ARROW_UP_KEY = 'ArrowUp'; +const ARROW_DOWN_KEY = 'ArrowDown'; +const HOME_KEY = 'Home'; +const END_KEY = 'End'; +const CLASS_NAME_ACTIVE = 'active'; +const CLASS_NAME_FADE$1 = 'fade'; +const CLASS_NAME_SHOW$1 = 'show'; +const CLASS_DROPDOWN = 'dropdown'; +const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; +const SELECTOR_DROPDOWN_MENU = '.dropdown-menu'; +const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`; +const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'; +const SELECTOR_OUTER = '.nav-item, .list-group-item'; +const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`; +const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6 +const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`; +const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`; - var _super = _createSuper(SocketIoPresenceChannel); +/** + * Class definition + */ - function SocketIoPresenceChannel() { - _classCallCheck(this, SocketIoPresenceChannel); +class Tab extends BaseComponent { + constructor(element) { + super(element); + this._parent = this._element.closest(SELECTOR_TAB_PANEL); + if (!this._parent) { + return; + // TODO: should throw exception in v6 + // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`) + } - return _super.apply(this, arguments); + // Set up initial aria attributes + this._setInitialAttributes(this._parent, this._getChildren()); + EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); } - _createClass(SocketIoPresenceChannel, [{ - key: "here", - value: - /** - * Register a callback to be called anytime the member list changes. - */ - function here(callback) { - this.on('presence:subscribed', function (members) { - callback(members.map(function (m) { - return m.user_info; - })); - }); - return this; + // Getters + static get NAME() { + return NAME$1; + } + + // Public + show() { + // Shows this elem and deactivate the active sibling if exists + const innerElem = this._element; + if (this._elemIsActive(innerElem)) { + return; } - /** - * Listen for someone joining the channel. - */ - }, { - key: "joining", - value: function joining(callback) { - this.on('presence:joining', function (member) { - return callback(member.user_info); - }); - return this; + // Search for active tab on same parent to deactivate it + const active = this._getActiveElem(); + const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, { + relatedTarget: innerElem + }) : null; + const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, { + relatedTarget: active + }); + if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) { + return; } - /** - * Send a whisper event to other clients in the channel. - */ + this._deactivate(active, innerElem); + this._activate(innerElem, active); + } - }, { - key: "whisper", - value: function whisper(eventName, data) { - this.socket.emit('client event', { - channel: this.name, - event: "client-".concat(eventName), - data: data - }); - return this; + // Private + _activate(element, relatedElem) { + if (!element) { + return; } - /** - * Listen for someone leaving the channel. - */ + element.classList.add(CLASS_NAME_ACTIVE); + this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section - }, { - key: "leaving", - value: function leaving(callback) { - this.on('presence:leaving', function (member) { - return callback(member.user_info); + const complete = () => { + if (element.getAttribute('role') !== 'tab') { + element.classList.add(CLASS_NAME_SHOW$1); + return; + } + element.removeAttribute('tabindex'); + element.setAttribute('aria-selected', true); + this._toggleDropDown(element, true); + EventHandler.trigger(element, EVENT_SHOWN$1, { + relatedTarget: relatedElem }); - return this; + }; + this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); + } + _deactivate(element, relatedElem) { + if (!element) { + return; } - }]); - - return SocketIoPresenceChannel; -}(SocketIoPrivateChannel); - -/** - * This class represents a null channel. - */ - -var NullChannel = /*#__PURE__*/function (_Channel) { - _inherits(NullChannel, _Channel); - - var _super = _createSuper(NullChannel); - - function NullChannel() { - _classCallCheck(this, NullChannel); + element.classList.remove(CLASS_NAME_ACTIVE); + element.blur(); + this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too - return _super.apply(this, arguments); + const complete = () => { + if (element.getAttribute('role') !== 'tab') { + element.classList.remove(CLASS_NAME_SHOW$1); + return; + } + element.setAttribute('aria-selected', false); + element.setAttribute('tabindex', '-1'); + this._toggleDropDown(element, false); + EventHandler.trigger(element, EVENT_HIDDEN$1, { + relatedTarget: relatedElem + }); + }; + this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); } - - _createClass(NullChannel, [{ - key: "subscribe", - value: - /** - * Subscribe to a channel. - */ - function subscribe() {// + _keydown(event) { + if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) { + return; } - /** - * Unsubscribe from a channel. - */ - - }, { - key: "unsubscribe", - value: function unsubscribe() {// + event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page + event.preventDefault(); + const children = this._getChildren().filter(element => !isDisabled(element)); + let nextActiveElement; + if ([HOME_KEY, END_KEY].includes(event.key)) { + nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]; + } else { + const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key); + nextActiveElement = getNextActiveElement(children, event.target, isNext, true); } - /** - * Listen for an event on the channel instance. - */ - - }, { - key: "listen", - value: function listen(event, callback) { - return this; + if (nextActiveElement) { + nextActiveElement.focus({ + preventScroll: true + }); + Tab.getOrCreateInstance(nextActiveElement).show(); } - /** - * Listen for all events on the channel instance. - */ - - }, { - key: "listenToAll", - value: function listenToAll(callback) { - return this; + } + _getChildren() { + // collection of inner elements + return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent); + } + _getActiveElem() { + return this._getChildren().find(child => this._elemIsActive(child)) || null; + } + _setInitialAttributes(parent, children) { + this._setAttributeIfNotExists(parent, 'role', 'tablist'); + for (const child of children) { + this._setInitialAttributesOnChild(child); } - /** - * Stop listening for an event on the channel instance. - */ - - }, { - key: "stopListening", - value: function stopListening(event, callback) { - return this; + } + _setInitialAttributesOnChild(child) { + child = this._getInnerElement(child); + const isActive = this._elemIsActive(child); + const outerElem = this._getOuterElement(child); + child.setAttribute('aria-selected', isActive); + if (outerElem !== child) { + this._setAttributeIfNotExists(outerElem, 'role', 'presentation'); } - /** - * Register a callback to be called anytime a subscription succeeds. - */ - - }, { - key: "subscribed", - value: function subscribed(callback) { - return this; + if (!isActive) { + child.setAttribute('tabindex', '-1'); } - /** - * Register a callback to be called anytime an error occurs. - */ + this._setAttributeIfNotExists(child, 'role', 'tab'); - }, { - key: "error", - value: function error(callback) { - return this; + // set attributes to the related panel too + this._setInitialAttributesOnTargetPanel(child); + } + _setInitialAttributesOnTargetPanel(child) { + const target = SelectorEngine.getElementFromSelector(child); + if (!target) { + return; } - /** - * Bind a channel to an event. - */ - - }, { - key: "on", - value: function on(event, callback) { - return this; + this._setAttributeIfNotExists(target, 'role', 'tabpanel'); + if (child.id) { + this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`); } - }]); + } + _toggleDropDown(element, open) { + const outerElem = this._getOuterElement(element); + if (!outerElem.classList.contains(CLASS_DROPDOWN)) { + return; + } + const toggle = (selector, className) => { + const element = SelectorEngine.findOne(selector, outerElem); + if (element) { + element.classList.toggle(className, open); + } + }; + toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE); + toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1); + outerElem.setAttribute('aria-expanded', open); + } + _setAttributeIfNotExists(element, attribute, value) { + if (!element.hasAttribute(attribute)) { + element.setAttribute(attribute, value); + } + } + _elemIsActive(elem) { + return elem.classList.contains(CLASS_NAME_ACTIVE); + } - return NullChannel; -}(Channel); + // Try to get the inner element (usually the .nav-link) + _getInnerElement(elem) { + return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem); + } -/** - * This class represents a null private channel. - */ + // Try to get the outer element (usually the .nav-item) + _getOuterElement(elem) { + return elem.closest(SELECTOR_OUTER) || elem; + } -var NullPrivateChannel = /*#__PURE__*/function (_NullChannel) { - _inherits(NullPrivateChannel, _NullChannel); + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Tab.getOrCreateInstance(this); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError(`No method named "${config}"`); + } + data[config](); + }); + } +} - var _super = _createSuper(NullPrivateChannel); +/** + * Data API implementation + */ - function NullPrivateChannel() { - _classCallCheck(this, NullPrivateChannel); +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { + if (['A', 'AREA'].includes(this.tagName)) { + event.preventDefault(); + } + if (isDisabled(this)) { + return; + } + Tab.getOrCreateInstance(this).show(); +}); - return _super.apply(this, arguments); +/** + * Initialize on focus + */ +EventHandler.on(window, EVENT_LOAD_DATA_API, () => { + for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) { + Tab.getOrCreateInstance(element); } +}); +/** + * jQuery + */ - _createClass(NullPrivateChannel, [{ - key: "whisper", - value: - /** - * Send a whisper event to other clients in the channel. - */ - function whisper(eventName, data) { - return this; - } - }]); +defineJQueryPlugin(Tab); + +/** + * -------------------------------------------------------------------------- + * Bootstrap toast.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * -------------------------------------------------------------------------- + */ - return NullPrivateChannel; -}(NullChannel); /** - * This class represents a null presence channel. + * Constants */ -var NullPresenceChannel = /*#__PURE__*/function (_NullChannel) { - _inherits(NullPresenceChannel, _NullChannel); +const NAME = 'toast'; +const DATA_KEY = 'bs.toast'; +const EVENT_KEY = `.${DATA_KEY}`; +const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; +const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; +const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; +const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; +const EVENT_HIDE = `hide${EVENT_KEY}`; +const EVENT_HIDDEN = `hidden${EVENT_KEY}`; +const EVENT_SHOW = `show${EVENT_KEY}`; +const EVENT_SHOWN = `shown${EVENT_KEY}`; +const CLASS_NAME_FADE = 'fade'; +const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility +const CLASS_NAME_SHOW = 'show'; +const CLASS_NAME_SHOWING = 'showing'; +const DefaultType = { + animation: 'boolean', + autohide: 'boolean', + delay: 'number' +}; +const Default = { + animation: true, + autohide: true, + delay: 5000 +}; - var _super = _createSuper(NullPresenceChannel); +/** + * Class definition + */ - function NullPresenceChannel() { - _classCallCheck(this, NullPresenceChannel); +class Toast extends BaseComponent { + constructor(element, config) { + super(element, config); + this._timeout = null; + this._hasMouseInteraction = false; + this._hasKeyboardInteraction = false; + this._setListeners(); + } - return _super.apply(this, arguments); + // Getters + static get Default() { + return Default; + } + static get DefaultType() { + return DefaultType; + } + static get NAME() { + return NAME; } - _createClass(NullPresenceChannel, [{ - key: "here", - value: - /** - * Register a callback to be called anytime the member list changes. - */ - function here(callback) { - return this; + // Public + show() { + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); + if (showEvent.defaultPrevented) { + return; } - /** - * Listen for someone joining the channel. - */ - - }, { - key: "joining", - value: function joining(callback) { - return this; + this._clearTimeout(); + if (this._config.animation) { + this._element.classList.add(CLASS_NAME_FADE); } - /** - * Send a whisper event to other clients in the channel. - */ - - }, { - key: "whisper", - value: function whisper(eventName, data) { - return this; + const complete = () => { + this._element.classList.remove(CLASS_NAME_SHOWING); + EventHandler.trigger(this._element, EVENT_SHOWN); + this._maybeScheduleHide(); + }; + this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated + reflow(this._element); + this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING); + this._queueCallback(complete, this._element, this._config.animation); + } + hide() { + if (!this.isShown()) { + return; } - /** - * Listen for someone leaving the channel. - */ - - }, { - key: "leaving", - value: function leaving(callback) { - return this; + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); + if (hideEvent.defaultPrevented) { + return; } - }]); - - return NullPresenceChannel; -}(NullChannel); - -var Connector = /*#__PURE__*/function () { - /** - * Create a new class instance. - */ - function Connector(options) { - _classCallCheck(this, Connector); - - /** - * Default connector options. - */ - this._defaultOptions = { - auth: { - headers: {} - }, - authEndpoint: '/broadcasting/auth', - userAuthentication: { - endpoint: '/broadcasting/user-auth', - headers: {} - }, - broadcaster: 'pusher', - csrfToken: null, - bearerToken: null, - host: null, - key: null, - namespace: 'App.Events' + const complete = () => { + this._element.classList.add(CLASS_NAME_HIDE); // @deprecated + this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW); + EventHandler.trigger(this._element, EVENT_HIDDEN); }; - this.setOptions(options); - this.connect(); + this._element.classList.add(CLASS_NAME_SHOWING); + this._queueCallback(complete, this._element, this._config.animation); + } + dispose() { + this._clearTimeout(); + if (this.isShown()) { + this._element.classList.remove(CLASS_NAME_SHOW); + } + super.dispose(); + } + isShown() { + return this._element.classList.contains(CLASS_NAME_SHOW); } - /** - * Merge the custom options with the defaults. - */ + // Private - _createClass(Connector, [{ - key: "setOptions", - value: function setOptions(options) { - this.options = _extends(this._defaultOptions, options); - var token = this.csrfToken(); + _maybeScheduleHide() { + if (!this._config.autohide) { + return; + } + if (this._hasMouseInteraction || this._hasKeyboardInteraction) { + return; + } + this._timeout = setTimeout(() => { + this.hide(); + }, this._config.delay); + } + _onInteraction(event, isInteracting) { + switch (event.type) { + case 'mouseover': + case 'mouseout': + { + this._hasMouseInteraction = isInteracting; + break; + } + case 'focusin': + case 'focusout': + { + this._hasKeyboardInteraction = isInteracting; + break; + } + } + if (isInteracting) { + this._clearTimeout(); + return; + } + const nextElement = event.relatedTarget; + if (this._element === nextElement || this._element.contains(nextElement)) { + return; + } + this._maybeScheduleHide(); + } + _setListeners() { + EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); + EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); + EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); + EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); + } + _clearTimeout() { + clearTimeout(this._timeout); + this._timeout = null; + } - if (token) { - this.options.auth.headers['X-CSRF-TOKEN'] = token; - this.options.userAuthentication.headers['X-CSRF-TOKEN'] = token; + // Static + static jQueryInterface(config) { + return this.each(function () { + const data = Toast.getOrCreateInstance(this, config); + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`); + } + data[config](this); } + }); + } +} - token = this.options.bearerToken; +/** + * Data API implementation + */ - if (token) { - this.options.auth.headers['Authorization'] = 'Bearer ' + token; - this.options.userAuthentication.headers['Authorization'] = 'Bearer ' + token; - } +enableDismissTrigger(Toast); - return options; - } - /** - * Extract the CSRF token from the page. - */ +/** + * jQuery + */ - }, { - key: "csrfToken", - value: function csrfToken() { - var selector; +defineJQueryPlugin(Toast); - if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) { - return window['Laravel'].csrfToken; - } else if (this.options.csrfToken) { - return this.options.csrfToken; - } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) { - return selector.getAttribute('content'); - } - return null; - } - }]); +//# sourceMappingURL=bootstrap.esm.js.map - return Connector; -}(); -/** - * This class creates a connector to Pusher. +/***/ }), + +/***/ "./node_modules/buffer/index.js": +/*!**************************************!*\ + !*** ./node_modules/buffer/index.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <http://feross.org> + * @license MIT */ +/* eslint-disable no-proto */ -var PusherConnector = /*#__PURE__*/function (_Connector) { - _inherits(PusherConnector, _Connector); - var _super = _createSuper(PusherConnector); - function PusherConnector() { - var _this; +var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") +var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") +var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js") - _classCallCheck(this, PusherConnector); +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 - _this = _super.apply(this, arguments); - /** - * All of the subscribed channel names. - */ +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. - _this.channels = {}; - return _this; + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = __webpack_require__.g.TYPED_ARRAY_SUPPORT !== undefined + ? __webpack_require__.g.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false } - /** - * Create a fresh Pusher connection. - */ +} +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} - _createClass(PusherConnector, [{ - key: "connect", - value: function connect() { - if (typeof this.options.client !== 'undefined') { - this.pusher = this.options.client; - } else if (this.options.Pusher) { - this.pusher = new this.options.Pusher(this.options.key, this.options); - } else { - this.pusher = new Pusher(this.options.key, this.options); - } +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) } - /** - * Sign in the user via Pusher user authentication (https://pusher.com/docs/channels/using_channels/user-authentication/). - */ + that.length = length + } - }, { - key: "signin", - value: function signin() { - this.pusher.signin(); - } - /** - * Listen for an event on a channel instance. - */ + return that +} - }, { - key: "listen", - value: function listen(name, event, callback) { - return this.channel(name).listen(event, callback); - } - /** - * Get a channel instance by name. - */ +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ - }, { - key: "channel", - value: function channel(name) { - if (!this.channels[name]) { - this.channels[name] = new PusherChannel(this.pusher, name, this.options); - } +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } - return this.channels[name]; + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) } - /** - * Get a private channel instance by name. - */ + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} - }, { - key: "privateChannel", - value: function privateChannel(name) { - if (!this.channels['private-' + name]) { - this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options); - } +Buffer.poolSize = 8192 // not used by this implementation - return this.channels['private-' + name]; - } - /** - * Get a private encrypted channel instance by name. - */ +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} - }, { - key: "encryptedPrivateChannel", - value: function encryptedPrivateChannel(name) { - if (!this.channels['private-encrypted-' + name]) { - this.channels['private-encrypted-' + name] = new PusherEncryptedPrivateChannel(this.pusher, 'private-encrypted-' + name, this.options); - } +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } - return this.channels['private-encrypted-' + name]; - } - /** - * Get a presence channel instance by name. - */ + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } - }, { - key: "presenceChannel", - value: function presenceChannel(name) { - if (!this.channels['presence-' + name]) { - this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options); - } + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } - return this.channels['presence-' + name]; - } - /** - * Leave the given channel, as well as its private and presence variants. - */ + return fromObject(that, value) +} - }, { - key: "leave", - value: function leave(name) { - var _this2 = this; +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} - var channels = [name, 'private-' + name, 'private-encrypted-' + name, 'presence-' + name]; - channels.forEach(function (name, index) { - _this2.leaveChannel(name); - }); - } - /** - * Leave the given channel. - */ +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} - }, { - key: "leaveChannel", - value: function leaveChannel(name) { - if (this.channels[name]) { - this.channels[name].unsubscribe(); - delete this.channels[name]; - } - } - /** - * Get the socket ID for the connection. - */ +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} - }, { - key: "socketId", - value: function socketId() { - return this.pusher.connection.socket_id; - } - /** - * Disconnect Pusher connection. - */ +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} - }, { - key: "disconnect", - value: function disconnect() { - this.pusher.disconnect(); +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 } - }]); - - return PusherConnector; -}(Connector); + } + return that +} /** - * This class creates a connnector to a Socket.io server. + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} -var SocketIoConnector = /*#__PURE__*/function (_Connector) { - _inherits(SocketIoConnector, _Connector); +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } - var _super = _createSuper(SocketIoConnector); + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } - function SocketIoConnector() { - var _this; + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) - _classCallCheck(this, SocketIoConnector); + var actual = that.write(string, encoding) - _this = _super.apply(this, arguments); - /** - * All of the subscribed channel names. - */ + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } - _this.channels = {}; - return _this; + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 } - /** - * Create a fresh Socket.io connection. - */ + return that +} +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer - _createClass(SocketIoConnector, [{ - key: "connect", - value: function connect() { - var _this2 = this; + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } - var io = this.getSocketIO(); - this.socket = io(this.options.host, this.options); - this.socket.on('reconnect', function () { - Object.values(_this2.channels).forEach(function (channel) { - channel.subscribe(); - }); - }); - return this.socket; - } - /** - * Get socket.io module from global scope or options. - */ + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } - }, { - key: "getSocketIO", - value: function getSocketIO() { - if (typeof this.options.client !== 'undefined') { - return this.options.client; - } + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } - if (typeof io !== 'undefined') { - return io; - } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} - throw new Error('Socket.io client not found. Should be globally available or passed via options.client'); - } - /** - * Listen for an event on a channel instance. - */ +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) - }, { - key: "listen", - value: function listen(name, event, callback) { - return this.channel(name).listen(event, callback); + if (that.length === 0) { + return that } - /** - * Get a channel instance by name. - */ - }, { - key: "channel", - value: function channel(name) { - if (!this.channels[name]) { - this.channels[name] = new SocketIoChannel(this.socket, name, this.options); + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) } + return fromArrayLike(that, obj) + } - return this.channels[name]; + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) } - /** - * Get a private channel instance by name. - */ + } - }, { - key: "privateChannel", - value: function privateChannel(name) { - if (!this.channels['private-' + name]) { - this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options); - } + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} - return this.channels['private-' + name]; - } - /** - * Get a presence channel instance by name. - */ +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} - }, { - key: "presenceChannel", - value: function presenceChannel(name) { - if (!this.channels['presence-' + name]) { - this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options); - } +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} - return this.channels['presence-' + name]; - } - /** - * Leave the given channel, as well as its private and presence variants. - */ +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} - }, { - key: "leave", - value: function leave(name) { - var _this3 = this; +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } - var channels = [name, 'private-' + name, 'presence-' + name]; - channels.forEach(function (name) { - _this3.leaveChannel(name); - }); - } - /** - * Leave the given channel. - */ + if (a === b) return 0 - }, { - key: "leaveChannel", - value: function leaveChannel(name) { - if (this.channels[name]) { - this.channels[name].unsubscribe(); - delete this.channels[name]; - } - } - /** - * Get the socket ID for the connection. - */ + var x = a.length + var y = b.length - }, { - key: "socketId", - value: function socketId() { - return this.socket.id; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break } - /** - * Disconnect Socketio connection. - */ + } - }, { - key: "disconnect", - value: function disconnect() { - this.socket.disconnect(); - } - }]); + if (x < y) return -1 + if (y < x) return 1 + return 0 +} - return SocketIoConnector; -}(Connector); +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} -/** - * This class creates a null connector. - */ +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } -var NullConnector = /*#__PURE__*/function (_Connector) { - _inherits(NullConnector, _Connector); + if (list.length === 0) { + return Buffer.alloc(0) + } - var _super = _createSuper(NullConnector); + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } - function NullConnector() { - var _this; + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} - _classCallCheck(this, NullConnector); +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } - _this = _super.apply(this, arguments); - /** - * All of the subscribed channel names. - */ + var len = string.length + if (len === 0) return 0 - _this.channels = {}; - return _this; + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } } - /** - * Create a fresh connection. - */ +} +Buffer.byteLength = byteLength +function slowToString (encoding, start, end) { + var loweredCase = false - _createClass(NullConnector, [{ - key: "connect", - value: function connect() {// - } - /** - * Listen for an event on a channel instance. - */ + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. - }, { - key: "listen", - value: function listen(name, event, callback) { - return new NullChannel(); - } - /** - * Get a channel instance by name. - */ + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } - }, { - key: "channel", - value: function channel(name) { - return new NullChannel(); - } - /** - * Get a private channel instance by name. - */ + if (end === undefined || end > this.length) { + end = this.length + } - }, { - key: "privateChannel", - value: function privateChannel(name) { - return new NullPrivateChannel(); - } - /** - * Get a private encrypted channel instance by name. - */ + if (end <= 0) { + return '' + } - }, { - key: "encryptedPrivateChannel", - value: function encryptedPrivateChannel(name) { - return new NullPrivateChannel(); - } - /** - * Get a presence channel instance by name. - */ + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 - }, { - key: "presenceChannel", - value: function presenceChannel(name) { - return new NullPresenceChannel(); - } - /** - * Leave the given channel, as well as its private and presence variants. - */ + if (end <= start) { + return '' + } - }, { - key: "leave", - value: function leave(name) {// - } - /** - * Leave the given channel. - */ + if (!encoding) encoding = 'utf8' - }, { - key: "leaveChannel", - value: function leaveChannel(name) {// - } - /** - * Get the socket ID for the connection. - */ + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) - }, { - key: "socketId", - value: function socketId() { - return 'fake-socket-id'; - } - /** - * Disconnect the connection. - */ + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) - }, { - key: "disconnect", - value: function disconnect() {// + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true } - }]); + } +} - return NullConnector; -}(Connector); +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true -/** - * This class is the primary API for interacting with broadcasting. - */ +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} -var Echo = /*#__PURE__*/function () { - /** - * Create a new class instance. - */ - function Echo(options) { - _classCallCheck(this, Echo); +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} - this.options = options; - this.connect(); +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} - if (!this.options.withoutInterceptors) { - this.registerInterceptors(); - } +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') } - /** - * Get a channel instance by name. - */ + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} - _createClass(Echo, [{ - key: "channel", - value: function channel(_channel) { - return this.connector.channel(_channel); +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '<Buffer ' + str + '>' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break } - /** - * Create a new connection. - */ + } - }, { - key: "connect", - value: function connect() { - if (this.options.broadcaster == 'pusher') { - this.connector = new PusherConnector(this.options); - } else if (this.options.broadcaster == 'socket.io') { - this.connector = new SocketIoConnector(this.options); - } else if (this.options.broadcaster == 'null') { - this.connector = new NullConnector(this.options); - } else if (typeof this.options.broadcaster == 'function') { - this.connector = new this.options.broadcaster(this.options); + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } - /** - * Disconnect from the Echo server. - */ + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } - }, { - key: "disconnect", - value: function disconnect() { - this.connector.disconnect(); - } - /** - * Get a presence channel instance by name. - */ + throw new TypeError('val must be string, number or Buffer') +} - }, { - key: "join", - value: function join(channel) { - return this.connector.presenceChannel(channel); - } - /** - * Leave the given channel, as well as its private and presence variants. - */ +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length - }, { - key: "leave", - value: function leave(channel) { - this.connector.leave(channel); + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 } - /** - * Leave the given channel. - */ + } - }, { - key: "leaveChannel", - value: function leaveChannel(channel) { - this.connector.leaveChannel(channel); + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) } - /** - * Leave all channels. - */ + } - }, { - key: "leaveAllChannels", - value: function leaveAllChannels() { - for (var channel in this.connector.channels) { - this.leaveChannel(channel); + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 } } - /** - * Listen for an event on a channel instance. - */ - - }, { - key: "listen", - value: function listen(channel, event, callback) { - return this.connector.listen(channel, event, callback); + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i } - /** - * Get a private channel instance by name. - */ + } - }, { - key: "private", - value: function _private(channel) { - return this.connector.privateChannel(channel); + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining } - /** - * Get a private encrypted channel instance by name. - */ + } - }, { - key: "encryptedPrivate", - value: function encryptedPrivate(channel) { - return this.connector.encryptedPrivateChannel(channel); - } - /** - * Get the Socket ID for the connection. - */ + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - }, { - key: "socketId", - value: function socketId() { - return this.connector.socketId(); - } - /** - * Register 3rd party request interceptiors. These are used to automatically - * send a connections socket id to a Laravel app with a X-Socket-Id header. - */ + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} - }, { - key: "registerInterceptors", - value: function registerInterceptors() { - if (typeof Vue === 'function' && Vue.http) { - this.registerVueRequestInterceptor(); - } +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} - if (typeof axios === 'function') { - this.registerAxiosRequestInterceptor(); - } +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} - if (typeof jQuery === 'function') { - this.registerjQueryAjaxSetup(); - } +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} - if ((typeof Turbo === "undefined" ? "undefined" : _typeof(Turbo)) === 'object') { - this.registerTurboRequestInterceptor(); - } +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined } - /** - * Register a Vue HTTP interceptor to add the X-Socket-ID header. - */ + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } - }, { - key: "registerVueRequestInterceptor", - value: function registerVueRequestInterceptor() { - var _this = this; + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining - Vue.http.interceptors.push(function (request, next) { - if (_this.socketId()) { - request.headers.set('X-Socket-ID', _this.socketId()); - } + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } - next(); - }); - } - /** - * Register an Axios HTTP interceptor to add the X-Socket-ID header. - */ + if (!encoding) encoding = 'utf8' - }, { - key: "registerAxiosRequestInterceptor", - value: function registerAxiosRequestInterceptor() { - var _this2 = this; + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) - axios.interceptors.request.use(function (config) { - if (_this2.socketId()) { - config.headers['X-Socket-Id'] = _this2.socketId(); - } + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) - return config; - }); + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true } - /** - * Register jQuery AjaxPrefilter to add the X-Socket-ID header. - */ + } +} - }, { - key: "registerjQueryAjaxSetup", - value: function registerjQueryAjaxSetup() { - var _this3 = this; +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} - if (typeof jQuery.ajax != 'undefined') { - jQuery.ajaxPrefilter(function (options, originalOptions, xhr) { - if (_this3.socketId()) { - xhr.setRequestHeader('X-Socket-Id', _this3.socketId()); +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } } - }); } } - /** - * Register the Turbo Request interceptor to add the X-Socket-ID header. - */ - }, { - key: "registerTurboRequestInterceptor", - value: function registerTurboRequestInterceptor() { - var _this4 = this; - - document.addEventListener('turbo:before-fetch-request', function (event) { - event.detail.fetchOptions.headers['X-Socket-Id'] = _this4.socketId(); - }); + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF } - }]); - return Echo; -}(); + res.push(codePoint) + i += bytesPerSequence + } + return decodeCodePointsArray(res) +} +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } -/***/ }), + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} -/***/ "./resources/sass/app.scss": -/*!*********************************!*\ - !*** ./resources/sass/app.scss ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) -/***/ }), + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/***/ ((module) => { +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } -// shim for using process in browser -var process = module.exports = {}; + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. + if (end < start) end = start -var cachedSetTimeout; -var cachedClearTimeout; + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); + return newBuf } -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + return val } -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + return val } -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] } -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] } -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) } -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; -function noop() {} +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} -process.listeners = function (name) { return [] } +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + return val +} -/***/ }), +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) -/***/ "./node_modules/pusher-js/dist/web/pusher.js": -/*!***************************************************!*\ - !*** ./node_modules/pusher-js/dist/web/pusher.js ***! - \***************************************************/ -/***/ ((module) => { + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 -/*! - * Pusher JavaScript Library v7.6.0 - * https://pusher.com/ - * - * Copyright 2020, Pusher - * Released under the MIT licence. - */ + if (val >= mul) val -= Math.pow(2, 8 * byteLength) -(function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else {} -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __nested_webpack_require_669__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_669__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __nested_webpack_require_669__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __nested_webpack_require_669__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __nested_webpack_require_669__.d = function(exports, name, getter) { -/******/ if(!__nested_webpack_require_669__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __nested_webpack_require_669__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __nested_webpack_require_669__.t = function(value, mode) { -/******/ if(mode & 1) value = __nested_webpack_require_669__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __nested_webpack_require_669__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_669__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __nested_webpack_require_669__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __nested_webpack_require_669__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __nested_webpack_require_669__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __nested_webpack_require_669__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __nested_webpack_require_669__(__nested_webpack_require_669__.s = 2); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { + return val +} -"use strict"; +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} -// Copyright (C) 2016 Dmitry Chestnykh -// MIT License. See LICENSE file for details. -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Package base64 implements Base64 encoding and decoding. - */ -// Invalid character used in decoding to indicate -// that the character to decode is out of range of -// alphabet and cannot be decoded. -var INVALID_BYTE = 256; -/** - * Implements standard Base64 encoding. - * - * Operates in constant time. - */ -var Coder = /** @class */ (function () { - // TODO(dchest): methods to encode chunk-by-chunk. - function Coder(_paddingCharacter) { - if (_paddingCharacter === void 0) { _paddingCharacter = "="; } - this._paddingCharacter = _paddingCharacter; +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 } - Coder.prototype.encodedLength = function (length) { - if (!this._paddingCharacter) { - return (length * 8 + 5) / 6 | 0; + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue } - return (length + 2) / 3 * 4 | 0; - }; - Coder.prototype.encode = function (data) { - var out = ""; - var i = 0; - for (; i < data.length - 2; i += 3) { - var c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]); - out += this._encodeByte((c >>> 3 * 6) & 63); - out += this._encodeByte((c >>> 2 * 6) & 63); - out += this._encodeByte((c >>> 1 * 6) & 63); - out += this._encodeByte((c >>> 0 * 6) & 63); - } - var left = data.length - i; - if (left > 0) { - var c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0); - out += this._encodeByte((c >>> 3 * 6) & 63); - out += this._encodeByte((c >>> 2 * 6) & 63); - if (left === 2) { - out += this._encodeByte((c >>> 1 * 6) & 63); - } - else { - out += this._paddingCharacter || ""; - } - out += this._paddingCharacter || ""; - } - return out; - }; - Coder.prototype.maxDecodedLength = function (length) { - if (!this._paddingCharacter) { - return (length * 6 + 7) / 8 | 0; - } - return length / 4 * 3 | 0; - }; - Coder.prototype.decodedLength = function (s) { - return this.maxDecodedLength(s.length - this._getPaddingLength(s)); - }; - Coder.prototype.decode = function (s) { - if (s.length === 0) { - return new Uint8Array(0); - } - var paddingLength = this._getPaddingLength(s); - var length = s.length - paddingLength; - var out = new Uint8Array(this.maxDecodedLength(length)); - var op = 0; - var i = 0; - var haveBad = 0; - var v0 = 0, v1 = 0, v2 = 0, v3 = 0; - for (; i < length - 4; i += 4) { - v0 = this._decodeChar(s.charCodeAt(i + 0)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - v2 = this._decodeChar(s.charCodeAt(i + 2)); - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op++] = (v0 << 2) | (v1 >>> 4); - out[op++] = (v1 << 4) | (v2 >>> 2); - out[op++] = (v2 << 6) | v3; - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - haveBad |= v2 & INVALID_BYTE; - haveBad |= v3 & INVALID_BYTE; - } - if (i < length - 1) { - v0 = this._decodeChar(s.charCodeAt(i)); - v1 = this._decodeChar(s.charCodeAt(i + 1)); - out[op++] = (v0 << 2) | (v1 >>> 4); - haveBad |= v0 & INVALID_BYTE; - haveBad |= v1 & INVALID_BYTE; - } - if (i < length - 2) { - v2 = this._decodeChar(s.charCodeAt(i + 2)); - out[op++] = (v1 << 4) | (v2 >>> 2); - haveBad |= v2 & INVALID_BYTE; - } - if (i < length - 3) { - v3 = this._decodeChar(s.charCodeAt(i + 3)); - out[op++] = (v2 << 6) | v3; - haveBad |= v3 & INVALID_BYTE; - } - if (haveBad !== 0) { - throw new Error("Base64Coder: incorrect characters for decoding"); - } - return out; - }; - // Standard encoding have the following encoded/decoded ranges, - // which we need to convert between. - // - // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 + / - // Index: 0 - 25 26 - 51 52 - 61 62 63 - // ASCII: 65 - 90 97 - 122 48 - 57 43 47 - // - // Encode 6 bits in b into a new character. - Coder.prototype._encodeByte = function (b) { - // Encoding uses constant time operations as follows: - // - // 1. Define comparison of A with B using (A - B) >>> 8: - // if A > B, then result is positive integer - // if A <= B, then result is 0 - // - // 2. Define selection of C or 0 using bitwise AND: X & C: - // if X == 0, then result is 0 - // if X != 0, then result is C - // - // 3. Start with the smallest comparison (b >= 0), which is always - // true, so set the result to the starting ASCII value (65). - // - // 4. Continue comparing b to higher ASCII values, and selecting - // zero if comparison isn't true, otherwise selecting a value - // to add to result, which: - // - // a) undoes the previous addition - // b) provides new value to add - // - var result = b; - // b >= 0 - result += 65; - // b > 25 - result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97); - // b > 51 - result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48); - // b > 61 - result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43); - // b > 62 - result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47); - return String.fromCharCode(result); - }; - // Decode a character code into a byte. - // Must return 256 if character is out of alphabet range. - Coder.prototype._decodeChar = function (c) { - // Decoding works similar to encoding: using the same comparison - // function, but now it works on ranges: result is always incremented - // by value, but this value becomes zero if the range is not - // satisfied. - // - // Decoding starts with invalid value, 256, which is then - // subtracted when the range is satisfied. If none of the ranges - // apply, the function returns 256, which is then checked by - // the caller to throw error. - var result = INVALID_BYTE; // start with invalid character - // c == 43 (c > 42 and c < 44) - result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62); - // c == 47 (c > 46 and c < 48) - result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63); - // c > 47 and c < 58 - result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52); - // c > 64 and c < 91 - result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0); - // c > 96 and c < 123 - result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26); - return result; - }; - Coder.prototype._getPaddingLength = function (s) { - var paddingLength = 0; - if (this._paddingCharacter) { - for (var i = s.length - 1; i >= 0; i--) { - if (s[i] !== this._paddingCharacter) { - break; - } - paddingLength++; - } - if (s.length < 4 || paddingLength > 2) { - throw new Error("Base64Coder: incorrect padding"); - } - } - return paddingLength; - }; - return Coder; -}()); -exports.Coder = Coder; -var stdCoder = new Coder(); -function encode(data) { - return stdCoder.encode(data); -} -exports.encode = encode; -function decode(s) { - return stdCoder.decode(s); -} -exports.decode = decode; -/** - * Implements URL-safe Base64 encoding. - * (Same as Base64, but '+' is replaced with '-', and '/' with '_'). - * - * Operates in constant time. - */ -var URLSafeCoder = /** @class */ (function (_super) { - __extends(URLSafeCoder, _super); - function URLSafeCoder() { - return _super !== null && _super.apply(this, arguments) || this; + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } - // URL-safe encoding have the following encoded/decoded ranges: - // - // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 - _ - // Index: 0 - 25 26 - 51 52 - 61 62 63 - // ASCII: 65 - 90 97 - 122 48 - 57 45 95 - // - URLSafeCoder.prototype._encodeByte = function (b) { - var result = b; - // b >= 0 - result += 65; - // b > 25 - result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97); - // b > 51 - result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48); - // b > 61 - result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45); - // b > 62 - result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95); - return String.fromCharCode(result); - }; - URLSafeCoder.prototype._decodeChar = function (c) { - var result = INVALID_BYTE; - // c == 45 (c > 44 and c < 46) - result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62); - // c == 95 (c > 94 and c < 96) - result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63); - // c > 47 and c < 58 - result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52); - // c > 64 and c < 91 - result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0); - // c > 96 and c < 123 - result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26); - return result; - }; - return URLSafeCoder; -}(Coder)); -exports.URLSafeCoder = URLSafeCoder; -var urlSafeCoder = new URLSafeCoder(); -function encodeURLSafe(data) { - return urlSafeCoder.encode(data); + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes } -exports.encodeURLSafe = encodeURLSafe; -function decodeURLSafe(s) { - return urlSafeCoder.decode(s); + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray } -exports.decodeURLSafe = decodeURLSafe; -exports.encodedLength = function (length) { - return stdCoder.encodedLength(length); -}; -exports.maxDecodedLength = function (length) { - return stdCoder.maxDecodedLength(length); -}; -exports.decodedLength = function (s) { - return stdCoder.decodedLength(s); -}; +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } -"use strict"; + return byteArray +} -// Copyright (C) 2016 Dmitry Chestnykh -// MIT License. See LICENSE file for details. -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Package utf8 implements UTF-8 encoding and decoding. +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + + +/***/ }), + +/***/ "./node_modules/clipboard/dist/clipboard.js": +/*!**************************************************!*\ + !*** ./node_modules/clipboard/dist/clipboard.js ***! + \**************************************************/ +/***/ (function(module) { + +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha */ -var INVALID_UTF16 = "utf8: invalid string"; -var INVALID_UTF8 = "utf8: invalid source encoding"; +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(this, function() { +return /******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 686: +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) { + +"use strict"; + +// EXPORTS +__nested_webpack_require_623__.d(__nested_webpack_exports__, { + "default": function() { return /* binding */ clipboard; } +}); + +// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js +var tiny_emitter = __nested_webpack_require_623__(279); +var tiny_emitter_default = /*#__PURE__*/__nested_webpack_require_623__.n(tiny_emitter); +// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js +var listen = __nested_webpack_require_623__(370); +var listen_default = /*#__PURE__*/__nested_webpack_require_623__.n(listen); +// EXTERNAL MODULE: ./node_modules/select/src/select.js +var src_select = __nested_webpack_require_623__(817); +var select_default = /*#__PURE__*/__nested_webpack_require_623__.n(src_select); +;// CONCATENATED MODULE: ./src/common/command.js /** - * Encodes the given string into UTF-8 byte array. - * Throws if the source string has invalid UTF-16 encoding. + * Executes a given operation type. + * @param {String} type + * @return {Boolean} */ -function encode(s) { - // Calculate result length and allocate output array. - // encodedLength() also validates string and throws errors, - // so we don't need repeat validation here. - var arr = new Uint8Array(encodedLength(s)); - var pos = 0; - for (var i = 0; i < s.length; i++) { - var c = s.charCodeAt(i); - if (c < 0x80) { - arr[pos++] = c; - } - else if (c < 0x800) { - arr[pos++] = 0xc0 | c >> 6; - arr[pos++] = 0x80 | c & 0x3f; - } - else if (c < 0xd800) { - arr[pos++] = 0xe0 | c >> 12; - arr[pos++] = 0x80 | (c >> 6) & 0x3f; - arr[pos++] = 0x80 | c & 0x3f; - } - else { - i++; // get one more character - c = (c & 0x3ff) << 10; - c |= s.charCodeAt(i) & 0x3ff; - c += 0x10000; - arr[pos++] = 0xf0 | c >> 18; - arr[pos++] = 0x80 | (c >> 12) & 0x3f; - arr[pos++] = 0x80 | (c >> 6) & 0x3f; - arr[pos++] = 0x80 | c & 0x3f; - } - } - return arr; +function command(type) { + try { + return document.execCommand(type); + } catch (err) { + return false; + } } -exports.encode = encode; +;// CONCATENATED MODULE: ./src/actions/cut.js + + /** - * Returns the number of bytes required to encode the given string into UTF-8. - * Throws if the source string has invalid UTF-16 encoding. + * Cut action wrapper. + * @param {String|HTMLElement} target + * @return {String} */ -function encodedLength(s) { - var result = 0; - for (var i = 0; i < s.length; i++) { - var c = s.charCodeAt(i); - if (c < 0x80) { - result += 1; - } - else if (c < 0x800) { - result += 2; - } - else if (c < 0xd800) { - result += 3; - } - else if (c <= 0xdfff) { - if (i >= s.length - 1) { - throw new Error(INVALID_UTF16); - } - i++; // "eat" next character - result += 4; - } - else { - throw new Error(INVALID_UTF16); - } - } - return result; -} -exports.encodedLength = encodedLength; + +var ClipboardActionCut = function ClipboardActionCut(target) { + var selectedText = select_default()(target); + command('cut'); + return selectedText; +}; + +/* harmony default export */ var actions_cut = (ClipboardActionCut); +;// CONCATENATED MODULE: ./src/common/create-fake-element.js /** - * Decodes the given byte array from UTF-8 into a string. - * Throws if encoding is invalid. + * Creates a fake textarea element with a value. + * @param {String} value + * @return {HTMLElement} */ -function decode(arr) { - var chars = []; - for (var i = 0; i < arr.length; i++) { - var b = arr[i]; - if (b & 0x80) { - var min = void 0; - if (b < 0xe0) { - // Need 1 more byte. - if (i >= arr.length) { - throw new Error(INVALID_UTF8); - } - var n1 = arr[++i]; - if ((n1 & 0xc0) !== 0x80) { - throw new Error(INVALID_UTF8); - } - b = (b & 0x1f) << 6 | (n1 & 0x3f); - min = 0x80; - } - else if (b < 0xf0) { - // Need 2 more bytes. - if (i >= arr.length - 1) { - throw new Error(INVALID_UTF8); - } - var n1 = arr[++i]; - var n2 = arr[++i]; - if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) { - throw new Error(INVALID_UTF8); - } - b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f); - min = 0x800; - } - else if (b < 0xf8) { - // Need 3 more bytes. - if (i >= arr.length - 2) { - throw new Error(INVALID_UTF8); - } - var n1 = arr[++i]; - var n2 = arr[++i]; - var n3 = arr[++i]; - if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) { - throw new Error(INVALID_UTF8); - } - b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f); - min = 0x10000; - } - else { - throw new Error(INVALID_UTF8); - } - if (b < min || (b >= 0xd800 && b <= 0xdfff)) { - throw new Error(INVALID_UTF8); - } - if (b >= 0x10000) { - // Surrogate pair. - if (b > 0x10ffff) { - throw new Error(INVALID_UTF8); - } - b -= 0x10000; - chars.push(String.fromCharCode(0xd800 | (b >> 10))); - b = 0xdc00 | (b & 0x3ff); - } - } - chars.push(String.fromCharCode(b)); - } - return chars.join(""); -} -exports.decode = decode; +function createFakeElement(value) { + var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; + var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS + fakeElement.style.fontSize = '12pt'; // Reset box model -/***/ }), -/* 2 */ -/***/ (function(module, exports, __nested_webpack_require_19901__) { + fakeElement.style.border = '0'; + fakeElement.style.padding = '0'; + fakeElement.style.margin = '0'; // Move element out of screen horizontally -// required so we don't have to do require('pusher').default etc. -module.exports = __nested_webpack_require_19901__(3).default; + fakeElement.style.position = 'absolute'; + fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + fakeElement.style.top = "".concat(yPosition, "px"); + fakeElement.setAttribute('readonly', ''); + fakeElement.value = value; + return fakeElement; +} +;// CONCATENATED MODULE: ./src/actions/copy.js -/***/ }), -/* 3 */ -/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_20105__) { -"use strict"; -// ESM COMPAT FLAG -__nested_webpack_require_20105__.r(__nested_webpack_exports__); -// CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts -var ScriptReceiverFactory = (function () { - function ScriptReceiverFactory(prefix, name) { - this.lastId = 0; - this.prefix = prefix; - this.name = name; - } - ScriptReceiverFactory.prototype.create = function (callback) { - this.lastId++; - var number = this.lastId; - var id = this.prefix + number; - var name = this.name + '[' + number + ']'; - var called = false; - var callbackWrapper = function () { - if (!called) { - callback.apply(null, arguments); - called = true; - } - }; - this[number] = callbackWrapper; - return { number: number, id: id, name: name, callback: callbackWrapper }; - }; - ScriptReceiverFactory.prototype.remove = function (receiver) { - delete this[receiver.number]; - }; - return ScriptReceiverFactory; -}()); +/** + * Create fake copy action wrapper using a fake element. + * @param {String} target + * @param {Object} options + * @return {String} + */ -var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.ScriptReceivers'); +var fakeCopyAction = function fakeCopyAction(value, options) { + var fakeElement = createFakeElement(value); + options.container.appendChild(fakeElement); + var selectedText = select_default()(fakeElement); + command('copy'); + fakeElement.remove(); + return selectedText; +}; +/** + * Copy action wrapper. + * @param {String|HTMLElement} target + * @param {Object} options + * @return {String} + */ -// CONCATENATED MODULE: ./src/core/defaults.ts -var Defaults = { - VERSION: "7.6.0", - PROTOCOL: 7, - wsPort: 80, - wssPort: 443, - wsPath: '', - httpHost: 'sockjs.pusher.com', - httpPort: 80, - httpsPort: 443, - httpPath: '/pusher', - stats_host: 'stats.pusher.com', - authEndpoint: '/pusher/auth', - authTransport: 'ajax', - activityTimeout: 120000, - pongTimeout: 30000, - unavailableTimeout: 10000, - cluster: 'mt1', - userAuthentication: { - endpoint: '/pusher/user-auth', - transport: 'ajax' - }, - channelAuthorization: { - endpoint: '/pusher/auth', - transport: 'ajax' - }, - cdn_http: "http://js.pusher.com", - cdn_https: "https://js.pusher.com", - dependency_suffix: "" + +var ClipboardActionCopy = function ClipboardActionCopy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + var selectedText = ''; + + if (typeof target === 'string') { + selectedText = fakeCopyAction(target, options); + } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) { + // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange + selectedText = fakeCopyAction(target.value, options); + } else { + selectedText = select_default()(target); + command('copy'); + } + + return selectedText; }; -/* harmony default export */ var defaults = (Defaults); -// CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts +/* harmony default export */ var actions_copy = (ClipboardActionCopy); +;// CONCATENATED MODULE: ./src/actions/default.js +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -var dependency_loader_DependencyLoader = (function () { - function DependencyLoader(options) { - this.options = options; - this.receivers = options.receivers || ScriptReceivers; - this.loading = {}; - } - DependencyLoader.prototype.load = function (name, options, callback) { - var self = this; - if (self.loading[name] && self.loading[name].length > 0) { - self.loading[name].push(callback); - } - else { - self.loading[name] = [callback]; - var request = runtime.createScriptRequest(self.getPath(name, options)); - var receiver = self.receivers.create(function (error) { - self.receivers.remove(receiver); - if (self.loading[name]) { - var callbacks = self.loading[name]; - delete self.loading[name]; - var successCallback = function (wasSuccessful) { - if (!wasSuccessful) { - request.cleanup(); - } - }; - for (var i = 0; i < callbacks.length; i++) { - callbacks[i](error, successCallback); - } - } - }); - request.send(receiver); - } - }; - DependencyLoader.prototype.getRoot = function (options) { - var cdn; - var protocol = runtime.getDocument().location.protocol; - if ((options && options.useTLS) || protocol === 'https:') { - cdn = this.options.cdn_https; - } - else { - cdn = this.options.cdn_http; - } - return cdn.replace(/\/*$/, '') + '/' + this.options.version; - }; - DependencyLoader.prototype.getPath = function (name, options) { - return this.getRoot(options) + '/' + name + this.options.suffix + '.js'; - }; - return DependencyLoader; -}()); -/* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader); -// CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts +/** + * Inner function which performs selection from either `text` or `target` + * properties and then executes copy or cut operations. + * @param {Object} options + */ +var ClipboardActionDefault = function ClipboardActionDefault() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // Defines base properties passed from constructor. + var _options$action = options.action, + action = _options$action === void 0 ? 'copy' : _options$action, + container = options.container, + target = options.target, + text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. + if (action !== 'copy' && action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } // Sets the `target` property using an element that will be have its content copied. -var DependenciesReceivers = new ScriptReceiverFactory('_pusher_dependencies', 'Pusher.DependenciesReceivers'); -var Dependencies = new dependency_loader({ - cdn_http: defaults.cdn_http, - cdn_https: defaults.cdn_https, - version: defaults.VERSION, - suffix: defaults.dependency_suffix, - receivers: DependenciesReceivers -}); -// CONCATENATED MODULE: ./src/core/utils/url_store.ts -var urlStore = { - baseUrl: 'https://pusher.com', - urls: { - authenticationEndpoint: { - path: '/docs/channels/server_api/authenticating_users' - }, - authorizationEndpoint: { - path: '/docs/channels/server_api/authorizing-users/' - }, - javascriptQuickStart: { - path: '/docs/javascript_quick_start' - }, - triggeringClientEvents: { - path: '/docs/client_api_guide/client_events#trigger-events' - }, - encryptedChannelSupport: { - fullUrl: 'https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support' - } - } -}; -var buildLogSuffix = function (key) { - var urlPrefix = 'See:'; - var urlObj = urlStore.urls[key]; - if (!urlObj) - return ''; - var url; - if (urlObj.fullUrl) { - url = urlObj.fullUrl; - } - else if (urlObj.path) { - url = urlStore.baseUrl + urlObj.path; + if (target !== undefined) { + if (target && _typeof(target) === 'object' && target.nodeType === 1) { + if (action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + + if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + } else { + throw new Error('Invalid "target" value, use a valid Element'); } - if (!url) - return ''; - return urlPrefix + " " + url; -}; -/* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix }); + } // Define selection strategy based on `text` property. -// CONCATENATED MODULE: ./src/core/auth/options.ts -var AuthRequestType; -(function (AuthRequestType) { - AuthRequestType["UserAuthentication"] = "user-authentication"; - AuthRequestType["ChannelAuthorization"] = "channel-authorization"; -})(AuthRequestType || (AuthRequestType = {})); -// CONCATENATED MODULE: ./src/core/errors.ts -var __extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var BadEventName = (function (_super) { - __extends(BadEventName, _super); - function BadEventName(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return BadEventName; -}(Error)); + if (text) { + return actions_copy(text, { + container: container + }); + } // Defines which selection strategy based on `target` property. -var BadChannelName = (function (_super) { - __extends(BadChannelName, _super); - function BadChannelName(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return BadChannelName; -}(Error)); -var RequestTimedOut = (function (_super) { - __extends(RequestTimedOut, _super); - function RequestTimedOut(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return RequestTimedOut; -}(Error)); + if (target) { + return action === 'cut' ? actions_cut(target) : actions_copy(target, { + container: container + }); + } +}; -var TransportPriorityTooLow = (function (_super) { - __extends(TransportPriorityTooLow, _super); - function TransportPriorityTooLow(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return TransportPriorityTooLow; -}(Error)); +/* harmony default export */ var actions_default = (ClipboardActionDefault); +;// CONCATENATED MODULE: ./src/clipboard.js +function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } -var TransportClosed = (function (_super) { - __extends(TransportClosed, _super); - function TransportClosed(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return TransportClosed; -}(Error)); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var UnsupportedFeature = (function (_super) { - __extends(UnsupportedFeature, _super); - function UnsupportedFeature(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return UnsupportedFeature; -}(Error)); +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } -var UnsupportedTransport = (function (_super) { - __extends(UnsupportedTransport, _super); - function UnsupportedTransport(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return UnsupportedTransport; -}(Error)); +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -var UnsupportedStrategy = (function (_super) { - __extends(UnsupportedStrategy, _super); - function UnsupportedStrategy(msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return UnsupportedStrategy; -}(Error)); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } -var HTTPAuthError = (function (_super) { - __extends(HTTPAuthError, _super); - function HTTPAuthError(status, msg) { - var _newTarget = this.constructor; - var _this = _super.call(this, msg) || this; - _this.status = status; - Object.setPrototypeOf(_this, _newTarget.prototype); - return _this; - } - return HTTPAuthError; -}(Error)); +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } -// CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts +function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } -var ajax = function (context, query, authOptions, authRequestType, callback) { - var xhr = runtime.createXHR(); - xhr.open('POST', authOptions.endpoint, true); - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - for (var headerName in authOptions.headers) { - xhr.setRequestHeader(headerName, authOptions.headers[headerName]); - } - if (authOptions.headersProvider != null) { - var dynamicHeaders = authOptions.headersProvider(); - for (var headerName in dynamicHeaders) { - xhr.setRequestHeader(headerName, dynamicHeaders[headerName]); - } - } - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (xhr.status === 200) { - var data = void 0; - var parsed = false; - try { - data = JSON.parse(xhr.responseText); - parsed = true; - } - catch (e) { - callback(new HTTPAuthError(200, "JSON returned from " + authRequestType.toString() + " endpoint was invalid, yet status code was 200. Data was: " + xhr.responseText), null); - } - if (parsed) { - callback(null, data); - } - } - else { - var suffix = ''; - switch (authRequestType) { - case AuthRequestType.UserAuthentication: - suffix = url_store.buildLogSuffix('authenticationEndpoint'); - break; - case AuthRequestType.ChannelAuthorization: - suffix = "Clients must be authorized to join private or presence channels. " + url_store.buildLogSuffix('authorizationEndpoint'); - break; - } - callback(new HTTPAuthError(xhr.status, "Unable to retrieve auth string from " + authRequestType.toString() + " endpoint - " + - ("received status: " + xhr.status + " from " + authOptions.endpoint + ". " + suffix)), null); - } - } - }; - xhr.send(query); - return xhr; -}; -/* harmony default export */ var xhr_auth = (ajax); -// CONCATENATED MODULE: ./src/core/base64.ts -function encode(s) { - return btoa(utob(s)); -} -var fromCharCode = String.fromCharCode; -var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -var b64tab = {}; -for (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) { - b64tab[b64chars.charAt(base64_i)] = base64_i; -} -var cb_utob = function (c) { - var cc = c.charCodeAt(0); - return cc < 0x80 - ? c - : cc < 0x800 - ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f)) - : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) + - fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + - fromCharCode(0x80 | (cc & 0x3f)); -}; -var utob = function (u) { - return u.replace(/[^\x00-\x7F]/g, cb_utob); -}; -var cb_encode = function (ccc) { - var padlen = [0, 2, 1][ccc.length % 3]; - var ord = (ccc.charCodeAt(0) << 16) | - ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) | - (ccc.length > 2 ? ccc.charCodeAt(2) : 0); - var chars = [ - b64chars.charAt(ord >>> 18), - b64chars.charAt((ord >>> 12) & 63), - padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63), - padlen >= 1 ? '=' : b64chars.charAt(ord & 63) - ]; - return chars.join(''); -}; -var btoa = window.btoa || - function (b) { - return b.replace(/[\s\S]{1,3}/g, cb_encode); - }; -// CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts -var Timer = (function () { - function Timer(set, clear, delay, callback) { - var _this = this; - this.clear = clear; - this.timer = set(function () { - if (_this.timer) { - _this.timer = callback(_this.timer); - } - }, delay); - } - Timer.prototype.isRunning = function () { - return this.timer !== null; - }; - Timer.prototype.ensureAborted = function () { - if (this.timer) { - this.clear(this.timer); - this.timer = null; - } - }; - return Timer; -}()); -/* harmony default export */ var abstract_timer = (Timer); -// CONCATENATED MODULE: ./src/core/utils/timers/index.ts -var timers_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -function timers_clearTimeout(timer) { - window.clearTimeout(timer); -} -function timers_clearInterval(timer) { - window.clearInterval(timer); -} -var OneOffTimer = (function (_super) { - timers_extends(OneOffTimer, _super); - function OneOffTimer(delay, callback) { - return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) { - callback(); - return null; - }) || this; - } - return OneOffTimer; -}(abstract_timer)); -var PeriodicTimer = (function (_super) { - timers_extends(PeriodicTimer, _super); - function PeriodicTimer(delay, callback) { - return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) { - callback(); - return timer; - }) || this; - } - return PeriodicTimer; -}(abstract_timer)); +/** + * Helper function to retrieve attribute value. + * @param {String} suffix + * @param {Element} element + */ +function getAttributeValue(suffix, element) { + var attribute = "data-clipboard-".concat(suffix); -// CONCATENATED MODULE: ./src/core/util.ts + if (!element.hasAttribute(attribute)) { + return; + } -var Util = { - now: function () { - if (Date.now) { - return Date.now(); - } - else { - return new Date().valueOf(); - } - }, - defer: function (callback) { - return new OneOffTimer(0, callback); - }, - method: function (name) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var boundArguments = Array.prototype.slice.call(arguments, 1); - return function (object) { - return object[name].apply(object, boundArguments.concat(arguments)); - }; - } -}; -/* harmony default export */ var util = (Util); + return element.getAttribute(attribute); +} +/** + * Base class which takes one or more elements, adds event listeners to them, + * and instantiates a new `ClipboardAction` on each click. + */ -// CONCATENATED MODULE: ./src/core/utils/collections.ts +var Clipboard = /*#__PURE__*/function (_Emitter) { + _inherits(Clipboard, _Emitter); -function extend(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; + var _super = _createSuper(Clipboard); + + /** + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + * @param {Object} options + */ + function Clipboard(trigger, options) { + var _this; + + _classCallCheck(this, Clipboard); + + _this = _super.call(this); + + _this.resolveOptions(options); + + _this.listenClick(trigger); + + return _this; + } + /** + * Defines if attributes would be resolved using internal setter functions + * or custom functions that were passed in the constructor. + * @param {Object} options + */ + + + _createClass(Clipboard, [{ + key: "resolveOptions", + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = typeof options.action === 'function' ? options.action : this.defaultAction; + this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; + this.text = typeof options.text === 'function' ? options.text : this.defaultText; + this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body; } - for (var i = 0; i < sources.length; i++) { - var extensions = sources[i]; - for (var property in extensions) { - if (extensions[property] && - extensions[property].constructor && - extensions[property].constructor === Object) { - target[property] = extend(target[property] || {}, extensions[property]); - } - else { - target[property] = extensions[property]; - } - } + /** + * Adds a click event listener to the passed trigger. + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + */ + + }, { + key: "listenClick", + value: function listenClick(trigger) { + var _this2 = this; + + this.listener = listen_default()(trigger, 'click', function (e) { + return _this2.onClick(e); + }); } - return target; -} -function stringify() { - var m = ['Pusher']; - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === 'string') { - m.push(arguments[i]); - } - else { - m.push(safeJSONStringify(arguments[i])); + /** + * Defines a new `ClipboardAction` on each click event. + * @param {Event} e + */ + + }, { + key: "onClick", + value: function onClick(e) { + var trigger = e.delegateTarget || e.currentTarget; + var action = this.action(trigger) || 'copy'; + var text = actions_default({ + action: action, + container: this.container, + target: this.target(trigger), + text: this.text(trigger) + }); // Fires an event based on the copy operation result. + + this.emit(text ? 'success' : 'error', { + action: action, + text: text, + trigger: trigger, + clearSelection: function clearSelection() { + if (trigger) { + trigger.focus(); + } + + window.getSelection().removeAllRanges(); } + }); } - return m.join(' : '); -} -function arrayIndexOf(array, item) { - var nativeIndexOf = Array.prototype.indexOf; - if (array === null) { - return -1; + /** + * Default `action` lookup function. + * @param {Element} trigger + */ + + }, { + key: "defaultAction", + value: function defaultAction(trigger) { + return getAttributeValue('action', trigger); } - if (nativeIndexOf && array.indexOf === nativeIndexOf) { - return array.indexOf(item); + /** + * Default `target` lookup function. + * @param {Element} trigger + */ + + }, { + key: "defaultTarget", + value: function defaultTarget(trigger) { + var selector = getAttributeValue('target', trigger); + + if (selector) { + return document.querySelector(selector); + } } - for (var i = 0, l = array.length; i < l; i++) { - if (array[i] === item) { - return i; - } + /** + * Allow fire programmatically a copy action + * @param {String|HTMLElement} target + * @param {Object} options + * @returns Text copied. + */ + + }, { + key: "defaultText", + + /** + * Default `text` lookup function. + * @param {Element} trigger + */ + value: function defaultText(trigger) { + return getAttributeValue('text', trigger); } - return -1; -} -function objectApply(object, f) { - for (var key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - f(object[key], key, object); - } + /** + * Destroy lifecycle. + */ + + }, { + key: "destroy", + value: function destroy() { + this.listener.destroy(); } -} -function keys(object) { - var keys = []; - objectApply(object, function (_, key) { - keys.push(key); - }); - return keys; -} -function values(object) { - var values = []; - objectApply(object, function (value) { - values.push(value); - }); - return values; -} -function apply(array, f, context) { - for (var i = 0; i < array.length; i++) { - f.call(context || window, array[i], i, array); + }], [{ + key: "copy", + value: function copy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + return actions_copy(target, options); } -} -function map(array, f) { - var result = []; - for (var i = 0; i < array.length; i++) { - result.push(f(array[i], i, array, result)); + /** + * Allow fire programmatically a cut action + * @param {String|HTMLElement} target + * @returns Text cutted. + */ + + }, { + key: "cut", + value: function cut(target) { + return actions_cut(target); } - return result; -} -function mapObject(object, f) { - var result = {}; - objectApply(object, function (value, key) { - result[key] = f(value); - }); - return result; -} -function filter(array, test) { - test = - test || - function (value) { - return !!value; - }; - var result = []; - for (var i = 0; i < array.length; i++) { - if (test(array[i], i, array, result)) { - result.push(array[i]); - } + /** + * Returns the support of the given action, or all actions if no action is + * given. + * @param {String} [action] + */ + + }, { + key: "isSupported", + value: function isSupported() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; + var actions = typeof action === 'string' ? [action] : action; + var support = !!document.queryCommandSupported; + actions.forEach(function (action) { + support = support && !!document.queryCommandSupported(action); + }); + return support; } - return result; -} -function filterObject(object, test) { - var result = {}; - objectApply(object, function (value, key) { - if ((test && test(value, key, object, result)) || Boolean(value)) { - result[key] = value; - } - }); - return result; -} -function flatten(object) { - var result = []; - objectApply(object, function (value, key) { - result.push([key, value]); - }); - return result; + }]); + + return Clipboard; +}((tiny_emitter_default())); + +/* harmony default export */ var clipboard = (Clipboard); + +/***/ }), + +/***/ 828: +/***/ (function(module) { + +var DOCUMENT_NODE_TYPE = 9; + +/** + * A polyfill for Element.matches() + */ +if (typeof Element !== 'undefined' && !Element.prototype.matches) { + var proto = Element.prototype; + + proto.matches = proto.matchesSelector || + proto.mozMatchesSelector || + proto.msMatchesSelector || + proto.oMatchesSelector || + proto.webkitMatchesSelector; } -function any(array, test) { - for (var i = 0; i < array.length; i++) { - if (test(array[i], i, array)) { - return true; + +/** + * Finds the closest parent that matches a selector. + * + * @param {Element} element + * @param {String} selector + * @return {Function} + */ +function closest (element, selector) { + while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { + if (typeof element.matches === 'function' && + element.matches(selector)) { + return element; } + element = element.parentNode; } - return false; } -function collections_all(array, test) { - for (var i = 0; i < array.length; i++) { - if (!test(array[i], i, array)) { - return false; + +module.exports = closest; + + +/***/ }), + +/***/ 438: +/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) { + +var closest = __nested_webpack_require_15749__(828); + +/** + * Delegates event to a selector. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ +function _delegate(element, selector, type, callback, useCapture) { + var listenerFn = listener.apply(this, arguments); + + element.addEventListener(type, listenerFn, useCapture); + + return { + destroy: function() { + element.removeEventListener(type, listenerFn, useCapture); } } - return true; -} -function encodeParamsObject(data) { - return mapObject(data, function (value) { - if (typeof value === 'object') { - value = safeJSONStringify(value); - } - return encodeURIComponent(encode(value.toString())); - }); } -function buildQueryString(data) { - var params = filterObject(data, function (value) { - return value !== undefined; + +/** + * Delegates event to a selector. + * + * @param {Element|String|Array} [elements] + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ +function delegate(elements, selector, type, callback, useCapture) { + // Handle the regular Element usage + if (typeof elements.addEventListener === 'function') { + return _delegate.apply(null, arguments); + } + + // Handle Element-less usage, it defaults to global delegation + if (typeof type === 'function') { + // Use `document` as the first parameter, then apply arguments + // This is a short way to .unshift `arguments` without running into deoptimizations + return _delegate.bind(null, document).apply(null, arguments); + } + + // Handle Selector-based usage + if (typeof elements === 'string') { + elements = document.querySelectorAll(elements); + } + + // Handle Array-like based usage + return Array.prototype.map.call(elements, function (element) { + return _delegate(element, selector, type, callback, useCapture); }); - var query = map(flatten(encodeParamsObject(params)), util.method('join', '=')).join('&'); - return query; } -function decycleObject(object) { - var objects = [], paths = []; - return (function derez(value, path) { - var i, name, nu; - switch (typeof value) { - case 'object': - if (!value) { - return null; - } - for (i = 0; i < objects.length; i += 1) { - if (objects[i] === value) { - return { $ref: paths[i] }; - } - } - objects.push(value); - paths.push(path); - if (Object.prototype.toString.apply(value) === '[object Array]') { - nu = []; - for (i = 0; i < value.length; i += 1) { - nu[i] = derez(value[i], path + '[' + i + ']'); - } - } - else { - nu = {}; - for (name in value) { - if (Object.prototype.hasOwnProperty.call(value, name)) { - nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']'); - } - } - } - return nu; - case 'number': - case 'string': - case 'boolean': - return value; + +/** + * Finds closest match and invokes callback. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Function} + */ +function listener(element, selector, type, callback) { + return function(e) { + e.delegateTarget = closest(e.target, selector); + + if (e.delegateTarget) { + callback.call(element, e); } - })(object, '$'); -} -function safeJSONStringify(source) { - try { - return JSON.stringify(source); - } - catch (e) { - return JSON.stringify(decycleObject(source)); } } -// CONCATENATED MODULE: ./src/core/logger.ts +module.exports = delegate; -var logger_Logger = (function () { - function Logger() { - this.globalLog = function (message) { - if (window.console && window.console.log) { - window.console.log(message); - } - }; - } - Logger.prototype.debug = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this.log(this.globalLog, args); - }; - Logger.prototype.warn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this.log(this.globalLogWarn, args); - }; - Logger.prototype.error = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this.log(this.globalLogError, args); - }; - Logger.prototype.globalLogWarn = function (message) { - if (window.console && window.console.warn) { - window.console.warn(message); - } - else { - this.globalLog(message); - } - }; - Logger.prototype.globalLogError = function (message) { - if (window.console && window.console.error) { - window.console.error(message); - } - else { - this.globalLogWarn(message); - } - }; - Logger.prototype.log = function (defaultLoggingFunction) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var message = stringify.apply(this, arguments); - if (core_pusher.log) { - core_pusher.log(message); - } - else if (core_pusher.logToConsole) { - var log = defaultLoggingFunction.bind(this); - log(message); - } - }; - return Logger; -}()); -/* harmony default export */ var logger = (new logger_Logger()); +/***/ }), -// CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts +/***/ 879: +/***/ (function(__unused_webpack_module, exports) { -var jsonp = function (context, query, authOptions, authRequestType, callback) { - if (authOptions.headers !== undefined || - authOptions.headersProvider != null) { - logger.warn("To send headers with the " + authRequestType.toString() + " request, you must use AJAX, rather than JSONP."); - } - var callbackName = context.nextAuthCallbackID.toString(); - context.nextAuthCallbackID++; - var document = context.getDocument(); - var script = document.createElement('script'); - context.auth_callbacks[callbackName] = function (data) { - callback(null, data); - }; - var callback_name = "Pusher.auth_callbacks['" + callbackName + "']"; - script.src = - authOptions.endpoint + - '?callback=' + - encodeURIComponent(callback_name) + - '&' + - query; - var head = document.getElementsByTagName('head')[0] || document.documentElement; - head.insertBefore(script, head.firstChild); +/** + * Check if argument is a HTML element. + * + * @param {Object} value + * @return {Boolean} + */ +exports.node = function(value) { + return value !== undefined + && value instanceof HTMLElement + && value.nodeType === 1; }; -/* harmony default export */ var jsonp_auth = (jsonp); -// CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts -var ScriptRequest = (function () { - function ScriptRequest(src) { - this.src = src; - } - ScriptRequest.prototype.send = function (receiver) { - var self = this; - var errorString = 'Error loading ' + self.src; - self.script = document.createElement('script'); - self.script.id = receiver.id; - self.script.src = self.src; - self.script.type = 'text/javascript'; - self.script.charset = 'UTF-8'; - if (self.script.addEventListener) { - self.script.onerror = function () { - receiver.callback(errorString); - }; - self.script.onload = function () { - receiver.callback(null); - }; - } - else { - self.script.onreadystatechange = function () { - if (self.script.readyState === 'loaded' || - self.script.readyState === 'complete') { - receiver.callback(null); - } - }; - } - if (self.script.async === undefined && - document.attachEvent && - /opera/i.test(navigator.userAgent)) { - self.errorScript = document.createElement('script'); - self.errorScript.id = receiver.id + '_error'; - self.errorScript.text = receiver.name + "('" + errorString + "');"; - self.script.async = self.errorScript.async = false; - } - else { - self.script.async = true; - } - var head = document.getElementsByTagName('head')[0]; - head.insertBefore(self.script, head.firstChild); - if (self.errorScript) { - head.insertBefore(self.errorScript, self.script.nextSibling); - } - }; - ScriptRequest.prototype.cleanup = function () { - if (this.script) { - this.script.onload = this.script.onerror = null; - this.script.onreadystatechange = null; - } - if (this.script && this.script.parentNode) { - this.script.parentNode.removeChild(this.script); - } - if (this.errorScript && this.errorScript.parentNode) { - this.errorScript.parentNode.removeChild(this.errorScript); - } - this.script = null; - this.errorScript = null; - }; - return ScriptRequest; -}()); -/* harmony default export */ var script_request = (ScriptRequest); +/** + * Check if argument is a list of HTML elements. + * + * @param {Object} value + * @return {Boolean} + */ +exports.nodeList = function(value) { + var type = Object.prototype.toString.call(value); -// CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts + return value !== undefined + && (type === '[object NodeList]' || type === '[object HTMLCollection]') + && ('length' in value) + && (value.length === 0 || exports.node(value[0])); +}; +/** + * Check if argument is a string. + * + * @param {Object} value + * @return {Boolean} + */ +exports.string = function(value) { + return typeof value === 'string' + || value instanceof String; +}; -var jsonp_request_JSONPRequest = (function () { - function JSONPRequest(url, data) { - this.url = url; - this.data = data; - } - JSONPRequest.prototype.send = function (receiver) { - if (this.request) { - return; - } - var query = buildQueryString(this.data); - var url = this.url + '/' + receiver.number + '?' + query; - this.request = runtime.createScriptRequest(url); - this.request.send(receiver); - }; - JSONPRequest.prototype.cleanup = function () { - if (this.request) { - this.request.cleanup(); - } - }; - return JSONPRequest; -}()); -/* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest); +/** + * Check if argument is a function. + * + * @param {Object} value + * @return {Boolean} + */ +exports.fn = function(value) { + var type = Object.prototype.toString.call(value); -// CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts + return type === '[object Function]'; +}; -var getAgent = function (sender, useTLS) { - return function (data, callback) { - var scheme = 'http' + (useTLS ? 's' : '') + '://'; - var url = scheme + (sender.host || sender.options.host) + sender.options.path; - var request = runtime.createJSONPRequest(url, data); - var receiver = runtime.ScriptReceivers.create(function (error, result) { - ScriptReceivers.remove(receiver); - request.cleanup(); - if (result && result.host) { - sender.host = result.host; - } - if (callback) { - callback(error, result); - } - }); - request.send(receiver); - }; -}; -var jsonp_timeline_jsonp = { - name: 'jsonp', - getAgent: getAgent -}; -/* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp); +/***/ }), -// CONCATENATED MODULE: ./src/core/transports/url_schemes.ts +/***/ 370: +/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) { -function getGenericURL(baseScheme, params, path) { - var scheme = baseScheme + (params.useTLS ? 's' : ''); - var host = params.useTLS ? params.hostTLS : params.hostNonTLS; - return scheme + '://' + host + path; -} -function getGenericPath(key, queryString) { - var path = '/app/' + key; - var query = '?protocol=' + - defaults.PROTOCOL + - '&client=js' + - '&version=' + - defaults.VERSION + - (queryString ? '&' + queryString : ''); - return path + query; -} -var ws = { - getInitial: function (key, params) { - var path = (params.httpPath || '') + getGenericPath(key, 'flash=false'); - return getGenericURL('ws', params, path); - } -}; -var http = { - getInitial: function (key, params) { - var path = (params.httpPath || '/pusher') + getGenericPath(key); - return getGenericURL('http', params, path); - } -}; -var sockjs = { - getInitial: function (key, params) { - return getGenericURL('http', params, params.httpPath || '/pusher'); - }, - getPath: function (key, params) { - return getGenericPath(key); +var is = __nested_webpack_require_19113__(879); +var delegate = __nested_webpack_require_19113__(438); + +/** + * Validates all params and calls the right + * listener function based on its target type. + * + * @param {String|HTMLElement|HTMLCollection|NodeList} target + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listen(target, type, callback) { + if (!target && !type && !callback) { + throw new Error('Missing required arguments'); } -}; -// CONCATENATED MODULE: ./src/core/events/callback_registry.ts + if (!is.string(type)) { + throw new TypeError('Second argument must be a String'); + } -var callback_registry_CallbackRegistry = (function () { - function CallbackRegistry() { - this._callbacks = {}; + if (!is.fn(callback)) { + throw new TypeError('Third argument must be a Function'); } - CallbackRegistry.prototype.get = function (name) { - return this._callbacks[prefix(name)]; - }; - CallbackRegistry.prototype.add = function (name, callback, context) { - var prefixedEventName = prefix(name); - this._callbacks[prefixedEventName] = - this._callbacks[prefixedEventName] || []; - this._callbacks[prefixedEventName].push({ - fn: callback, - context: context - }); - }; - CallbackRegistry.prototype.remove = function (name, callback, context) { - if (!name && !callback && !context) { - this._callbacks = {}; - return; - } - var names = name ? [prefix(name)] : keys(this._callbacks); - if (callback || context) { - this.removeCallback(names, callback, context); - } - else { - this.removeAllCallbacks(names); + + if (is.node(target)) { + return listenNode(target, type, callback); + } + else if (is.nodeList(target)) { + return listenNodeList(target, type, callback); + } + else if (is.string(target)) { + return listenSelector(target, type, callback); + } + else { + throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); + } +} + +/** + * Adds an event listener to a HTML element + * and returns a remove listener function. + * + * @param {HTMLElement} node + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenNode(node, type, callback) { + node.addEventListener(type, callback); + + return { + destroy: function() { + node.removeEventListener(type, callback); } - }; - CallbackRegistry.prototype.removeCallback = function (names, callback, context) { - apply(names, function (name) { - this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) { - return ((callback && callback !== binding.fn) || - (context && context !== binding.context)); + } +} + +/** + * Add an event listener to a list of HTML elements + * and returns a remove listener function. + * + * @param {NodeList|HTMLCollection} nodeList + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenNodeList(nodeList, type, callback) { + Array.prototype.forEach.call(nodeList, function(node) { + node.addEventListener(type, callback); + }); + + return { + destroy: function() { + Array.prototype.forEach.call(nodeList, function(node) { + node.removeEventListener(type, callback); }); - if (this._callbacks[name].length === 0) { - delete this._callbacks[name]; - } - }, this); - }; - CallbackRegistry.prototype.removeAllCallbacks = function (names) { - apply(names, function (name) { - delete this._callbacks[name]; - }, this); - }; - return CallbackRegistry; -}()); -/* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry); -function prefix(name) { - return '_' + name; + } + } } -// CONCATENATED MODULE: ./src/core/events/dispatcher.ts +/** + * Add an event listener to a selector + * and returns a remove listener function. + * + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenSelector(selector, type, callback) { + return delegate(document.body, selector, type, callback); +} +module.exports = listen; -var dispatcher_Dispatcher = (function () { - function Dispatcher(failThrough) { - this.callbacks = new callback_registry(); - this.global_callbacks = []; - this.failThrough = failThrough; + +/***/ }), + +/***/ 817: +/***/ (function(module) { + +function select(element) { + var selectedText; + + if (element.nodeName === 'SELECT') { + element.focus(); + + selectedText = element.value; } - Dispatcher.prototype.bind = function (eventName, callback, context) { - this.callbacks.add(eventName, callback, context); - return this; - }; - Dispatcher.prototype.bind_global = function (callback) { - this.global_callbacks.push(callback); - return this; - }; - Dispatcher.prototype.unbind = function (eventName, callback, context) { - this.callbacks.remove(eventName, callback, context); - return this; - }; - Dispatcher.prototype.unbind_global = function (callback) { - if (!callback) { - this.global_callbacks = []; - return this; - } - this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; }); - return this; - }; - Dispatcher.prototype.unbind_all = function () { - this.unbind(); - this.unbind_global(); - return this; - }; - Dispatcher.prototype.emit = function (eventName, data, metadata) { - for (var i = 0; i < this.global_callbacks.length; i++) { - this.global_callbacks[i](eventName, data); - } - var callbacks = this.callbacks.get(eventName); - var args = []; - if (metadata) { - args.push(data, metadata); - } - else if (data) { - args.push(data); + else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { + var isReadOnly = element.hasAttribute('readonly'); + + if (!isReadOnly) { + element.setAttribute('readonly', ''); } - if (callbacks && callbacks.length > 0) { - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].fn.apply(callbacks[i].context || window, args); - } + + element.select(); + element.setSelectionRange(0, element.value.length); + + if (!isReadOnly) { + element.removeAttribute('readonly'); } - else if (this.failThrough) { - this.failThrough(eventName, data); + + selectedText = element.value; + } + else { + if (element.hasAttribute('contenteditable')) { + element.focus(); } - return this; - }; - return Dispatcher; -}()); -/* harmony default export */ var dispatcher = (dispatcher_Dispatcher); -// CONCATENATED MODULE: ./src/core/transports/transport_connection.ts -var transport_connection_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); + var selection = window.getSelection(); + var range = document.createRange(); + range.selectNodeContents(element); + selection.removeAllRanges(); + selection.addRange(range); + selectedText = selection.toString(); + } + return selectedText; +} +module.exports = select; -var transport_connection_TransportConnection = (function (_super) { - transport_connection_extends(TransportConnection, _super); - function TransportConnection(hooks, name, priority, key, options) { - var _this = _super.call(this) || this; - _this.initialize = runtime.transportConnectionInitializer; - _this.hooks = hooks; - _this.name = name; - _this.priority = priority; - _this.key = key; - _this.options = options; - _this.state = 'new'; - _this.timeline = options.timeline; - _this.activityTimeout = options.activityTimeout; - _this.id = _this.timeline.generateUniqueID(); - return _this; - } - TransportConnection.prototype.handlesActivityChecks = function () { - return Boolean(this.hooks.handlesActivityChecks); - }; - TransportConnection.prototype.supportsPing = function () { - return Boolean(this.hooks.supportsPing); - }; - TransportConnection.prototype.connect = function () { - var _this = this; - if (this.socket || this.state !== 'initialized') { - return false; - } - var url = this.hooks.urls.getInitial(this.key, this.options); - try { - this.socket = this.hooks.getSocket(url, this.options); - } - catch (e) { - util.defer(function () { - _this.onError(e); - _this.changeState('closed'); - }); - return false; - } - this.bindListeners(); - logger.debug('Connecting', { transport: this.name, url: url }); - this.changeState('connecting'); - return true; - }; - TransportConnection.prototype.close = function () { - if (this.socket) { - this.socket.close(); - return true; - } - else { - return false; - } - }; - TransportConnection.prototype.send = function (data) { - var _this = this; - if (this.state === 'open') { - util.defer(function () { - if (_this.socket) { - _this.socket.send(data); - } - }); - return true; - } - else { - return false; - } - }; - TransportConnection.prototype.ping = function () { - if (this.state === 'open' && this.supportsPing()) { - this.socket.ping(); - } - }; - TransportConnection.prototype.onOpen = function () { - if (this.hooks.beforeOpen) { - this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options)); - } - this.changeState('open'); - this.socket.onopen = undefined; - }; - TransportConnection.prototype.onError = function (error) { - this.emit('error', { type: 'WebSocketError', error: error }); - this.timeline.error(this.buildTimelineMessage({ error: error.toString() })); - }; - TransportConnection.prototype.onClose = function (closeEvent) { - if (closeEvent) { - this.changeState('closed', { - code: closeEvent.code, - reason: closeEvent.reason, - wasClean: closeEvent.wasClean - }); - } - else { - this.changeState('closed'); - } - this.unbindListeners(); - this.socket = undefined; - }; - TransportConnection.prototype.onMessage = function (message) { - this.emit('message', message); - }; - TransportConnection.prototype.onActivity = function () { - this.emit('activity'); - }; - TransportConnection.prototype.bindListeners = function () { - var _this = this; - this.socket.onopen = function () { - _this.onOpen(); - }; - this.socket.onerror = function (error) { - _this.onError(error); - }; - this.socket.onclose = function (closeEvent) { - _this.onClose(closeEvent); - }; - this.socket.onmessage = function (message) { - _this.onMessage(message); - }; - if (this.supportsPing()) { - this.socket.onactivity = function () { - _this.onActivity(); - }; - } - }; - TransportConnection.prototype.unbindListeners = function () { - if (this.socket) { - this.socket.onopen = undefined; - this.socket.onerror = undefined; - this.socket.onclose = undefined; - this.socket.onmessage = undefined; - if (this.supportsPing()) { - this.socket.onactivity = undefined; - } - } - }; - TransportConnection.prototype.changeState = function (state, params) { - this.state = state; - this.timeline.info(this.buildTimelineMessage({ - state: state, - params: params - })); - this.emit(state, params); - }; - TransportConnection.prototype.buildTimelineMessage = function (message) { - return extend({ cid: this.id }, message); - }; - return TransportConnection; -}(dispatcher)); -/* harmony default export */ var transport_connection = (transport_connection_TransportConnection); -// CONCATENATED MODULE: ./src/core/transports/transport.ts +/***/ }), -var transport_Transport = (function () { - function Transport(hooks) { - this.hooks = hooks; - } - Transport.prototype.isSupported = function (environment) { - return this.hooks.isSupported(environment); - }; - Transport.prototype.createConnection = function (name, priority, key, options) { - return new transport_connection(this.hooks, name, priority, key, options); - }; - return Transport; -}()); -/* harmony default export */ var transports_transport = (transport_Transport); +/***/ 279: +/***/ (function(module) { -// CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts +function E () { + // Keep this empty so it's easier to inherit from + // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) +} +E.prototype = { + on: function (name, callback, ctx) { + var e = this.e || (this.e = {}); + (e[name] || (e[name] = [])).push({ + fn: callback, + ctx: ctx + }); + return this; + }, -var WSTransport = new transports_transport({ - urls: ws, - handlesActivityChecks: false, - supportsPing: false, - isInitialized: function () { - return Boolean(runtime.getWebSocketAPI()); - }, - isSupported: function () { - return Boolean(runtime.getWebSocketAPI()); - }, - getSocket: function (url) { - return runtime.createWebSocket(url); - } -}); -var httpConfiguration = { - urls: http, - handlesActivityChecks: false, - supportsPing: true, - isInitialized: function () { - return true; - } -}; -var streamingConfiguration = extend({ - getSocket: function (url) { - return runtime.HTTPFactory.createStreamingSocket(url); - } -}, httpConfiguration); -var pollingConfiguration = extend({ - getSocket: function (url) { - return runtime.HTTPFactory.createPollingSocket(url); + once: function (name, callback, ctx) { + var self = this; + function listener () { + self.off(name, listener); + callback.apply(ctx, arguments); + }; + + listener._ = callback + return this.on(name, listener, ctx); + }, + + emit: function (name) { + var data = [].slice.call(arguments, 1); + var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); + var i = 0; + var len = evtArr.length; + + for (i; i < len; i++) { + evtArr[i].fn.apply(evtArr[i].ctx, data); } -}, httpConfiguration); -var xhrConfiguration = { - isSupported: function () { - return runtime.isXHRSupported(); + + return this; + }, + + off: function (name, callback) { + var e = this.e || (this.e = {}); + var evts = e[name]; + var liveEvents = []; + + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) + liveEvents.push(evts[i]); + } } -}; -var XHRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xhrConfiguration))); -var XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration)); -var Transports = { - ws: WSTransport, - xhr_streaming: XHRStreamingTransport, - xhr_polling: XHRPollingTransport -}; -/* harmony default export */ var transports = (Transports); -// CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts + // Remove event from queue to prevent memory leak + // Suggested by https://github.com/lazd + // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 + (liveEvents.length) + ? e[name] = liveEvents + : delete e[name]; + return this; + } +}; +module.exports = E; +module.exports.TinyEmitter = E; +/***/ }) -var SockJSTransport = new transports_transport({ - file: 'sockjs', - urls: sockjs, - handlesActivityChecks: true, - supportsPing: false, - isSupported: function () { - return true; - }, - isInitialized: function () { - return window.SockJS !== undefined; - }, - getSocket: function (url, options) { - return new window.SockJS(url, null, { - js_path: Dependencies.getPath('sockjs', { - useTLS: options.useTLS - }), - ignore_null_origin: options.ignoreNullOrigin - }); - }, - beforeOpen: function (socket, path) { - socket.send(JSON.stringify({ - path: path - })); - } +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_24495__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_24495__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_24495__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __nested_webpack_require_24495__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __nested_webpack_require_24495__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__nested_webpack_require_24495__.o(definition, key) && !__nested_webpack_require_24495__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __nested_webpack_require_24495__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_24495__(686); +/******/ })() +.default; }); -var xdrConfiguration = { - isSupported: function (environment) { - var yes = runtime.isXDRSupported(environment.useTLS); - return yes; + +/***/ }), + +/***/ "./node_modules/ieee754/index.js": +/*!***************************************!*\ + !*** ./node_modules/ieee754/index.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, exports) => { + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + + +/***/ }), + +/***/ "./node_modules/isarray/index.js": +/*!***************************************!*\ + !*** ./node_modules/isarray/index.js ***! + \***************************************/ +/***/ ((module) => { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; }; -var XDRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xdrConfiguration))); -var XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration)); -transports.xdr_streaming = XDRStreamingTransport; -transports.xdr_polling = XDRPollingTransport; -transports.sockjs = SockJSTransport; -/* harmony default export */ var transports_transports = (transports); -// CONCATENATED MODULE: ./src/runtimes/web/net_info.ts -var net_info_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var NetInfo = (function (_super) { - net_info_extends(NetInfo, _super); - function NetInfo() { - var _this = _super.call(this) || this; - var self = _this; - if (window.addEventListener !== undefined) { - window.addEventListener('online', function () { - self.emit('online'); - }, false); - window.addEventListener('offline', function () { - self.emit('offline'); - }, false); +/***/ }), + +/***/ "./node_modules/laravel-echo/dist/echo.js": +/*!************************************************!*\ + !*** ./node_modules/laravel-echo/dist/echo.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Channel: () => (/* binding */ Channel), +/* harmony export */ Connector: () => (/* binding */ Connector), +/* harmony export */ EventFormatter: () => (/* binding */ EventFormatter), +/* harmony export */ "default": () => (/* binding */ Echo) +/* harmony export */ }); +function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; } - return _this; + } } - NetInfo.prototype.isOnline = function () { - if (window.navigator.onLine === undefined) { - return true; - } - else { - return window.navigator.onLine; - } - }; - return NetInfo; -}(dispatcher)); -var net_info_Network = new NetInfo(); + return target; + }; -// CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts + return _extends.apply(this, arguments); +} +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } -var assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () { - function AssistantToTheTransportManager(manager, transport, options) { - this.manager = manager; - this.transport = transport; - this.minPingDelay = options.minPingDelay; - this.maxPingDelay = options.maxPingDelay; - this.pingDelay = undefined; + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true } - AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) { - var _this = this; - options = extend({}, options, { - activityTimeout: this.pingDelay - }); - var connection = this.transport.createConnection(name, priority, key, options); - var openTimestamp = null; - var onOpen = function () { - connection.unbind('open', onOpen); - connection.bind('closed', onClosed); - openTimestamp = util.now(); - }; - var onClosed = function (closeEvent) { - connection.unbind('closed', onClosed); - if (closeEvent.code === 1002 || closeEvent.code === 1003) { - _this.manager.reportDeath(); - } - else if (!closeEvent.wasClean && openTimestamp) { - var lifespan = util.now() - openTimestamp; - if (lifespan < 2 * _this.maxPingDelay) { - _this.manager.reportDeath(); - _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay); - } - } - }; - connection.bind('open', onOpen); - return connection; - }; - AssistantToTheTransportManager.prototype.isSupported = function (environment) { - return this.manager.isAlive() && this.transport.isSupported(environment); - }; - return AssistantToTheTransportManager; -}()); -/* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager); + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) _setPrototypeOf(subClass, superClass); +} -// CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts -var Protocol = { - decodeMessage: function (messageEvent) { - try { - var messageData = JSON.parse(messageEvent.data); - var pusherEventData = messageData.data; - if (typeof pusherEventData === 'string') { - try { - pusherEventData = JSON.parse(messageData.data); - } - catch (e) { } - } - var pusherEvent = { - event: messageData.event, - channel: messageData.channel, - data: pusherEventData - }; - if (messageData.user_id) { - pusherEvent.user_id = messageData.user_id; - } - return pusherEvent; - } - catch (e) { - throw { type: 'MessageParseError', error: e, data: messageEvent.data }; - } - }, - encodeMessage: function (event) { - return JSON.stringify(event); - }, - processHandshake: function (messageEvent) { - var message = Protocol.decodeMessage(messageEvent); - if (message.event === 'pusher:connection_established') { - if (!message.data.activity_timeout) { - throw 'No activity timeout specified in handshake'; - } - return { - action: 'connected', - id: message.data.socket_id, - activityTimeout: message.data.activity_timeout * 1000 - }; - } - else if (message.event === 'pusher:error') { - return { - action: this.getCloseAction(message.data), - error: this.getCloseError(message.data) - }; - } - else { - throw 'Invalid handshake'; - } - }, - getCloseAction: function (closeEvent) { - if (closeEvent.code < 4000) { - if (closeEvent.code >= 1002 && closeEvent.code <= 1004) { - return 'backoff'; - } - else { - return null; - } - } - else if (closeEvent.code === 4000) { - return 'tls_only'; - } - else if (closeEvent.code < 4100) { - return 'refused'; - } - else if (closeEvent.code < 4200) { - return 'backoff'; - } - else if (closeEvent.code < 4300) { - return 'retry'; - } - else { - return 'refused'; - } - }, - getCloseError: function (closeEvent) { - if (closeEvent.code !== 1000 && closeEvent.code !== 1001) { - return { - type: 'PusherError', - data: { - code: closeEvent.code, - message: closeEvent.reason || closeEvent.message - } - }; - } - else { - return null; - } - } -}; -/* harmony default export */ var protocol_protocol = (Protocol); +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} -// CONCATENATED MODULE: ./src/core/connection/connection.ts -var connection_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } +} -var connection_Connection = (function (_super) { - connection_extends(Connection, _super); - function Connection(id, transport) { - var _this = _super.call(this) || this; - _this.id = id; - _this.transport = transport; - _this.activityTimeout = transport.activityTimeout; - _this.bindListeners(); - return _this; - } - Connection.prototype.handlesActivityChecks = function () { - return this.transport.handlesActivityChecks(); - }; - Connection.prototype.send = function (data) { - return this.transport.send(data); - }; - Connection.prototype.send_event = function (name, data, channel) { - var event = { event: name, data: data }; - if (channel) { - event.channel = channel; - } - logger.debug('Event sent', event); - return this.send(protocol_protocol.encodeMessage(event)); - }; - Connection.prototype.ping = function () { - if (this.transport.supportsPing()) { - this.transport.ping(); - } - else { - this.send_event('pusher:ping', {}); - } - }; - Connection.prototype.close = function () { - this.transport.close(); - }; - Connection.prototype.bindListeners = function () { - var _this = this; - var listeners = { - message: function (messageEvent) { - var pusherEvent; - try { - pusherEvent = protocol_protocol.decodeMessage(messageEvent); - } - catch (e) { - _this.emit('error', { - type: 'MessageParseError', - error: e, - data: messageEvent.data - }); - } - if (pusherEvent !== undefined) { - logger.debug('Event recd', pusherEvent); - switch (pusherEvent.event) { - case 'pusher:error': - _this.emit('error', { - type: 'PusherError', - data: pusherEvent.data - }); - break; - case 'pusher:ping': - _this.emit('ping'); - break; - case 'pusher:pong': - _this.emit('pong'); - break; - } - _this.emit('message', pusherEvent); - } - }, - activity: function () { - _this.emit('activity'); - }, - error: function (error) { - _this.emit('error', error); - }, - closed: function (closeEvent) { - unbindListeners(); - if (closeEvent && closeEvent.code) { - _this.handleCloseEvent(closeEvent); - } - _this.transport = null; - _this.emit('closed'); - } - }; - var unbindListeners = function () { - objectApply(listeners, function (listener, event) { - _this.transport.unbind(event, listener); - }); - }; - objectApply(listeners, function (listener, event) { - _this.transport.bind(event, listener); - }); - }; - Connection.prototype.handleCloseEvent = function (closeEvent) { - var action = protocol_protocol.getCloseAction(closeEvent); - var error = protocol_protocol.getCloseError(closeEvent); - if (error) { - this.emit('error', error); - } - if (action) { - this.emit(action, { action: action, error: error }); - } - }; - return Connection; -}(dispatcher)); -/* harmony default export */ var connection_connection = (connection_Connection); +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } -// CONCATENATED MODULE: ./src/core/connection/handshake/index.ts + return self; +} +function _possibleConstructorReturn(self, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self); +} -var handshake_Handshake = (function () { - function Handshake(transport, callback) { - this.transport = transport; - this.callback = callback; - this.bindListeners(); - } - Handshake.prototype.close = function () { - this.unbindListeners(); - this.transport.close(); - }; - Handshake.prototype.bindListeners = function () { - var _this = this; - this.onMessage = function (m) { - _this.unbindListeners(); - var result; - try { - result = protocol_protocol.processHandshake(m); - } - catch (e) { - _this.finish('error', { error: e }); - _this.transport.close(); - return; - } - if (result.action === 'connected') { - _this.finish('connected', { - connection: new connection_connection(result.id, _this.transport), - activityTimeout: result.activityTimeout - }); - } - else { - _this.finish(result.action, { error: result.error }); - _this.transport.close(); - } - }; - this.onClosed = function (closeEvent) { - _this.unbindListeners(); - var action = protocol_protocol.getCloseAction(closeEvent) || 'backoff'; - var error = protocol_protocol.getCloseError(closeEvent); - _this.finish(action, { error: error }); - }; - this.transport.bind('message', this.onMessage); - this.transport.bind('closed', this.onClosed); - }; - Handshake.prototype.unbindListeners = function () { - this.transport.unbind('message', this.onMessage); - this.transport.unbind('closed', this.onClosed); - }; - Handshake.prototype.finish = function (action, params) { - this.callback(extend({ transport: this.transport, action: action }, params)); - }; - return Handshake; -}()); -/* harmony default export */ var connection_handshake = (handshake_Handshake); - -// CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts - -var timeline_sender_TimelineSender = (function () { - function TimelineSender(timeline, options) { - this.timeline = timeline; - this.options = options || {}; - } - TimelineSender.prototype.send = function (useTLS, callback) { - if (this.timeline.isEmpty()) { - return; - } - this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback); - }; - return TimelineSender; -}()); -/* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender); +function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); -// CONCATENATED MODULE: ./src/core/channels/channel.ts -var channel_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), + result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; +} +/** + * This class represents a basic channel. + */ +var Channel = /*#__PURE__*/function () { + function Channel() { + _classCallCheck(this, Channel); + } -var channel_Channel = (function (_super) { - channel_extends(Channel, _super); - function Channel(name, pusher) { - var _this = _super.call(this, function (event, data) { - logger.debug('No callbacks on ' + name + ' for ' + event); - }) || this; - _this.name = name; - _this.pusher = pusher; - _this.subscribed = false; - _this.subscriptionPending = false; - _this.subscriptionCancelled = false; - return _this; + _createClass(Channel, [{ + key: "listenForWhisper", + value: + /** + * Listen for a whisper event on the channel instance. + */ + function listenForWhisper(event, callback) { + return this.listen('.client-' + event, callback); } - Channel.prototype.authorize = function (socketId, callback) { - return callback(null, { auth: '' }); - }; - Channel.prototype.trigger = function (event, data) { - if (event.indexOf('client-') !== 0) { - throw new BadEventName("Event '" + event + "' does not start with 'client-'"); - } - if (!this.subscribed) { - var suffix = url_store.buildLogSuffix('triggeringClientEvents'); - logger.warn("Client event triggered before channel 'subscription_succeeded' event . " + suffix); - } - return this.pusher.send_event(event, data, this.name); - }; - Channel.prototype.disconnect = function () { - this.subscribed = false; - this.subscriptionPending = false; - }; - Channel.prototype.handleEvent = function (event) { - var eventName = event.event; - var data = event.data; - if (eventName === 'pusher_internal:subscription_succeeded') { - this.handleSubscriptionSucceededEvent(event); - } - else if (eventName === 'pusher_internal:subscription_count') { - this.handleSubscriptionCountEvent(event); - } - else if (eventName.indexOf('pusher_internal:') !== 0) { - var metadata = {}; - this.emit(eventName, data, metadata); - } - }; - Channel.prototype.handleSubscriptionSucceededEvent = function (event) { - this.subscriptionPending = false; - this.subscribed = true; - if (this.subscriptionCancelled) { - this.pusher.unsubscribe(this.name); - } - else { - this.emit('pusher:subscription_succeeded', event.data); - } - }; - Channel.prototype.handleSubscriptionCountEvent = function (event) { - if (event.data.subscription_count) { - this.subscriptionCount = event.data.subscription_count; - } - this.emit('pusher:subscription_count', event.data); - }; - Channel.prototype.subscribe = function () { - var _this = this; - if (this.subscribed) { - return; - } - this.subscriptionPending = true; - this.subscriptionCancelled = false; - this.authorize(this.pusher.connection.socket_id, function (error, data) { - if (error) { - _this.subscriptionPending = false; - logger.error(error.toString()); - _this.emit('pusher:subscription_error', Object.assign({}, { - type: 'AuthError', - error: error.message - }, error instanceof HTTPAuthError ? { status: error.status } : {})); - } - else { - _this.pusher.send_event('pusher:subscribe', { - auth: data.auth, - channel_data: data.channel_data, - channel: _this.name - }); - } - }); - }; - Channel.prototype.unsubscribe = function () { - this.subscribed = false; - this.pusher.send_event('pusher:unsubscribe', { - channel: this.name - }); - }; - Channel.prototype.cancelSubscription = function () { - this.subscriptionCancelled = true; - }; - Channel.prototype.reinstateSubscription = function () { - this.subscriptionCancelled = false; - }; - return Channel; -}(dispatcher)); -/* harmony default export */ var channels_channel = (channel_Channel); + /** + * Listen for an event on the channel instance. + */ -// CONCATENATED MODULE: ./src/core/channels/private_channel.ts -var private_channel_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); + }, { + key: "notification", + value: function notification(callback) { + return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback); + } + /** + * Stop listening for a whisper event on the channel instance. + */ -var PrivateChannel = (function (_super) { - private_channel_extends(PrivateChannel, _super); - function PrivateChannel() { - return _super !== null && _super.apply(this, arguments) || this; + }, { + key: "stopListeningForWhisper", + value: function stopListeningForWhisper(event, callback) { + return this.stopListening('.client-' + event, callback); } - PrivateChannel.prototype.authorize = function (socketId, callback) { - return this.pusher.config.channelAuthorizer({ - channelName: this.name, - socketId: socketId - }, callback); - }; - return PrivateChannel; -}(channels_channel)); -/* harmony default export */ var private_channel = (PrivateChannel); + }]); -// CONCATENATED MODULE: ./src/core/channels/members.ts + return Channel; +}(); -var members_Members = (function () { - function Members() { - this.reset(); - } - Members.prototype.get = function (id) { - if (Object.prototype.hasOwnProperty.call(this.members, id)) { - return { - id: id, - info: this.members[id] - }; - } - else { - return null; - } - }; - Members.prototype.each = function (callback) { - var _this = this; - objectApply(this.members, function (member, id) { - callback(_this.get(id)); - }); - }; - Members.prototype.setMyID = function (id) { - this.myID = id; - }; - Members.prototype.onSubscription = function (subscriptionData) { - this.members = subscriptionData.presence.hash; - this.count = subscriptionData.presence.count; - this.me = this.get(this.myID); - }; - Members.prototype.addMember = function (memberData) { - if (this.get(memberData.user_id) === null) { - this.count++; - } - this.members[memberData.user_id] = memberData.user_info; - return this.get(memberData.user_id); - }; - Members.prototype.removeMember = function (memberData) { - var member = this.get(memberData.user_id); - if (member) { - delete this.members[memberData.user_id]; - this.count--; - } - return member; - }; - Members.prototype.reset = function () { - this.members = {}; - this.count = 0; - this.myID = null; - this.me = null; - }; - return Members; -}()); -/* harmony default export */ var members = (members_Members); - -// CONCATENATED MODULE: ./src/core/channels/presence_channel.ts -var presence_channel_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = ( false) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = ( false) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; +/** + * Event name formatter + */ +var EventFormatter = /*#__PURE__*/function () { + /** + * Create a new class instance. + */ + function EventFormatter(namespace) { + _classCallCheck(this, EventFormatter); + this.namespace = namespace; // + } + /** + * Format the given event name. + */ + _createClass(EventFormatter, [{ + key: "format", + value: function format(event) { + if (event.charAt(0) === '.' || event.charAt(0) === '\\') { + return event.substr(1); + } else if (this.namespace) { + event = this.namespace + '.' + event; + } -var presence_channel_PresenceChannel = (function (_super) { - presence_channel_extends(PresenceChannel, _super); - function PresenceChannel(name, pusher) { - var _this = _super.call(this, name, pusher) || this; - _this.members = new members(); - return _this; + return event.replace(/\./g, '\\'); } - PresenceChannel.prototype.authorize = function (socketId, callback) { - var _this = this; - _super.prototype.authorize.call(this, socketId, function (error, authData) { return __awaiter(_this, void 0, void 0, function () { - var channelData, suffix; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!!error) return [3, 3]; - authData = authData; - if (!(authData.channel_data != null)) return [3, 1]; - channelData = JSON.parse(authData.channel_data); - this.members.setMyID(channelData.user_id); - return [3, 3]; - case 1: return [4, this.pusher.user.signinDonePromise]; - case 2: - _a.sent(); - if (this.pusher.user.user_data != null) { - this.members.setMyID(this.pusher.user.user_data.id); - } - else { - suffix = url_store.buildLogSuffix('authorizationEndpoint'); - logger.error("Invalid auth response for channel '" + this.name + "', " + - ("expected 'channel_data' field. " + suffix + ", ") + - "or the user should be signed in."); - callback('Invalid auth response'); - return [2]; - } - _a.label = 3; - case 3: - callback(error, authData); - return [2]; - } - }); - }); }); - }; - PresenceChannel.prototype.handleEvent = function (event) { - var eventName = event.event; - if (eventName.indexOf('pusher_internal:') === 0) { - this.handleInternalEvent(event); - } - else { - var data = event.data; - var metadata = {}; - if (event.user_id) { - metadata.user_id = event.user_id; - } - this.emit(eventName, data, metadata); - } - }; - PresenceChannel.prototype.handleInternalEvent = function (event) { - var eventName = event.event; - var data = event.data; - switch (eventName) { - case 'pusher_internal:subscription_succeeded': - this.handleSubscriptionSucceededEvent(event); - break; - case 'pusher_internal:subscription_count': - this.handleSubscriptionCountEvent(event); - break; - case 'pusher_internal:member_added': - var addedMember = this.members.addMember(data); - this.emit('pusher:member_added', addedMember); - break; - case 'pusher_internal:member_removed': - var removedMember = this.members.removeMember(data); - if (removedMember) { - this.emit('pusher:member_removed', removedMember); - } - break; - } - }; - PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) { - this.subscriptionPending = false; - this.subscribed = true; - if (this.subscriptionCancelled) { - this.pusher.unsubscribe(this.name); - } - else { - this.members.onSubscription(event.data); - this.emit('pusher:subscription_succeeded', this.members); - } - }; - PresenceChannel.prototype.disconnect = function () { - this.members.reset(); - _super.prototype.disconnect.call(this); - }; - return PresenceChannel; -}(private_channel)); -/* harmony default export */ var presence_channel = (presence_channel_PresenceChannel); - -// EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js -var utf8 = __nested_webpack_require_20105__(1); - -// EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js -var base64 = __nested_webpack_require_20105__(0); + /** + * Set the event namespace. + */ -// CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts -var encrypted_channel_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); + }, { + key: "setNamespace", + value: function setNamespace(value) { + this.namespace = value; + } + }]); + return EventFormatter; +}(); +/** + * This class represents a Pusher channel. + */ +var PusherChannel = /*#__PURE__*/function (_Channel) { + _inherits(PusherChannel, _Channel); + var _super = _createSuper(PusherChannel); -var encrypted_channel_EncryptedChannel = (function (_super) { - encrypted_channel_extends(EncryptedChannel, _super); - function EncryptedChannel(name, pusher, nacl) { - var _this = _super.call(this, name, pusher) || this; - _this.key = null; - _this.nacl = nacl; - return _this; + /** + * Create a new class instance. + */ + function PusherChannel(pusher, name, options) { + var _this; + + _classCallCheck(this, PusherChannel); + + _this = _super.call(this); + _this.name = name; + _this.pusher = pusher; + _this.options = options; + _this.eventFormatter = new EventFormatter(_this.options.namespace); + + _this.subscribe(); + + return _this; + } + /** + * Subscribe to a Pusher channel. + */ + + + _createClass(PusherChannel, [{ + key: "subscribe", + value: function subscribe() { + this.subscription = this.pusher.subscribe(this.name); } - EncryptedChannel.prototype.authorize = function (socketId, callback) { - var _this = this; - _super.prototype.authorize.call(this, socketId, function (error, authData) { - if (error) { - callback(error, authData); - return; - } - var sharedSecret = authData['shared_secret']; - if (!sharedSecret) { - callback(new Error("No shared_secret key in auth payload for encrypted channel: " + _this.name), null); - return; - } - _this.key = Object(base64["decode"])(sharedSecret); - delete authData['shared_secret']; - callback(null, authData); - }); - }; - EncryptedChannel.prototype.trigger = function (event, data) { - throw new UnsupportedFeature('Client events are not currently supported for encrypted channels'); - }; - EncryptedChannel.prototype.handleEvent = function (event) { - var eventName = event.event; - var data = event.data; - if (eventName.indexOf('pusher_internal:') === 0 || - eventName.indexOf('pusher:') === 0) { - _super.prototype.handleEvent.call(this, event); - return; - } - this.handleEncryptedEvent(eventName, data); - }; - EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) { - var _this = this; - if (!this.key) { - logger.debug('Received encrypted event before key has been retrieved from the authEndpoint'); - return; - } - if (!data.ciphertext || !data.nonce) { - logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' + - data); - return; - } - var cipherText = Object(base64["decode"])(data.ciphertext); - if (cipherText.length < this.nacl.secretbox.overheadLength) { - logger.error("Expected encrypted event ciphertext length to be " + this.nacl.secretbox.overheadLength + ", got: " + cipherText.length); - return; - } - var nonce = Object(base64["decode"])(data.nonce); - if (nonce.length < this.nacl.secretbox.nonceLength) { - logger.error("Expected encrypted event nonce length to be " + this.nacl.secretbox.nonceLength + ", got: " + nonce.length); - return; - } - var bytes = this.nacl.secretbox.open(cipherText, nonce, this.key); - if (bytes === null) { - logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...'); - this.authorize(this.pusher.connection.socket_id, function (error, authData) { - if (error) { - logger.error("Failed to make a request to the authEndpoint: " + authData + ". Unable to fetch new key, so dropping encrypted event"); - return; - } - bytes = _this.nacl.secretbox.open(cipherText, nonce, _this.key); - if (bytes === null) { - logger.error("Failed to decrypt event with new key. Dropping encrypted event"); - return; - } - _this.emit(event, _this.getDataToEmit(bytes)); - return; - }); - return; - } - this.emit(event, this.getDataToEmit(bytes)); - }; - EncryptedChannel.prototype.getDataToEmit = function (bytes) { - var raw = Object(utf8["decode"])(bytes); - try { - return JSON.parse(raw); - } - catch (_a) { - return raw; + /** + * Unsubscribe from a Pusher channel. + */ + + }, { + key: "unsubscribe", + value: function unsubscribe() { + this.pusher.unsubscribe(this.name); + } + /** + * Listen for an event on the channel instance. + */ + + }, { + key: "listen", + value: function listen(event, callback) { + this.on(this.eventFormatter.format(event), callback); + return this; + } + /** + * Listen for all events on the channel instance. + */ + + }, { + key: "listenToAll", + value: function listenToAll(callback) { + var _this2 = this; + + this.subscription.bind_global(function (event, data) { + if (event.startsWith('pusher:')) { + return; } - }; - return EncryptedChannel; -}(private_channel)); -/* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel); -// CONCATENATED MODULE: ./src/core/connection/connection_manager.ts -var connection_manager_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); + var namespace = _this2.options.namespace.replace(/\./g, '\\'); + var formattedEvent = event.startsWith(namespace) ? event.substring(namespace.length + 1) : '.' + event; + callback(formattedEvent, data); + }); + return this; + } + /** + * Stop listening for an event on the channel instance. + */ + }, { + key: "stopListening", + value: function stopListening(event, callback) { + if (callback) { + this.subscription.unbind(this.eventFormatter.format(event), callback); + } else { + this.subscription.unbind(this.eventFormatter.format(event)); + } + return this; + } + /** + * Stop listening for all events on the channel instance. + */ + }, { + key: "stopListeningToAll", + value: function stopListeningToAll(callback) { + if (callback) { + this.subscription.unbind_global(callback); + } else { + this.subscription.unbind_global(); + } -var connection_manager_ConnectionManager = (function (_super) { - connection_manager_extends(ConnectionManager, _super); - function ConnectionManager(key, options) { - var _this = _super.call(this) || this; - _this.state = 'initialized'; - _this.connection = null; - _this.key = key; - _this.options = options; - _this.timeline = _this.options.timeline; - _this.usingTLS = _this.options.useTLS; - _this.errorCallbacks = _this.buildErrorCallbacks(); - _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks); - _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks); - var Network = runtime.getNetwork(); - Network.bind('online', function () { - _this.timeline.info({ netinfo: 'online' }); - if (_this.state === 'connecting' || _this.state === 'unavailable') { - _this.retryIn(0); - } - }); - Network.bind('offline', function () { - _this.timeline.info({ netinfo: 'offline' }); - if (_this.connection) { - _this.sendActivityCheck(); - } - }); - _this.updateStrategy(); - return _this; + return this; } - ConnectionManager.prototype.connect = function () { - if (this.connection || this.runner) { - return; - } - if (!this.strategy.isSupported()) { - this.updateState('failed'); - return; - } - this.updateState('connecting'); - this.startConnecting(); - this.setUnavailableTimer(); - }; - ConnectionManager.prototype.send = function (data) { - if (this.connection) { - return this.connection.send(data); - } - else { - return false; - } - }; - ConnectionManager.prototype.send_event = function (name, data, channel) { - if (this.connection) { - return this.connection.send_event(name, data, channel); - } - else { - return false; - } - }; - ConnectionManager.prototype.disconnect = function () { - this.disconnectInternally(); - this.updateState('disconnected'); - }; - ConnectionManager.prototype.isUsingTLS = function () { - return this.usingTLS; - }; - ConnectionManager.prototype.startConnecting = function () { + /** + * Register a callback to be called anytime a subscription succeeds. + */ + + }, { + key: "subscribed", + value: function subscribed(callback) { + this.on('pusher:subscription_succeeded', function () { + callback(); + }); + return this; + } + /** + * Register a callback to be called anytime a subscription error occurs. + */ + + }, { + key: "error", + value: function error(callback) { + this.on('pusher:subscription_error', function (status) { + callback(status); + }); + return this; + } + /** + * Bind a channel to an event. + */ + + }, { + key: "on", + value: function on(event, callback) { + this.subscription.bind(event, callback); + return this; + } + }]); + + return PusherChannel; +}(Channel); + +/** + * This class represents a Pusher private channel. + */ + +var PusherPrivateChannel = /*#__PURE__*/function (_PusherChannel) { + _inherits(PusherPrivateChannel, _PusherChannel); + + var _super = _createSuper(PusherPrivateChannel); + + function PusherPrivateChannel() { + _classCallCheck(this, PusherPrivateChannel); + + return _super.apply(this, arguments); + } + + _createClass(PusherPrivateChannel, [{ + key: "whisper", + value: + /** + * Send a whisper event to other clients in the channel. + */ + function whisper(eventName, data) { + this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); + return this; + } + }]); + + return PusherPrivateChannel; +}(PusherChannel); + +/** + * This class represents a Pusher private channel. + */ + +var PusherEncryptedPrivateChannel = /*#__PURE__*/function (_PusherChannel) { + _inherits(PusherEncryptedPrivateChannel, _PusherChannel); + + var _super = _createSuper(PusherEncryptedPrivateChannel); + + function PusherEncryptedPrivateChannel() { + _classCallCheck(this, PusherEncryptedPrivateChannel); + + return _super.apply(this, arguments); + } + + _createClass(PusherEncryptedPrivateChannel, [{ + key: "whisper", + value: + /** + * Send a whisper event to other clients in the channel. + */ + function whisper(eventName, data) { + this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); + return this; + } + }]); + + return PusherEncryptedPrivateChannel; +}(PusherChannel); + +/** + * This class represents a Pusher presence channel. + */ + +var PusherPresenceChannel = /*#__PURE__*/function (_PusherChannel) { + _inherits(PusherPresenceChannel, _PusherChannel); + + var _super = _createSuper(PusherPresenceChannel); + + function PusherPresenceChannel() { + _classCallCheck(this, PusherPresenceChannel); + + return _super.apply(this, arguments); + } + + _createClass(PusherPresenceChannel, [{ + key: "here", + value: + /** + * Register a callback to be called anytime the member list changes. + */ + function here(callback) { + this.on('pusher:subscription_succeeded', function (data) { + callback(Object.keys(data.members).map(function (k) { + return data.members[k]; + })); + }); + return this; + } + /** + * Listen for someone joining the channel. + */ + + }, { + key: "joining", + value: function joining(callback) { + this.on('pusher:member_added', function (member) { + callback(member.info); + }); + return this; + } + /** + * Send a whisper event to other clients in the channel. + */ + + }, { + key: "whisper", + value: function whisper(eventName, data) { + this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data); + return this; + } + /** + * Listen for someone leaving the channel. + */ + + }, { + key: "leaving", + value: function leaving(callback) { + this.on('pusher:member_removed', function (member) { + callback(member.info); + }); + return this; + } + }]); + + return PusherPresenceChannel; +}(PusherChannel); + +/** + * This class represents a Socket.io channel. + */ + +var SocketIoChannel = /*#__PURE__*/function (_Channel) { + _inherits(SocketIoChannel, _Channel); + + var _super = _createSuper(SocketIoChannel); + + /** + * Create a new class instance. + */ + function SocketIoChannel(socket, name, options) { + var _this; + + _classCallCheck(this, SocketIoChannel); + + _this = _super.call(this); + /** + * The event callbacks applied to the socket. + */ + + _this.events = {}; + /** + * User supplied callbacks for events on this channel. + */ + + _this.listeners = {}; + _this.name = name; + _this.socket = socket; + _this.options = options; + _this.eventFormatter = new EventFormatter(_this.options.namespace); + + _this.subscribe(); + + return _this; + } + /** + * Subscribe to a Socket.io channel. + */ + + + _createClass(SocketIoChannel, [{ + key: "subscribe", + value: function subscribe() { + this.socket.emit('subscribe', { + channel: this.name, + auth: this.options.auth || {} + }); + } + /** + * Unsubscribe from channel and ubind event callbacks. + */ + + }, { + key: "unsubscribe", + value: function unsubscribe() { + this.unbind(); + this.socket.emit('unsubscribe', { + channel: this.name, + auth: this.options.auth || {} + }); + } + /** + * Listen for an event on the channel instance. + */ + + }, { + key: "listen", + value: function listen(event, callback) { + this.on(this.eventFormatter.format(event), callback); + return this; + } + /** + * Stop listening for an event on the channel instance. + */ + + }, { + key: "stopListening", + value: function stopListening(event, callback) { + this.unbindEvent(this.eventFormatter.format(event), callback); + return this; + } + /** + * Register a callback to be called anytime a subscription succeeds. + */ + + }, { + key: "subscribed", + value: function subscribed(callback) { + this.on('connect', function (socket) { + callback(socket); + }); + return this; + } + /** + * Register a callback to be called anytime an error occurs. + */ + + }, { + key: "error", + value: function error(callback) { + return this; + } + /** + * Bind the channel's socket to an event and store the callback. + */ + + }, { + key: "on", + value: function on(event, callback) { + var _this2 = this; + + this.listeners[event] = this.listeners[event] || []; + + if (!this.events[event]) { + this.events[event] = function (channel, data) { + if (_this2.name === channel && _this2.listeners[event]) { + _this2.listeners[event].forEach(function (cb) { + return cb(data); + }); + } + }; + + this.socket.on(event, this.events[event]); + } + + this.listeners[event].push(callback); + return this; + } + /** + * Unbind the channel's socket from all stored event callbacks. + */ + + }, { + key: "unbind", + value: function unbind() { + var _this3 = this; + + Object.keys(this.events).forEach(function (event) { + _this3.unbindEvent(event); + }); + } + /** + * Unbind the listeners for the given event. + */ + + }, { + key: "unbindEvent", + value: function unbindEvent(event, callback) { + this.listeners[event] = this.listeners[event] || []; + + if (callback) { + this.listeners[event] = this.listeners[event].filter(function (cb) { + return cb !== callback; + }); + } + + if (!callback || this.listeners[event].length === 0) { + if (this.events[event]) { + this.socket.removeListener(event, this.events[event]); + delete this.events[event]; + } + + delete this.listeners[event]; + } + } + }]); + + return SocketIoChannel; +}(Channel); + +/** + * This class represents a Socket.io private channel. + */ + +var SocketIoPrivateChannel = /*#__PURE__*/function (_SocketIoChannel) { + _inherits(SocketIoPrivateChannel, _SocketIoChannel); + + var _super = _createSuper(SocketIoPrivateChannel); + + function SocketIoPrivateChannel() { + _classCallCheck(this, SocketIoPrivateChannel); + + return _super.apply(this, arguments); + } + + _createClass(SocketIoPrivateChannel, [{ + key: "whisper", + value: + /** + * Send a whisper event to other clients in the channel. + */ + function whisper(eventName, data) { + this.socket.emit('client event', { + channel: this.name, + event: "client-".concat(eventName), + data: data + }); + return this; + } + }]); + + return SocketIoPrivateChannel; +}(SocketIoChannel); + +/** + * This class represents a Socket.io presence channel. + */ + +var SocketIoPresenceChannel = /*#__PURE__*/function (_SocketIoPrivateChann) { + _inherits(SocketIoPresenceChannel, _SocketIoPrivateChann); + + var _super = _createSuper(SocketIoPresenceChannel); + + function SocketIoPresenceChannel() { + _classCallCheck(this, SocketIoPresenceChannel); + + return _super.apply(this, arguments); + } + + _createClass(SocketIoPresenceChannel, [{ + key: "here", + value: + /** + * Register a callback to be called anytime the member list changes. + */ + function here(callback) { + this.on('presence:subscribed', function (members) { + callback(members.map(function (m) { + return m.user_info; + })); + }); + return this; + } + /** + * Listen for someone joining the channel. + */ + + }, { + key: "joining", + value: function joining(callback) { + this.on('presence:joining', function (member) { + return callback(member.user_info); + }); + return this; + } + /** + * Send a whisper event to other clients in the channel. + */ + + }, { + key: "whisper", + value: function whisper(eventName, data) { + this.socket.emit('client event', { + channel: this.name, + event: "client-".concat(eventName), + data: data + }); + return this; + } + /** + * Listen for someone leaving the channel. + */ + + }, { + key: "leaving", + value: function leaving(callback) { + this.on('presence:leaving', function (member) { + return callback(member.user_info); + }); + return this; + } + }]); + + return SocketIoPresenceChannel; +}(SocketIoPrivateChannel); + +/** + * This class represents a null channel. + */ + +var NullChannel = /*#__PURE__*/function (_Channel) { + _inherits(NullChannel, _Channel); + + var _super = _createSuper(NullChannel); + + function NullChannel() { + _classCallCheck(this, NullChannel); + + return _super.apply(this, arguments); + } + + _createClass(NullChannel, [{ + key: "subscribe", + value: + /** + * Subscribe to a channel. + */ + function subscribe() {// + } + /** + * Unsubscribe from a channel. + */ + + }, { + key: "unsubscribe", + value: function unsubscribe() {// + } + /** + * Listen for an event on the channel instance. + */ + + }, { + key: "listen", + value: function listen(event, callback) { + return this; + } + /** + * Listen for all events on the channel instance. + */ + + }, { + key: "listenToAll", + value: function listenToAll(callback) { + return this; + } + /** + * Stop listening for an event on the channel instance. + */ + + }, { + key: "stopListening", + value: function stopListening(event, callback) { + return this; + } + /** + * Register a callback to be called anytime a subscription succeeds. + */ + + }, { + key: "subscribed", + value: function subscribed(callback) { + return this; + } + /** + * Register a callback to be called anytime an error occurs. + */ + + }, { + key: "error", + value: function error(callback) { + return this; + } + /** + * Bind a channel to an event. + */ + + }, { + key: "on", + value: function on(event, callback) { + return this; + } + }]); + + return NullChannel; +}(Channel); + +/** + * This class represents a null private channel. + */ + +var NullPrivateChannel = /*#__PURE__*/function (_NullChannel) { + _inherits(NullPrivateChannel, _NullChannel); + + var _super = _createSuper(NullPrivateChannel); + + function NullPrivateChannel() { + _classCallCheck(this, NullPrivateChannel); + + return _super.apply(this, arguments); + } + + _createClass(NullPrivateChannel, [{ + key: "whisper", + value: + /** + * Send a whisper event to other clients in the channel. + */ + function whisper(eventName, data) { + return this; + } + }]); + + return NullPrivateChannel; +}(NullChannel); + +/** + * This class represents a null presence channel. + */ + +var NullPresenceChannel = /*#__PURE__*/function (_NullChannel) { + _inherits(NullPresenceChannel, _NullChannel); + + var _super = _createSuper(NullPresenceChannel); + + function NullPresenceChannel() { + _classCallCheck(this, NullPresenceChannel); + + return _super.apply(this, arguments); + } + + _createClass(NullPresenceChannel, [{ + key: "here", + value: + /** + * Register a callback to be called anytime the member list changes. + */ + function here(callback) { + return this; + } + /** + * Listen for someone joining the channel. + */ + + }, { + key: "joining", + value: function joining(callback) { + return this; + } + /** + * Send a whisper event to other clients in the channel. + */ + + }, { + key: "whisper", + value: function whisper(eventName, data) { + return this; + } + /** + * Listen for someone leaving the channel. + */ + + }, { + key: "leaving", + value: function leaving(callback) { + return this; + } + }]); + + return NullPresenceChannel; +}(NullChannel); + +var Connector = /*#__PURE__*/function () { + /** + * Create a new class instance. + */ + function Connector(options) { + _classCallCheck(this, Connector); + + /** + * Default connector options. + */ + this._defaultOptions = { + auth: { + headers: {} + }, + authEndpoint: '/broadcasting/auth', + userAuthentication: { + endpoint: '/broadcasting/user-auth', + headers: {} + }, + broadcaster: 'pusher', + csrfToken: null, + bearerToken: null, + host: null, + key: null, + namespace: 'App.Events' + }; + this.setOptions(options); + this.connect(); + } + /** + * Merge the custom options with the defaults. + */ + + + _createClass(Connector, [{ + key: "setOptions", + value: function setOptions(options) { + this.options = _extends(this._defaultOptions, options); + var token = this.csrfToken(); + + if (token) { + this.options.auth.headers['X-CSRF-TOKEN'] = token; + this.options.userAuthentication.headers['X-CSRF-TOKEN'] = token; + } + + token = this.options.bearerToken; + + if (token) { + this.options.auth.headers['Authorization'] = 'Bearer ' + token; + this.options.userAuthentication.headers['Authorization'] = 'Bearer ' + token; + } + + return options; + } + /** + * Extract the CSRF token from the page. + */ + + }, { + key: "csrfToken", + value: function csrfToken() { + var selector; + + if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) { + return window['Laravel'].csrfToken; + } else if (this.options.csrfToken) { + return this.options.csrfToken; + } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) { + return selector.getAttribute('content'); + } + + return null; + } + }]); + + return Connector; +}(); + +/** + * This class creates a connector to Pusher. + */ + +var PusherConnector = /*#__PURE__*/function (_Connector) { + _inherits(PusherConnector, _Connector); + + var _super = _createSuper(PusherConnector); + + function PusherConnector() { + var _this; + + _classCallCheck(this, PusherConnector); + + _this = _super.apply(this, arguments); + /** + * All of the subscribed channel names. + */ + + _this.channels = {}; + return _this; + } + /** + * Create a fresh Pusher connection. + */ + + + _createClass(PusherConnector, [{ + key: "connect", + value: function connect() { + if (typeof this.options.client !== 'undefined') { + this.pusher = this.options.client; + } else if (this.options.Pusher) { + this.pusher = new this.options.Pusher(this.options.key, this.options); + } else { + this.pusher = new Pusher(this.options.key, this.options); + } + } + /** + * Sign in the user via Pusher user authentication (https://pusher.com/docs/channels/using_channels/user-authentication/). + */ + + }, { + key: "signin", + value: function signin() { + this.pusher.signin(); + } + /** + * Listen for an event on a channel instance. + */ + + }, { + key: "listen", + value: function listen(name, event, callback) { + return this.channel(name).listen(event, callback); + } + /** + * Get a channel instance by name. + */ + + }, { + key: "channel", + value: function channel(name) { + if (!this.channels[name]) { + this.channels[name] = new PusherChannel(this.pusher, name, this.options); + } + + return this.channels[name]; + } + /** + * Get a private channel instance by name. + */ + + }, { + key: "privateChannel", + value: function privateChannel(name) { + if (!this.channels['private-' + name]) { + this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options); + } + + return this.channels['private-' + name]; + } + /** + * Get a private encrypted channel instance by name. + */ + + }, { + key: "encryptedPrivateChannel", + value: function encryptedPrivateChannel(name) { + if (!this.channels['private-encrypted-' + name]) { + this.channels['private-encrypted-' + name] = new PusherEncryptedPrivateChannel(this.pusher, 'private-encrypted-' + name, this.options); + } + + return this.channels['private-encrypted-' + name]; + } + /** + * Get a presence channel instance by name. + */ + + }, { + key: "presenceChannel", + value: function presenceChannel(name) { + if (!this.channels['presence-' + name]) { + this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options); + } + + return this.channels['presence-' + name]; + } + /** + * Leave the given channel, as well as its private and presence variants. + */ + + }, { + key: "leave", + value: function leave(name) { + var _this2 = this; + + var channels = [name, 'private-' + name, 'private-encrypted-' + name, 'presence-' + name]; + channels.forEach(function (name, index) { + _this2.leaveChannel(name); + }); + } + /** + * Leave the given channel. + */ + + }, { + key: "leaveChannel", + value: function leaveChannel(name) { + if (this.channels[name]) { + this.channels[name].unsubscribe(); + delete this.channels[name]; + } + } + /** + * Get the socket ID for the connection. + */ + + }, { + key: "socketId", + value: function socketId() { + return this.pusher.connection.socket_id; + } + /** + * Disconnect Pusher connection. + */ + + }, { + key: "disconnect", + value: function disconnect() { + this.pusher.disconnect(); + } + }]); + + return PusherConnector; +}(Connector); + +/** + * This class creates a connnector to a Socket.io server. + */ + +var SocketIoConnector = /*#__PURE__*/function (_Connector) { + _inherits(SocketIoConnector, _Connector); + + var _super = _createSuper(SocketIoConnector); + + function SocketIoConnector() { + var _this; + + _classCallCheck(this, SocketIoConnector); + + _this = _super.apply(this, arguments); + /** + * All of the subscribed channel names. + */ + + _this.channels = {}; + return _this; + } + /** + * Create a fresh Socket.io connection. + */ + + + _createClass(SocketIoConnector, [{ + key: "connect", + value: function connect() { + var _this2 = this; + + var io = this.getSocketIO(); + this.socket = io(this.options.host, this.options); + this.socket.on('reconnect', function () { + Object.values(_this2.channels).forEach(function (channel) { + channel.subscribe(); + }); + }); + return this.socket; + } + /** + * Get socket.io module from global scope or options. + */ + + }, { + key: "getSocketIO", + value: function getSocketIO() { + if (typeof this.options.client !== 'undefined') { + return this.options.client; + } + + if (typeof io !== 'undefined') { + return io; + } + + throw new Error('Socket.io client not found. Should be globally available or passed via options.client'); + } + /** + * Listen for an event on a channel instance. + */ + + }, { + key: "listen", + value: function listen(name, event, callback) { + return this.channel(name).listen(event, callback); + } + /** + * Get a channel instance by name. + */ + + }, { + key: "channel", + value: function channel(name) { + if (!this.channels[name]) { + this.channels[name] = new SocketIoChannel(this.socket, name, this.options); + } + + return this.channels[name]; + } + /** + * Get a private channel instance by name. + */ + + }, { + key: "privateChannel", + value: function privateChannel(name) { + if (!this.channels['private-' + name]) { + this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options); + } + + return this.channels['private-' + name]; + } + /** + * Get a presence channel instance by name. + */ + + }, { + key: "presenceChannel", + value: function presenceChannel(name) { + if (!this.channels['presence-' + name]) { + this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options); + } + + return this.channels['presence-' + name]; + } + /** + * Leave the given channel, as well as its private and presence variants. + */ + + }, { + key: "leave", + value: function leave(name) { + var _this3 = this; + + var channels = [name, 'private-' + name, 'presence-' + name]; + channels.forEach(function (name) { + _this3.leaveChannel(name); + }); + } + /** + * Leave the given channel. + */ + + }, { + key: "leaveChannel", + value: function leaveChannel(name) { + if (this.channels[name]) { + this.channels[name].unsubscribe(); + delete this.channels[name]; + } + } + /** + * Get the socket ID for the connection. + */ + + }, { + key: "socketId", + value: function socketId() { + return this.socket.id; + } + /** + * Disconnect Socketio connection. + */ + + }, { + key: "disconnect", + value: function disconnect() { + this.socket.disconnect(); + } + }]); + + return SocketIoConnector; +}(Connector); + +/** + * This class creates a null connector. + */ + +var NullConnector = /*#__PURE__*/function (_Connector) { + _inherits(NullConnector, _Connector); + + var _super = _createSuper(NullConnector); + + function NullConnector() { + var _this; + + _classCallCheck(this, NullConnector); + + _this = _super.apply(this, arguments); + /** + * All of the subscribed channel names. + */ + + _this.channels = {}; + return _this; + } + /** + * Create a fresh connection. + */ + + + _createClass(NullConnector, [{ + key: "connect", + value: function connect() {// + } + /** + * Listen for an event on a channel instance. + */ + + }, { + key: "listen", + value: function listen(name, event, callback) { + return new NullChannel(); + } + /** + * Get a channel instance by name. + */ + + }, { + key: "channel", + value: function channel(name) { + return new NullChannel(); + } + /** + * Get a private channel instance by name. + */ + + }, { + key: "privateChannel", + value: function privateChannel(name) { + return new NullPrivateChannel(); + } + /** + * Get a private encrypted channel instance by name. + */ + + }, { + key: "encryptedPrivateChannel", + value: function encryptedPrivateChannel(name) { + return new NullPrivateChannel(); + } + /** + * Get a presence channel instance by name. + */ + + }, { + key: "presenceChannel", + value: function presenceChannel(name) { + return new NullPresenceChannel(); + } + /** + * Leave the given channel, as well as its private and presence variants. + */ + + }, { + key: "leave", + value: function leave(name) {// + } + /** + * Leave the given channel. + */ + + }, { + key: "leaveChannel", + value: function leaveChannel(name) {// + } + /** + * Get the socket ID for the connection. + */ + + }, { + key: "socketId", + value: function socketId() { + return 'fake-socket-id'; + } + /** + * Disconnect the connection. + */ + + }, { + key: "disconnect", + value: function disconnect() {// + } + }]); + + return NullConnector; +}(Connector); + +/** + * This class is the primary API for interacting with broadcasting. + */ + +var Echo = /*#__PURE__*/function () { + /** + * Create a new class instance. + */ + function Echo(options) { + _classCallCheck(this, Echo); + + this.options = options; + this.connect(); + + if (!this.options.withoutInterceptors) { + this.registerInterceptors(); + } + } + /** + * Get a channel instance by name. + */ + + + _createClass(Echo, [{ + key: "channel", + value: function channel(_channel) { + return this.connector.channel(_channel); + } + /** + * Create a new connection. + */ + + }, { + key: "connect", + value: function connect() { + if (this.options.broadcaster == 'pusher') { + this.connector = new PusherConnector(this.options); + } else if (this.options.broadcaster == 'socket.io') { + this.connector = new SocketIoConnector(this.options); + } else if (this.options.broadcaster == 'null') { + this.connector = new NullConnector(this.options); + } else if (typeof this.options.broadcaster == 'function') { + this.connector = new this.options.broadcaster(this.options); + } + } + /** + * Disconnect from the Echo server. + */ + + }, { + key: "disconnect", + value: function disconnect() { + this.connector.disconnect(); + } + /** + * Get a presence channel instance by name. + */ + + }, { + key: "join", + value: function join(channel) { + return this.connector.presenceChannel(channel); + } + /** + * Leave the given channel, as well as its private and presence variants. + */ + + }, { + key: "leave", + value: function leave(channel) { + this.connector.leave(channel); + } + /** + * Leave the given channel. + */ + + }, { + key: "leaveChannel", + value: function leaveChannel(channel) { + this.connector.leaveChannel(channel); + } + /** + * Leave all channels. + */ + + }, { + key: "leaveAllChannels", + value: function leaveAllChannels() { + for (var channel in this.connector.channels) { + this.leaveChannel(channel); + } + } + /** + * Listen for an event on a channel instance. + */ + + }, { + key: "listen", + value: function listen(channel, event, callback) { + return this.connector.listen(channel, event, callback); + } + /** + * Get a private channel instance by name. + */ + + }, { + key: "private", + value: function _private(channel) { + return this.connector.privateChannel(channel); + } + /** + * Get a private encrypted channel instance by name. + */ + + }, { + key: "encryptedPrivate", + value: function encryptedPrivate(channel) { + return this.connector.encryptedPrivateChannel(channel); + } + /** + * Get the Socket ID for the connection. + */ + + }, { + key: "socketId", + value: function socketId() { + return this.connector.socketId(); + } + /** + * Register 3rd party request interceptiors. These are used to automatically + * send a connections socket id to a Laravel app with a X-Socket-Id header. + */ + + }, { + key: "registerInterceptors", + value: function registerInterceptors() { + if (typeof Vue === 'function' && Vue.http) { + this.registerVueRequestInterceptor(); + } + + if (typeof axios === 'function') { + this.registerAxiosRequestInterceptor(); + } + + if (typeof jQuery === 'function') { + this.registerjQueryAjaxSetup(); + } + + if ((typeof Turbo === "undefined" ? "undefined" : _typeof(Turbo)) === 'object') { + this.registerTurboRequestInterceptor(); + } + } + /** + * Register a Vue HTTP interceptor to add the X-Socket-ID header. + */ + + }, { + key: "registerVueRequestInterceptor", + value: function registerVueRequestInterceptor() { + var _this = this; + + Vue.http.interceptors.push(function (request, next) { + if (_this.socketId()) { + request.headers.set('X-Socket-ID', _this.socketId()); + } + + next(); + }); + } + /** + * Register an Axios HTTP interceptor to add the X-Socket-ID header. + */ + + }, { + key: "registerAxiosRequestInterceptor", + value: function registerAxiosRequestInterceptor() { + var _this2 = this; + + axios.interceptors.request.use(function (config) { + if (_this2.socketId()) { + config.headers['X-Socket-Id'] = _this2.socketId(); + } + + return config; + }); + } + /** + * Register jQuery AjaxPrefilter to add the X-Socket-ID header. + */ + + }, { + key: "registerjQueryAjaxSetup", + value: function registerjQueryAjaxSetup() { + var _this3 = this; + + if (typeof jQuery.ajax != 'undefined') { + jQuery.ajaxPrefilter(function (options, originalOptions, xhr) { + if (_this3.socketId()) { + xhr.setRequestHeader('X-Socket-Id', _this3.socketId()); + } + }); + } + } + /** + * Register the Turbo Request interceptor to add the X-Socket-ID header. + */ + + }, { + key: "registerTurboRequestInterceptor", + value: function registerTurboRequestInterceptor() { + var _this4 = this; + + document.addEventListener('turbo:before-fetch-request', function (event) { + event.detail.fetchOptions.headers['X-Socket-Id'] = _this4.socketId(); + }); + } + }]); + + return Echo; +}(); + + + + +/***/ }), + +/***/ "./resources/sass/app.scss": +/*!*********************************!*\ + !*** ./resources/sass/app.scss ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "./node_modules/pusher-js/dist/web/pusher.js": +/*!***************************************************!*\ + !*** ./node_modules/pusher-js/dist/web/pusher.js ***! + \***************************************************/ +/***/ ((module) => { + +/*! + * Pusher JavaScript Library v7.6.0 + * https://pusher.com/ + * + * Copyright 2020, Pusher + * Released under the MIT licence. + */ + +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_669__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_669__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_669__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_669__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_669__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_669__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_669__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __nested_webpack_require_669__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_669__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_669__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_669__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_669__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_669__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_669__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_669__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_669__(__nested_webpack_require_669__.s = 2); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Copyright (C) 2016 Dmitry Chestnykh +// MIT License. See LICENSE file for details. +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Package base64 implements Base64 encoding and decoding. + */ +// Invalid character used in decoding to indicate +// that the character to decode is out of range of +// alphabet and cannot be decoded. +var INVALID_BYTE = 256; +/** + * Implements standard Base64 encoding. + * + * Operates in constant time. + */ +var Coder = /** @class */ (function () { + // TODO(dchest): methods to encode chunk-by-chunk. + function Coder(_paddingCharacter) { + if (_paddingCharacter === void 0) { _paddingCharacter = "="; } + this._paddingCharacter = _paddingCharacter; + } + Coder.prototype.encodedLength = function (length) { + if (!this._paddingCharacter) { + return (length * 8 + 5) / 6 | 0; + } + return (length + 2) / 3 * 4 | 0; + }; + Coder.prototype.encode = function (data) { + var out = ""; + var i = 0; + for (; i < data.length - 2; i += 3) { + var c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]); + out += this._encodeByte((c >>> 3 * 6) & 63); + out += this._encodeByte((c >>> 2 * 6) & 63); + out += this._encodeByte((c >>> 1 * 6) & 63); + out += this._encodeByte((c >>> 0 * 6) & 63); + } + var left = data.length - i; + if (left > 0) { + var c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0); + out += this._encodeByte((c >>> 3 * 6) & 63); + out += this._encodeByte((c >>> 2 * 6) & 63); + if (left === 2) { + out += this._encodeByte((c >>> 1 * 6) & 63); + } + else { + out += this._paddingCharacter || ""; + } + out += this._paddingCharacter || ""; + } + return out; + }; + Coder.prototype.maxDecodedLength = function (length) { + if (!this._paddingCharacter) { + return (length * 6 + 7) / 8 | 0; + } + return length / 4 * 3 | 0; + }; + Coder.prototype.decodedLength = function (s) { + return this.maxDecodedLength(s.length - this._getPaddingLength(s)); + }; + Coder.prototype.decode = function (s) { + if (s.length === 0) { + return new Uint8Array(0); + } + var paddingLength = this._getPaddingLength(s); + var length = s.length - paddingLength; + var out = new Uint8Array(this.maxDecodedLength(length)); + var op = 0; + var i = 0; + var haveBad = 0; + var v0 = 0, v1 = 0, v2 = 0, v3 = 0; + for (; i < length - 4; i += 4) { + v0 = this._decodeChar(s.charCodeAt(i + 0)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + v2 = this._decodeChar(s.charCodeAt(i + 2)); + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op++] = (v0 << 2) | (v1 >>> 4); + out[op++] = (v1 << 4) | (v2 >>> 2); + out[op++] = (v2 << 6) | v3; + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + haveBad |= v2 & INVALID_BYTE; + haveBad |= v3 & INVALID_BYTE; + } + if (i < length - 1) { + v0 = this._decodeChar(s.charCodeAt(i)); + v1 = this._decodeChar(s.charCodeAt(i + 1)); + out[op++] = (v0 << 2) | (v1 >>> 4); + haveBad |= v0 & INVALID_BYTE; + haveBad |= v1 & INVALID_BYTE; + } + if (i < length - 2) { + v2 = this._decodeChar(s.charCodeAt(i + 2)); + out[op++] = (v1 << 4) | (v2 >>> 2); + haveBad |= v2 & INVALID_BYTE; + } + if (i < length - 3) { + v3 = this._decodeChar(s.charCodeAt(i + 3)); + out[op++] = (v2 << 6) | v3; + haveBad |= v3 & INVALID_BYTE; + } + if (haveBad !== 0) { + throw new Error("Base64Coder: incorrect characters for decoding"); + } + return out; + }; + // Standard encoding have the following encoded/decoded ranges, + // which we need to convert between. + // + // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 + / + // Index: 0 - 25 26 - 51 52 - 61 62 63 + // ASCII: 65 - 90 97 - 122 48 - 57 43 47 + // + // Encode 6 bits in b into a new character. + Coder.prototype._encodeByte = function (b) { + // Encoding uses constant time operations as follows: + // + // 1. Define comparison of A with B using (A - B) >>> 8: + // if A > B, then result is positive integer + // if A <= B, then result is 0 + // + // 2. Define selection of C or 0 using bitwise AND: X & C: + // if X == 0, then result is 0 + // if X != 0, then result is C + // + // 3. Start with the smallest comparison (b >= 0), which is always + // true, so set the result to the starting ASCII value (65). + // + // 4. Continue comparing b to higher ASCII values, and selecting + // zero if comparison isn't true, otherwise selecting a value + // to add to result, which: + // + // a) undoes the previous addition + // b) provides new value to add + // + var result = b; + // b >= 0 + result += 65; + // b > 25 + result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97); + // b > 51 + result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48); + // b > 61 + result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43); + // b > 62 + result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47); + return String.fromCharCode(result); + }; + // Decode a character code into a byte. + // Must return 256 if character is out of alphabet range. + Coder.prototype._decodeChar = function (c) { + // Decoding works similar to encoding: using the same comparison + // function, but now it works on ranges: result is always incremented + // by value, but this value becomes zero if the range is not + // satisfied. + // + // Decoding starts with invalid value, 256, which is then + // subtracted when the range is satisfied. If none of the ranges + // apply, the function returns 256, which is then checked by + // the caller to throw error. + var result = INVALID_BYTE; // start with invalid character + // c == 43 (c > 42 and c < 44) + result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62); + // c == 47 (c > 46 and c < 48) + result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63); + // c > 47 and c < 58 + result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52); + // c > 64 and c < 91 + result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0); + // c > 96 and c < 123 + result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26); + return result; + }; + Coder.prototype._getPaddingLength = function (s) { + var paddingLength = 0; + if (this._paddingCharacter) { + for (var i = s.length - 1; i >= 0; i--) { + if (s[i] !== this._paddingCharacter) { + break; + } + paddingLength++; + } + if (s.length < 4 || paddingLength > 2) { + throw new Error("Base64Coder: incorrect padding"); + } + } + return paddingLength; + }; + return Coder; +}()); +exports.Coder = Coder; +var stdCoder = new Coder(); +function encode(data) { + return stdCoder.encode(data); +} +exports.encode = encode; +function decode(s) { + return stdCoder.decode(s); +} +exports.decode = decode; +/** + * Implements URL-safe Base64 encoding. + * (Same as Base64, but '+' is replaced with '-', and '/' with '_'). + * + * Operates in constant time. + */ +var URLSafeCoder = /** @class */ (function (_super) { + __extends(URLSafeCoder, _super); + function URLSafeCoder() { + return _super !== null && _super.apply(this, arguments) || this; + } + // URL-safe encoding have the following encoded/decoded ranges: + // + // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 - _ + // Index: 0 - 25 26 - 51 52 - 61 62 63 + // ASCII: 65 - 90 97 - 122 48 - 57 45 95 + // + URLSafeCoder.prototype._encodeByte = function (b) { + var result = b; + // b >= 0 + result += 65; + // b > 25 + result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97); + // b > 51 + result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48); + // b > 61 + result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45); + // b > 62 + result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95); + return String.fromCharCode(result); + }; + URLSafeCoder.prototype._decodeChar = function (c) { + var result = INVALID_BYTE; + // c == 45 (c > 44 and c < 46) + result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62); + // c == 95 (c > 94 and c < 96) + result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63); + // c > 47 and c < 58 + result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52); + // c > 64 and c < 91 + result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0); + // c > 96 and c < 123 + result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26); + return result; + }; + return URLSafeCoder; +}(Coder)); +exports.URLSafeCoder = URLSafeCoder; +var urlSafeCoder = new URLSafeCoder(); +function encodeURLSafe(data) { + return urlSafeCoder.encode(data); +} +exports.encodeURLSafe = encodeURLSafe; +function decodeURLSafe(s) { + return urlSafeCoder.decode(s); +} +exports.decodeURLSafe = decodeURLSafe; +exports.encodedLength = function (length) { + return stdCoder.encodedLength(length); +}; +exports.maxDecodedLength = function (length) { + return stdCoder.maxDecodedLength(length); +}; +exports.decodedLength = function (s) { + return stdCoder.decodedLength(s); +}; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Copyright (C) 2016 Dmitry Chestnykh +// MIT License. See LICENSE file for details. +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Package utf8 implements UTF-8 encoding and decoding. + */ +var INVALID_UTF16 = "utf8: invalid string"; +var INVALID_UTF8 = "utf8: invalid source encoding"; +/** + * Encodes the given string into UTF-8 byte array. + * Throws if the source string has invalid UTF-16 encoding. + */ +function encode(s) { + // Calculate result length and allocate output array. + // encodedLength() also validates string and throws errors, + // so we don't need repeat validation here. + var arr = new Uint8Array(encodedLength(s)); + var pos = 0; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 0x80) { + arr[pos++] = c; + } + else if (c < 0x800) { + arr[pos++] = 0xc0 | c >> 6; + arr[pos++] = 0x80 | c & 0x3f; + } + else if (c < 0xd800) { + arr[pos++] = 0xe0 | c >> 12; + arr[pos++] = 0x80 | (c >> 6) & 0x3f; + arr[pos++] = 0x80 | c & 0x3f; + } + else { + i++; // get one more character + c = (c & 0x3ff) << 10; + c |= s.charCodeAt(i) & 0x3ff; + c += 0x10000; + arr[pos++] = 0xf0 | c >> 18; + arr[pos++] = 0x80 | (c >> 12) & 0x3f; + arr[pos++] = 0x80 | (c >> 6) & 0x3f; + arr[pos++] = 0x80 | c & 0x3f; + } + } + return arr; +} +exports.encode = encode; +/** + * Returns the number of bytes required to encode the given string into UTF-8. + * Throws if the source string has invalid UTF-16 encoding. + */ +function encodedLength(s) { + var result = 0; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 0x80) { + result += 1; + } + else if (c < 0x800) { + result += 2; + } + else if (c < 0xd800) { + result += 3; + } + else if (c <= 0xdfff) { + if (i >= s.length - 1) { + throw new Error(INVALID_UTF16); + } + i++; // "eat" next character + result += 4; + } + else { + throw new Error(INVALID_UTF16); + } + } + return result; +} +exports.encodedLength = encodedLength; +/** + * Decodes the given byte array from UTF-8 into a string. + * Throws if encoding is invalid. + */ +function decode(arr) { + var chars = []; + for (var i = 0; i < arr.length; i++) { + var b = arr[i]; + if (b & 0x80) { + var min = void 0; + if (b < 0xe0) { + // Need 1 more byte. + if (i >= arr.length) { + throw new Error(INVALID_UTF8); + } + var n1 = arr[++i]; + if ((n1 & 0xc0) !== 0x80) { + throw new Error(INVALID_UTF8); + } + b = (b & 0x1f) << 6 | (n1 & 0x3f); + min = 0x80; + } + else if (b < 0xf0) { + // Need 2 more bytes. + if (i >= arr.length - 1) { + throw new Error(INVALID_UTF8); + } + var n1 = arr[++i]; + var n2 = arr[++i]; + if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) { + throw new Error(INVALID_UTF8); + } + b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f); + min = 0x800; + } + else if (b < 0xf8) { + // Need 3 more bytes. + if (i >= arr.length - 2) { + throw new Error(INVALID_UTF8); + } + var n1 = arr[++i]; + var n2 = arr[++i]; + var n3 = arr[++i]; + if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) { + throw new Error(INVALID_UTF8); + } + b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f); + min = 0x10000; + } + else { + throw new Error(INVALID_UTF8); + } + if (b < min || (b >= 0xd800 && b <= 0xdfff)) { + throw new Error(INVALID_UTF8); + } + if (b >= 0x10000) { + // Surrogate pair. + if (b > 0x10ffff) { + throw new Error(INVALID_UTF8); + } + b -= 0x10000; + chars.push(String.fromCharCode(0xd800 | (b >> 10))); + b = 0xdc00 | (b & 0x3ff); + } + } + chars.push(String.fromCharCode(b)); + } + return chars.join(""); +} +exports.decode = decode; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __nested_webpack_require_19901__) { + +// required so we don't have to do require('pusher').default etc. +module.exports = __nested_webpack_require_19901__(3).default; + + +/***/ }), +/* 3 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_20105__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_20105__.r(__nested_webpack_exports__); + +// CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts +var ScriptReceiverFactory = (function () { + function ScriptReceiverFactory(prefix, name) { + this.lastId = 0; + this.prefix = prefix; + this.name = name; + } + ScriptReceiverFactory.prototype.create = function (callback) { + this.lastId++; + var number = this.lastId; + var id = this.prefix + number; + var name = this.name + '[' + number + ']'; + var called = false; + var callbackWrapper = function () { + if (!called) { + callback.apply(null, arguments); + called = true; + } + }; + this[number] = callbackWrapper; + return { number: number, id: id, name: name, callback: callbackWrapper }; + }; + ScriptReceiverFactory.prototype.remove = function (receiver) { + delete this[receiver.number]; + }; + return ScriptReceiverFactory; +}()); + +var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.ScriptReceivers'); + +// CONCATENATED MODULE: ./src/core/defaults.ts +var Defaults = { + VERSION: "7.6.0", + PROTOCOL: 7, + wsPort: 80, + wssPort: 443, + wsPath: '', + httpHost: 'sockjs.pusher.com', + httpPort: 80, + httpsPort: 443, + httpPath: '/pusher', + stats_host: 'stats.pusher.com', + authEndpoint: '/pusher/auth', + authTransport: 'ajax', + activityTimeout: 120000, + pongTimeout: 30000, + unavailableTimeout: 10000, + cluster: 'mt1', + userAuthentication: { + endpoint: '/pusher/user-auth', + transport: 'ajax' + }, + channelAuthorization: { + endpoint: '/pusher/auth', + transport: 'ajax' + }, + cdn_http: "http://js.pusher.com", + cdn_https: "https://js.pusher.com", + dependency_suffix: "" +}; +/* harmony default export */ var defaults = (Defaults); + +// CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts + + +var dependency_loader_DependencyLoader = (function () { + function DependencyLoader(options) { + this.options = options; + this.receivers = options.receivers || ScriptReceivers; + this.loading = {}; + } + DependencyLoader.prototype.load = function (name, options, callback) { + var self = this; + if (self.loading[name] && self.loading[name].length > 0) { + self.loading[name].push(callback); + } + else { + self.loading[name] = [callback]; + var request = runtime.createScriptRequest(self.getPath(name, options)); + var receiver = self.receivers.create(function (error) { + self.receivers.remove(receiver); + if (self.loading[name]) { + var callbacks = self.loading[name]; + delete self.loading[name]; + var successCallback = function (wasSuccessful) { + if (!wasSuccessful) { + request.cleanup(); + } + }; + for (var i = 0; i < callbacks.length; i++) { + callbacks[i](error, successCallback); + } + } + }); + request.send(receiver); + } + }; + DependencyLoader.prototype.getRoot = function (options) { + var cdn; + var protocol = runtime.getDocument().location.protocol; + if ((options && options.useTLS) || protocol === 'https:') { + cdn = this.options.cdn_https; + } + else { + cdn = this.options.cdn_http; + } + return cdn.replace(/\/*$/, '') + '/' + this.options.version; + }; + DependencyLoader.prototype.getPath = function (name, options) { + return this.getRoot(options) + '/' + name + this.options.suffix + '.js'; + }; + return DependencyLoader; +}()); +/* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader); + +// CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts + + + +var DependenciesReceivers = new ScriptReceiverFactory('_pusher_dependencies', 'Pusher.DependenciesReceivers'); +var Dependencies = new dependency_loader({ + cdn_http: defaults.cdn_http, + cdn_https: defaults.cdn_https, + version: defaults.VERSION, + suffix: defaults.dependency_suffix, + receivers: DependenciesReceivers +}); + +// CONCATENATED MODULE: ./src/core/utils/url_store.ts +var urlStore = { + baseUrl: 'https://pusher.com', + urls: { + authenticationEndpoint: { + path: '/docs/channels/server_api/authenticating_users' + }, + authorizationEndpoint: { + path: '/docs/channels/server_api/authorizing-users/' + }, + javascriptQuickStart: { + path: '/docs/javascript_quick_start' + }, + triggeringClientEvents: { + path: '/docs/client_api_guide/client_events#trigger-events' + }, + encryptedChannelSupport: { + fullUrl: 'https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support' + } + } +}; +var buildLogSuffix = function (key) { + var urlPrefix = 'See:'; + var urlObj = urlStore.urls[key]; + if (!urlObj) + return ''; + var url; + if (urlObj.fullUrl) { + url = urlObj.fullUrl; + } + else if (urlObj.path) { + url = urlStore.baseUrl + urlObj.path; + } + if (!url) + return ''; + return urlPrefix + " " + url; +}; +/* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix }); + +// CONCATENATED MODULE: ./src/core/auth/options.ts +var AuthRequestType; +(function (AuthRequestType) { + AuthRequestType["UserAuthentication"] = "user-authentication"; + AuthRequestType["ChannelAuthorization"] = "channel-authorization"; +})(AuthRequestType || (AuthRequestType = {})); + +// CONCATENATED MODULE: ./src/core/errors.ts +var __extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var BadEventName = (function (_super) { + __extends(BadEventName, _super); + function BadEventName(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return BadEventName; +}(Error)); + +var BadChannelName = (function (_super) { + __extends(BadChannelName, _super); + function BadChannelName(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return BadChannelName; +}(Error)); + +var RequestTimedOut = (function (_super) { + __extends(RequestTimedOut, _super); + function RequestTimedOut(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return RequestTimedOut; +}(Error)); + +var TransportPriorityTooLow = (function (_super) { + __extends(TransportPriorityTooLow, _super); + function TransportPriorityTooLow(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return TransportPriorityTooLow; +}(Error)); + +var TransportClosed = (function (_super) { + __extends(TransportClosed, _super); + function TransportClosed(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return TransportClosed; +}(Error)); + +var UnsupportedFeature = (function (_super) { + __extends(UnsupportedFeature, _super); + function UnsupportedFeature(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return UnsupportedFeature; +}(Error)); + +var UnsupportedTransport = (function (_super) { + __extends(UnsupportedTransport, _super); + function UnsupportedTransport(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return UnsupportedTransport; +}(Error)); + +var UnsupportedStrategy = (function (_super) { + __extends(UnsupportedStrategy, _super); + function UnsupportedStrategy(msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return UnsupportedStrategy; +}(Error)); + +var HTTPAuthError = (function (_super) { + __extends(HTTPAuthError, _super); + function HTTPAuthError(status, msg) { + var _newTarget = this.constructor; + var _this = _super.call(this, msg) || this; + _this.status = status; + Object.setPrototypeOf(_this, _newTarget.prototype); + return _this; + } + return HTTPAuthError; +}(Error)); + + +// CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts + + + + +var ajax = function (context, query, authOptions, authRequestType, callback) { + var xhr = runtime.createXHR(); + xhr.open('POST', authOptions.endpoint, true); + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + for (var headerName in authOptions.headers) { + xhr.setRequestHeader(headerName, authOptions.headers[headerName]); + } + if (authOptions.headersProvider != null) { + var dynamicHeaders = authOptions.headersProvider(); + for (var headerName in dynamicHeaders) { + xhr.setRequestHeader(headerName, dynamicHeaders[headerName]); + } + } + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (xhr.status === 200) { + var data = void 0; + var parsed = false; + try { + data = JSON.parse(xhr.responseText); + parsed = true; + } + catch (e) { + callback(new HTTPAuthError(200, "JSON returned from " + authRequestType.toString() + " endpoint was invalid, yet status code was 200. Data was: " + xhr.responseText), null); + } + if (parsed) { + callback(null, data); + } + } + else { + var suffix = ''; + switch (authRequestType) { + case AuthRequestType.UserAuthentication: + suffix = url_store.buildLogSuffix('authenticationEndpoint'); + break; + case AuthRequestType.ChannelAuthorization: + suffix = "Clients must be authorized to join private or presence channels. " + url_store.buildLogSuffix('authorizationEndpoint'); + break; + } + callback(new HTTPAuthError(xhr.status, "Unable to retrieve auth string from " + authRequestType.toString() + " endpoint - " + + ("received status: " + xhr.status + " from " + authOptions.endpoint + ". " + suffix)), null); + } + } + }; + xhr.send(query); + return xhr; +}; +/* harmony default export */ var xhr_auth = (ajax); + +// CONCATENATED MODULE: ./src/core/base64.ts +function encode(s) { + return btoa(utob(s)); +} +var fromCharCode = String.fromCharCode; +var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +var b64tab = {}; +for (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) { + b64tab[b64chars.charAt(base64_i)] = base64_i; +} +var cb_utob = function (c) { + var cc = c.charCodeAt(0); + return cc < 0x80 + ? c + : cc < 0x800 + ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f)) + : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) + + fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + + fromCharCode(0x80 | (cc & 0x3f)); +}; +var utob = function (u) { + return u.replace(/[^\x00-\x7F]/g, cb_utob); +}; +var cb_encode = function (ccc) { + var padlen = [0, 2, 1][ccc.length % 3]; + var ord = (ccc.charCodeAt(0) << 16) | + ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) | + (ccc.length > 2 ? ccc.charCodeAt(2) : 0); + var chars = [ + b64chars.charAt(ord >>> 18), + b64chars.charAt((ord >>> 12) & 63), + padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63), + padlen >= 1 ? '=' : b64chars.charAt(ord & 63) + ]; + return chars.join(''); +}; +var btoa = window.btoa || + function (b) { + return b.replace(/[\s\S]{1,3}/g, cb_encode); + }; + +// CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts +var Timer = (function () { + function Timer(set, clear, delay, callback) { + var _this = this; + this.clear = clear; + this.timer = set(function () { + if (_this.timer) { + _this.timer = callback(_this.timer); + } + }, delay); + } + Timer.prototype.isRunning = function () { + return this.timer !== null; + }; + Timer.prototype.ensureAborted = function () { + if (this.timer) { + this.clear(this.timer); + this.timer = null; + } + }; + return Timer; +}()); +/* harmony default export */ var abstract_timer = (Timer); + +// CONCATENATED MODULE: ./src/core/utils/timers/index.ts +var timers_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + +function timers_clearTimeout(timer) { + window.clearTimeout(timer); +} +function timers_clearInterval(timer) { + window.clearInterval(timer); +} +var OneOffTimer = (function (_super) { + timers_extends(OneOffTimer, _super); + function OneOffTimer(delay, callback) { + return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) { + callback(); + return null; + }) || this; + } + return OneOffTimer; +}(abstract_timer)); + +var PeriodicTimer = (function (_super) { + timers_extends(PeriodicTimer, _super); + function PeriodicTimer(delay, callback) { + return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) { + callback(); + return timer; + }) || this; + } + return PeriodicTimer; +}(abstract_timer)); + + +// CONCATENATED MODULE: ./src/core/util.ts + +var Util = { + now: function () { + if (Date.now) { + return Date.now(); + } + else { + return new Date().valueOf(); + } + }, + defer: function (callback) { + return new OneOffTimer(0, callback); + }, + method: function (name) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var boundArguments = Array.prototype.slice.call(arguments, 1); + return function (object) { + return object[name].apply(object, boundArguments.concat(arguments)); + }; + } +}; +/* harmony default export */ var util = (Util); + +// CONCATENATED MODULE: ./src/core/utils/collections.ts + + +function extend(target) { + var sources = []; + for (var _i = 1; _i < arguments.length; _i++) { + sources[_i - 1] = arguments[_i]; + } + for (var i = 0; i < sources.length; i++) { + var extensions = sources[i]; + for (var property in extensions) { + if (extensions[property] && + extensions[property].constructor && + extensions[property].constructor === Object) { + target[property] = extend(target[property] || {}, extensions[property]); + } + else { + target[property] = extensions[property]; + } + } + } + return target; +} +function stringify() { + var m = ['Pusher']; + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === 'string') { + m.push(arguments[i]); + } + else { + m.push(safeJSONStringify(arguments[i])); + } + } + return m.join(' : '); +} +function arrayIndexOf(array, item) { + var nativeIndexOf = Array.prototype.indexOf; + if (array === null) { + return -1; + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) { + return array.indexOf(item); + } + for (var i = 0, l = array.length; i < l; i++) { + if (array[i] === item) { + return i; + } + } + return -1; +} +function objectApply(object, f) { + for (var key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + f(object[key], key, object); + } + } +} +function keys(object) { + var keys = []; + objectApply(object, function (_, key) { + keys.push(key); + }); + return keys; +} +function values(object) { + var values = []; + objectApply(object, function (value) { + values.push(value); + }); + return values; +} +function apply(array, f, context) { + for (var i = 0; i < array.length; i++) { + f.call(context || window, array[i], i, array); + } +} +function map(array, f) { + var result = []; + for (var i = 0; i < array.length; i++) { + result.push(f(array[i], i, array, result)); + } + return result; +} +function mapObject(object, f) { + var result = {}; + objectApply(object, function (value, key) { + result[key] = f(value); + }); + return result; +} +function filter(array, test) { + test = + test || + function (value) { + return !!value; + }; + var result = []; + for (var i = 0; i < array.length; i++) { + if (test(array[i], i, array, result)) { + result.push(array[i]); + } + } + return result; +} +function filterObject(object, test) { + var result = {}; + objectApply(object, function (value, key) { + if ((test && test(value, key, object, result)) || Boolean(value)) { + result[key] = value; + } + }); + return result; +} +function flatten(object) { + var result = []; + objectApply(object, function (value, key) { + result.push([key, value]); + }); + return result; +} +function any(array, test) { + for (var i = 0; i < array.length; i++) { + if (test(array[i], i, array)) { + return true; + } + } + return false; +} +function collections_all(array, test) { + for (var i = 0; i < array.length; i++) { + if (!test(array[i], i, array)) { + return false; + } + } + return true; +} +function encodeParamsObject(data) { + return mapObject(data, function (value) { + if (typeof value === 'object') { + value = safeJSONStringify(value); + } + return encodeURIComponent(encode(value.toString())); + }); +} +function buildQueryString(data) { + var params = filterObject(data, function (value) { + return value !== undefined; + }); + var query = map(flatten(encodeParamsObject(params)), util.method('join', '=')).join('&'); + return query; +} +function decycleObject(object) { + var objects = [], paths = []; + return (function derez(value, path) { + var i, name, nu; + switch (typeof value) { + case 'object': + if (!value) { + return null; + } + for (i = 0; i < objects.length; i += 1) { + if (objects[i] === value) { + return { $ref: paths[i] }; + } + } + objects.push(value); + paths.push(path); + if (Object.prototype.toString.apply(value) === '[object Array]') { + nu = []; + for (i = 0; i < value.length; i += 1) { + nu[i] = derez(value[i], path + '[' + i + ']'); + } + } + else { + nu = {}; + for (name in value) { + if (Object.prototype.hasOwnProperty.call(value, name)) { + nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']'); + } + } + } + return nu; + case 'number': + case 'string': + case 'boolean': + return value; + } + })(object, '$'); +} +function safeJSONStringify(source) { + try { + return JSON.stringify(source); + } + catch (e) { + return JSON.stringify(decycleObject(source)); + } +} + +// CONCATENATED MODULE: ./src/core/logger.ts + + +var logger_Logger = (function () { + function Logger() { + this.globalLog = function (message) { + if (window.console && window.console.log) { + window.console.log(message); + } + }; + } + Logger.prototype.debug = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + this.log(this.globalLog, args); + }; + Logger.prototype.warn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + this.log(this.globalLogWarn, args); + }; + Logger.prototype.error = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + this.log(this.globalLogError, args); + }; + Logger.prototype.globalLogWarn = function (message) { + if (window.console && window.console.warn) { + window.console.warn(message); + } + else { + this.globalLog(message); + } + }; + Logger.prototype.globalLogError = function (message) { + if (window.console && window.console.error) { + window.console.error(message); + } + else { + this.globalLogWarn(message); + } + }; + Logger.prototype.log = function (defaultLoggingFunction) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var message = stringify.apply(this, arguments); + if (core_pusher.log) { + core_pusher.log(message); + } + else if (core_pusher.logToConsole) { + var log = defaultLoggingFunction.bind(this); + log(message); + } + }; + return Logger; +}()); +/* harmony default export */ var logger = (new logger_Logger()); + +// CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts + +var jsonp = function (context, query, authOptions, authRequestType, callback) { + if (authOptions.headers !== undefined || + authOptions.headersProvider != null) { + logger.warn("To send headers with the " + authRequestType.toString() + " request, you must use AJAX, rather than JSONP."); + } + var callbackName = context.nextAuthCallbackID.toString(); + context.nextAuthCallbackID++; + var document = context.getDocument(); + var script = document.createElement('script'); + context.auth_callbacks[callbackName] = function (data) { + callback(null, data); + }; + var callback_name = "Pusher.auth_callbacks['" + callbackName + "']"; + script.src = + authOptions.endpoint + + '?callback=' + + encodeURIComponent(callback_name) + + '&' + + query; + var head = document.getElementsByTagName('head')[0] || document.documentElement; + head.insertBefore(script, head.firstChild); +}; +/* harmony default export */ var jsonp_auth = (jsonp); + +// CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts +var ScriptRequest = (function () { + function ScriptRequest(src) { + this.src = src; + } + ScriptRequest.prototype.send = function (receiver) { + var self = this; + var errorString = 'Error loading ' + self.src; + self.script = document.createElement('script'); + self.script.id = receiver.id; + self.script.src = self.src; + self.script.type = 'text/javascript'; + self.script.charset = 'UTF-8'; + if (self.script.addEventListener) { + self.script.onerror = function () { + receiver.callback(errorString); + }; + self.script.onload = function () { + receiver.callback(null); + }; + } + else { + self.script.onreadystatechange = function () { + if (self.script.readyState === 'loaded' || + self.script.readyState === 'complete') { + receiver.callback(null); + } + }; + } + if (self.script.async === undefined && + document.attachEvent && + /opera/i.test(navigator.userAgent)) { + self.errorScript = document.createElement('script'); + self.errorScript.id = receiver.id + '_error'; + self.errorScript.text = receiver.name + "('" + errorString + "');"; + self.script.async = self.errorScript.async = false; + } + else { + self.script.async = true; + } + var head = document.getElementsByTagName('head')[0]; + head.insertBefore(self.script, head.firstChild); + if (self.errorScript) { + head.insertBefore(self.errorScript, self.script.nextSibling); + } + }; + ScriptRequest.prototype.cleanup = function () { + if (this.script) { + this.script.onload = this.script.onerror = null; + this.script.onreadystatechange = null; + } + if (this.script && this.script.parentNode) { + this.script.parentNode.removeChild(this.script); + } + if (this.errorScript && this.errorScript.parentNode) { + this.errorScript.parentNode.removeChild(this.errorScript); + } + this.script = null; + this.errorScript = null; + }; + return ScriptRequest; +}()); +/* harmony default export */ var script_request = (ScriptRequest); + +// CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts + + +var jsonp_request_JSONPRequest = (function () { + function JSONPRequest(url, data) { + this.url = url; + this.data = data; + } + JSONPRequest.prototype.send = function (receiver) { + if (this.request) { + return; + } + var query = buildQueryString(this.data); + var url = this.url + '/' + receiver.number + '?' + query; + this.request = runtime.createScriptRequest(url); + this.request.send(receiver); + }; + JSONPRequest.prototype.cleanup = function () { + if (this.request) { + this.request.cleanup(); + } + }; + return JSONPRequest; +}()); +/* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest); + +// CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts + + +var getAgent = function (sender, useTLS) { + return function (data, callback) { + var scheme = 'http' + (useTLS ? 's' : '') + '://'; + var url = scheme + (sender.host || sender.options.host) + sender.options.path; + var request = runtime.createJSONPRequest(url, data); + var receiver = runtime.ScriptReceivers.create(function (error, result) { + ScriptReceivers.remove(receiver); + request.cleanup(); + if (result && result.host) { + sender.host = result.host; + } + if (callback) { + callback(error, result); + } + }); + request.send(receiver); + }; +}; +var jsonp_timeline_jsonp = { + name: 'jsonp', + getAgent: getAgent +}; +/* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp); + +// CONCATENATED MODULE: ./src/core/transports/url_schemes.ts + +function getGenericURL(baseScheme, params, path) { + var scheme = baseScheme + (params.useTLS ? 's' : ''); + var host = params.useTLS ? params.hostTLS : params.hostNonTLS; + return scheme + '://' + host + path; +} +function getGenericPath(key, queryString) { + var path = '/app/' + key; + var query = '?protocol=' + + defaults.PROTOCOL + + '&client=js' + + '&version=' + + defaults.VERSION + + (queryString ? '&' + queryString : ''); + return path + query; +} +var ws = { + getInitial: function (key, params) { + var path = (params.httpPath || '') + getGenericPath(key, 'flash=false'); + return getGenericURL('ws', params, path); + } +}; +var http = { + getInitial: function (key, params) { + var path = (params.httpPath || '/pusher') + getGenericPath(key); + return getGenericURL('http', params, path); + } +}; +var sockjs = { + getInitial: function (key, params) { + return getGenericURL('http', params, params.httpPath || '/pusher'); + }, + getPath: function (key, params) { + return getGenericPath(key); + } +}; + +// CONCATENATED MODULE: ./src/core/events/callback_registry.ts + +var callback_registry_CallbackRegistry = (function () { + function CallbackRegistry() { + this._callbacks = {}; + } + CallbackRegistry.prototype.get = function (name) { + return this._callbacks[prefix(name)]; + }; + CallbackRegistry.prototype.add = function (name, callback, context) { + var prefixedEventName = prefix(name); + this._callbacks[prefixedEventName] = + this._callbacks[prefixedEventName] || []; + this._callbacks[prefixedEventName].push({ + fn: callback, + context: context + }); + }; + CallbackRegistry.prototype.remove = function (name, callback, context) { + if (!name && !callback && !context) { + this._callbacks = {}; + return; + } + var names = name ? [prefix(name)] : keys(this._callbacks); + if (callback || context) { + this.removeCallback(names, callback, context); + } + else { + this.removeAllCallbacks(names); + } + }; + CallbackRegistry.prototype.removeCallback = function (names, callback, context) { + apply(names, function (name) { + this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) { + return ((callback && callback !== binding.fn) || + (context && context !== binding.context)); + }); + if (this._callbacks[name].length === 0) { + delete this._callbacks[name]; + } + }, this); + }; + CallbackRegistry.prototype.removeAllCallbacks = function (names) { + apply(names, function (name) { + delete this._callbacks[name]; + }, this); + }; + return CallbackRegistry; +}()); +/* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry); +function prefix(name) { + return '_' + name; +} + +// CONCATENATED MODULE: ./src/core/events/dispatcher.ts + + +var dispatcher_Dispatcher = (function () { + function Dispatcher(failThrough) { + this.callbacks = new callback_registry(); + this.global_callbacks = []; + this.failThrough = failThrough; + } + Dispatcher.prototype.bind = function (eventName, callback, context) { + this.callbacks.add(eventName, callback, context); + return this; + }; + Dispatcher.prototype.bind_global = function (callback) { + this.global_callbacks.push(callback); + return this; + }; + Dispatcher.prototype.unbind = function (eventName, callback, context) { + this.callbacks.remove(eventName, callback, context); + return this; + }; + Dispatcher.prototype.unbind_global = function (callback) { + if (!callback) { + this.global_callbacks = []; + return this; + } + this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; }); + return this; + }; + Dispatcher.prototype.unbind_all = function () { + this.unbind(); + this.unbind_global(); + return this; + }; + Dispatcher.prototype.emit = function (eventName, data, metadata) { + for (var i = 0; i < this.global_callbacks.length; i++) { + this.global_callbacks[i](eventName, data); + } + var callbacks = this.callbacks.get(eventName); + var args = []; + if (metadata) { + args.push(data, metadata); + } + else if (data) { + args.push(data); + } + if (callbacks && callbacks.length > 0) { + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].fn.apply(callbacks[i].context || window, args); + } + } + else if (this.failThrough) { + this.failThrough(eventName, data); + } + return this; + }; + return Dispatcher; +}()); +/* harmony default export */ var dispatcher = (dispatcher_Dispatcher); + +// CONCATENATED MODULE: ./src/core/transports/transport_connection.ts +var transport_connection_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +var transport_connection_TransportConnection = (function (_super) { + transport_connection_extends(TransportConnection, _super); + function TransportConnection(hooks, name, priority, key, options) { + var _this = _super.call(this) || this; + _this.initialize = runtime.transportConnectionInitializer; + _this.hooks = hooks; + _this.name = name; + _this.priority = priority; + _this.key = key; + _this.options = options; + _this.state = 'new'; + _this.timeline = options.timeline; + _this.activityTimeout = options.activityTimeout; + _this.id = _this.timeline.generateUniqueID(); + return _this; + } + TransportConnection.prototype.handlesActivityChecks = function () { + return Boolean(this.hooks.handlesActivityChecks); + }; + TransportConnection.prototype.supportsPing = function () { + return Boolean(this.hooks.supportsPing); + }; + TransportConnection.prototype.connect = function () { + var _this = this; + if (this.socket || this.state !== 'initialized') { + return false; + } + var url = this.hooks.urls.getInitial(this.key, this.options); + try { + this.socket = this.hooks.getSocket(url, this.options); + } + catch (e) { + util.defer(function () { + _this.onError(e); + _this.changeState('closed'); + }); + return false; + } + this.bindListeners(); + logger.debug('Connecting', { transport: this.name, url: url }); + this.changeState('connecting'); + return true; + }; + TransportConnection.prototype.close = function () { + if (this.socket) { + this.socket.close(); + return true; + } + else { + return false; + } + }; + TransportConnection.prototype.send = function (data) { + var _this = this; + if (this.state === 'open') { + util.defer(function () { + if (_this.socket) { + _this.socket.send(data); + } + }); + return true; + } + else { + return false; + } + }; + TransportConnection.prototype.ping = function () { + if (this.state === 'open' && this.supportsPing()) { + this.socket.ping(); + } + }; + TransportConnection.prototype.onOpen = function () { + if (this.hooks.beforeOpen) { + this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options)); + } + this.changeState('open'); + this.socket.onopen = undefined; + }; + TransportConnection.prototype.onError = function (error) { + this.emit('error', { type: 'WebSocketError', error: error }); + this.timeline.error(this.buildTimelineMessage({ error: error.toString() })); + }; + TransportConnection.prototype.onClose = function (closeEvent) { + if (closeEvent) { + this.changeState('closed', { + code: closeEvent.code, + reason: closeEvent.reason, + wasClean: closeEvent.wasClean + }); + } + else { + this.changeState('closed'); + } + this.unbindListeners(); + this.socket = undefined; + }; + TransportConnection.prototype.onMessage = function (message) { + this.emit('message', message); + }; + TransportConnection.prototype.onActivity = function () { + this.emit('activity'); + }; + TransportConnection.prototype.bindListeners = function () { + var _this = this; + this.socket.onopen = function () { + _this.onOpen(); + }; + this.socket.onerror = function (error) { + _this.onError(error); + }; + this.socket.onclose = function (closeEvent) { + _this.onClose(closeEvent); + }; + this.socket.onmessage = function (message) { + _this.onMessage(message); + }; + if (this.supportsPing()) { + this.socket.onactivity = function () { + _this.onActivity(); + }; + } + }; + TransportConnection.prototype.unbindListeners = function () { + if (this.socket) { + this.socket.onopen = undefined; + this.socket.onerror = undefined; + this.socket.onclose = undefined; + this.socket.onmessage = undefined; + if (this.supportsPing()) { + this.socket.onactivity = undefined; + } + } + }; + TransportConnection.prototype.changeState = function (state, params) { + this.state = state; + this.timeline.info(this.buildTimelineMessage({ + state: state, + params: params + })); + this.emit(state, params); + }; + TransportConnection.prototype.buildTimelineMessage = function (message) { + return extend({ cid: this.id }, message); + }; + return TransportConnection; +}(dispatcher)); +/* harmony default export */ var transport_connection = (transport_connection_TransportConnection); + +// CONCATENATED MODULE: ./src/core/transports/transport.ts + +var transport_Transport = (function () { + function Transport(hooks) { + this.hooks = hooks; + } + Transport.prototype.isSupported = function (environment) { + return this.hooks.isSupported(environment); + }; + Transport.prototype.createConnection = function (name, priority, key, options) { + return new transport_connection(this.hooks, name, priority, key, options); + }; + return Transport; +}()); +/* harmony default export */ var transports_transport = (transport_Transport); + +// CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts + + + + +var WSTransport = new transports_transport({ + urls: ws, + handlesActivityChecks: false, + supportsPing: false, + isInitialized: function () { + return Boolean(runtime.getWebSocketAPI()); + }, + isSupported: function () { + return Boolean(runtime.getWebSocketAPI()); + }, + getSocket: function (url) { + return runtime.createWebSocket(url); + } +}); +var httpConfiguration = { + urls: http, + handlesActivityChecks: false, + supportsPing: true, + isInitialized: function () { + return true; + } +}; +var streamingConfiguration = extend({ + getSocket: function (url) { + return runtime.HTTPFactory.createStreamingSocket(url); + } +}, httpConfiguration); +var pollingConfiguration = extend({ + getSocket: function (url) { + return runtime.HTTPFactory.createPollingSocket(url); + } +}, httpConfiguration); +var xhrConfiguration = { + isSupported: function () { + return runtime.isXHRSupported(); + } +}; +var XHRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xhrConfiguration))); +var XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration)); +var Transports = { + ws: WSTransport, + xhr_streaming: XHRStreamingTransport, + xhr_polling: XHRPollingTransport +}; +/* harmony default export */ var transports = (Transports); + +// CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts + + + + + + +var SockJSTransport = new transports_transport({ + file: 'sockjs', + urls: sockjs, + handlesActivityChecks: true, + supportsPing: false, + isSupported: function () { + return true; + }, + isInitialized: function () { + return window.SockJS !== undefined; + }, + getSocket: function (url, options) { + return new window.SockJS(url, null, { + js_path: Dependencies.getPath('sockjs', { + useTLS: options.useTLS + }), + ignore_null_origin: options.ignoreNullOrigin + }); + }, + beforeOpen: function (socket, path) { + socket.send(JSON.stringify({ + path: path + })); + } +}); +var xdrConfiguration = { + isSupported: function (environment) { + var yes = runtime.isXDRSupported(environment.useTLS); + return yes; + } +}; +var XDRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xdrConfiguration))); +var XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration)); +transports.xdr_streaming = XDRStreamingTransport; +transports.xdr_polling = XDRPollingTransport; +transports.sockjs = SockJSTransport; +/* harmony default export */ var transports_transports = (transports); + +// CONCATENATED MODULE: ./src/runtimes/web/net_info.ts +var net_info_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + +var NetInfo = (function (_super) { + net_info_extends(NetInfo, _super); + function NetInfo() { + var _this = _super.call(this) || this; + var self = _this; + if (window.addEventListener !== undefined) { + window.addEventListener('online', function () { + self.emit('online'); + }, false); + window.addEventListener('offline', function () { + self.emit('offline'); + }, false); + } + return _this; + } + NetInfo.prototype.isOnline = function () { + if (window.navigator.onLine === undefined) { + return true; + } + else { + return window.navigator.onLine; + } + }; + return NetInfo; +}(dispatcher)); + +var net_info_Network = new NetInfo(); + +// CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts + + +var assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () { + function AssistantToTheTransportManager(manager, transport, options) { + this.manager = manager; + this.transport = transport; + this.minPingDelay = options.minPingDelay; + this.maxPingDelay = options.maxPingDelay; + this.pingDelay = undefined; + } + AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) { + var _this = this; + options = extend({}, options, { + activityTimeout: this.pingDelay + }); + var connection = this.transport.createConnection(name, priority, key, options); + var openTimestamp = null; + var onOpen = function () { + connection.unbind('open', onOpen); + connection.bind('closed', onClosed); + openTimestamp = util.now(); + }; + var onClosed = function (closeEvent) { + connection.unbind('closed', onClosed); + if (closeEvent.code === 1002 || closeEvent.code === 1003) { + _this.manager.reportDeath(); + } + else if (!closeEvent.wasClean && openTimestamp) { + var lifespan = util.now() - openTimestamp; + if (lifespan < 2 * _this.maxPingDelay) { + _this.manager.reportDeath(); + _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay); + } + } + }; + connection.bind('open', onOpen); + return connection; + }; + AssistantToTheTransportManager.prototype.isSupported = function (environment) { + return this.manager.isAlive() && this.transport.isSupported(environment); + }; + return AssistantToTheTransportManager; +}()); +/* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager); + +// CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts +var Protocol = { + decodeMessage: function (messageEvent) { + try { + var messageData = JSON.parse(messageEvent.data); + var pusherEventData = messageData.data; + if (typeof pusherEventData === 'string') { + try { + pusherEventData = JSON.parse(messageData.data); + } + catch (e) { } + } + var pusherEvent = { + event: messageData.event, + channel: messageData.channel, + data: pusherEventData + }; + if (messageData.user_id) { + pusherEvent.user_id = messageData.user_id; + } + return pusherEvent; + } + catch (e) { + throw { type: 'MessageParseError', error: e, data: messageEvent.data }; + } + }, + encodeMessage: function (event) { + return JSON.stringify(event); + }, + processHandshake: function (messageEvent) { + var message = Protocol.decodeMessage(messageEvent); + if (message.event === 'pusher:connection_established') { + if (!message.data.activity_timeout) { + throw 'No activity timeout specified in handshake'; + } + return { + action: 'connected', + id: message.data.socket_id, + activityTimeout: message.data.activity_timeout * 1000 + }; + } + else if (message.event === 'pusher:error') { + return { + action: this.getCloseAction(message.data), + error: this.getCloseError(message.data) + }; + } + else { + throw 'Invalid handshake'; + } + }, + getCloseAction: function (closeEvent) { + if (closeEvent.code < 4000) { + if (closeEvent.code >= 1002 && closeEvent.code <= 1004) { + return 'backoff'; + } + else { + return null; + } + } + else if (closeEvent.code === 4000) { + return 'tls_only'; + } + else if (closeEvent.code < 4100) { + return 'refused'; + } + else if (closeEvent.code < 4200) { + return 'backoff'; + } + else if (closeEvent.code < 4300) { + return 'retry'; + } + else { + return 'refused'; + } + }, + getCloseError: function (closeEvent) { + if (closeEvent.code !== 1000 && closeEvent.code !== 1001) { + return { + type: 'PusherError', + data: { + code: closeEvent.code, + message: closeEvent.reason || closeEvent.message + } + }; + } + else { + return null; + } + } +}; +/* harmony default export */ var protocol_protocol = (Protocol); + +// CONCATENATED MODULE: ./src/core/connection/connection.ts +var connection_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var connection_Connection = (function (_super) { + connection_extends(Connection, _super); + function Connection(id, transport) { + var _this = _super.call(this) || this; + _this.id = id; + _this.transport = transport; + _this.activityTimeout = transport.activityTimeout; + _this.bindListeners(); + return _this; + } + Connection.prototype.handlesActivityChecks = function () { + return this.transport.handlesActivityChecks(); + }; + Connection.prototype.send = function (data) { + return this.transport.send(data); + }; + Connection.prototype.send_event = function (name, data, channel) { + var event = { event: name, data: data }; + if (channel) { + event.channel = channel; + } + logger.debug('Event sent', event); + return this.send(protocol_protocol.encodeMessage(event)); + }; + Connection.prototype.ping = function () { + if (this.transport.supportsPing()) { + this.transport.ping(); + } + else { + this.send_event('pusher:ping', {}); + } + }; + Connection.prototype.close = function () { + this.transport.close(); + }; + Connection.prototype.bindListeners = function () { + var _this = this; + var listeners = { + message: function (messageEvent) { + var pusherEvent; + try { + pusherEvent = protocol_protocol.decodeMessage(messageEvent); + } + catch (e) { + _this.emit('error', { + type: 'MessageParseError', + error: e, + data: messageEvent.data + }); + } + if (pusherEvent !== undefined) { + logger.debug('Event recd', pusherEvent); + switch (pusherEvent.event) { + case 'pusher:error': + _this.emit('error', { + type: 'PusherError', + data: pusherEvent.data + }); + break; + case 'pusher:ping': + _this.emit('ping'); + break; + case 'pusher:pong': + _this.emit('pong'); + break; + } + _this.emit('message', pusherEvent); + } + }, + activity: function () { + _this.emit('activity'); + }, + error: function (error) { + _this.emit('error', error); + }, + closed: function (closeEvent) { + unbindListeners(); + if (closeEvent && closeEvent.code) { + _this.handleCloseEvent(closeEvent); + } + _this.transport = null; + _this.emit('closed'); + } + }; + var unbindListeners = function () { + objectApply(listeners, function (listener, event) { + _this.transport.unbind(event, listener); + }); + }; + objectApply(listeners, function (listener, event) { + _this.transport.bind(event, listener); + }); + }; + Connection.prototype.handleCloseEvent = function (closeEvent) { + var action = protocol_protocol.getCloseAction(closeEvent); + var error = protocol_protocol.getCloseError(closeEvent); + if (error) { + this.emit('error', error); + } + if (action) { + this.emit(action, { action: action, error: error }); + } + }; + return Connection; +}(dispatcher)); +/* harmony default export */ var connection_connection = (connection_Connection); + +// CONCATENATED MODULE: ./src/core/connection/handshake/index.ts + + + +var handshake_Handshake = (function () { + function Handshake(transport, callback) { + this.transport = transport; + this.callback = callback; + this.bindListeners(); + } + Handshake.prototype.close = function () { + this.unbindListeners(); + this.transport.close(); + }; + Handshake.prototype.bindListeners = function () { + var _this = this; + this.onMessage = function (m) { + _this.unbindListeners(); + var result; + try { + result = protocol_protocol.processHandshake(m); + } + catch (e) { + _this.finish('error', { error: e }); + _this.transport.close(); + return; + } + if (result.action === 'connected') { + _this.finish('connected', { + connection: new connection_connection(result.id, _this.transport), + activityTimeout: result.activityTimeout + }); + } + else { + _this.finish(result.action, { error: result.error }); + _this.transport.close(); + } + }; + this.onClosed = function (closeEvent) { + _this.unbindListeners(); + var action = protocol_protocol.getCloseAction(closeEvent) || 'backoff'; + var error = protocol_protocol.getCloseError(closeEvent); + _this.finish(action, { error: error }); + }; + this.transport.bind('message', this.onMessage); + this.transport.bind('closed', this.onClosed); + }; + Handshake.prototype.unbindListeners = function () { + this.transport.unbind('message', this.onMessage); + this.transport.unbind('closed', this.onClosed); + }; + Handshake.prototype.finish = function (action, params) { + this.callback(extend({ transport: this.transport, action: action }, params)); + }; + return Handshake; +}()); +/* harmony default export */ var connection_handshake = (handshake_Handshake); + +// CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts + +var timeline_sender_TimelineSender = (function () { + function TimelineSender(timeline, options) { + this.timeline = timeline; + this.options = options || {}; + } + TimelineSender.prototype.send = function (useTLS, callback) { + if (this.timeline.isEmpty()) { + return; + } + this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback); + }; + return TimelineSender; +}()); +/* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender); + +// CONCATENATED MODULE: ./src/core/channels/channel.ts +var channel_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +var channel_Channel = (function (_super) { + channel_extends(Channel, _super); + function Channel(name, pusher) { + var _this = _super.call(this, function (event, data) { + logger.debug('No callbacks on ' + name + ' for ' + event); + }) || this; + _this.name = name; + _this.pusher = pusher; + _this.subscribed = false; + _this.subscriptionPending = false; + _this.subscriptionCancelled = false; + return _this; + } + Channel.prototype.authorize = function (socketId, callback) { + return callback(null, { auth: '' }); + }; + Channel.prototype.trigger = function (event, data) { + if (event.indexOf('client-') !== 0) { + throw new BadEventName("Event '" + event + "' does not start with 'client-'"); + } + if (!this.subscribed) { + var suffix = url_store.buildLogSuffix('triggeringClientEvents'); + logger.warn("Client event triggered before channel 'subscription_succeeded' event . " + suffix); + } + return this.pusher.send_event(event, data, this.name); + }; + Channel.prototype.disconnect = function () { + this.subscribed = false; + this.subscriptionPending = false; + }; + Channel.prototype.handleEvent = function (event) { + var eventName = event.event; + var data = event.data; + if (eventName === 'pusher_internal:subscription_succeeded') { + this.handleSubscriptionSucceededEvent(event); + } + else if (eventName === 'pusher_internal:subscription_count') { + this.handleSubscriptionCountEvent(event); + } + else if (eventName.indexOf('pusher_internal:') !== 0) { + var metadata = {}; + this.emit(eventName, data, metadata); + } + }; + Channel.prototype.handleSubscriptionSucceededEvent = function (event) { + this.subscriptionPending = false; + this.subscribed = true; + if (this.subscriptionCancelled) { + this.pusher.unsubscribe(this.name); + } + else { + this.emit('pusher:subscription_succeeded', event.data); + } + }; + Channel.prototype.handleSubscriptionCountEvent = function (event) { + if (event.data.subscription_count) { + this.subscriptionCount = event.data.subscription_count; + } + this.emit('pusher:subscription_count', event.data); + }; + Channel.prototype.subscribe = function () { + var _this = this; + if (this.subscribed) { + return; + } + this.subscriptionPending = true; + this.subscriptionCancelled = false; + this.authorize(this.pusher.connection.socket_id, function (error, data) { + if (error) { + _this.subscriptionPending = false; + logger.error(error.toString()); + _this.emit('pusher:subscription_error', Object.assign({}, { + type: 'AuthError', + error: error.message + }, error instanceof HTTPAuthError ? { status: error.status } : {})); + } + else { + _this.pusher.send_event('pusher:subscribe', { + auth: data.auth, + channel_data: data.channel_data, + channel: _this.name + }); + } + }); + }; + Channel.prototype.unsubscribe = function () { + this.subscribed = false; + this.pusher.send_event('pusher:unsubscribe', { + channel: this.name + }); + }; + Channel.prototype.cancelSubscription = function () { + this.subscriptionCancelled = true; + }; + Channel.prototype.reinstateSubscription = function () { + this.subscriptionCancelled = false; + }; + return Channel; +}(dispatcher)); +/* harmony default export */ var channels_channel = (channel_Channel); + +// CONCATENATED MODULE: ./src/core/channels/private_channel.ts +var private_channel_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + +var PrivateChannel = (function (_super) { + private_channel_extends(PrivateChannel, _super); + function PrivateChannel() { + return _super !== null && _super.apply(this, arguments) || this; + } + PrivateChannel.prototype.authorize = function (socketId, callback) { + return this.pusher.config.channelAuthorizer({ + channelName: this.name, + socketId: socketId + }, callback); + }; + return PrivateChannel; +}(channels_channel)); +/* harmony default export */ var private_channel = (PrivateChannel); + +// CONCATENATED MODULE: ./src/core/channels/members.ts + +var members_Members = (function () { + function Members() { + this.reset(); + } + Members.prototype.get = function (id) { + if (Object.prototype.hasOwnProperty.call(this.members, id)) { + return { + id: id, + info: this.members[id] + }; + } + else { + return null; + } + }; + Members.prototype.each = function (callback) { + var _this = this; + objectApply(this.members, function (member, id) { + callback(_this.get(id)); + }); + }; + Members.prototype.setMyID = function (id) { + this.myID = id; + }; + Members.prototype.onSubscription = function (subscriptionData) { + this.members = subscriptionData.presence.hash; + this.count = subscriptionData.presence.count; + this.me = this.get(this.myID); + }; + Members.prototype.addMember = function (memberData) { + if (this.get(memberData.user_id) === null) { + this.count++; + } + this.members[memberData.user_id] = memberData.user_info; + return this.get(memberData.user_id); + }; + Members.prototype.removeMember = function (memberData) { + var member = this.get(memberData.user_id); + if (member) { + delete this.members[memberData.user_id]; + this.count--; + } + return member; + }; + Members.prototype.reset = function () { + this.members = {}; + this.count = 0; + this.myID = null; + this.me = null; + }; + return Members; +}()); +/* harmony default export */ var members = (members_Members); + +// CONCATENATED MODULE: ./src/core/channels/presence_channel.ts +var presence_channel_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = ( false) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = ( false) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; + + + + +var presence_channel_PresenceChannel = (function (_super) { + presence_channel_extends(PresenceChannel, _super); + function PresenceChannel(name, pusher) { + var _this = _super.call(this, name, pusher) || this; + _this.members = new members(); + return _this; + } + PresenceChannel.prototype.authorize = function (socketId, callback) { + var _this = this; + _super.prototype.authorize.call(this, socketId, function (error, authData) { return __awaiter(_this, void 0, void 0, function () { + var channelData, suffix; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!!error) return [3, 3]; + authData = authData; + if (!(authData.channel_data != null)) return [3, 1]; + channelData = JSON.parse(authData.channel_data); + this.members.setMyID(channelData.user_id); + return [3, 3]; + case 1: return [4, this.pusher.user.signinDonePromise]; + case 2: + _a.sent(); + if (this.pusher.user.user_data != null) { + this.members.setMyID(this.pusher.user.user_data.id); + } + else { + suffix = url_store.buildLogSuffix('authorizationEndpoint'); + logger.error("Invalid auth response for channel '" + this.name + "', " + + ("expected 'channel_data' field. " + suffix + ", ") + + "or the user should be signed in."); + callback('Invalid auth response'); + return [2]; + } + _a.label = 3; + case 3: + callback(error, authData); + return [2]; + } + }); + }); }); + }; + PresenceChannel.prototype.handleEvent = function (event) { + var eventName = event.event; + if (eventName.indexOf('pusher_internal:') === 0) { + this.handleInternalEvent(event); + } + else { + var data = event.data; + var metadata = {}; + if (event.user_id) { + metadata.user_id = event.user_id; + } + this.emit(eventName, data, metadata); + } + }; + PresenceChannel.prototype.handleInternalEvent = function (event) { + var eventName = event.event; + var data = event.data; + switch (eventName) { + case 'pusher_internal:subscription_succeeded': + this.handleSubscriptionSucceededEvent(event); + break; + case 'pusher_internal:subscription_count': + this.handleSubscriptionCountEvent(event); + break; + case 'pusher_internal:member_added': + var addedMember = this.members.addMember(data); + this.emit('pusher:member_added', addedMember); + break; + case 'pusher_internal:member_removed': + var removedMember = this.members.removeMember(data); + if (removedMember) { + this.emit('pusher:member_removed', removedMember); + } + break; + } + }; + PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) { + this.subscriptionPending = false; + this.subscribed = true; + if (this.subscriptionCancelled) { + this.pusher.unsubscribe(this.name); + } + else { + this.members.onSubscription(event.data); + this.emit('pusher:subscription_succeeded', this.members); + } + }; + PresenceChannel.prototype.disconnect = function () { + this.members.reset(); + _super.prototype.disconnect.call(this); + }; + return PresenceChannel; +}(private_channel)); +/* harmony default export */ var presence_channel = (presence_channel_PresenceChannel); + +// EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js +var utf8 = __nested_webpack_require_20105__(1); + +// EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js +var base64 = __nested_webpack_require_20105__(0); + +// CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts +var encrypted_channel_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +var encrypted_channel_EncryptedChannel = (function (_super) { + encrypted_channel_extends(EncryptedChannel, _super); + function EncryptedChannel(name, pusher, nacl) { + var _this = _super.call(this, name, pusher) || this; + _this.key = null; + _this.nacl = nacl; + return _this; + } + EncryptedChannel.prototype.authorize = function (socketId, callback) { + var _this = this; + _super.prototype.authorize.call(this, socketId, function (error, authData) { + if (error) { + callback(error, authData); + return; + } + var sharedSecret = authData['shared_secret']; + if (!sharedSecret) { + callback(new Error("No shared_secret key in auth payload for encrypted channel: " + _this.name), null); + return; + } + _this.key = Object(base64["decode"])(sharedSecret); + delete authData['shared_secret']; + callback(null, authData); + }); + }; + EncryptedChannel.prototype.trigger = function (event, data) { + throw new UnsupportedFeature('Client events are not currently supported for encrypted channels'); + }; + EncryptedChannel.prototype.handleEvent = function (event) { + var eventName = event.event; + var data = event.data; + if (eventName.indexOf('pusher_internal:') === 0 || + eventName.indexOf('pusher:') === 0) { + _super.prototype.handleEvent.call(this, event); + return; + } + this.handleEncryptedEvent(eventName, data); + }; + EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) { + var _this = this; + if (!this.key) { + logger.debug('Received encrypted event before key has been retrieved from the authEndpoint'); + return; + } + if (!data.ciphertext || !data.nonce) { + logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' + + data); + return; + } + var cipherText = Object(base64["decode"])(data.ciphertext); + if (cipherText.length < this.nacl.secretbox.overheadLength) { + logger.error("Expected encrypted event ciphertext length to be " + this.nacl.secretbox.overheadLength + ", got: " + cipherText.length); + return; + } + var nonce = Object(base64["decode"])(data.nonce); + if (nonce.length < this.nacl.secretbox.nonceLength) { + logger.error("Expected encrypted event nonce length to be " + this.nacl.secretbox.nonceLength + ", got: " + nonce.length); + return; + } + var bytes = this.nacl.secretbox.open(cipherText, nonce, this.key); + if (bytes === null) { + logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...'); + this.authorize(this.pusher.connection.socket_id, function (error, authData) { + if (error) { + logger.error("Failed to make a request to the authEndpoint: " + authData + ". Unable to fetch new key, so dropping encrypted event"); + return; + } + bytes = _this.nacl.secretbox.open(cipherText, nonce, _this.key); + if (bytes === null) { + logger.error("Failed to decrypt event with new key. Dropping encrypted event"); + return; + } + _this.emit(event, _this.getDataToEmit(bytes)); + return; + }); + return; + } + this.emit(event, this.getDataToEmit(bytes)); + }; + EncryptedChannel.prototype.getDataToEmit = function (bytes) { + var raw = Object(utf8["decode"])(bytes); + try { + return JSON.parse(raw); + } + catch (_a) { + return raw; + } + }; + return EncryptedChannel; +}(private_channel)); +/* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel); + +// CONCATENATED MODULE: ./src/core/connection/connection_manager.ts +var connection_manager_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +var connection_manager_ConnectionManager = (function (_super) { + connection_manager_extends(ConnectionManager, _super); + function ConnectionManager(key, options) { + var _this = _super.call(this) || this; + _this.state = 'initialized'; + _this.connection = null; + _this.key = key; + _this.options = options; + _this.timeline = _this.options.timeline; + _this.usingTLS = _this.options.useTLS; + _this.errorCallbacks = _this.buildErrorCallbacks(); + _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks); + _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks); + var Network = runtime.getNetwork(); + Network.bind('online', function () { + _this.timeline.info({ netinfo: 'online' }); + if (_this.state === 'connecting' || _this.state === 'unavailable') { + _this.retryIn(0); + } + }); + Network.bind('offline', function () { + _this.timeline.info({ netinfo: 'offline' }); + if (_this.connection) { + _this.sendActivityCheck(); + } + }); + _this.updateStrategy(); + return _this; + } + ConnectionManager.prototype.connect = function () { + if (this.connection || this.runner) { + return; + } + if (!this.strategy.isSupported()) { + this.updateState('failed'); + return; + } + this.updateState('connecting'); + this.startConnecting(); + this.setUnavailableTimer(); + }; + ConnectionManager.prototype.send = function (data) { + if (this.connection) { + return this.connection.send(data); + } + else { + return false; + } + }; + ConnectionManager.prototype.send_event = function (name, data, channel) { + if (this.connection) { + return this.connection.send_event(name, data, channel); + } + else { + return false; + } + }; + ConnectionManager.prototype.disconnect = function () { + this.disconnectInternally(); + this.updateState('disconnected'); + }; + ConnectionManager.prototype.isUsingTLS = function () { + return this.usingTLS; + }; + ConnectionManager.prototype.startConnecting = function () { + var _this = this; + var callback = function (error, handshake) { + if (error) { + _this.runner = _this.strategy.connect(0, callback); + } + else { + if (handshake.action === 'error') { + _this.emit('error', { + type: 'HandshakeError', + error: handshake.error + }); + _this.timeline.error({ handshakeError: handshake.error }); + } + else { + _this.abortConnecting(); + _this.handshakeCallbacks[handshake.action](handshake); + } + } + }; + this.runner = this.strategy.connect(0, callback); + }; + ConnectionManager.prototype.abortConnecting = function () { + if (this.runner) { + this.runner.abort(); + this.runner = null; + } + }; + ConnectionManager.prototype.disconnectInternally = function () { + this.abortConnecting(); + this.clearRetryTimer(); + this.clearUnavailableTimer(); + if (this.connection) { + var connection = this.abandonConnection(); + connection.close(); + } + }; + ConnectionManager.prototype.updateStrategy = function () { + this.strategy = this.options.getStrategy({ + key: this.key, + timeline: this.timeline, + useTLS: this.usingTLS + }); + }; + ConnectionManager.prototype.retryIn = function (delay) { + var _this = this; + this.timeline.info({ action: 'retry', delay: delay }); + if (delay > 0) { + this.emit('connecting_in', Math.round(delay / 1000)); + } + this.retryTimer = new OneOffTimer(delay || 0, function () { + _this.disconnectInternally(); + _this.connect(); + }); + }; + ConnectionManager.prototype.clearRetryTimer = function () { + if (this.retryTimer) { + this.retryTimer.ensureAborted(); + this.retryTimer = null; + } + }; + ConnectionManager.prototype.setUnavailableTimer = function () { + var _this = this; + this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () { + _this.updateState('unavailable'); + }); + }; + ConnectionManager.prototype.clearUnavailableTimer = function () { + if (this.unavailableTimer) { + this.unavailableTimer.ensureAborted(); + } + }; + ConnectionManager.prototype.sendActivityCheck = function () { + var _this = this; + this.stopActivityCheck(); + this.connection.ping(); + this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () { + _this.timeline.error({ pong_timed_out: _this.options.pongTimeout }); + _this.retryIn(0); + }); + }; + ConnectionManager.prototype.resetActivityCheck = function () { + var _this = this; + this.stopActivityCheck(); + if (this.connection && !this.connection.handlesActivityChecks()) { + this.activityTimer = new OneOffTimer(this.activityTimeout, function () { + _this.sendActivityCheck(); + }); + } + }; + ConnectionManager.prototype.stopActivityCheck = function () { + if (this.activityTimer) { + this.activityTimer.ensureAborted(); + } + }; + ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) { + var _this = this; + return extend({}, errorCallbacks, { + message: function (message) { + _this.resetActivityCheck(); + _this.emit('message', message); + }, + ping: function () { + _this.send_event('pusher:pong', {}); + }, + activity: function () { + _this.resetActivityCheck(); + }, + error: function (error) { + _this.emit('error', error); + }, + closed: function () { + _this.abandonConnection(); + if (_this.shouldRetry()) { + _this.retryIn(1000); + } + } + }); + }; + ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) { + var _this = this; + return extend({}, errorCallbacks, { + connected: function (handshake) { + _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity); + _this.clearUnavailableTimer(); + _this.setConnection(handshake.connection); + _this.socket_id = _this.connection.id; + _this.updateState('connected', { socket_id: _this.socket_id }); + } + }); + }; + ConnectionManager.prototype.buildErrorCallbacks = function () { + var _this = this; + var withErrorEmitted = function (callback) { + return function (result) { + if (result.error) { + _this.emit('error', { type: 'WebSocketError', error: result.error }); + } + callback(result); + }; + }; + return { + tls_only: withErrorEmitted(function () { + _this.usingTLS = true; + _this.updateStrategy(); + _this.retryIn(0); + }), + refused: withErrorEmitted(function () { + _this.disconnect(); + }), + backoff: withErrorEmitted(function () { + _this.retryIn(1000); + }), + retry: withErrorEmitted(function () { + _this.retryIn(0); + }) + }; + }; + ConnectionManager.prototype.setConnection = function (connection) { + this.connection = connection; + for (var event in this.connectionCallbacks) { + this.connection.bind(event, this.connectionCallbacks[event]); + } + this.resetActivityCheck(); + }; + ConnectionManager.prototype.abandonConnection = function () { + if (!this.connection) { + return; + } + this.stopActivityCheck(); + for (var event in this.connectionCallbacks) { + this.connection.unbind(event, this.connectionCallbacks[event]); + } + var connection = this.connection; + this.connection = null; + return connection; + }; + ConnectionManager.prototype.updateState = function (newState, data) { + var previousState = this.state; + this.state = newState; + if (previousState !== newState) { + var newStateDescription = newState; + if (newStateDescription === 'connected') { + newStateDescription += ' with new socket ID ' + data.socket_id; + } + logger.debug('State changed', previousState + ' -> ' + newStateDescription); + this.timeline.info({ state: newState, params: data }); + this.emit('state_change', { previous: previousState, current: newState }); + this.emit(newState, data); + } + }; + ConnectionManager.prototype.shouldRetry = function () { + return this.state === 'connecting' || this.state === 'connected'; + }; + return ConnectionManager; +}(dispatcher)); +/* harmony default export */ var connection_manager = (connection_manager_ConnectionManager); + +// CONCATENATED MODULE: ./src/core/channels/channels.ts + + + + +var channels_Channels = (function () { + function Channels() { + this.channels = {}; + } + Channels.prototype.add = function (name, pusher) { + if (!this.channels[name]) { + this.channels[name] = createChannel(name, pusher); + } + return this.channels[name]; + }; + Channels.prototype.all = function () { + return values(this.channels); + }; + Channels.prototype.find = function (name) { + return this.channels[name]; + }; + Channels.prototype.remove = function (name) { + var channel = this.channels[name]; + delete this.channels[name]; + return channel; + }; + Channels.prototype.disconnect = function () { + objectApply(this.channels, function (channel) { + channel.disconnect(); + }); + }; + return Channels; +}()); +/* harmony default export */ var channels = (channels_Channels); +function createChannel(name, pusher) { + if (name.indexOf('private-encrypted-') === 0) { + if (pusher.config.nacl) { + return factory.createEncryptedChannel(name, pusher, pusher.config.nacl); + } + var errMsg = 'Tried to subscribe to a private-encrypted- channel but no nacl implementation available'; + var suffix = url_store.buildLogSuffix('encryptedChannelSupport'); + throw new UnsupportedFeature(errMsg + ". " + suffix); + } + else if (name.indexOf('private-') === 0) { + return factory.createPrivateChannel(name, pusher); + } + else if (name.indexOf('presence-') === 0) { + return factory.createPresenceChannel(name, pusher); + } + else if (name.indexOf('#') === 0) { + throw new BadChannelName('Cannot create a channel with name "' + name + '".'); + } + else { + return factory.createChannel(name, pusher); + } +} + +// CONCATENATED MODULE: ./src/core/utils/factory.ts + + + + + + + + + +var Factory = { + createChannels: function () { + return new channels(); + }, + createConnectionManager: function (key, options) { + return new connection_manager(key, options); + }, + createChannel: function (name, pusher) { + return new channels_channel(name, pusher); + }, + createPrivateChannel: function (name, pusher) { + return new private_channel(name, pusher); + }, + createPresenceChannel: function (name, pusher) { + return new presence_channel(name, pusher); + }, + createEncryptedChannel: function (name, pusher, nacl) { + return new encrypted_channel(name, pusher, nacl); + }, + createTimelineSender: function (timeline, options) { + return new timeline_sender(timeline, options); + }, + createHandshake: function (transport, callback) { + return new connection_handshake(transport, callback); + }, + createAssistantToTheTransportManager: function (manager, transport, options) { + return new assistant_to_the_transport_manager(manager, transport, options); + } +}; +/* harmony default export */ var factory = (Factory); + +// CONCATENATED MODULE: ./src/core/transports/transport_manager.ts + +var transport_manager_TransportManager = (function () { + function TransportManager(options) { + this.options = options || {}; + this.livesLeft = this.options.lives || Infinity; + } + TransportManager.prototype.getAssistant = function (transport) { + return factory.createAssistantToTheTransportManager(this, transport, { + minPingDelay: this.options.minPingDelay, + maxPingDelay: this.options.maxPingDelay + }); + }; + TransportManager.prototype.isAlive = function () { + return this.livesLeft > 0; + }; + TransportManager.prototype.reportDeath = function () { + this.livesLeft -= 1; + }; + return TransportManager; +}()); +/* harmony default export */ var transport_manager = (transport_manager_TransportManager); + +// CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts + + + +var sequential_strategy_SequentialStrategy = (function () { + function SequentialStrategy(strategies, options) { + this.strategies = strategies; + this.loop = Boolean(options.loop); + this.failFast = Boolean(options.failFast); + this.timeout = options.timeout; + this.timeoutLimit = options.timeoutLimit; + } + SequentialStrategy.prototype.isSupported = function () { + return any(this.strategies, util.method('isSupported')); + }; + SequentialStrategy.prototype.connect = function (minPriority, callback) { + var _this = this; + var strategies = this.strategies; + var current = 0; + var timeout = this.timeout; + var runner = null; + var tryNextStrategy = function (error, handshake) { + if (handshake) { + callback(null, handshake); + } + else { + current = current + 1; + if (_this.loop) { + current = current % strategies.length; + } + if (current < strategies.length) { + if (timeout) { + timeout = timeout * 2; + if (_this.timeoutLimit) { + timeout = Math.min(timeout, _this.timeoutLimit); + } + } + runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy); + } + else { + callback(true); + } + } + }; + runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy); + return { + abort: function () { + runner.abort(); + }, + forceMinPriority: function (p) { + minPriority = p; + if (runner) { + runner.forceMinPriority(p); + } + } + }; + }; + SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) { + var timer = null; + var runner = null; + if (options.timeout > 0) { + timer = new OneOffTimer(options.timeout, function () { + runner.abort(); + callback(true); + }); + } + runner = strategy.connect(minPriority, function (error, handshake) { + if (error && timer && timer.isRunning() && !options.failFast) { + return; + } + if (timer) { + timer.ensureAborted(); + } + callback(error, handshake); + }); + return { + abort: function () { + if (timer) { + timer.ensureAborted(); + } + runner.abort(); + }, + forceMinPriority: function (p) { + runner.forceMinPriority(p); + } + }; + }; + return SequentialStrategy; +}()); +/* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy); + +// CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts + + +var best_connected_ever_strategy_BestConnectedEverStrategy = (function () { + function BestConnectedEverStrategy(strategies) { + this.strategies = strategies; + } + BestConnectedEverStrategy.prototype.isSupported = function () { + return any(this.strategies, util.method('isSupported')); + }; + BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) { + return connect(this.strategies, minPriority, function (i, runners) { + return function (error, handshake) { + runners[i].error = error; + if (error) { + if (allRunnersFailed(runners)) { + callback(true); + } + return; + } + apply(runners, function (runner) { + runner.forceMinPriority(handshake.transport.priority); + }); + callback(null, handshake); + }; + }); + }; + return BestConnectedEverStrategy; +}()); +/* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy); +function connect(strategies, minPriority, callbackBuilder) { + var runners = map(strategies, function (strategy, i, _, rs) { + return strategy.connect(minPriority, callbackBuilder(i, rs)); + }); + return { + abort: function () { + apply(runners, abortRunner); + }, + forceMinPriority: function (p) { + apply(runners, function (runner) { + runner.forceMinPriority(p); + }); + } + }; +} +function allRunnersFailed(runners) { + return collections_all(runners, function (runner) { + return Boolean(runner.error); + }); +} +function abortRunner(runner) { + if (!runner.error && !runner.aborted) { + runner.abort(); + runner.aborted = true; + } +} + +// CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts + + + + +var cached_strategy_CachedStrategy = (function () { + function CachedStrategy(strategy, transports, options) { + this.strategy = strategy; + this.transports = transports; + this.ttl = options.ttl || 1800 * 1000; + this.usingTLS = options.useTLS; + this.timeline = options.timeline; + } + CachedStrategy.prototype.isSupported = function () { + return this.strategy.isSupported(); + }; + CachedStrategy.prototype.connect = function (minPriority, callback) { + var usingTLS = this.usingTLS; + var info = fetchTransportCache(usingTLS); + var strategies = [this.strategy]; + if (info && info.timestamp + this.ttl >= util.now()) { + var transport = this.transports[info.transport]; + if (transport) { + this.timeline.info({ + cached: true, + transport: info.transport, + latency: info.latency + }); + strategies.push(new sequential_strategy([transport], { + timeout: info.latency * 2 + 1000, + failFast: true + })); + } + } + var startTimestamp = util.now(); + var runner = strategies + .pop() + .connect(minPriority, function cb(error, handshake) { + if (error) { + flushTransportCache(usingTLS); + if (strategies.length > 0) { + startTimestamp = util.now(); + runner = strategies.pop().connect(minPriority, cb); + } + else { + callback(error); + } + } + else { + storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp); + callback(null, handshake); + } + }); + return { + abort: function () { + runner.abort(); + }, + forceMinPriority: function (p) { + minPriority = p; + if (runner) { + runner.forceMinPriority(p); + } + } + }; + }; + return CachedStrategy; +}()); +/* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy); +function getTransportCacheKey(usingTLS) { + return 'pusherTransport' + (usingTLS ? 'TLS' : 'NonTLS'); +} +function fetchTransportCache(usingTLS) { + var storage = runtime.getLocalStorage(); + if (storage) { + try { + var serializedCache = storage[getTransportCacheKey(usingTLS)]; + if (serializedCache) { + return JSON.parse(serializedCache); + } + } + catch (e) { + flushTransportCache(usingTLS); + } + } + return null; +} +function storeTransportCache(usingTLS, transport, latency) { + var storage = runtime.getLocalStorage(); + if (storage) { + try { + storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({ + timestamp: util.now(), + transport: transport, + latency: latency + }); + } + catch (e) { + } + } +} +function flushTransportCache(usingTLS) { + var storage = runtime.getLocalStorage(); + if (storage) { + try { + delete storage[getTransportCacheKey(usingTLS)]; + } + catch (e) { + } + } +} + +// CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts + +var delayed_strategy_DelayedStrategy = (function () { + function DelayedStrategy(strategy, _a) { + var number = _a.delay; + this.strategy = strategy; + this.options = { delay: number }; + } + DelayedStrategy.prototype.isSupported = function () { + return this.strategy.isSupported(); + }; + DelayedStrategy.prototype.connect = function (minPriority, callback) { + var strategy = this.strategy; + var runner; + var timer = new OneOffTimer(this.options.delay, function () { + runner = strategy.connect(minPriority, callback); + }); + return { + abort: function () { + timer.ensureAborted(); + if (runner) { + runner.abort(); + } + }, + forceMinPriority: function (p) { + minPriority = p; + if (runner) { + runner.forceMinPriority(p); + } + } + }; + }; + return DelayedStrategy; +}()); +/* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy); + +// CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts +var IfStrategy = (function () { + function IfStrategy(test, trueBranch, falseBranch) { + this.test = test; + this.trueBranch = trueBranch; + this.falseBranch = falseBranch; + } + IfStrategy.prototype.isSupported = function () { + var branch = this.test() ? this.trueBranch : this.falseBranch; + return branch.isSupported(); + }; + IfStrategy.prototype.connect = function (minPriority, callback) { + var branch = this.test() ? this.trueBranch : this.falseBranch; + return branch.connect(minPriority, callback); + }; + return IfStrategy; +}()); +/* harmony default export */ var if_strategy = (IfStrategy); + +// CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts +var FirstConnectedStrategy = (function () { + function FirstConnectedStrategy(strategy) { + this.strategy = strategy; + } + FirstConnectedStrategy.prototype.isSupported = function () { + return this.strategy.isSupported(); + }; + FirstConnectedStrategy.prototype.connect = function (minPriority, callback) { + var runner = this.strategy.connect(minPriority, function (error, handshake) { + if (handshake) { + runner.abort(); + } + callback(error, handshake); + }); + return runner; + }; + return FirstConnectedStrategy; +}()); +/* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy); + +// CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts + + + + + + + +function testSupportsStrategy(strategy) { + return function () { + return strategy.isSupported(); + }; +} +var getDefaultStrategy = function (config, baseOptions, defineTransport) { + var definedTransports = {}; + function defineTransportStrategy(name, type, priority, options, manager) { + var transport = defineTransport(config, name, type, priority, options, manager); + definedTransports[name] = transport; + return transport; + } + var ws_options = Object.assign({}, baseOptions, { + hostNonTLS: config.wsHost + ':' + config.wsPort, + hostTLS: config.wsHost + ':' + config.wssPort, + httpPath: config.wsPath + }); + var wss_options = Object.assign({}, ws_options, { + useTLS: true + }); + var sockjs_options = Object.assign({}, baseOptions, { + hostNonTLS: config.httpHost + ':' + config.httpPort, + hostTLS: config.httpHost + ':' + config.httpsPort, + httpPath: config.httpPath + }); + var timeouts = { + loop: true, + timeout: 15000, + timeoutLimit: 60000 + }; + var ws_manager = new transport_manager({ + lives: 2, + minPingDelay: 10000, + maxPingDelay: config.activityTimeout + }); + var streaming_manager = new transport_manager({ + lives: 2, + minPingDelay: 10000, + maxPingDelay: config.activityTimeout + }); + var ws_transport = defineTransportStrategy('ws', 'ws', 3, ws_options, ws_manager); + var wss_transport = defineTransportStrategy('wss', 'ws', 3, wss_options, ws_manager); + var sockjs_transport = defineTransportStrategy('sockjs', 'sockjs', 1, sockjs_options); + var xhr_streaming_transport = defineTransportStrategy('xhr_streaming', 'xhr_streaming', 1, sockjs_options, streaming_manager); + var xdr_streaming_transport = defineTransportStrategy('xdr_streaming', 'xdr_streaming', 1, sockjs_options, streaming_manager); + var xhr_polling_transport = defineTransportStrategy('xhr_polling', 'xhr_polling', 1, sockjs_options); + var xdr_polling_transport = defineTransportStrategy('xdr_polling', 'xdr_polling', 1, sockjs_options); + var ws_loop = new sequential_strategy([ws_transport], timeouts); + var wss_loop = new sequential_strategy([wss_transport], timeouts); + var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts); + var streaming_loop = new sequential_strategy([ + new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport) + ], timeouts); + var polling_loop = new sequential_strategy([ + new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport) + ], timeouts); + var http_loop = new sequential_strategy([ + new if_strategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy([ + streaming_loop, + new delayed_strategy(polling_loop, { delay: 4000 }) + ]), polling_loop) + ], timeouts); + var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop); + var wsStrategy; + if (baseOptions.useTLS) { + wsStrategy = new best_connected_ever_strategy([ + ws_loop, + new delayed_strategy(http_fallback_loop, { delay: 2000 }) + ]); + } + else { + wsStrategy = new best_connected_ever_strategy([ + ws_loop, + new delayed_strategy(wss_loop, { delay: 2000 }), + new delayed_strategy(http_fallback_loop, { delay: 5000 }) + ]); + } + return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, { + ttl: 1800000, + timeline: baseOptions.timeline, + useTLS: baseOptions.useTLS + }); +}; +/* harmony default export */ var default_strategy = (getDefaultStrategy); + +// CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts + +/* harmony default export */ var transport_connection_initializer = (function () { + var self = this; + self.timeline.info(self.buildTimelineMessage({ + transport: self.name + (self.options.useTLS ? 's' : '') + })); + if (self.hooks.isInitialized()) { + self.changeState('initialized'); + } + else if (self.hooks.file) { + self.changeState('initializing'); + Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) { + if (self.hooks.isInitialized()) { + self.changeState('initialized'); + callback(true); + } + else { + if (error) { + self.onError(error); + } + self.onClose(); + callback(false); + } + }); + } + else { + self.onClose(); + } +}); + +// CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts + +var http_xdomain_request_hooks = { + getRequest: function (socket) { + var xdr = new window.XDomainRequest(); + xdr.ontimeout = function () { + socket.emit('error', new RequestTimedOut()); + socket.close(); + }; + xdr.onerror = function (e) { + socket.emit('error', e); + socket.close(); + }; + xdr.onprogress = function () { + if (xdr.responseText && xdr.responseText.length > 0) { + socket.onChunk(200, xdr.responseText); + } + }; + xdr.onload = function () { + if (xdr.responseText && xdr.responseText.length > 0) { + socket.onChunk(200, xdr.responseText); + } + socket.emit('finished', 200); + socket.close(); + }; + return xdr; + }, + abortRequest: function (xdr) { + xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null; + xdr.abort(); + } +}; +/* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks); + +// CONCATENATED MODULE: ./src/core/http/http_request.ts +var http_request_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + +var MAX_BUFFER_LENGTH = 256 * 1024; +var http_request_HTTPRequest = (function (_super) { + http_request_extends(HTTPRequest, _super); + function HTTPRequest(hooks, method, url) { + var _this = _super.call(this) || this; + _this.hooks = hooks; + _this.method = method; + _this.url = url; + return _this; + } + HTTPRequest.prototype.start = function (payload) { + var _this = this; + this.position = 0; + this.xhr = this.hooks.getRequest(this); + this.unloader = function () { + _this.close(); + }; + runtime.addUnloadListener(this.unloader); + this.xhr.open(this.method, this.url, true); + if (this.xhr.setRequestHeader) { + this.xhr.setRequestHeader('Content-Type', 'application/json'); + } + this.xhr.send(payload); + }; + HTTPRequest.prototype.close = function () { + if (this.unloader) { + runtime.removeUnloadListener(this.unloader); + this.unloader = null; + } + if (this.xhr) { + this.hooks.abortRequest(this.xhr); + this.xhr = null; + } + }; + HTTPRequest.prototype.onChunk = function (status, data) { + while (true) { + var chunk = this.advanceBuffer(data); + if (chunk) { + this.emit('chunk', { status: status, data: chunk }); + } + else { + break; + } + } + if (this.isBufferTooLong(data)) { + this.emit('buffer_too_long'); + } + }; + HTTPRequest.prototype.advanceBuffer = function (buffer) { + var unreadData = buffer.slice(this.position); + var endOfLinePosition = unreadData.indexOf('\n'); + if (endOfLinePosition !== -1) { + this.position += endOfLinePosition + 1; + return unreadData.slice(0, endOfLinePosition); + } + else { + return null; + } + }; + HTTPRequest.prototype.isBufferTooLong = function (buffer) { + return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH; + }; + return HTTPRequest; +}(dispatcher)); +/* harmony default export */ var http_request = (http_request_HTTPRequest); + +// CONCATENATED MODULE: ./src/core/http/state.ts +var State; +(function (State) { + State[State["CONNECTING"] = 0] = "CONNECTING"; + State[State["OPEN"] = 1] = "OPEN"; + State[State["CLOSED"] = 3] = "CLOSED"; +})(State || (State = {})); +/* harmony default export */ var state = (State); + +// CONCATENATED MODULE: ./src/core/http/http_socket.ts + + + +var autoIncrement = 1; +var http_socket_HTTPSocket = (function () { + function HTTPSocket(hooks, url) { + this.hooks = hooks; + this.session = randomNumber(1000) + '/' + randomString(8); + this.location = getLocation(url); + this.readyState = state.CONNECTING; + this.openStream(); + } + HTTPSocket.prototype.send = function (payload) { + return this.sendRaw(JSON.stringify([payload])); + }; + HTTPSocket.prototype.ping = function () { + this.hooks.sendHeartbeat(this); + }; + HTTPSocket.prototype.close = function (code, reason) { + this.onClose(code, reason, true); + }; + HTTPSocket.prototype.sendRaw = function (payload) { + if (this.readyState === state.OPEN) { + try { + runtime.createSocketRequest('POST', getUniqueURL(getSendURL(this.location, this.session))).start(payload); + return true; + } + catch (e) { + return false; + } + } + else { + return false; + } + }; + HTTPSocket.prototype.reconnect = function () { + this.closeStream(); + this.openStream(); + }; + HTTPSocket.prototype.onClose = function (code, reason, wasClean) { + this.closeStream(); + this.readyState = state.CLOSED; + if (this.onclose) { + this.onclose({ + code: code, + reason: reason, + wasClean: wasClean + }); + } + }; + HTTPSocket.prototype.onChunk = function (chunk) { + if (chunk.status !== 200) { + return; + } + if (this.readyState === state.OPEN) { + this.onActivity(); + } + var payload; + var type = chunk.data.slice(0, 1); + switch (type) { + case 'o': + payload = JSON.parse(chunk.data.slice(1) || '{}'); + this.onOpen(payload); + break; + case 'a': + payload = JSON.parse(chunk.data.slice(1) || '[]'); + for (var i = 0; i < payload.length; i++) { + this.onEvent(payload[i]); + } + break; + case 'm': + payload = JSON.parse(chunk.data.slice(1) || 'null'); + this.onEvent(payload); + break; + case 'h': + this.hooks.onHeartbeat(this); + break; + case 'c': + payload = JSON.parse(chunk.data.slice(1) || '[]'); + this.onClose(payload[0], payload[1], true); + break; + } + }; + HTTPSocket.prototype.onOpen = function (options) { + if (this.readyState === state.CONNECTING) { + if (options && options.hostname) { + this.location.base = replaceHost(this.location.base, options.hostname); + } + this.readyState = state.OPEN; + if (this.onopen) { + this.onopen(); + } + } + else { + this.onClose(1006, 'Server lost session', true); + } + }; + HTTPSocket.prototype.onEvent = function (event) { + if (this.readyState === state.OPEN && this.onmessage) { + this.onmessage({ data: event }); + } + }; + HTTPSocket.prototype.onActivity = function () { + if (this.onactivity) { + this.onactivity(); + } + }; + HTTPSocket.prototype.onError = function (error) { + if (this.onerror) { + this.onerror(error); + } + }; + HTTPSocket.prototype.openStream = function () { + var _this = this; + this.stream = runtime.createSocketRequest('POST', getUniqueURL(this.hooks.getReceiveURL(this.location, this.session))); + this.stream.bind('chunk', function (chunk) { + _this.onChunk(chunk); + }); + this.stream.bind('finished', function (status) { + _this.hooks.onFinished(_this, status); + }); + this.stream.bind('buffer_too_long', function () { + _this.reconnect(); + }); + try { + this.stream.start(); + } + catch (error) { + util.defer(function () { + _this.onError(error); + _this.onClose(1006, 'Could not start streaming', false); + }); + } + }; + HTTPSocket.prototype.closeStream = function () { + if (this.stream) { + this.stream.unbind_all(); + this.stream.close(); + this.stream = null; + } + }; + return HTTPSocket; +}()); +function getLocation(url) { + var parts = /([^\?]*)\/*(\??.*)/.exec(url); + return { + base: parts[1], + queryString: parts[2] + }; +} +function getSendURL(url, session) { + return url.base + '/' + session + '/xhr_send'; +} +function getUniqueURL(url) { + var separator = url.indexOf('?') === -1 ? '?' : '&'; + return url + separator + 't=' + +new Date() + '&n=' + autoIncrement++; +} +function replaceHost(url, hostname) { + var urlParts = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(url); + return urlParts[1] + hostname + urlParts[3]; +} +function randomNumber(max) { + return runtime.randomInt(max); +} +function randomString(length) { + var result = []; + for (var i = 0; i < length; i++) { + result.push(randomNumber(32).toString(32)); + } + return result.join(''); +} +/* harmony default export */ var http_socket = (http_socket_HTTPSocket); + +// CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts +var http_streaming_socket_hooks = { + getReceiveURL: function (url, session) { + return url.base + '/' + session + '/xhr_streaming' + url.queryString; + }, + onHeartbeat: function (socket) { + socket.sendRaw('[]'); + }, + sendHeartbeat: function (socket) { + socket.sendRaw('[]'); + }, + onFinished: function (socket, status) { + socket.onClose(1006, 'Connection interrupted (' + status + ')', false); + } +}; +/* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks); + +// CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts +var http_polling_socket_hooks = { + getReceiveURL: function (url, session) { + return url.base + '/' + session + '/xhr' + url.queryString; + }, + onHeartbeat: function () { + }, + sendHeartbeat: function (socket) { + socket.sendRaw('[]'); + }, + onFinished: function (socket, status) { + if (status === 200) { + socket.reconnect(); + } + else { + socket.onClose(1006, 'Connection interrupted (' + status + ')', false); + } + } +}; +/* harmony default export */ var http_polling_socket = (http_polling_socket_hooks); + +// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts + +var http_xhr_request_hooks = { + getRequest: function (socket) { + var Constructor = runtime.getXHRAPI(); + var xhr = new Constructor(); + xhr.onreadystatechange = xhr.onprogress = function () { + switch (xhr.readyState) { + case 3: + if (xhr.responseText && xhr.responseText.length > 0) { + socket.onChunk(xhr.status, xhr.responseText); + } + break; + case 4: + if (xhr.responseText && xhr.responseText.length > 0) { + socket.onChunk(xhr.status, xhr.responseText); + } + socket.emit('finished', xhr.status); + socket.close(); + break; + } + }; + return xhr; + }, + abortRequest: function (xhr) { + xhr.onreadystatechange = null; + xhr.abort(); + } +}; +/* harmony default export */ var http_xhr_request = (http_xhr_request_hooks); + +// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts + + + + + +var HTTP = { + createStreamingSocket: function (url) { + return this.createSocket(http_streaming_socket, url); + }, + createPollingSocket: function (url) { + return this.createSocket(http_polling_socket, url); + }, + createSocket: function (hooks, url) { + return new http_socket(hooks, url); + }, + createXHR: function (method, url) { + return this.createRequest(http_xhr_request, method, url); + }, + createRequest: function (hooks, method, url) { + return new http_request(hooks, method, url); + } +}; +/* harmony default export */ var http_http = (HTTP); + +// CONCATENATED MODULE: ./src/runtimes/web/http/http.ts + + +http_http.createXDR = function (method, url) { + return this.createRequest(http_xdomain_request, method, url); +}; +/* harmony default export */ var web_http_http = (http_http); + +// CONCATENATED MODULE: ./src/runtimes/web/runtime.ts + + + + + + + + + + + + +var Runtime = { + nextAuthCallbackID: 1, + auth_callbacks: {}, + ScriptReceivers: ScriptReceivers, + DependenciesReceivers: DependenciesReceivers, + getDefaultStrategy: default_strategy, + Transports: transports_transports, + transportConnectionInitializer: transport_connection_initializer, + HTTPFactory: web_http_http, + TimelineTransport: jsonp_timeline, + getXHRAPI: function () { + return window.XMLHttpRequest; + }, + getWebSocketAPI: function () { + return window.WebSocket || window.MozWebSocket; + }, + setup: function (PusherClass) { + var _this = this; + window.Pusher = PusherClass; + var initializeOnDocumentBody = function () { + _this.onDocumentBody(PusherClass.ready); + }; + if (!window.JSON) { + Dependencies.load('json2', {}, initializeOnDocumentBody); + } + else { + initializeOnDocumentBody(); + } + }, + getDocument: function () { + return document; + }, + getProtocol: function () { + return this.getDocument().location.protocol; + }, + getAuthorizers: function () { + return { ajax: xhr_auth, jsonp: jsonp_auth }; + }, + onDocumentBody: function (callback) { + var _this = this; + if (document.body) { + callback(); + } + else { + setTimeout(function () { + _this.onDocumentBody(callback); + }, 0); + } + }, + createJSONPRequest: function (url, data) { + return new jsonp_request(url, data); + }, + createScriptRequest: function (src) { + return new script_request(src); + }, + getLocalStorage: function () { + try { + return window.localStorage; + } + catch (e) { + return undefined; + } + }, + createXHR: function () { + if (this.getXHRAPI()) { + return this.createXMLHttpRequest(); + } + else { + return this.createMicrosoftXHR(); + } + }, + createXMLHttpRequest: function () { + var Constructor = this.getXHRAPI(); + return new Constructor(); + }, + createMicrosoftXHR: function () { + return new ActiveXObject('Microsoft.XMLHTTP'); + }, + getNetwork: function () { + return net_info_Network; + }, + createWebSocket: function (url) { + var Constructor = this.getWebSocketAPI(); + return new Constructor(url); + }, + createSocketRequest: function (method, url) { + if (this.isXHRSupported()) { + return this.HTTPFactory.createXHR(method, url); + } + else if (this.isXDRSupported(url.indexOf('https:') === 0)) { + return this.HTTPFactory.createXDR(method, url); + } + else { + throw 'Cross-origin HTTP requests are not supported'; + } + }, + isXHRSupported: function () { + var Constructor = this.getXHRAPI(); + return (Boolean(Constructor) && new Constructor().withCredentials !== undefined); + }, + isXDRSupported: function (useTLS) { + var protocol = useTLS ? 'https:' : 'http:'; + var documentProtocol = this.getProtocol(); + return (Boolean(window['XDomainRequest']) && documentProtocol === protocol); + }, + addUnloadListener: function (listener) { + if (window.addEventListener !== undefined) { + window.addEventListener('unload', listener, false); + } + else if (window.attachEvent !== undefined) { + window.attachEvent('onunload', listener); + } + }, + removeUnloadListener: function (listener) { + if (window.addEventListener !== undefined) { + window.removeEventListener('unload', listener, false); + } + else if (window.detachEvent !== undefined) { + window.detachEvent('onunload', listener); + } + }, + randomInt: function (max) { + var random = function () { + var crypto = window.crypto || window['msCrypto']; + var random = crypto.getRandomValues(new Uint32Array(1))[0]; + return random / Math.pow(2, 32); + }; + return Math.floor(random() * max); + } +}; +/* harmony default export */ var runtime = (Runtime); + +// CONCATENATED MODULE: ./src/core/timeline/level.ts +var TimelineLevel; +(function (TimelineLevel) { + TimelineLevel[TimelineLevel["ERROR"] = 3] = "ERROR"; + TimelineLevel[TimelineLevel["INFO"] = 6] = "INFO"; + TimelineLevel[TimelineLevel["DEBUG"] = 7] = "DEBUG"; +})(TimelineLevel || (TimelineLevel = {})); +/* harmony default export */ var timeline_level = (TimelineLevel); + +// CONCATENATED MODULE: ./src/core/timeline/timeline.ts + + + +var timeline_Timeline = (function () { + function Timeline(key, session, options) { + this.key = key; + this.session = session; + this.events = []; + this.options = options || {}; + this.sent = 0; + this.uniqueID = 0; + } + Timeline.prototype.log = function (level, event) { + if (level <= this.options.level) { + this.events.push(extend({}, event, { timestamp: util.now() })); + if (this.options.limit && this.events.length > this.options.limit) { + this.events.shift(); + } + } + }; + Timeline.prototype.error = function (event) { + this.log(timeline_level.ERROR, event); + }; + Timeline.prototype.info = function (event) { + this.log(timeline_level.INFO, event); + }; + Timeline.prototype.debug = function (event) { + this.log(timeline_level.DEBUG, event); + }; + Timeline.prototype.isEmpty = function () { + return this.events.length === 0; + }; + Timeline.prototype.send = function (sendfn, callback) { + var _this = this; + var data = extend({ + session: this.session, + bundle: this.sent + 1, + key: this.key, + lib: 'js', + version: this.options.version, + cluster: this.options.cluster, + features: this.options.features, + timeline: this.events + }, this.options.params); + this.events = []; + sendfn(data, function (error, result) { + if (!error) { + _this.sent++; + } + if (callback) { + callback(error, result); + } + }); + return true; + }; + Timeline.prototype.generateUniqueID = function () { + this.uniqueID++; + return this.uniqueID; + }; + return Timeline; +}()); +/* harmony default export */ var timeline_timeline = (timeline_Timeline); + +// CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts + + + + +var transport_strategy_TransportStrategy = (function () { + function TransportStrategy(name, priority, transport, options) { + this.name = name; + this.priority = priority; + this.transport = transport; + this.options = options || {}; + } + TransportStrategy.prototype.isSupported = function () { + return this.transport.isSupported({ + useTLS: this.options.useTLS + }); + }; + TransportStrategy.prototype.connect = function (minPriority, callback) { + var _this = this; + if (!this.isSupported()) { + return failAttempt(new UnsupportedStrategy(), callback); + } + else if (this.priority < minPriority) { + return failAttempt(new TransportPriorityTooLow(), callback); + } + var connected = false; + var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options); + var handshake = null; + var onInitialized = function () { + transport.unbind('initialized', onInitialized); + transport.connect(); + }; + var onOpen = function () { + handshake = factory.createHandshake(transport, function (result) { + connected = true; + unbindListeners(); + callback(null, result); + }); + }; + var onError = function (error) { + unbindListeners(); + callback(error); + }; + var onClosed = function () { + unbindListeners(); + var serializedTransport; + serializedTransport = safeJSONStringify(transport); + callback(new TransportClosed(serializedTransport)); + }; + var unbindListeners = function () { + transport.unbind('initialized', onInitialized); + transport.unbind('open', onOpen); + transport.unbind('error', onError); + transport.unbind('closed', onClosed); + }; + transport.bind('initialized', onInitialized); + transport.bind('open', onOpen); + transport.bind('error', onError); + transport.bind('closed', onClosed); + transport.initialize(); + return { + abort: function () { + if (connected) { + return; + } + unbindListeners(); + if (handshake) { + handshake.close(); + } + else { + transport.close(); + } + }, + forceMinPriority: function (p) { + if (connected) { + return; + } + if (_this.priority < p) { + if (handshake) { + handshake.close(); + } + else { + transport.close(); + } + } + } + }; + }; + return TransportStrategy; +}()); +/* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy); +function failAttempt(error, callback) { + util.defer(function () { + callback(error); + }); + return { + abort: function () { }, + forceMinPriority: function () { } + }; +} + +// CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts + + + + + +var strategy_builder_Transports = runtime.Transports; +var strategy_builder_defineTransport = function (config, name, type, priority, options, manager) { + var transportClass = strategy_builder_Transports[type]; + if (!transportClass) { + throw new UnsupportedTransport(type); + } + var enabled = (!config.enabledTransports || + arrayIndexOf(config.enabledTransports, name) !== -1) && + (!config.disabledTransports || + arrayIndexOf(config.disabledTransports, name) === -1); + var transport; + if (enabled) { + options = Object.assign({ ignoreNullOrigin: config.ignoreNullOrigin }, options); + transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options); + } + else { + transport = strategy_builder_UnsupportedStrategy; + } + return transport; +}; +var strategy_builder_UnsupportedStrategy = { + isSupported: function () { + return false; + }, + connect: function (_, callback) { + var deferred = util.defer(function () { + callback(new UnsupportedStrategy()); + }); + return { + abort: function () { + deferred.ensureAborted(); + }, + forceMinPriority: function () { } + }; + } +}; + +// CONCATENATED MODULE: ./src/core/auth/user_authenticator.ts + + +var composeChannelQuery = function (params, authOptions) { + var query = 'socket_id=' + encodeURIComponent(params.socketId); + for (var key in authOptions.params) { + query += + '&' + + encodeURIComponent(key) + + '=' + + encodeURIComponent(authOptions.params[key]); + } + if (authOptions.paramsProvider != null) { + var dynamicParams = authOptions.paramsProvider(); + for (var key in dynamicParams) { + query += + '&' + + encodeURIComponent(key) + + '=' + + encodeURIComponent(dynamicParams[key]); + } + } + return query; +}; +var UserAuthenticator = function (authOptions) { + if (typeof runtime.getAuthorizers()[authOptions.transport] === 'undefined') { + throw "'" + authOptions.transport + "' is not a recognized auth transport"; + } + return function (params, callback) { + var query = composeChannelQuery(params, authOptions); + runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.UserAuthentication, callback); + }; +}; +/* harmony default export */ var user_authenticator = (UserAuthenticator); + +// CONCATENATED MODULE: ./src/core/auth/channel_authorizer.ts + + +var channel_authorizer_composeChannelQuery = function (params, authOptions) { + var query = 'socket_id=' + encodeURIComponent(params.socketId); + query += '&channel_name=' + encodeURIComponent(params.channelName); + for (var key in authOptions.params) { + query += + '&' + + encodeURIComponent(key) + + '=' + + encodeURIComponent(authOptions.params[key]); + } + if (authOptions.paramsProvider != null) { + var dynamicParams = authOptions.paramsProvider(); + for (var key in dynamicParams) { + query += + '&' + + encodeURIComponent(key) + + '=' + + encodeURIComponent(dynamicParams[key]); + } + } + return query; +}; +var ChannelAuthorizer = function (authOptions) { + if (typeof runtime.getAuthorizers()[authOptions.transport] === 'undefined') { + throw "'" + authOptions.transport + "' is not a recognized auth transport"; + } + return function (params, callback) { + var query = channel_authorizer_composeChannelQuery(params, authOptions); + runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.ChannelAuthorization, callback); + }; +}; +/* harmony default export */ var channel_authorizer = (ChannelAuthorizer); + +// CONCATENATED MODULE: ./src/core/auth/deprecated_channel_authorizer.ts +var ChannelAuthorizerProxy = function (pusher, authOptions, channelAuthorizerGenerator) { + var deprecatedAuthorizerOptions = { + authTransport: authOptions.transport, + authEndpoint: authOptions.endpoint, + auth: { + params: authOptions.params, + headers: authOptions.headers + } + }; + return function (params, callback) { + var channel = pusher.channel(params.channelName); + var channelAuthorizer = channelAuthorizerGenerator(channel, deprecatedAuthorizerOptions); + channelAuthorizer.authorize(params.socketId, callback); + }; +}; + +// CONCATENATED MODULE: ./src/core/config.ts +var __assign = ( false) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + + + + + +function getConfig(opts, pusher) { + var config = { + activityTimeout: opts.activityTimeout || defaults.activityTimeout, + cluster: opts.cluster || defaults.cluster, + httpPath: opts.httpPath || defaults.httpPath, + httpPort: opts.httpPort || defaults.httpPort, + httpsPort: opts.httpsPort || defaults.httpsPort, + pongTimeout: opts.pongTimeout || defaults.pongTimeout, + statsHost: opts.statsHost || defaults.stats_host, + unavailableTimeout: opts.unavailableTimeout || defaults.unavailableTimeout, + wsPath: opts.wsPath || defaults.wsPath, + wsPort: opts.wsPort || defaults.wsPort, + wssPort: opts.wssPort || defaults.wssPort, + enableStats: getEnableStatsConfig(opts), + httpHost: getHttpHost(opts), + useTLS: shouldUseTLS(opts), + wsHost: getWebsocketHost(opts), + userAuthenticator: buildUserAuthenticator(opts), + channelAuthorizer: buildChannelAuthorizer(opts, pusher) + }; + if ('disabledTransports' in opts) + config.disabledTransports = opts.disabledTransports; + if ('enabledTransports' in opts) + config.enabledTransports = opts.enabledTransports; + if ('ignoreNullOrigin' in opts) + config.ignoreNullOrigin = opts.ignoreNullOrigin; + if ('timelineParams' in opts) + config.timelineParams = opts.timelineParams; + if ('nacl' in opts) { + config.nacl = opts.nacl; + } + return config; +} +function getHttpHost(opts) { + if (opts.httpHost) { + return opts.httpHost; + } + if (opts.cluster) { + return "sockjs-" + opts.cluster + ".pusher.com"; + } + return defaults.httpHost; +} +function getWebsocketHost(opts) { + if (opts.wsHost) { + return opts.wsHost; + } + if (opts.cluster) { + return getWebsocketHostFromCluster(opts.cluster); + } + return getWebsocketHostFromCluster(defaults.cluster); +} +function getWebsocketHostFromCluster(cluster) { + return "ws-" + cluster + ".pusher.com"; +} +function shouldUseTLS(opts) { + if (runtime.getProtocol() === 'https:') { + return true; + } + else if (opts.forceTLS === false) { + return false; + } + return true; +} +function getEnableStatsConfig(opts) { + if ('enableStats' in opts) { + return opts.enableStats; + } + if ('disableStats' in opts) { + return !opts.disableStats; + } + return false; +} +function buildUserAuthenticator(opts) { + var userAuthentication = __assign(__assign({}, defaults.userAuthentication), opts.userAuthentication); + if ('customHandler' in userAuthentication && + userAuthentication['customHandler'] != null) { + return userAuthentication['customHandler']; + } + return user_authenticator(userAuthentication); +} +function buildChannelAuth(opts, pusher) { + var channelAuthorization; + if ('channelAuthorization' in opts) { + channelAuthorization = __assign(__assign({}, defaults.channelAuthorization), opts.channelAuthorization); + } + else { + channelAuthorization = { + transport: opts.authTransport || defaults.authTransport, + endpoint: opts.authEndpoint || defaults.authEndpoint + }; + if ('auth' in opts) { + if ('params' in opts.auth) + channelAuthorization.params = opts.auth.params; + if ('headers' in opts.auth) + channelAuthorization.headers = opts.auth.headers; + } + if ('authorizer' in opts) + channelAuthorization.customHandler = ChannelAuthorizerProxy(pusher, channelAuthorization, opts.authorizer); + } + return channelAuthorization; +} +function buildChannelAuthorizer(opts, pusher) { + var channelAuthorization = buildChannelAuth(opts, pusher); + if ('customHandler' in channelAuthorization && + channelAuthorization['customHandler'] != null) { + return channelAuthorization['customHandler']; + } + return channel_authorizer(channelAuthorization); +} + +// CONCATENATED MODULE: ./src/core/watchlist.ts +var watchlist_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + +var watchlist_WatchlistFacade = (function (_super) { + watchlist_extends(WatchlistFacade, _super); + function WatchlistFacade(pusher) { + var _this = _super.call(this, function (eventName, data) { + logger.debug("No callbacks on watchlist events for " + eventName); + }) || this; + _this.pusher = pusher; + _this.bindWatchlistInternalEvent(); + return _this; + } + WatchlistFacade.prototype.handleEvent = function (pusherEvent) { var _this = this; - var callback = function (error, handshake) { - if (error) { - _this.runner = _this.strategy.connect(0, callback); + pusherEvent.data.events.forEach(function (watchlistEvent) { + _this.emit(watchlistEvent.name, watchlistEvent); + }); + }; + WatchlistFacade.prototype.bindWatchlistInternalEvent = function () { + var _this = this; + this.pusher.connection.bind('message', function (pusherEvent) { + var eventName = pusherEvent.event; + if (eventName === 'pusher_internal:watchlist_events') { + _this.handleEvent(pusherEvent); } - else { - if (handshake.action === 'error') { - _this.emit('error', { - type: 'HandshakeError', - error: handshake.error - }); - _this.timeline.error({ handshakeError: handshake.error }); - } - else { - _this.abortConnecting(); - _this.handshakeCallbacks[handshake.action](handshake); - } + }); + }; + return WatchlistFacade; +}(dispatcher)); +/* harmony default export */ var watchlist = (watchlist_WatchlistFacade); + +// CONCATENATED MODULE: ./src/core/utils/flat_promise.ts +function flatPromise() { + var resolve, reject; + var promise = new Promise(function (res, rej) { + resolve = res; + reject = rej; + }); + return { promise: promise, resolve: resolve, reject: reject }; +} +/* harmony default export */ var flat_promise = (flatPromise); + +// CONCATENATED MODULE: ./src/core/user.ts +var user_extends = ( false) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +var user_UserFacade = (function (_super) { + user_extends(UserFacade, _super); + function UserFacade(pusher) { + var _this = _super.call(this, function (eventName, data) { + logger.debug('No callbacks on user for ' + eventName); + }) || this; + _this.signin_requested = false; + _this.user_data = null; + _this.serverToUserChannel = null; + _this.signinDonePromise = null; + _this._signinDoneResolve = null; + _this._onAuthorize = function (err, authData) { + if (err) { + logger.warn("Error during signin: " + err); + _this._cleanup(); + return; } + _this.pusher.send_event('pusher:signin', { + auth: authData.auth, + user_data: authData.user_data + }); }; - this.runner = this.strategy.connect(0, callback); + _this.pusher = pusher; + _this.pusher.connection.bind('state_change', function (_a) { + var previous = _a.previous, current = _a.current; + if (previous !== 'connected' && current === 'connected') { + _this._signin(); + } + if (previous === 'connected' && current !== 'connected') { + _this._cleanup(); + _this._newSigninPromiseIfNeeded(); + } + }); + _this.watchlist = new watchlist(pusher); + _this.pusher.connection.bind('message', function (event) { + var eventName = event.event; + if (eventName === 'pusher:signin_success') { + _this._onSigninSuccess(event.data); + } + if (_this.serverToUserChannel && + _this.serverToUserChannel.name === event.channel) { + _this.serverToUserChannel.handleEvent(event); + } + }); + return _this; + } + UserFacade.prototype.signin = function () { + if (this.signin_requested) { + return; + } + this.signin_requested = true; + this._signin(); }; - ConnectionManager.prototype.abortConnecting = function () { - if (this.runner) { - this.runner.abort(); - this.runner = null; + UserFacade.prototype._signin = function () { + if (!this.signin_requested) { + return; + } + this._newSigninPromiseIfNeeded(); + if (this.pusher.connection.state !== 'connected') { + return; } + this.pusher.config.userAuthenticator({ + socketId: this.pusher.connection.socket_id + }, this._onAuthorize); }; - ConnectionManager.prototype.disconnectInternally = function () { - this.abortConnecting(); - this.clearRetryTimer(); - this.clearUnavailableTimer(); - if (this.connection) { - var connection = this.abandonConnection(); - connection.close(); + UserFacade.prototype._onSigninSuccess = function (data) { + try { + this.user_data = JSON.parse(data.user_data); } + catch (e) { + logger.error("Failed parsing user data after signin: " + data.user_data); + this._cleanup(); + return; + } + if (typeof this.user_data.id !== 'string' || this.user_data.id === '') { + logger.error("user_data doesn't contain an id. user_data: " + this.user_data); + this._cleanup(); + return; + } + this._signinDoneResolve(); + this._subscribeChannels(); }; - ConnectionManager.prototype.updateStrategy = function () { - this.strategy = this.options.getStrategy({ - key: this.key, - timeline: this.timeline, - useTLS: this.usingTLS + UserFacade.prototype._subscribeChannels = function () { + var _this = this; + var ensure_subscribed = function (channel) { + if (channel.subscriptionPending && channel.subscriptionCancelled) { + channel.reinstateSubscription(); + } + else if (!channel.subscriptionPending && + _this.pusher.connection.state === 'connected') { + channel.subscribe(); + } + }; + this.serverToUserChannel = new channels_channel("#server-to-user-" + this.user_data.id, this.pusher); + this.serverToUserChannel.bind_global(function (eventName, data) { + if (eventName.indexOf('pusher_internal:') === 0 || + eventName.indexOf('pusher:') === 0) { + return; + } + _this.emit(eventName, data); }); + ensure_subscribed(this.serverToUserChannel); }; - ConnectionManager.prototype.retryIn = function (delay) { + UserFacade.prototype._cleanup = function () { + this.user_data = null; + if (this.serverToUserChannel) { + this.serverToUserChannel.unbind_all(); + this.serverToUserChannel.disconnect(); + this.serverToUserChannel = null; + } + if (this.signin_requested) { + this._signinDoneResolve(); + } + }; + UserFacade.prototype._newSigninPromiseIfNeeded = function () { + if (!this.signin_requested) { + return; + } + if (this.signinDonePromise && !this.signinDonePromise.done) { + return; + } + var _a = flat_promise(), promise = _a.promise, resolve = _a.resolve, _ = _a.reject; + promise.done = false; + var setDone = function () { + promise.done = true; + }; + promise.then(setDone)["catch"](setDone); + this.signinDonePromise = promise; + this._signinDoneResolve = resolve; + }; + return UserFacade; +}(dispatcher)); +/* harmony default export */ var user = (user_UserFacade); + +// CONCATENATED MODULE: ./src/core/pusher.ts + + + + + + + + + + + + + +var pusher_Pusher = (function () { + function Pusher(app_key, options) { var _this = this; - this.timeline.info({ action: 'retry', delay: delay }); - if (delay > 0) { - this.emit('connecting_in', Math.round(delay / 1000)); + checkAppKey(app_key); + options = options || {}; + if (!options.cluster && !(options.wsHost || options.httpHost)) { + var suffix = url_store.buildLogSuffix('javascriptQuickStart'); + logger.warn("You should always specify a cluster when connecting. " + suffix); } - this.retryTimer = new OneOffTimer(delay || 0, function () { - _this.disconnectInternally(); - _this.connect(); + if ('disableStats' in options) { + logger.warn('The disableStats option is deprecated in favor of enableStats'); + } + this.key = app_key; + this.config = getConfig(options, this); + this.channels = factory.createChannels(); + this.global_emitter = new dispatcher(); + this.sessionID = runtime.randomInt(1000000000); + this.timeline = new timeline_timeline(this.key, this.sessionID, { + cluster: this.config.cluster, + features: Pusher.getClientFeatures(), + params: this.config.timelineParams || {}, + limit: 50, + level: timeline_level.INFO, + version: defaults.VERSION }); - }; - ConnectionManager.prototype.clearRetryTimer = function () { - if (this.retryTimer) { - this.retryTimer.ensureAborted(); - this.retryTimer = null; + if (this.config.enableStats) { + this.timelineSender = factory.createTimelineSender(this.timeline, { + host: this.config.statsHost, + path: '/timeline/v2/' + runtime.TimelineTransport.name + }); + } + var getStrategy = function (options) { + return runtime.getDefaultStrategy(_this.config, options, strategy_builder_defineTransport); + }; + this.connection = factory.createConnectionManager(this.key, { + getStrategy: getStrategy, + timeline: this.timeline, + activityTimeout: this.config.activityTimeout, + pongTimeout: this.config.pongTimeout, + unavailableTimeout: this.config.unavailableTimeout, + useTLS: Boolean(this.config.useTLS) + }); + this.connection.bind('connected', function () { + _this.subscribeAll(); + if (_this.timelineSender) { + _this.timelineSender.send(_this.connection.isUsingTLS()); + } + }); + this.connection.bind('message', function (event) { + var eventName = event.event; + var internal = eventName.indexOf('pusher_internal:') === 0; + if (event.channel) { + var channel = _this.channel(event.channel); + if (channel) { + channel.handleEvent(event); + } + } + if (!internal) { + _this.global_emitter.emit(event.event, event.data); + } + }); + this.connection.bind('connecting', function () { + _this.channels.disconnect(); + }); + this.connection.bind('disconnected', function () { + _this.channels.disconnect(); + }); + this.connection.bind('error', function (err) { + logger.warn(err); + }); + Pusher.instances.push(this); + this.timeline.info({ instances: Pusher.instances.length }); + this.user = new user(this); + if (Pusher.isReady) { + this.connect(); + } + } + Pusher.ready = function () { + Pusher.isReady = true; + for (var i = 0, l = Pusher.instances.length; i < l; i++) { + Pusher.instances[i].connect(); } }; - ConnectionManager.prototype.setUnavailableTimer = function () { - var _this = this; - this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () { - _this.updateState('unavailable'); - }); + Pusher.getClientFeatures = function () { + return keys(filterObject({ ws: runtime.Transports.ws }, function (t) { + return t.isSupported({}); + })); }; - ConnectionManager.prototype.clearUnavailableTimer = function () { - if (this.unavailableTimer) { - this.unavailableTimer.ensureAborted(); - } + Pusher.prototype.channel = function (name) { + return this.channels.find(name); }; - ConnectionManager.prototype.sendActivityCheck = function () { - var _this = this; - this.stopActivityCheck(); - this.connection.ping(); - this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () { - _this.timeline.error({ pong_timed_out: _this.options.pongTimeout }); - _this.retryIn(0); - }); + Pusher.prototype.allChannels = function () { + return this.channels.all(); }; - ConnectionManager.prototype.resetActivityCheck = function () { - var _this = this; - this.stopActivityCheck(); - if (this.connection && !this.connection.handlesActivityChecks()) { - this.activityTimer = new OneOffTimer(this.activityTimeout, function () { - _this.sendActivityCheck(); - }); + Pusher.prototype.connect = function () { + this.connection.connect(); + if (this.timelineSender) { + if (!this.timelineSenderTimer) { + var usingTLS = this.connection.isUsingTLS(); + var timelineSender = this.timelineSender; + this.timelineSenderTimer = new PeriodicTimer(60000, function () { + timelineSender.send(usingTLS); + }); + } } }; - ConnectionManager.prototype.stopActivityCheck = function () { - if (this.activityTimer) { - this.activityTimer.ensureAborted(); + Pusher.prototype.disconnect = function () { + this.connection.disconnect(); + if (this.timelineSenderTimer) { + this.timelineSenderTimer.ensureAborted(); + this.timelineSenderTimer = null; } }; - ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) { - var _this = this; - return extend({}, errorCallbacks, { - message: function (message) { - _this.resetActivityCheck(); - _this.emit('message', message); - }, - ping: function () { - _this.send_event('pusher:pong', {}); - }, - activity: function () { - _this.resetActivityCheck(); - }, - error: function (error) { - _this.emit('error', error); - }, - closed: function () { - _this.abandonConnection(); - if (_this.shouldRetry()) { - _this.retryIn(1000); - } - } - }); + Pusher.prototype.bind = function (event_name, callback, context) { + this.global_emitter.bind(event_name, callback, context); + return this; }; - ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) { - var _this = this; - return extend({}, errorCallbacks, { - connected: function (handshake) { - _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity); - _this.clearUnavailableTimer(); - _this.setConnection(handshake.connection); - _this.socket_id = _this.connection.id; - _this.updateState('connected', { socket_id: _this.socket_id }); - } - }); + Pusher.prototype.unbind = function (event_name, callback, context) { + this.global_emitter.unbind(event_name, callback, context); + return this; }; - ConnectionManager.prototype.buildErrorCallbacks = function () { - var _this = this; - var withErrorEmitted = function (callback) { - return function (result) { - if (result.error) { - _this.emit('error', { type: 'WebSocketError', error: result.error }); - } - callback(result); - }; - }; - return { - tls_only: withErrorEmitted(function () { - _this.usingTLS = true; - _this.updateStrategy(); - _this.retryIn(0); - }), - refused: withErrorEmitted(function () { - _this.disconnect(); - }), - backoff: withErrorEmitted(function () { - _this.retryIn(1000); - }), - retry: withErrorEmitted(function () { - _this.retryIn(0); - }) - }; + Pusher.prototype.bind_global = function (callback) { + this.global_emitter.bind_global(callback); + return this; }; - ConnectionManager.prototype.setConnection = function (connection) { - this.connection = connection; - for (var event in this.connectionCallbacks) { - this.connection.bind(event, this.connectionCallbacks[event]); + Pusher.prototype.unbind_global = function (callback) { + this.global_emitter.unbind_global(callback); + return this; + }; + Pusher.prototype.unbind_all = function (callback) { + this.global_emitter.unbind_all(); + return this; + }; + Pusher.prototype.subscribeAll = function () { + var channelName; + for (channelName in this.channels.channels) { + if (this.channels.channels.hasOwnProperty(channelName)) { + this.subscribe(channelName); + } } - this.resetActivityCheck(); }; - ConnectionManager.prototype.abandonConnection = function () { - if (!this.connection) { - return; + Pusher.prototype.subscribe = function (channel_name) { + var channel = this.channels.add(channel_name, this); + if (channel.subscriptionPending && channel.subscriptionCancelled) { + channel.reinstateSubscription(); } - this.stopActivityCheck(); - for (var event in this.connectionCallbacks) { - this.connection.unbind(event, this.connectionCallbacks[event]); + else if (!channel.subscriptionPending && + this.connection.state === 'connected') { + channel.subscribe(); } - var connection = this.connection; - this.connection = null; - return connection; + return channel; }; - ConnectionManager.prototype.updateState = function (newState, data) { - var previousState = this.state; - this.state = newState; - if (previousState !== newState) { - var newStateDescription = newState; - if (newStateDescription === 'connected') { - newStateDescription += ' with new socket ID ' + data.socket_id; + Pusher.prototype.unsubscribe = function (channel_name) { + var channel = this.channels.find(channel_name); + if (channel && channel.subscriptionPending) { + channel.cancelSubscription(); + } + else { + channel = this.channels.remove(channel_name); + if (channel && channel.subscribed) { + channel.unsubscribe(); } - logger.debug('State changed', previousState + ' -> ' + newStateDescription); - this.timeline.info({ state: newState, params: data }); - this.emit('state_change', { previous: previousState, current: newState }); - this.emit(newState, data); } }; - ConnectionManager.prototype.shouldRetry = function () { - return this.state === 'connecting' || this.state === 'connected'; + Pusher.prototype.send_event = function (event_name, data, channel) { + return this.connection.send_event(event_name, data, channel); }; - return ConnectionManager; -}(dispatcher)); -/* harmony default export */ var connection_manager = (connection_manager_ConnectionManager); + Pusher.prototype.shouldUseTLS = function () { + return this.config.useTLS; + }; + Pusher.prototype.signin = function () { + this.user.signin(); + }; + Pusher.instances = []; + Pusher.isReady = false; + Pusher.logToConsole = false; + Pusher.Runtime = runtime; + Pusher.ScriptReceivers = runtime.ScriptReceivers; + Pusher.DependenciesReceivers = runtime.DependenciesReceivers; + Pusher.auth_callbacks = runtime.auth_callbacks; + return Pusher; +}()); +/* harmony default export */ var core_pusher = __nested_webpack_exports__["default"] = (pusher_Pusher); +function checkAppKey(key) { + if (key === null || key === undefined) { + throw 'You must pass your app key when you instantiate Pusher.'; + } +} +runtime.setup(pusher_Pusher); + + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=pusher.js.map + +/***/ }), + +/***/ "./node_modules/vue-loader/dist/exportHelper.js": +/*!******************************************************!*\ + !*** ./node_modules/vue-loader/dist/exportHelper.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +// runtime helper for setting properties on components +// in a tree-shakable way +exports["default"] = (sfc, props) => { + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props) { + target[key] = val; + } + return target; +}; + + +/***/ }), + +/***/ "./resources/js/vue-components/CopyButton.vue": +/*!****************************************************!*\ + !*** ./resources/js/vue-components/CopyButton.vue ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CopyButton.vue?vue&type=template&id=d28654aa */ "./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa"); +/* harmony import */ var _CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CopyButton.vue?vue&type=script&lang=js */ "./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js"); +/* harmony import */ var _Users_mlantz_Code_open_source_Grafite_scaffold_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); + + + + +; +const __exports__ = /*#__PURE__*/(0,_Users_mlantz_Code_open_source_Grafite_scaffold_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/vue-components/CopyButton.vue"]]) +/* hot reload */ +if (false) {} + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); + +/***/ }), + +/***/ "./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js": +/*!****************************************************************************!*\ + !*** ./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./CopyButton.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js"); + + +/***/ }), + +/***/ "./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa": +/*!**********************************************************************************!*\ + !*** ./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ render: () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__.render) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./CopyButton.vue?vue&type=template&id=d28654aa */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa"); + + +/***/ }), + +/***/ "./node_modules/vue/dist/vue.esm-bundler.js": +/*!**************************************************!*\ + !*** ./node_modules/vue/dist/vue.esm-bundler.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), +/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), +/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Comment), +/* harmony export */ DeprecationTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.DeprecationTypes), +/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.EffectScope), +/* harmony export */ ErrorCodes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ErrorCodes), +/* harmony export */ ErrorTypeStrings: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ErrorTypeStrings), +/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Fragment), +/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), +/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), +/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Static), +/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Suspense), +/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Teleport), +/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Text), +/* harmony export */ TrackOpTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TrackOpTypes), +/* harmony export */ Transition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Transition), +/* harmony export */ TransitionGroup: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TransitionGroup), +/* harmony export */ TriggerOpTypes: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TriggerOpTypes), +/* harmony export */ VueElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.VueElement), +/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.assertNumber), +/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), +/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), +/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.camelize), +/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.capitalize), +/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), +/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.compatUtils), +/* harmony export */ compile: () => (/* binding */ compileToFunction), +/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.computed), +/* harmony export */ createApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createApp), +/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createBlock), +/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), +/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), +/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), +/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), +/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), +/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createRenderer), +/* harmony export */ createSSRApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSSRApp), +/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSlots), +/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), +/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), +/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createVNode), +/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.customRef), +/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), +/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineComponent), +/* harmony export */ defineCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineCustomElement), +/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineEmits), +/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineExpose), +/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineModel), +/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineOptions), +/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineProps), +/* harmony export */ defineSSRCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSSRCustomElement), +/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSlots), +/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.devtools), +/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effect), +/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effectScope), +/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), +/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), +/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), +/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), +/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.h), +/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.handleError), +/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), +/* harmony export */ hydrate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hydrate), +/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), +/* harmony export */ initDirectivesForSSR: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initDirectivesForSSR), +/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.inject), +/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), +/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isProxy), +/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReactive), +/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReadonly), +/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRef), +/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), +/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isShallow), +/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isVNode), +/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.markRaw), +/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), +/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeModels), +/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeProps), +/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.nextTick), +/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), +/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), +/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), +/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onActivated), +/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), +/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), +/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), +/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), +/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), +/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onMounted), +/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), +/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), +/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), +/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), +/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), +/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUpdated), +/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.openBlock), +/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.popScopeId), +/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.provide), +/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), +/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), +/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), +/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.reactive), +/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.readonly), +/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ref), +/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), +/* harmony export */ render: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.render), +/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderList), +/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderSlot), +/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), +/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), +/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), +/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), +/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), +/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), +/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), +/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), +/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), +/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), +/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowRef), +/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), +/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), +/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.stop), +/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), +/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), +/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlers), +/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRaw), +/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRef), +/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRefs), +/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toValue), +/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), +/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.triggerRef), +/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.unref), +/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useAttrs), +/* harmony export */ useCssModule: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssModule), +/* harmony export */ useCssVars: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssVars), +/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useModel), +/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), +/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSlots), +/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), +/* harmony export */ vModelCheckbox: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox), +/* harmony export */ vModelDynamic: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelDynamic), +/* harmony export */ vModelRadio: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelRadio), +/* harmony export */ vModelSelect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelSelect), +/* harmony export */ vModelText: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelText), +/* harmony export */ vShow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vShow), +/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.version), +/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.warn), +/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watch), +/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchEffect), +/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), +/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), +/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), +/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withCtx), +/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDefaults), +/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDirectives), +/* harmony export */ withKeys: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withKeys), +/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withMemo), +/* harmony export */ withModifiers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withModifiers), +/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withScopeId) +/* harmony export */ }); +/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js"); +/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); +/* harmony import */ var _vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @vue/compiler-dom */ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js"); +/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); + + + + + + +function initDev() { + { + (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.initCustomFormatter)(); + } +} + +if (true) { + initDev(); +} +const compileCache = /* @__PURE__ */ new WeakMap(); +function getCache(options) { + let c = compileCache.get(options != null ? options : _vue_shared__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ); + if (!c) { + c = /* @__PURE__ */ Object.create(null); + compileCache.set(options != null ? options : _vue_shared__WEBPACK_IMPORTED_MODULE_2__.EMPTY_OBJ, c); + } + return c; +} +function compileToFunction(template, options) { + if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.isString)(template)) { + if (template.nodeType) { + template = template.innerHTML; + } else { + true && (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`invalid template option: `, template); + return _vue_shared__WEBPACK_IMPORTED_MODULE_2__.NOOP; + } + } + const key = template; + const cache = getCache(options); + const cached = cache[key]; + if (cached) { + return cached; + } + if (template[0] === "#") { + const el = document.querySelector(template); + if ( true && !el) { + (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`Template element not found or is empty: ${template}`); + } + template = el ? el.innerHTML : ``; + } + const opts = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.extend)( + { + hoistStatic: true, + onError: true ? onError : 0, + onWarn: true ? (e) => onError(e, true) : 0 + }, + options + ); + if (!opts.isCustomElement && typeof customElements !== "undefined") { + opts.isCustomElement = (tag) => !!customElements.get(tag); + } + const { code } = (0,_vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__.compile)(template, opts); + function onError(err, asWarning = false) { + const message = asWarning ? err.message : `Template compilation error: ${err.message}`; + const codeFrame = err.loc && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.generateCodeFrame)( + template, + err.loc.start.offset, + err.loc.end.offset + ); + (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(codeFrame ? `${message} +${codeFrame}` : message); + } + const render = new Function("Vue", code)(_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__); + render._rc = true; + return cache[key] = render; +} +(0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.registerRuntimeCompiler)(compileToFunction); -// CONCATENATED MODULE: ./src/core/channels/channels.ts +/***/ }), -var channels_Channels = (function () { - function Channels() { - this.channels = {}; - } - Channels.prototype.add = function (name, pusher) { - if (!this.channels[name]) { - this.channels[name] = createChannel(name, pusher); - } - return this.channels[name]; - }; - Channels.prototype.all = function () { - return values(this.channels); - }; - Channels.prototype.find = function (name) { - return this.channels[name]; - }; - Channels.prototype.remove = function (name) { - var channel = this.channels[name]; - delete this.channels[name]; - return channel; - }; - Channels.prototype.disconnect = function () { - objectApply(this.channels, function (channel) { - channel.disconnect(); - }); - }; - return Channels; -}()); -/* harmony default export */ var channels = (channels_Channels); -function createChannel(name, pusher) { - if (name.indexOf('private-encrypted-') === 0) { - if (pusher.config.nacl) { - return factory.createEncryptedChannel(name, pusher, pusher.config.nacl); - } - var errMsg = 'Tried to subscribe to a private-encrypted- channel but no nacl implementation available'; - var suffix = url_store.buildLogSuffix('encryptedChannelSupport'); - throw new UnsupportedFeature(errMsg + ". " + suffix); - } - else if (name.indexOf('private-') === 0) { - return factory.createPrivateChannel(name, pusher); - } - else if (name.indexOf('presence-') === 0) { - return factory.createPresenceChannel(name, pusher); +/***/ "./node_modules/axios/dist/browser/axios.cjs": +/*!***************************************************!*\ + !*** ./node_modules/axios/dist/browser/axios.cjs ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; +// Axios v1.6.5 Copyright (c) 2024 Matt Zabriskie and contributors + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); } - else if (name.indexOf('#') === 0) { - throw new BadChannelName('Cannot create a channel with name "' + name + '".'); + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); } - else { - return factory.createChannel(name, pusher); + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; } + } + return null; } -// CONCATENATED MODULE: ./src/core/utils/factory.ts +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g) +})(); +const isContextDefined = (context) => !isUndefined(context) && context !== _global; +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + }; + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; -var Factory = { - createChannels: function () { - return new channels(); - }, - createConnectionManager: function (key, options) { - return new connection_manager(key, options); - }, - createChannel: function (name, pusher) { - return new channels_channel(name, pusher); - }, - createPrivateChannel: function (name, pusher) { - return new private_channel(name, pusher); - }, - createPresenceChannel: function (name, pusher) { - return new presence_channel(name, pusher); - }, - createEncryptedChannel: function (name, pusher, nacl) { - return new encrypted_channel(name, pusher, nacl); - }, - createTimelineSender: function (timeline, options) { - return new timeline_sender(timeline, options); - }, - createHandshake: function (transport, callback) { - return new connection_handshake(transport, callback); - }, - createAssistantToTheTransportManager: function (manager, transport, options) { - return new assistant_to_the_transport_manager(manager, transport, options); + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; }; -/* harmony default export */ var factory = (Factory); -// CONCATENATED MODULE: ./src/core/transports/transport_manager.ts +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; -var transport_manager_TransportManager = (function () { - function TransportManager(options) { - this.options = options || {}; - this.livesLeft = this.options.lives || Infinity; - } - TransportManager.prototype.getAssistant = function (transport) { - return factory.createAssistantToTheTransportManager(this, transport, { - minPingDelay: this.options.minPingDelay, - maxPingDelay: this.options.maxPingDelay - }); - }; - TransportManager.prototype.isAlive = function () { - return this.livesLeft > 0; - }; - TransportManager.prototype.reportDeath = function () { - this.livesLeft -= 1; - }; - return TransportManager; -}()); -/* harmony default export */ var transport_manager = (transport_manager_TransportManager); -// CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object<any, any>} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; -var sequential_strategy_SequentialStrategy = (function () { - function SequentialStrategy(strategies, options) { - this.strategies = strategies; - this.loop = Boolean(options.loop); - this.failFast = Boolean(options.failFast); - this.timeout = options.timeout; - this.timeoutLimit = options.timeoutLimit; - } - SequentialStrategy.prototype.isSupported = function () { - return any(this.strategies, util.method('isSupported')); - }; - SequentialStrategy.prototype.connect = function (minPriority, callback) { - var _this = this; - var strategies = this.strategies; - var current = 0; - var timeout = this.timeout; - var runner = null; - var tryNextStrategy = function (error, handshake) { - if (handshake) { - callback(null, handshake); - } - else { - current = current + 1; - if (_this.loop) { - current = current % strategies.length; - } - if (current < strategies.length) { - if (timeout) { - timeout = timeout * 2; - if (_this.timeoutLimit) { - timeout = Math.min(timeout, _this.timeoutLimit); - } - } - runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy); - } - else { - callback(true); - } - } - }; - runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy); - return { - abort: function () { - runner.abort(); - }, - forceMinPriority: function (p) { - minPriority = p; - if (runner) { - runner.forceMinPriority(p); - } - } - }; - }; - SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) { - var timer = null; - var runner = null; - if (options.timeout > 0) { - timer = new OneOffTimer(options.timeout, function () { - runner.abort(); - callback(true); - }); - } - runner = strategy.connect(minPriority, function (error, handshake) { - if (error && timer && timer.isRunning() && !options.failFast) { - return; - } - if (timer) { - timer.ensureAborted(); - } - callback(error, handshake); - }); - return { - abort: function () { - if (timer) { - timer.ensureAborted(); - } - runner.abort(); - }, - forceMinPriority: function (p) { - runner.forceMinPriority(p); - } - }; - }; - return SequentialStrategy; -}()); -/* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy); + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array<boolean>} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; -// CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + return arr; +}; -var best_connected_ever_strategy_BestConnectedEverStrategy = (function () { - function BestConnectedEverStrategy(strategies) { - this.strategies = strategies; - } - BestConnectedEverStrategy.prototype.isSupported = function () { - return any(this.strategies, util.method('isSupported')); - }; - BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) { - return connect(this.strategies, minPriority, function (i, runners) { - return function (error, handshake) { - runners[i].error = error; - if (error) { - if (allRunnersFailed(runners)) { - callback(true); - } - return; - } - apply(runners, function (runner) { - runner.forceMinPriority(handshake.transport.priority); - }); - callback(null, handshake); - }; - }); - }; - return BestConnectedEverStrategy; -}()); -/* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy); -function connect(strategies, minPriority, callbackBuilder) { - var runners = map(strategies, function (strategy, i, _, rs) { - return strategy.connect(minPriority, callbackBuilder(i, rs)); - }); - return { - abort: function () { - apply(runners, abortRunner); - }, - forceMinPriority: function (p) { - apply(runners, function (runner) { - runner.forceMinPriority(p); - }); - } - }; -} -function allRunnersFailed(runners) { - return collections_all(runners, function (runner) { - return Boolean(runner.error); - }); -} -function abortRunner(runner) { - if (!runner.error && !runner.aborted) { - runner.abort(); - runner.aborted = true; - } -} +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); -// CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; -var cached_strategy_CachedStrategy = (function () { - function CachedStrategy(strategy, transports, options) { - this.strategy = strategy; - this.transports = transports; - this.ttl = options.ttl || 1800 * 1000; - this.usingTLS = options.useTLS; - this.timeline = options.timeline; - } - CachedStrategy.prototype.isSupported = function () { - return this.strategy.isSupported(); - }; - CachedStrategy.prototype.connect = function (minPriority, callback) { - var usingTLS = this.usingTLS; - var info = fetchTransportCache(usingTLS); - var strategies = [this.strategy]; - if (info && info.timestamp + this.ttl >= util.now()) { - var transport = this.transports[info.transport]; - if (transport) { - this.timeline.info({ - cached: true, - transport: info.transport, - latency: info.latency - }); - strategies.push(new sequential_strategy([transport], { - timeout: info.latency * 2 + 1000, - failFast: true - })); - } - } - var startTimestamp = util.now(); - var runner = strategies - .pop() - .connect(minPriority, function cb(error, handshake) { - if (error) { - flushTransportCache(usingTLS); - if (strategies.length > 0) { - startTimestamp = util.now(); - runner = strategies.pop().connect(minPriority, cb); - } - else { - callback(error); - } - } - else { - storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp); - callback(null, handshake); - } - }); - return { - abort: function () { - runner.abort(); - }, - forceMinPriority: function (p) { - minPriority = p; - if (runner) { - runner.forceMinPriority(p); - } - } - }; - }; - return CachedStrategy; -}()); -/* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy); -function getTransportCacheKey(usingTLS) { - return 'pusherTransport' + (usingTLS ? 'TLS' : 'NonTLS'); -} -function fetchTransportCache(usingTLS) { - var storage = runtime.getLocalStorage(); - if (storage) { - try { - var serializedCache = storage[getTransportCacheKey(usingTLS)]; - if (serializedCache) { - return JSON.parse(serializedCache); - } - } - catch (e) { - flushTransportCache(usingTLS); - } - } - return null; -} -function storeTransportCache(usingTLS, transport, latency) { - var storage = runtime.getLocalStorage(); - if (storage) { - try { - storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({ - timestamp: util.now(), - transport: transport, - latency: latency - }); - } - catch (e) { - } - } -} -function flushTransportCache(usingTLS) { - var storage = runtime.getLocalStorage(); - if (storage) { - try { - delete storage[getTransportCacheKey(usingTLS)]; - } - catch (e) { - } + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; } -} + }); -// CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts + Object.defineProperties(obj, reducedDescriptors); +}; -var delayed_strategy_DelayedStrategy = (function () { - function DelayedStrategy(strategy, _a) { - var number = _a.delay; - this.strategy = strategy; - this.options = { delay: number }; +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; } - DelayedStrategy.prototype.isSupported = function () { - return this.strategy.isSupported(); - }; - DelayedStrategy.prototype.connect = function (minPriority, callback) { - var strategy = this.strategy; - var runner; - var timer = new OneOffTimer(this.options.delay, function () { - runner = strategy.connect(minPriority, callback); - }); - return { - abort: function () { - timer.ensureAborted(); - if (runner) { - runner.abort(); - } - }, - forceMinPriority: function (p) { - minPriority = p; - if (runner) { - runner.forceMinPriority(p); - } - } - }; - }; - return DelayedStrategy; -}()); -/* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy); -// CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts -var IfStrategy = (function () { - function IfStrategy(test, trueBranch, falseBranch) { - this.test = test; - this.trueBranch = trueBranch; - this.falseBranch = falseBranch; + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; } - IfStrategy.prototype.isSupported = function () { - var branch = this.test() ? this.trueBranch : this.falseBranch; - return branch.isSupported(); - }; - IfStrategy.prototype.connect = function (minPriority, callback) { - var branch = this.test() ? this.trueBranch : this.falseBranch; - return branch.connect(minPriority, callback); - }; - return IfStrategy; -}()); -/* harmony default export */ var if_strategy = (IfStrategy); -// CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts -var FirstConnectedStrategy = (function () { - function FirstConnectedStrategy(strategy) { - this.strategy = strategy; + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; } - FirstConnectedStrategy.prototype.isSupported = function () { - return this.strategy.isSupported(); - }; - FirstConnectedStrategy.prototype.connect = function (minPriority, callback) { - var runner = this.strategy.connect(minPriority, function (error, handshake) { - if (handshake) { - runner.abort(); - } - callback(error, handshake); - }); - return runner; - }; - return FirstConnectedStrategy; -}()); -/* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy); + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; -// CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts +const noop = () => {}; +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +}; +const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; +const DIGIT = '0123456789'; +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0]; + } + return str; +}; -function testSupportsStrategy(strategy) { - return function () { - return strategy.isSupported(); - }; +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); } -var getDefaultStrategy = function (config, baseOptions, defineTransport) { - var definedTransports = {}; - function defineTransportStrategy(name, type, priority, options, manager) { - var transport = defineTransport(config, name, type, priority, options, manager); - definedTransports[name] = transport; - return transport; - } - var ws_options = Object.assign({}, baseOptions, { - hostNonTLS: config.wsHost + ':' + config.wsPort, - hostTLS: config.wsHost + ':' + config.wssPort, - httpPath: config.wsPath - }); - var wss_options = Object.assign({}, ws_options, { - useTLS: true - }); - var sockjs_options = Object.assign({}, baseOptions, { - hostNonTLS: config.httpHost + ':' + config.httpPort, - hostTLS: config.httpHost + ':' + config.httpsPort, - httpPath: config.httpPath - }); - var timeouts = { - loop: true, - timeout: 15000, - timeoutLimit: 60000 - }; - var ws_manager = new transport_manager({ - lives: 2, - minPingDelay: 10000, - maxPingDelay: config.activityTimeout - }); - var streaming_manager = new transport_manager({ - lives: 2, - minPingDelay: 10000, - maxPingDelay: config.activityTimeout - }); - var ws_transport = defineTransportStrategy('ws', 'ws', 3, ws_options, ws_manager); - var wss_transport = defineTransportStrategy('wss', 'ws', 3, wss_options, ws_manager); - var sockjs_transport = defineTransportStrategy('sockjs', 'sockjs', 1, sockjs_options); - var xhr_streaming_transport = defineTransportStrategy('xhr_streaming', 'xhr_streaming', 1, sockjs_options, streaming_manager); - var xdr_streaming_transport = defineTransportStrategy('xdr_streaming', 'xdr_streaming', 1, sockjs_options, streaming_manager); - var xhr_polling_transport = defineTransportStrategy('xhr_polling', 'xhr_polling', 1, sockjs_options); - var xdr_polling_transport = defineTransportStrategy('xdr_polling', 'xdr_polling', 1, sockjs_options); - var ws_loop = new sequential_strategy([ws_transport], timeouts); - var wss_loop = new sequential_strategy([wss_transport], timeouts); - var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts); - var streaming_loop = new sequential_strategy([ - new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport) - ], timeouts); - var polling_loop = new sequential_strategy([ - new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport) - ], timeouts); - var http_loop = new sequential_strategy([ - new if_strategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy([ - streaming_loop, - new delayed_strategy(polling_loop, { delay: 4000 }) - ]), polling_loop) - ], timeouts); - var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop); - var wsStrategy; - if (baseOptions.useTLS) { - wsStrategy = new best_connected_ever_strategy([ - ws_loop, - new delayed_strategy(http_fallback_loop, { delay: 2000 }) - ]); - } - else { - wsStrategy = new best_connected_ever_strategy([ - ws_loop, - new delayed_strategy(wss_loop, { delay: 2000 }), - new delayed_strategy(http_fallback_loop, { delay: 5000 }) - ]); - } - return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, { - ttl: 1800000, - timeline: baseOptions.timeline, - useTLS: baseOptions.useTLS - }); -}; -/* harmony default export */ var default_strategy = (getDefaultStrategy); -// CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts +const toJSONObject = (obj) => { + const stack = new Array(10); -/* harmony default export */ var transport_connection_initializer = (function () { - var self = this; - self.timeline.info(self.buildTimelineMessage({ - transport: self.name + (self.options.useTLS ? 's' : '') - })); - if (self.hooks.isInitialized()) { - self.changeState('initialized'); - } - else if (self.hooks.file) { - self.changeState('initializing'); - Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) { - if (self.hooks.isInitialized()) { - self.changeState('initialized'); - callback(true); - } - else { - if (error) { - self.onError(error); - } - self.onClose(); - callback(false); - } + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); }); - } - else { - self.onClose(); - } -}); -// CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts + stack[i] = undefined; -var http_xdomain_request_hooks = { - getRequest: function (socket) { - var xdr = new window.XDomainRequest(); - xdr.ontimeout = function () { - socket.emit('error', new RequestTimedOut()); - socket.close(); - }; - xdr.onerror = function (e) { - socket.emit('error', e); - socket.close(); - }; - xdr.onprogress = function () { - if (xdr.responseText && xdr.responseText.length > 0) { - socket.onChunk(200, xdr.responseText); - } - }; - xdr.onload = function () { - if (xdr.responseText && xdr.responseText.length > 0) { - socket.onChunk(200, xdr.responseText); - } - socket.emit('finished', 200); - socket.close(); - }; - return xdr; - }, - abortRequest: function (xdr) { - xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null; - xdr.abort(); + return target; + } } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +var utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable }; -/* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks); -// CONCATENATED MODULE: ./src/core/http/http_request.ts -var http_request_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } -var MAX_BUFFER_LENGTH = 256 * 1024; -var http_request_HTTPRequest = (function (_super) { - http_request_extends(HTTPRequest, _super); - function HTTPRequest(hooks, method, url) { - var _this = _super.call(this) || this; - _this.hooks = hooks; - _this.method = method; - _this.url = url; - return _this; - } - HTTPRequest.prototype.start = function (payload) { - var _this = this; - this.position = 0; - this.xhr = this.hooks.getRequest(this); - this.unloader = function () { - _this.close(); - }; - runtime.addUnloadListener(this.unloader); - this.xhr.open(this.method, this.url, true); - if (this.xhr.setRequestHeader) { - this.xhr.setRequestHeader('Content-Type', 'application/json'); - } - this.xhr.send(payload); - }; - HTTPRequest.prototype.close = function () { - if (this.unloader) { - runtime.removeUnloadListener(this.unloader); - this.unloader = null; - } - if (this.xhr) { - this.hooks.abortRequest(this.xhr); - this.xhr = null; - } - }; - HTTPRequest.prototype.onChunk = function (status, data) { - while (true) { - var chunk = this.advanceBuffer(data); - if (chunk) { - this.emit('chunk', { status: status, data: chunk }); - } - else { - break; - } - } - if (this.isBufferTooLong(data)) { - this.emit('buffer_too_long'); - } - }; - HTTPRequest.prototype.advanceBuffer = function (buffer) { - var unreadData = buffer.slice(this.position); - var endOfLinePosition = unreadData.indexOf('\n'); - if (endOfLinePosition !== -1) { - this.position += endOfLinePosition + 1; - return unreadData.slice(0, endOfLinePosition); - } - else { - return null; - } - }; - HTTPRequest.prototype.isBufferTooLong = function (buffer) { - return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH; + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null }; - return HTTPRequest; -}(dispatcher)); -/* harmony default export */ var http_request = (http_request_HTTPRequest); + } +}); -// CONCATENATED MODULE: ./src/core/http/state.ts -var State; -(function (State) { - State[State["CONNECTING"] = 0] = "CONNECTING"; - State[State["OPEN"] = 1] = "OPEN"; - State[State["CLOSED"] = 3] = "CLOSED"; -})(State || (State = {})); -/* harmony default export */ var state = (State); +const prototype$1 = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); -// CONCATENATED MODULE: ./src/core/http/http_socket.ts +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); -var autoIncrement = 1; -var http_socket_HTTPSocket = (function () { - function HTTPSocket(hooks, url) { - this.hooks = hooks; - this.session = randomNumber(1000) + '/' + randomString(8); - this.location = getLocation(url); - this.readyState = state.CONNECTING; - this.openStream(); - } - HTTPSocket.prototype.send = function (payload) { - return this.sendRaw(JSON.stringify([payload])); - }; - HTTPSocket.prototype.ping = function () { - this.hooks.sendHeartbeat(this); - }; - HTTPSocket.prototype.close = function (code, reason) { - this.onClose(code, reason, true); - }; - HTTPSocket.prototype.sendRaw = function (payload) { - if (this.readyState === state.OPEN) { - try { - runtime.createSocketRequest('POST', getUniqueURL(getSendURL(this.location, this.session))).start(payload); - return true; - } - catch (e) { - return false; - } - } - else { - return false; - } - }; - HTTPSocket.prototype.reconnect = function () { - this.closeStream(); - this.openStream(); - }; - HTTPSocket.prototype.onClose = function (code, reason, wasClean) { - this.closeStream(); - this.readyState = state.CLOSED; - if (this.onclose) { - this.onclose({ - code: code, - reason: reason, - wasClean: wasClean - }); - } - }; - HTTPSocket.prototype.onChunk = function (chunk) { - if (chunk.status !== 200) { - return; - } - if (this.readyState === state.OPEN) { - this.onActivity(); - } - var payload; - var type = chunk.data.slice(0, 1); - switch (type) { - case 'o': - payload = JSON.parse(chunk.data.slice(1) || '{}'); - this.onOpen(payload); - break; - case 'a': - payload = JSON.parse(chunk.data.slice(1) || '[]'); - for (var i = 0; i < payload.length; i++) { - this.onEvent(payload[i]); - } - break; - case 'm': - payload = JSON.parse(chunk.data.slice(1) || 'null'); - this.onEvent(payload); - break; - case 'h': - this.hooks.onHeartbeat(this); - break; - case 'c': - payload = JSON.parse(chunk.data.slice(1) || '[]'); - this.onClose(payload[0], payload[1], true); - break; - } - }; - HTTPSocket.prototype.onOpen = function (options) { - if (this.readyState === state.CONNECTING) { - if (options && options.hostname) { - this.location.base = replaceHost(this.location.base, options.hostname); - } - this.readyState = state.OPEN; - if (this.onopen) { - this.onopen(); - } - } - else { - this.onClose(1006, 'Server lost session', true); - } - }; - HTTPSocket.prototype.onEvent = function (event) { - if (this.readyState === state.OPEN && this.onmessage) { - this.onmessage({ data: event }); - } - }; - HTTPSocket.prototype.onActivity = function () { - if (this.onactivity) { - this.onactivity(); - } - }; - HTTPSocket.prototype.onError = function (error) { - if (this.onerror) { - this.onerror(error); - } - }; - HTTPSocket.prototype.openStream = function () { - var _this = this; - this.stream = runtime.createSocketRequest('POST', getUniqueURL(this.hooks.getReceiveURL(this.location, this.session))); - this.stream.bind('chunk', function (chunk) { - _this.onChunk(chunk); - }); - this.stream.bind('finished', function (status) { - _this.hooks.onFinished(_this, status); - }); - this.stream.bind('buffer_too_long', function () { - _this.reconnect(); - }); - try { - this.stream.start(); - } - catch (error) { - util.defer(function () { - _this.onError(error); - _this.onClose(1006, 'Could not start streaming', false); - }); - } - }; - HTTPSocket.prototype.closeStream = function () { - if (this.stream) { - this.stream.unbind_all(); - this.stream.close(); - this.stream = null; - } - }; - return HTTPSocket; -}()); -function getLocation(url) { - var parts = /([^\?]*)\/*(\??.*)/.exec(url); - return { - base: parts[1], - queryString: parts[2] - }; -} -function getSendURL(url, session) { - return url.base + '/' + session + '/xhr_send'; -} -function getUniqueURL(url) { - var separator = url.indexOf('?') === -1 ? '?' : '&'; - return url + separator + 't=' + +new Date() + '&n=' + autoIncrement++; + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +// eslint-disable-next-line strict +var httpAdapter = null; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); } -function replaceHost(url, hostname) { - var urlParts = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(url); - return urlParts[1] + hostname + urlParts[3]; + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; } -function randomNumber(max) { - return runtime.randomInt(max); + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); } -function randomString(length) { - var result = []; - for (var i = 0; i < length; i++) { - result.push(randomNumber(32).toString(32)); - } - return result.join(''); + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array<any>} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); } -/* harmony default export */ var http_socket = (http_socket_HTTPSocket); -// CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts -var http_streaming_socket_hooks = { - getReceiveURL: function (url, session) { - return url.base + '/' + session + '/xhr_streaming' + url.queryString; - }, - onHeartbeat: function (socket) { - socket.sendRaw('[]'); - }, - sendHeartbeat: function (socket) { - socket.sendRaw('[]'); - }, - onFinished: function (socket, status) { - socket.onClose(1006, 'Connection interrupted (' + status + ')', false); +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object<any, any>} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object<string, any>} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); } -}; -/* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks); -// CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts -var http_polling_socket_hooks = { - getReceiveURL: function (url, session) { - return url.base + '/' + session + '/xhr' + url.queryString; - }, - onHeartbeat: function () { - }, - sendHeartbeat: function (socket) { - socket.sendRaw('[]'); - }, - onFinished: function (socket, status) { - if (status === 200) { - socket.reconnect(); - } - else { - socket.onClose(1006, 'Connection interrupted (' + status + ')', false); - } + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); } -}; -/* harmony default export */ var http_polling_socket = (http_polling_socket_hooks); -// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } -var http_xhr_request_hooks = { - getRequest: function (socket) { - var Constructor = runtime.getXHRAPI(); - var xhr = new Constructor(); - xhr.onreadystatechange = xhr.onprogress = function () { - switch (xhr.readyState) { - case 3: - if (xhr.responseText && xhr.responseText.length > 0) { - socket.onChunk(xhr.status, xhr.responseText); - } - break; - case 4: - if (xhr.responseText && xhr.responseText.length > 0) { - socket.onChunk(xhr.status, xhr.responseText); - } - socket.emit('finished', xhr.status); - socket.close(); - break; - } - }; - return xhr; - }, - abortRequest: function (xhr) { - xhr.onreadystatechange = null; - xhr.abort(); + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array<String|Number>} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } } -}; -/* harmony default export */ var http_xhr_request = (http_xhr_request_hooks); -// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + const stack = []; + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); -var HTTP = { - createStreamingSocket: function (url) { - return this.createSocket(http_streaming_socket, url); - }, - createPollingSocket: function (url) { - return this.createSocket(http_polling_socket, url); - }, - createSocket: function (hooks, url) { - return new http_socket(hooks, url); - }, - createXHR: function (method, url) { - return this.createRequest(http_xhr_request, method, url); - }, - createRequest: function (hooks, method, url) { - return new http_request(hooks, method, url); + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); } -}; -/* harmony default export */ var http_http = (HTTP); -// CONCATENATED MODULE: ./src/runtimes/web/http/http.ts + stack.push(value); + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); -http_http.createXDR = function (method, url) { - return this.createRequest(http_xdomain_request, method, url); -}; -/* harmony default export */ var web_http_http = (http_http); + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); -// CONCATENATED MODULE: ./src/runtimes/web/runtime.ts + stack.pop(); + } + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + build(obj); + return formData; +} +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object<string, any>} params - The parameters to be converted to a FormData object. + * @param {Object<string, any>} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); +} +const prototype = AxiosURLSearchParams.prototype; +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} -var Runtime = { - nextAuthCallbackID: 1, - auth_callbacks: {}, - ScriptReceivers: ScriptReceivers, - DependenciesReceivers: DependenciesReceivers, - getDefaultStrategy: default_strategy, - Transports: transports_transports, - transportConnectionInitializer: transport_connection_initializer, - HTTPFactory: web_http_http, - TimelineTransport: jsonp_timeline, - getXHRAPI: function () { - return window.XMLHttpRequest; - }, - getWebSocketAPI: function () { - return window.WebSocket || window.MozWebSocket; - }, - setup: function (PusherClass) { - var _this = this; - window.Pusher = PusherClass; - var initializeOnDocumentBody = function () { - _this.onDocumentBody(PusherClass.ready); - }; - if (!window.JSON) { - Dependencies.load('json2', {}, initializeOnDocumentBody); - } - else { - initializeOnDocumentBody(); - } - }, - getDocument: function () { - return document; - }, - getProtocol: function () { - return this.getDocument().location.protocol; - }, - getAuthorizers: function () { - return { ajax: xhr_auth, jsonp: jsonp_auth }; - }, - onDocumentBody: function (callback) { - var _this = this; - if (document.body) { - callback(); - } - else { - setTimeout(function () { - _this.onDocumentBody(callback); - }, 0); - } - }, - createJSONPRequest: function (url, data) { - return new jsonp_request(url, data); - }, - createScriptRequest: function (src) { - return new script_request(src); - }, - getLocalStorage: function () { - try { - return window.localStorage; - } - catch (e) { - return undefined; - } - }, - createXHR: function () { - if (this.getXHRAPI()) { - return this.createXMLHttpRequest(); - } - else { - return this.createMicrosoftXHR(); - } - }, - createXMLHttpRequest: function () { - var Constructor = this.getXHRAPI(); - return new Constructor(); - }, - createMicrosoftXHR: function () { - return new ActiveXObject('Microsoft.XMLHTTP'); - }, - getNetwork: function () { - return net_info_Network; - }, - createWebSocket: function (url) { - var Constructor = this.getWebSocketAPI(); - return new Constructor(url); - }, - createSocketRequest: function (method, url) { - if (this.isXHRSupported()) { - return this.HTTPFactory.createXHR(method, url); - } - else if (this.isXDRSupported(url.indexOf('https:') === 0)) { - return this.HTTPFactory.createXDR(method, url); - } - else { - throw 'Cross-origin HTTP requests are not supported'; - } - }, - isXHRSupported: function () { - var Constructor = this.getXHRAPI(); - return (Boolean(Constructor) && new Constructor().withCredentials !== undefined); - }, - isXDRSupported: function (useTLS) { - var protocol = useTLS ? 'https:' : 'http:'; - var documentProtocol = this.getProtocol(); - return (Boolean(window['XDomainRequest']) && documentProtocol === protocol); - }, - addUnloadListener: function (listener) { - if (window.addEventListener !== undefined) { - window.addEventListener('unload', listener, false); - } - else if (window.attachEvent !== undefined) { - window.attachEvent('onunload', listener); - } - }, - removeUnloadListener: function (listener) { - if (window.addEventListener !== undefined) { - window.removeEventListener('unload', listener, false); - } - else if (window.detachEvent !== undefined) { - window.detachEvent('onunload', listener); - } - }, - randomInt: function (max) { - var random = function () { - var crypto = window.crypto || window['msCrypto']; - var random = crypto.getRandomValues(new Uint32Array(1))[0]; - return random / Math.pow(2, 32); - }; - return Math.floor(random() * max); +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); } -}; -/* harmony default export */ var runtime = (Runtime); + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } -// CONCATENATED MODULE: ./src/core/timeline/level.ts -var TimelineLevel; -(function (TimelineLevel) { - TimelineLevel[TimelineLevel["ERROR"] = 3] = "ERROR"; - TimelineLevel[TimelineLevel["INFO"] = 6] = "INFO"; - TimelineLevel[TimelineLevel["DEBUG"] = 7] = "DEBUG"; -})(TimelineLevel || (TimelineLevel = {})); -/* harmony default export */ var timeline_level = (TimelineLevel); + return url; +} -// CONCATENATED MODULE: ./src/core/timeline/timeline.ts +class InterceptorManager { + constructor() { + this.handlers = []; + } + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } -var timeline_Timeline = (function () { - function Timeline(key, session, options) { - this.key = key; - this.session = session; - this.events = []; - this.options = options || {}; - this.sent = 0; - this.uniqueID = 0; + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; } - Timeline.prototype.log = function (level, event) { - if (level <= this.options.level) { - this.events.push(extend({}, event, { timestamp: util.now() })); - if (this.options.limit && this.events.length > this.options.limit) { - this.events.shift(); - } - } - }; - Timeline.prototype.error = function (event) { - this.log(timeline_level.ERROR, event); - }; - Timeline.prototype.info = function (event) { - this.log(timeline_level.INFO, event); - }; - Timeline.prototype.debug = function (event) { - this.log(timeline_level.DEBUG, event); - }; - Timeline.prototype.isEmpty = function () { - return this.events.length === 0; - }; - Timeline.prototype.send = function (sendfn, callback) { - var _this = this; - var data = extend({ - session: this.session, - bundle: this.sent + 1, - key: this.key, - lib: 'js', - version: this.options.version, - cluster: this.options.cluster, - features: this.options.features, - timeline: this.events - }, this.options.params); - this.events = []; - sendfn(data, function (error, result) { - if (!error) { - _this.sent++; - } - if (callback) { - callback(error, result); - } - }); - return true; - }; - Timeline.prototype.generateUniqueID = function () { - this.uniqueID++; - return this.uniqueID; - }; - return Timeline; -}()); -/* harmony default export */ var timeline_timeline = (timeline_Timeline); + } -// CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +var InterceptorManager$1 = InterceptorManager; +var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; +var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; +var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; -var transport_strategy_TransportStrategy = (function () { - function TransportStrategy(name, priority, transport, options) { - this.name = name; - this.priority = priority; - this.transport = transport; - this.options = options || {}; +var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + +var platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv +}); + +var platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); } - TransportStrategy.prototype.isSupported = function () { - return this.transport.isSupported({ - useTLS: this.options.useTLS - }); - }; - TransportStrategy.prototype.connect = function (minPriority, callback) { - var _this = this; - if (!this.isSupported()) { - return failAttempt(new UnsupportedStrategy(), callback); - } - else if (this.priority < minPriority) { - return failAttempt(new TransportPriorityTooLow(), callback); - } - var connected = false; - var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options); - var handshake = null; - var onInitialized = function () { - transport.unbind('initialized', onInitialized); - transport.connect(); - }; - var onOpen = function () { - handshake = factory.createHandshake(transport, function (result) { - connected = true; - unbindListeners(); - callback(null, result); - }); - }; - var onError = function (error) { - unbindListeners(); - callback(error); - }; - var onClosed = function () { - unbindListeners(); - var serializedTransport; - serializedTransport = safeJSONStringify(transport); - callback(new TransportClosed(serializedTransport)); - }; - var unbindListeners = function () { - transport.unbind('initialized', onInitialized); - transport.unbind('open', onOpen); - transport.unbind('error', onError); - transport.unbind('closed', onClosed); - }; - transport.bind('initialized', onInitialized); - transport.bind('open', onOpen); - transport.bind('error', onError); - transport.bind('closed', onClosed); - transport.initialize(); - return { - abort: function () { - if (connected) { - return; - } - unbindListeners(); - if (handshake) { - handshake.close(); - } - else { - transport.close(); - } - }, - forceMinPriority: function (p) { - if (connected) { - return; - } - if (_this.priority < p) { - if (handshake) { - handshake.close(); - } - else { - transport.close(); - } - } - } - }; - }; - return TransportStrategy; -}()); -/* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy); -function failAttempt(error, callback) { - util.defer(function () { - callback(error); + }, options)); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array<any>} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object<string, any> | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); }); - return { - abort: function () { }, - forceMinPriority: function () { } - }; + + return obj; + } + + return null; } -// CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + return (encoder || JSON.stringify)(rawValue); +} +const defaults = { + transitional: transitionalDefaults, + adapter: ['xhr', 'http'], -var strategy_builder_Transports = runtime.Transports; -var strategy_builder_defineTransport = function (config, name, type, priority, options, manager) { - var transportClass = strategy_builder_Transports[type]; - if (!transportClass) { - throw new UnsupportedTransport(type); + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); } - var enabled = (!config.enabledTransports || - arrayIndexOf(config.enabledTransports, name) !== -1) && - (!config.disabledTransports || - arrayIndexOf(config.disabledTransports, name) === -1); - var transport; - if (enabled) { - options = Object.assign({ ignoreNullOrigin: config.ignoreNullOrigin }, options); - transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options); + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; } - else { - transport = strategy_builder_UnsupportedStrategy; + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) + ) { + return data; } - return transport; -}; -var strategy_builder_UnsupportedStrategy = { - isSupported: function () { - return false; - }, - connect: function (_, callback) { - var deferred = util.defer(function () { - callback(new UnsupportedStrategy()); - }); - return { - abort: function () { - deferred.ensureAborted(); - }, - forceMinPriority: function () { } - }; + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); } -}; -// CONCATENATED MODULE: ./src/core/auth/user_authenticator.ts + let isFileList; + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } -var composeChannelQuery = function (params, authOptions) { - var query = 'socket_id=' + encodeURIComponent(params.socketId); - for (var key in authOptions.params) { - query += - '&' + - encodeURIComponent(key) + - '=' + - encodeURIComponent(authOptions.params[key]); + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } } - if (authOptions.paramsProvider != null) { - var dynamicParams = authOptions.paramsProvider(); - for (var key in dynamicParams) { - query += - '&' + - encodeURIComponent(key) + - '=' + - encodeURIComponent(dynamicParams[key]); + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; } + } } - return query; -}; -var UserAuthenticator = function (authOptions) { - if (typeof runtime.getAuthorizers()[authOptions.transport] === 'undefined') { - throw "'" + authOptions.transport + "' is not a recognized auth transport"; + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined } - return function (params, callback) { - var query = composeChannelQuery(params, authOptions); - runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.UserAuthentication, callback); - }; + } }; -/* harmony default export */ var user_authenticator = (UserAuthenticator); -// CONCATENATED MODULE: ./src/core/auth/channel_authorizer.ts +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); +var defaults$1 = defaults; -var channel_authorizer_composeChannelQuery = function (params, authOptions) { - var query = 'socket_id=' + encodeURIComponent(params.socketId); - query += '&channel_name=' + encodeURIComponent(params.channelName); - for (var key in authOptions.params) { - query += - '&' + - encodeURIComponent(key) + - '=' + - encodeURIComponent(authOptions.params[key]); +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +var parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; } - if (authOptions.paramsProvider != null) { - var dynamicParams = authOptions.paramsProvider(); - for (var key in dynamicParams) { - query += - '&' + - encodeURIComponent(key) + - '=' + - encodeURIComponent(dynamicParams[key]); - } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } } - return query; -}; -var ChannelAuthorizer = function (authOptions) { - if (typeof runtime.getAuthorizers()[authOptions.transport] === 'undefined') { - throw "'" + authOptions.transport + "' is not a recognized auth transport"; + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); } - return function (params, callback) { - var query = channel_authorizer_composeChannelQuery(params, authOptions); - runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.ChannelAuthorization, callback); - }; -}; -/* harmony default export */ var channel_authorizer = (ChannelAuthorizer); -// CONCATENATED MODULE: ./src/core/auth/deprecated_channel_authorizer.ts -var ChannelAuthorizerProxy = function (pusher, authOptions, channelAuthorizerGenerator) { - var deprecatedAuthorizerOptions = { - authTransport: authOptions.transport, - authEndpoint: authOptions.endpoint, - auth: { - params: authOptions.params, - headers: authOptions.headers + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; } - }; - return function (params, callback) { - var channel = pusher.channel(params.channelName); - var channelAuthorizer = channelAuthorizerGenerator(channel, deprecatedAuthorizerOptions); - channelAuthorizer.authorize(params.socketId, callback); - }; -}; -// CONCATENATED MODULE: ./src/core/config.ts -var __assign = ( false) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + if (parser === true) { + return parseTokens(value); } - return t; - }; - return __assign.apply(this, arguments); -}; + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); -function getConfig(opts, pusher) { - var config = { - activityTimeout: opts.activityTimeout || defaults.activityTimeout, - cluster: opts.cluster || defaults.cluster, - httpPath: opts.httpPath || defaults.httpPath, - httpPort: opts.httpPort || defaults.httpPort, - httpsPort: opts.httpsPort || defaults.httpsPort, - pongTimeout: opts.pongTimeout || defaults.pongTimeout, - statsHost: opts.statsHost || defaults.stats_host, - unavailableTimeout: opts.unavailableTimeout || defaults.unavailableTimeout, - wsPath: opts.wsPath || defaults.wsPath, - wsPort: opts.wsPort || defaults.wsPort, - wssPort: opts.wssPort || defaults.wssPort, - enableStats: getEnableStatsConfig(opts), - httpHost: getHttpHost(opts), - useTLS: shouldUseTLS(opts), - wsHost: getWebsocketHost(opts), - userAuthenticator: buildUserAuthenticator(opts), - channelAuthorizer: buildChannelAuthorizer(opts, pusher) - }; - if ('disabledTransports' in opts) - config.disabledTransports = opts.disabledTransports; - if ('enabledTransports' in opts) - config.enabledTransports = opts.enabledTransports; - if ('ignoreNullOrigin' in opts) - config.ignoreNullOrigin = opts.ignoreNullOrigin; - if ('timelineParams' in opts) - config.timelineParams = opts.timelineParams; - if ('nacl' in opts) { - config.nacl = opts.nacl; - } - return config; -} -function getHttpHost(opts) { - if (opts.httpHost) { - return opts.httpHost; - } - if (opts.cluster) { - return "sockjs-" + opts.cluster + ".pusher.com"; + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); } - return defaults.httpHost; -} -function getWebsocketHost(opts) { - if (opts.wsHost) { - return opts.wsHost; + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } } - if (opts.cluster) { - return getWebsocketHostFromCluster(opts.cluster); + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); } - return getWebsocketHostFromCluster(defaults.cluster); -} -function getWebsocketHostFromCluster(cluster) { - return "ws-" + cluster + ".pusher.com"; -} -function shouldUseTLS(opts) { - if (runtime.getProtocol() === 'https:') { - return true; + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } } - else if (opts.forceTLS === false) { - return false; + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } } - return true; + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } } -function getEnableStatsConfig(opts) { - if ('enableStats' in opts) { - return opts.enableStats; - } - if ('disableStats' in opts) { - return !opts.disableStats; + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; } - return false; + } +}); + +utils$1.freezeMethods(AxiosHeaders); + +var AxiosHeaders$1 = AxiosHeaders; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; } -function buildUserAuthenticator(opts) { - var userAuthentication = __assign(__assign({}, defaults.userAuthentication), opts.userAuthentication); - if ('customHandler' in userAuthentication && - userAuthentication['customHandler'] != null) { - return userAuthentication['customHandler']; - } - return user_authenticator(userAuthentication); + +function isCancel(value) { + return !!(value && value.__CANCEL__); } -function buildChannelAuth(opts, pusher) { - var channelAuthorization; - if ('channelAuthorization' in opts) { - channelAuthorization = __assign(__assign({}, defaults.channelAuthorization), opts.channelAuthorization); - } - else { - channelAuthorization = { - transport: opts.authTransport || defaults.authTransport, - endpoint: opts.authEndpoint || defaults.authEndpoint - }; - if ('auth' in opts) { - if ('params' in opts.auth) - channelAuthorization.params = opts.auth.params; - if ('headers' in opts.auth) - channelAuthorization.headers = opts.auth.headers; - } - if ('authorizer' in opts) - channelAuthorization.customHandler = ChannelAuthorizerProxy(pusher, channelAuthorization, opts.authorizer); - } - return channelAuthorization; + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; } -function buildChannelAuthorizer(opts, pusher) { - var channelAuthorization = buildChannelAuth(opts, pusher); - if ('customHandler' in channelAuthorization && - channelAuthorization['customHandler'] != null) { - return channelAuthorization['customHandler']; - } - return channel_authorizer(channelAuthorization); + +utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } } -// CONCATENATED MODULE: ./src/core/watchlist.ts -var watchlist_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var cookies = platform.hasStandardBrowserEnv ? + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; -var watchlist_WatchlistFacade = (function (_super) { - watchlist_extends(WatchlistFacade, _super); - function WatchlistFacade(pusher) { - var _this = _super.call(this, function (eventName, data) { - logger.debug("No callbacks on watchlist events for " + eventName); - }) || this; - _this.pusher = pusher; - _this.bindWatchlistInternalEvent(); - return _this; + utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); + + utils$1.isString(path) && cookie.push('path=' + path); + + utils$1.isString(domain) && cookie.push('domain=' + domain); + + secure === true && cookie.push('secure'); + + document.cookie = cookie.join('; '); + }, + + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000); } - WatchlistFacade.prototype.handleEvent = function (pusherEvent) { - var _this = this; - pusherEvent.data.events.forEach(function (watchlistEvent) { - _this.emit(watchlistEvent.name, watchlistEvent); - }); - }; - WatchlistFacade.prototype.bindWatchlistInternalEvent = function () { - var _this = this; - this.pusher.connection.bind('message', function (pusherEvent) { - var eventName = pusherEvent.event; - if (eventName === 'pusher_internal:watchlist_events') { - _this.handleEvent(pusherEvent); - } - }); - }; - return WatchlistFacade; -}(dispatcher)); -/* harmony default export */ var watchlist = (watchlist_WatchlistFacade); + } -// CONCATENATED MODULE: ./src/core/utils/flat_promise.ts -function flatPromise() { - var resolve, reject; - var promise = new Promise(function (res, rej) { - resolve = res; - reject = rej; - }); - return { promise: promise, resolve: resolve, reject: reject }; + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); } -/* harmony default export */ var flat_promise = (flatPromise); -// CONCATENATED MODULE: ./src/core/user.ts -var user_extends = ( false) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +var isURLSameOrigin = platform.hasStandardBrowserEnv ? +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute('href', href); -var user_UserFacade = (function (_super) { - user_extends(UserFacade, _super); - function UserFacade(pusher) { - var _this = _super.call(this, function (eventName, data) { - logger.debug('No callbacks on user for ' + eventName); - }) || this; - _this.signin_requested = false; - _this.user_data = null; - _this.serverToUserChannel = null; - _this.signinDonePromise = null; - _this._signinDoneResolve = null; - _this._onAuthorize = function (err, authData) { - if (err) { - logger.warn("Error during signin: " + err); - _this._cleanup(); - return; - } - _this.pusher.send_event('pusher:signin', { - auth: authData.auth, - user_data: authData.user_data - }); - }; - _this.pusher = pusher; - _this.pusher.connection.bind('state_change', function (_a) { - var previous = _a.previous, current = _a.current; - if (previous !== 'connected' && current === 'connected') { - _this._signin(); - } - if (previous === 'connected' && current !== 'connected') { - _this._cleanup(); - _this._newSigninPromiseIfNeeded(); - } - }); - _this.watchlist = new watchlist(pusher); - _this.pusher.connection.bind('message', function (event) { - var eventName = event.event; - if (eventName === 'pusher:signin_success') { - _this._onSigninSuccess(event.data); - } - if (_this.serverToUserChannel && - _this.serverToUserChannel.name === event.channel) { - _this.serverToUserChannel.handleEvent(event); - } - }); - return _this; + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; } - UserFacade.prototype.signin = function () { - if (this.signin_requested) { - return; - } - this.signin_requested = true; - this._signin(); - }; - UserFacade.prototype._signin = function () { - if (!this.signin_requested) { - return; - } - this._newSigninPromiseIfNeeded(); - if (this.pusher.connection.state !== 'connected') { - return; - } - this.pusher.config.userAuthenticator({ - socketId: this.pusher.connection.socket_id - }, this._onAuthorize); - }; - UserFacade.prototype._onSigninSuccess = function (data) { - try { - this.user_data = JSON.parse(data.user_data); - } - catch (e) { - logger.error("Failed parsing user data after signin: " + data.user_data); - this._cleanup(); - return; - } - if (typeof this.user_data.id !== 'string' || this.user_data.id === '') { - logger.error("user_data doesn't contain an id. user_data: " + this.user_data); - this._cleanup(); - return; - } - this._signinDoneResolve(); - this._subscribeChannels(); - }; - UserFacade.prototype._subscribeChannels = function () { - var _this = this; - var ensure_subscribed = function (channel) { - if (channel.subscriptionPending && channel.subscriptionCancelled) { - channel.reinstateSubscription(); - } - else if (!channel.subscriptionPending && - _this.pusher.connection.state === 'connected') { - channel.subscribe(); - } - }; - this.serverToUserChannel = new channels_channel("#server-to-user-" + this.user_data.id, this.pusher); - this.serverToUserChannel.bind_global(function (eventName, data) { - if (eventName.indexOf('pusher_internal:') === 0 || - eventName.indexOf('pusher:') === 0) { - return; - } - _this.emit(eventName, data); - }); - ensure_subscribed(this.serverToUserChannel); + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); }; - UserFacade.prototype._cleanup = function () { - this.user_data = null; - if (this.serverToUserChannel) { - this.serverToUserChannel.unbind_all(); - this.serverToUserChannel.disconnect(); - this.serverToUserChannel = null; - } - if (this.signin_requested) { - this._signinDoneResolve(); - } + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; }; - UserFacade.prototype._newSigninPromiseIfNeeded = function () { - if (!this.signin_requested) { - return; - } - if (this.signinDonePromise && !this.signinDonePromise.done) { - return; - } - var _a = flat_promise(), promise = _a.promise, resolve = _a.resolve, _ = _a.reject; - promise.done = false; - var setDone = function () { - promise.done = true; - }; - promise.then(setDone)["catch"](setDone); - this.signinDonePromise = promise; - this._signinDoneResolve = resolve; + })(); + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e }; - return UserFacade; -}(dispatcher)); -/* harmony default export */ var user = (user_UserFacade); -// CONCATENATED MODULE: ./src/core/pusher.ts + data[isDownloadStream ? 'download' : 'upload'] = true; + listener(data); + }; +} +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; +var xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders$1.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + let contentType; + if (utils$1.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } + let request = new XMLHttpRequest(); + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + const fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + // Set the request timeout in MS + request.timeout = config.timeout; + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$1.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; -var pusher_Pusher = (function () { - function Pusher(app_key, options) { - var _this = this; - checkAppKey(app_key); - options = options || {}; - if (!options.cluster && !(options.wsHost || options.httpHost)) { - var suffix = url_store.buildLogSuffix('javascriptQuickStart'); - logger.warn("You should always specify a cluster when connecting. " + suffix); - } - if ('disableStats' in options) { - logger.warn('The disableStats option is deprecated in favor of enableStats'); - } - this.key = app_key; - this.config = getConfig(options, this); - this.channels = factory.createChannels(); - this.global_emitter = new dispatcher(); - this.sessionID = runtime.randomInt(1000000000); - this.timeline = new timeline_timeline(this.key, this.sessionID, { - cluster: this.config.cluster, - features: Pusher.getClientFeatures(), - params: this.config.timelineParams || {}, - limit: 50, - level: timeline_level.INFO, - version: defaults.VERSION - }); - if (this.config.enableStats) { - this.timelineSender = factory.createTimelineSender(this.timeline, { - host: this.config.statsHost, - path: '/timeline/v2/' + runtime.TimelineTransport.name - }); - } - var getStrategy = function (options) { - return runtime.getDefaultStrategy(_this.config, options, strategy_builder_defineTransport); - }; - this.connection = factory.createConnectionManager(this.key, { - getStrategy: getStrategy, - timeline: this.timeline, - activityTimeout: this.config.activityTimeout, - pongTimeout: this.config.pongTimeout, - unavailableTimeout: this.config.unavailableTimeout, - useTLS: Boolean(this.config.useTLS) - }); - this.connection.bind('connected', function () { - _this.subscribeAll(); - if (_this.timelineSender) { - _this.timelineSender.send(_this.connection.isUsingTLS()); - } - }); - this.connection.bind('message', function (event) { - var eventName = event.event; - var internal = eventName.indexOf('pusher_internal:') === 0; - if (event.channel) { - var channel = _this.channel(event.channel); - if (channel) { - channel.handleEvent(event); - } - } - if (!internal) { - _this.global_emitter.emit(event.event, event.data); - } - }); - this.connection.bind('connecting', function () { - _this.channels.disconnect(); - }); - this.connection.bind('disconnected', function () { - _this.channels.disconnect(); - }); - this.connection.bind('error', function (err) { - logger.warn(err); - }); - Pusher.instances.push(this); - this.timeline.info({ instances: Pusher.instances.length }); - this.user = new user(this); - if (Pusher.isReady) { - this.connect(); - } + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; } - Pusher.ready = function () { - Pusher.isReady = true; - for (var i = 0, l = Pusher.instances.length; i < l; i++) { - Pusher.instances[i].connect(); - } - }; - Pusher.getClientFeatures = function () { - return keys(filterObject({ ws: runtime.Transports.ws }, function (t) { - return t.isSupported({}); - })); - }; - Pusher.prototype.channel = function (name) { - return this.channels.find(name); - }; - Pusher.prototype.allChannels = function () { - return this.channels.all(); - }; - Pusher.prototype.connect = function () { - this.connection.connect(); - if (this.timelineSender) { - if (!this.timelineSenderTimer) { - var usingTLS = this.connection.isUsingTLS(); - var timelineSender = this.timelineSender; - this.timelineSenderTimer = new PeriodicTimer(60000, function () { - timelineSender.send(usingTLS); - }); - } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; } - }; - Pusher.prototype.disconnect = function () { - this.connection.disconnect(); - if (this.timelineSenderTimer) { - this.timelineSenderTimer.ensureAborted(); - this.timelineSenderTimer = null; + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; }; - Pusher.prototype.bind = function (event_name, callback, context) { - this.global_emitter.bind(event_name, callback, context); - return this; - }; - Pusher.prototype.unbind = function (event_name, callback, context) { - this.global_emitter.unbind(event_name, callback, context); - return this; - }; - Pusher.prototype.bind_global = function (callback) { - this.global_emitter.bind_global(callback); - return this; - }; - Pusher.prototype.unbind_global = function (callback) { - this.global_emitter.unbind_global(callback); - return this; - }; - Pusher.prototype.unbind_all = function (callback) { - this.global_emitter.unbind_all(); - return this; - }; - Pusher.prototype.subscribeAll = function () { - var channelName; - for (channelName in this.channels.channels) { - if (this.channels.channels.hasOwnProperty(channelName)) { - this.subscribe(channelName); - } - } + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; }; - Pusher.prototype.subscribe = function (channel_name) { - var channel = this.channels.add(channel_name, this); - if (channel.subscriptionPending && channel.subscriptionCancelled) { - channel.reinstateSubscription(); - } - else if (!channel.subscriptionPending && - this.connection.state === 'connected') { - channel.subscribe(); - } - return channel; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; }; - Pusher.prototype.unsubscribe = function (channel_name) { - var channel = this.channels.find(channel_name); - if (channel && channel.subscriptionPending) { - channel.cancelSubscription(); + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); } - else { - channel = this.channels.remove(channel_name); - if (channel && channel.subscribed) { - channel.unsubscribe(); - } + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; } - }; - Pusher.prototype.send_event = function (event_name, data, channel) { - return this.connection.send_event(event_name, data, channel); - }; - Pusher.prototype.shouldUseTLS = function () { - return this.config.useTLS; - }; - Pusher.prototype.signin = function () { - this.user.signin(); - }; - Pusher.instances = []; - Pusher.isReady = false; - Pusher.logToConsole = false; - Pusher.Runtime = runtime; - Pusher.ScriptReceivers = runtime.ScriptReceivers; - Pusher.DependenciesReceivers = runtime.DependenciesReceivers; - Pusher.auth_callbacks = runtime.auth_callbacks; - return Pusher; -}()); -/* harmony default export */ var core_pusher = __nested_webpack_exports__["default"] = (pusher_Pusher); -function checkAppKey(key) { - if (key === null || key === undefined) { - throw 'You must pass your app key when you instantiate Pusher.'; + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } } -} -runtime.setup(pusher_Pusher); + const protocol = parseProtocol(fullPath); -/***/ }) -/******/ ]); + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +}; + +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } }); -//# sourceMappingURL=pusher.js.map -/***/ }), +const renderReason = (reason) => `- ${reason}`; -/***/ "./node_modules/vue-loader/dist/exportHelper.js": -/*!******************************************************!*\ - !*** ./node_modules/vue-loader/dist/exportHelper.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports) => { +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; -"use strict"; +var adapters = { + getAdapter: (adapters) => { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; -Object.defineProperty(exports, "__esModule", ({ value: true })); -// runtime helper for setting properties on components -// in a tree-shakable way -exports["default"] = (sfc, props) => { - const target = sfc.__vccOpts || sfc; - for (const [key, val] of props) { - target[key] = val; + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; } - return target; + + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; + }, + adapters: knownAdapters }; +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } -/***/ }), + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} -/***/ "./resources/js/vue-components/CopyButton.vue": -/*!****************************************************!*\ - !*** ./resources/js/vue-components/CopyButton.vue ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CopyButton.vue?vue&type=template&id=d28654aa */ "./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa"); -/* harmony import */ var _CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CopyButton.vue?vue&type=script&lang=js */ "./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js"); -/* harmony import */ var _Users_mlantz_Code_open_source_Grafite_scaffold_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); + config.headers = AxiosHeaders$1.from(config.headers); + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter); -; -const __exports__ = /*#__PURE__*/(0,_Users_mlantz_Code_open_source_Grafite_scaffold_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/vue-components/CopyButton.vue"]]) -/* hot reload */ -if (false) {} + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$1.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const VERSION = "1.6.5"; + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); +const deprecatedWarnings = {}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } -/***/ }), + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } -/***/ "./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js": -/*!****************************************************************************!*\ - !*** ./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) -/* harmony export */ }); -/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./CopyButton.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=script&lang=js"); + return validator ? validator(value, opt, opts) : true; + }; +}; +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ -/***/ }), +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} -/***/ "./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa": -/*!**********************************************************************************!*\ - !*** ./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa ***! - \**********************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +var validator = { + assertOptions, + validators: validators$1 +}; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ render: () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__.render) -/* harmony export */ }); -/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_CopyButton_vue_vue_type_template_id_d28654aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./CopyButton.vue?vue&type=template&id=d28654aa */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/vue-components/CopyButton.vue?vue&type=template&id=d28654aa"); +const validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } -/***/ }), + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } -/***/ "./node_modules/vue/dist/vue.esm-bundler.js": -/*!**************************************************!*\ - !*** ./node_modules/vue/dist/vue.esm-bundler.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + config = mergeConfig(this.defaults, config); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ BaseTransition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransition), -/* harmony export */ BaseTransitionPropsValidators: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.BaseTransitionPropsValidators), -/* harmony export */ Comment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Comment), -/* harmony export */ EffectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.EffectScope), -/* harmony export */ Fragment: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Fragment), -/* harmony export */ KeepAlive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.KeepAlive), -/* harmony export */ ReactiveEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ReactiveEffect), -/* harmony export */ Static: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Static), -/* harmony export */ Suspense: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Suspense), -/* harmony export */ Teleport: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Teleport), -/* harmony export */ Text: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Text), -/* harmony export */ Transition: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.Transition), -/* harmony export */ TransitionGroup: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.TransitionGroup), -/* harmony export */ VueElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.VueElement), -/* harmony export */ assertNumber: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.assertNumber), -/* harmony export */ callWithAsyncErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithAsyncErrorHandling), -/* harmony export */ callWithErrorHandling: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.callWithErrorHandling), -/* harmony export */ camelize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.camelize), -/* harmony export */ capitalize: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.capitalize), -/* harmony export */ cloneVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.cloneVNode), -/* harmony export */ compatUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.compatUtils), -/* harmony export */ compile: () => (/* binding */ compileToFunction), -/* harmony export */ computed: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.computed), -/* harmony export */ createApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createApp), -/* harmony export */ createBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createBlock), -/* harmony export */ createCommentVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode), -/* harmony export */ createElementBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementBlock), -/* harmony export */ createElementVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createElementVNode), -/* harmony export */ createHydrationRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createHydrationRenderer), -/* harmony export */ createPropsRestProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createPropsRestProxy), -/* harmony export */ createRenderer: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createRenderer), -/* harmony export */ createSSRApp: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSSRApp), -/* harmony export */ createSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createSlots), -/* harmony export */ createStaticVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createStaticVNode), -/* harmony export */ createTextVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createTextVNode), -/* harmony export */ createVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.createVNode), -/* harmony export */ customRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.customRef), -/* harmony export */ defineAsyncComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineAsyncComponent), -/* harmony export */ defineComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineComponent), -/* harmony export */ defineCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineCustomElement), -/* harmony export */ defineEmits: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineEmits), -/* harmony export */ defineExpose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineExpose), -/* harmony export */ defineModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineModel), -/* harmony export */ defineOptions: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineOptions), -/* harmony export */ defineProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineProps), -/* harmony export */ defineSSRCustomElement: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSSRCustomElement), -/* harmony export */ defineSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.defineSlots), -/* harmony export */ devtools: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.devtools), -/* harmony export */ effect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effect), -/* harmony export */ effectScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.effectScope), -/* harmony export */ getCurrentInstance: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance), -/* harmony export */ getCurrentScope: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getCurrentScope), -/* harmony export */ getTransitionRawChildren: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.getTransitionRawChildren), -/* harmony export */ guardReactiveProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps), -/* harmony export */ h: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.h), -/* harmony export */ handleError: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.handleError), -/* harmony export */ hasInjectionContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hasInjectionContext), -/* harmony export */ hydrate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.hydrate), -/* harmony export */ initCustomFormatter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initCustomFormatter), -/* harmony export */ initDirectivesForSSR: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.initDirectivesForSSR), -/* harmony export */ inject: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.inject), -/* harmony export */ isMemoSame: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isMemoSame), -/* harmony export */ isProxy: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isProxy), -/* harmony export */ isReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReactive), -/* harmony export */ isReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isReadonly), -/* harmony export */ isRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRef), -/* harmony export */ isRuntimeOnly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isRuntimeOnly), -/* harmony export */ isShallow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isShallow), -/* harmony export */ isVNode: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.isVNode), -/* harmony export */ markRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.markRaw), -/* harmony export */ mergeDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeDefaults), -/* harmony export */ mergeModels: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeModels), -/* harmony export */ mergeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.mergeProps), -/* harmony export */ nextTick: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.nextTick), -/* harmony export */ normalizeClass: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeClass), -/* harmony export */ normalizeProps: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeProps), -/* harmony export */ normalizeStyle: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle), -/* harmony export */ onActivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onActivated), -/* harmony export */ onBeforeMount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount), -/* harmony export */ onBeforeUnmount: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount), -/* harmony export */ onBeforeUpdate: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onBeforeUpdate), -/* harmony export */ onDeactivated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onDeactivated), -/* harmony export */ onErrorCaptured: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onErrorCaptured), -/* harmony export */ onMounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onMounted), -/* harmony export */ onRenderTracked: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTracked), -/* harmony export */ onRenderTriggered: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onRenderTriggered), -/* harmony export */ onScopeDispose: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onScopeDispose), -/* harmony export */ onServerPrefetch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onServerPrefetch), -/* harmony export */ onUnmounted: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUnmounted), -/* harmony export */ onUpdated: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.onUpdated), -/* harmony export */ openBlock: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.openBlock), -/* harmony export */ popScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.popScopeId), -/* harmony export */ provide: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.provide), -/* harmony export */ proxyRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.proxyRefs), -/* harmony export */ pushScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.pushScopeId), -/* harmony export */ queuePostFlushCb: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.queuePostFlushCb), -/* harmony export */ reactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.reactive), -/* harmony export */ readonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.readonly), -/* harmony export */ ref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ref), -/* harmony export */ registerRuntimeCompiler: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.registerRuntimeCompiler), -/* harmony export */ render: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.render), -/* harmony export */ renderList: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderList), -/* harmony export */ renderSlot: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.renderSlot), -/* harmony export */ resolveComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveComponent), -/* harmony export */ resolveDirective: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDirective), -/* harmony export */ resolveDynamicComponent: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent), -/* harmony export */ resolveFilter: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveFilter), -/* harmony export */ resolveTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.resolveTransitionHooks), -/* harmony export */ setBlockTracking: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setBlockTracking), -/* harmony export */ setDevtoolsHook: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setDevtoolsHook), -/* harmony export */ setTransitionHooks: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.setTransitionHooks), -/* harmony export */ shallowReactive: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReactive), -/* harmony export */ shallowReadonly: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowReadonly), -/* harmony export */ shallowRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.shallowRef), -/* harmony export */ ssrContextKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrContextKey), -/* harmony export */ ssrUtils: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.ssrUtils), -/* harmony export */ stop: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.stop), -/* harmony export */ toDisplayString: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toDisplayString), -/* harmony export */ toHandlerKey: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlerKey), -/* harmony export */ toHandlers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toHandlers), -/* harmony export */ toRaw: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRaw), -/* harmony export */ toRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRef), -/* harmony export */ toRefs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toRefs), -/* harmony export */ toValue: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.toValue), -/* harmony export */ transformVNodeArgs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.transformVNodeArgs), -/* harmony export */ triggerRef: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.triggerRef), -/* harmony export */ unref: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.unref), -/* harmony export */ useAttrs: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useAttrs), -/* harmony export */ useCssModule: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssModule), -/* harmony export */ useCssVars: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useCssVars), -/* harmony export */ useModel: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useModel), -/* harmony export */ useSSRContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSSRContext), -/* harmony export */ useSlots: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useSlots), -/* harmony export */ useTransitionState: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.useTransitionState), -/* harmony export */ vModelCheckbox: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox), -/* harmony export */ vModelDynamic: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelDynamic), -/* harmony export */ vModelRadio: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelRadio), -/* harmony export */ vModelSelect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelSelect), -/* harmony export */ vModelText: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vModelText), -/* harmony export */ vShow: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.vShow), -/* harmony export */ version: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.version), -/* harmony export */ warn: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.warn), -/* harmony export */ watch: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watch), -/* harmony export */ watchEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchEffect), -/* harmony export */ watchPostEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchPostEffect), -/* harmony export */ watchSyncEffect: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.watchSyncEffect), -/* harmony export */ withAsyncContext: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withAsyncContext), -/* harmony export */ withCtx: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withCtx), -/* harmony export */ withDefaults: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDefaults), -/* harmony export */ withDirectives: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withDirectives), -/* harmony export */ withKeys: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withKeys), -/* harmony export */ withMemo: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withMemo), -/* harmony export */ withModifiers: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withModifiers), -/* harmony export */ withScopeId: () => (/* reexport safe */ _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__.withScopeId) -/* harmony export */ }); -/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js"); -/* harmony import */ var _vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"); -/* harmony import */ var _vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @vue/compiler-dom */ "./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js"); -/* harmony import */ var _vue_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.esm-bundler.js"); + const {transitional, paramsSerializer, headers} = config; + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; -function initDev() { - { - (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.initCustomFormatter)(); + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; } -} -if (true) { - initDev(); + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } } -const compileCache = /* @__PURE__ */ Object.create(null); -function compileToFunction(template, options) { - if (!(0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.isString)(template)) { - if (template.nodeType) { - template = template.innerHTML; - } else { - true && (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`invalid template option: `, template); - return _vue_shared__WEBPACK_IMPORTED_MODULE_2__.NOOP; + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +var Axios$1 = Axios; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); } - const key = template; - const cached = compileCache[key]; - if (cached) { - return cached; + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } } - if (template[0] === "#") { - const el = document.querySelector(template); - if ( true && !el) { - (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(`Template element not found or is empty: ${template}`); + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; } - template = el ? el.innerHTML : ``; } - const opts = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.extend)( - { - hoistStatic: true, - onError: true ? onError : 0, - onWarn: true ? (e) => onError(e, true) : 0 - }, - options - ); - if (!opts.isCustomElement && typeof customElements !== "undefined") { - opts.isCustomElement = (tag) => !!customElements.get(tag); + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } } - const { code } = (0,_vue_compiler_dom__WEBPACK_IMPORTED_MODULE_3__.compile)(template, opts); - function onError(err, asWarning = false) { - const message = asWarning ? err.message : `Template compilation error: ${err.message}`; - const codeFrame = err.loc && (0,_vue_shared__WEBPACK_IMPORTED_MODULE_2__.generateCodeFrame)( - template, - err.loc.start.offset, - err.loc.end.offset - ); - (0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.warn)(codeFrame ? `${message} -${codeFrame}` : message); + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; } - const render = new Function("Vue", code)(_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_0__); - render._rc = true; - return compileCache[key] = render; } -(0,_vue_runtime_dom__WEBPACK_IMPORTED_MODULE_1__.registerRuntimeCompiler)(compileToFunction); +var CancelToken$1 = CancelToken; +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); -/***/ }), +var HttpStatusCode$1 = HttpStatusCode; -/***/ "./node_modules/axios/package.json": -/*!*****************************************!*\ - !*** ./node_modules/axios/package.json ***! - \*****************************************/ -/***/ ((module) => { +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$1; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders$1; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$1; + +axios.default = axios; + +module.exports = axios; +//# sourceMappingURL=axios.cjs.map -"use strict"; -module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}'); /***/ }) @@ -34929,7 +39576,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; -/******/ +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache @@ -34943,17 +39590,17 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ // no module.loaded needed /******/ exports: {} /******/ }; -/******/ +/******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } -/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; -/******/ +/******/ /************************************************************************/ /******/ /* webpack/runtime/chunk loaded */ /******/ (() => { @@ -34986,7 +39633,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ return result; /******/ }; /******/ })(); -/******/ +/******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports @@ -34998,7 +39645,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ } /******/ }; /******/ })(); -/******/ +/******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { @@ -35010,12 +39657,12 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ } /******/ })(); /******/ })(); -/******/ +/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); -/******/ +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -35026,11 +39673,11 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); -/******/ +/******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI -/******/ +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded @@ -35038,19 +39685,19 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ "/js/app": 0, /******/ "css/app": 0 /******/ }; -/******/ +/******/ /******/ // no chunk on demand loading -/******/ +/******/ /******/ // no prefetching -/******/ +/******/ /******/ // no preloaded -/******/ +/******/ /******/ // no HMR -/******/ +/******/ /******/ // no HMR manifest -/******/ +/******/ /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); -/******/ +/******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { /******/ var [chunkIds, moreModules, runtime] = data; @@ -35075,20 +39722,20 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P /******/ } /******/ return __webpack_require__.O(result); /******/ } -/******/ +/******/ /******/ var chunkLoadingGlobal = self["webpackChunkscaffold"] = self["webpackChunkscaffold"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); -/******/ +/******/ /************************************************************************/ -/******/ +/******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module depends on other loaded chunks and execution need to be delayed /******/ __webpack_require__.O(undefined, ["css/app"], () => (__webpack_require__("./resources/js/app.js"))) /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["css/app"], () => (__webpack_require__("./resources/sass/app.scss"))) /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); -/******/ +/******/ /******/ })() ; \ No newline at end of file diff --git a/readme.md b/readme.md index 4c84ad6..92aa0f0 100644 --- a/readme.md +++ b/readme.md @@ -41,6 +41,10 @@ Scaffold is *intended* to be used to start a project and then be heavily altered 1. PHP 8.1+ +## Setup + +sail up + ## Compatibility and Support Since Grafite Scaffold is a starter project it offers no support, and no compatibily guarantees. diff --git a/resources/js/script-components/ajax-forms.js b/resources/js/script-components/ajax-forms.js index 1456cb6..2dabab1 100644 --- a/resources/js/script-components/ajax-forms.js +++ b/resources/js/script-components/ajax-forms.js @@ -2,11 +2,11 @@ * Handling Ajax form submissions */ window.ajax = (_event) => { + let _originalContent = null; _event.preventDefault(); let _form = _event.target.closest('form'); let _button = _event.target; - let _originalContent = null; if (! _button.hasAttribute('data-formsjs-onclick')) { _button = _button.closest('button'); @@ -47,22 +47,33 @@ window.ajax = (_event) => { [error.response.data.errors].forEach((key) => { let _fieldKey = Object.keys(key)[0]; let _errorMessage = document.createElement('div'); + _errorMessage.classList.add('invalid-feedback'); _errorMessage.innerText = error.response.data.errors[_fieldKey]; let _fieldKeySelector = `input[name="${_fieldKey}"]`; let _field = document.querySelector(_fieldKeySelector); + if (! _field) { // means its a select... I guess + _fieldKeySelector = `select[name="${_fieldKey}"]`; + _field = document.querySelector(_fieldKeySelector); + } + + if (! _field) { // means its a textarea... I guess + _fieldKeySelector = `textarea[name="${_fieldKey}"]`; + _field = document.querySelector(_fieldKeySelector); + } + if (! _field.classList.contains('is-invalid')) { _field.classList.add('is-invalid'); _field.parentNode.appendChild(_errorMessage); } - window.Forms_validation(); + window.FormsJS_validation(); }); } - if (_button) { + if (_button && _originalContent) { _button.innerHTML = _originalContent; } }); @@ -71,13 +82,26 @@ window.ajax = (_event) => { window.ajaxDebounced = window.app.debounce(window.ajax); +window.FormsJS_submit_debounce = window.app.debounce((event) => { + if (event.target.form) { + event.target.form.submit(); + } + + if (event.target.tagName === 'FORM') { + event.target.submit(); + } +}); + window.ajaxWithRefresh = function (event) { window.ajax(event); setTimeout(() => { window.Livewire.dispatch('refresh'); setTimeout(() => { - window.FormsJS(); - window.turnOnTooltips(); + let _form = event.target.closest('form'); + + if (_form) { + _form.reset(); + } }, 1000); }, 1000); }; diff --git a/resources/sass/app/_primary_components.scss b/resources/sass/app/_primary_components.scss index 72d0dfb..66077c6 100644 --- a/resources/sass/app/_primary_components.scss +++ b/resources/sass/app/_primary_components.scss @@ -68,3 +68,8 @@ // .cta::after { // content: " ..."; // } + +pre { + background-color: var(--bs-tertiary-bg); + white-space: pre-wrap; +} diff --git a/resources/views/admin/users/index.blade.php b/resources/views/admin/users/index.blade.php index 08ab808..ae50c8b 100755 --- a/resources/views/admin/users/index.blade.php +++ b/resources/views/admin/users/index.blade.php @@ -50,7 +50,7 @@ <div class="card-header"> <h4 class="m-0">User Invites</h4> </div> - <div class="card-body"> + <div class="card-body m-2"> <table class="table table-striped table-borderless m-0 p-0"> <tbody> @foreach($invites as $invite)