From 9f2f064efc0e0faedf1cd127a9c97e8b98c8075b Mon Sep 17 00:00:00 2001 From: laura Date: Wed, 25 Aug 2021 19:04:53 -0400 Subject: [PATCH 01/29] one more --- .DS_Store | Bin 0 -> 6148 bytes .idea/.gitignore | 3 + .idea/compiler.xml | 21 ++ .idea/encodings.xml | 6 + .idea/jarRepositories.xml | 20 ++ .idea/libraries/Maven__antlr_antlr_2_7_7.xml | 13 + ...__ch_qos_logback_logback_classic_1_2_5.xml | 13 + ...ven__ch_qos_logback_logback_core_1_2_5.xml | 13 + .../Maven__com_fasterxml_classmate_1_5_1.xml | 13 + ...ackson_core_jackson_annotations_2_12_4.xml | 13 + ...erxml_jackson_core_jackson_core_2_12_4.xml | 13 + ...l_jackson_core_jackson_databind_2_12_4.xml | 13 + ..._datatype_jackson_datatype_jdk8_2_12_4.xml | 13 + ...atatype_jackson_datatype_jsr310_2_12_4.xml | 13 + ..._jackson_module_parameter_names_2_12_4.xml | 13 + ...n__com_jayway_jsonpath_json_path_2_5_0.xml | 13 + ...un_activation_jakarta_activation_1_2_2.xml | 13 + ...n_istack_istack_commons_runtime_3_0_12.xml | 13 + ...ogle_android_json_0_0_20131108_vaadin1.xml | 13 + .../Maven__com_zaxxer_HikariCP_4_0_3.xml | 13 + ...ctivation_jakarta_activation_api_1_2_2.xml | 13 + ...nnotation_jakarta_annotation_api_1_3_5.xml | 13 + ...sistence_jakarta_persistence_api_2_2_3.xml | 13 + ...nsaction_jakarta_transaction_api_1_3_3.xml | 13 + ...ta_xml_bind_jakarta_xml_bind_api_2_3_3.xml | 13 + ...aven__net_bytebuddy_byte_buddy_1_10_22.xml | 13 + ...net_bytebuddy_byte_buddy_agent_1_10_22.xml | 13 + ...ven__net_minidev_accessors_smart_2_4_7.xml | 13 + .../Maven__net_minidev_json_smart_2_4_7.xml | 13 + ..._apache_logging_log4j_log4j_api_2_14_1.xml | 13 + ...he_logging_log4j_log4j_to_slf4j_2_14_1.xml | 13 + ..._tomcat_embed_tomcat_embed_core_9_0_52.xml | 13 + ...he_tomcat_embed_tomcat_embed_el_9_0_52.xml | 13 + ...at_embed_tomcat_embed_websocket_9_0_52.xml | 13 + ..._org_apiguardian_apiguardian_api_1_1_0.xml | 13 + ...Maven__org_aspectj_aspectjweaver_1_9_7.xml | 13 + ...Maven__org_assertj_assertj_core_3_19_0.xml | 13 + .../Maven__org_dom4j_dom4j_2_1_3.xml | 13 + ..._org_glassfish_jaxb_jaxb_runtime_2_3_5.xml | 13 + .../Maven__org_glassfish_jaxb_txw2_2_3_5.xml | 13 + .../Maven__org_hamcrest_hamcrest_2_2.xml | 13 + ...ernate_commons_annotations_5_1_2_Final.xml | 13 + ..._hibernate_hibernate_core_5_4_32_Final.xml | 13 + ...ven__org_javassist_javassist_3_27_0_GA.xml | 13 + .../Maven__org_jboss_jandex_2_2_3_Final.xml | 13 + ...boss_logging_jboss_logging_3_4_2_Final.xml | 13 + ..._org_junit_jupiter_junit_jupiter_5_7_2.xml | 13 + ..._junit_jupiter_junit_jupiter_api_5_7_2.xml | 13 + ...nit_jupiter_junit_jupiter_engine_5_7_2.xml | 13 + ...nit_jupiter_junit_jupiter_params_5_7_2.xml | 13 + ..._platform_junit_platform_commons_1_7_2.xml | 13 + ...t_platform_junit_platform_engine_1_7_2.xml | 13 + .../Maven__org_mockito_mockito_core_3_9_0.xml | 13 + ...rg_mockito_mockito_junit_jupiter_3_9_0.xml | 13 + .../Maven__org_objenesis_objenesis_3_2.xml | 13 + ...Maven__org_opentest4j_opentest4j_1_2_0.xml | 13 + .../libraries/Maven__org_ow2_asm_asm_9_1.xml | 13 + ...aven__org_skyscreamer_jsonassert_1_5_0.xml | 13 + .../Maven__org_slf4j_jul_to_slf4j_1_7_32.xml | 13 + .../Maven__org_slf4j_slf4j_api_1_7_32.xml | 13 + ...springframework_boot_spring_boot_2_5_4.xml | 13 + ...k_boot_spring_boot_autoconfigure_2_5_4.xml | 13 + ...mework_boot_spring_boot_devtools_2_5_4.xml | 13 + ...amework_boot_spring_boot_starter_2_5_4.xml | 13 + ...ork_boot_spring_boot_starter_aop_2_5_4.xml | 13 + ...oot_spring_boot_starter_data_jpa_2_5_4.xml | 13 + ...rk_boot_spring_boot_starter_jdbc_2_5_4.xml | 13 + ...rk_boot_spring_boot_starter_json_2_5_4.xml | 13 + ...boot_spring_boot_starter_logging_2_5_4.xml | 13 + ...rk_boot_spring_boot_starter_test_2_5_4.xml | 13 + ..._boot_spring_boot_starter_tomcat_2_5_4.xml | 13 + ...ork_boot_spring_boot_starter_web_2_5_4.xml | 13 + ...gframework_boot_spring_boot_test_2_5_4.xml | 13 + ...t_spring_boot_test_autoconfigure_2_5_4.xml | 13 + ...amework_data_spring_data_commons_2_5_4.xml | 13 + ...ngframework_data_spring_data_jpa_2_5_4.xml | 13 + ...__org_springframework_spring_aop_5_3_9.xml | 13 + ...g_springframework_spring_aspects_5_3_9.xml | 13 + ...org_springframework_spring_beans_5_3_9.xml | 13 + ...g_springframework_spring_context_5_3_9.xml | 13 + ..._org_springframework_spring_core_5_3_9.xml | 13 + ...pringframework_spring_expression_5_3_9.xml | 13 + ...__org_springframework_spring_jcl_5_3_9.xml | 13 + ..._org_springframework_spring_jdbc_5_3_9.xml | 13 + ...__org_springframework_spring_orm_5_3_9.xml | 13 + ..._org_springframework_spring_test_5_3_9.xml | 13 + ...n__org_springframework_spring_tx_5_3_9.xml | 13 + ...__org_springframework_spring_web_5_3_9.xml | 13 + ...rg_springframework_spring_webmvc_5_3_9.xml | 13 + .../Maven__org_xmlunit_xmlunit_core_2_8_2.xml | 13 + .../Maven__org_yaml_snakeyaml_1_28.xml | 13 + .idea/misc.xml | 11 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + HELP.md | 20 ++ demo.iml | 101 ++++++ mvnw | 310 ++++++++++++++++++ mvnw.cmd | 182 ++++++++++ pom.xml | 51 +++ .../com/example/demo/DemoApplication.java | 13 + src/main/resources/application.properties | 1 + .../example/demo/DemoApplicationTests.java | 13 + target/classes/application.properties | 1 + .../com/example/demo/DemoApplication.class | Bin 0 -> 733 bytes .../example/demo/DemoApplicationTests.class | Bin 0 -> 531 bytes 105 files changed, 1885 insertions(+) create mode 100644 .DS_Store create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/libraries/Maven__antlr_antlr_2_7_7.xml create mode 100644 .idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_5.xml create mode 100644 .idea/libraries/Maven__ch_qos_logback_logback_core_1_2_5.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_12_4.xml create mode 100644 .idea/libraries/Maven__com_jayway_jsonpath_json_path_2_5_0.xml create mode 100644 .idea/libraries/Maven__com_sun_activation_jakarta_activation_1_2_2.xml create mode 100644 .idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml create mode 100644 .idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml create mode 100644 .idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml create mode 100644 .idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml create mode 100644 .idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml create mode 100644 .idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml create mode 100644 .idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml create mode 100644 .idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml create mode 100644 .idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_22.xml create mode 100644 .idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_22.xml create mode 100644 .idea/libraries/Maven__net_minidev_accessors_smart_2_4_7.xml create mode 100644 .idea/libraries/Maven__net_minidev_json_smart_2_4_7.xml create mode 100644 .idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml create mode 100644 .idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_14_1.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_52.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_52.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_52.xml create mode 100644 .idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml create mode 100644 .idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml create mode 100644 .idea/libraries/Maven__org_assertj_assertj_core_3_19_0.xml create mode 100644 .idea/libraries/Maven__org_dom4j_dom4j_2_1_3.xml create mode 100644 .idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_5.xml create mode 100644 .idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_5.xml create mode 100644 .idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml create mode 100644 .idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml create mode 100644 .idea/libraries/Maven__org_hibernate_hibernate_core_5_4_32_Final.xml create mode 100644 .idea/libraries/Maven__org_javassist_javassist_3_27_0_GA.xml create mode 100644 .idea/libraries/Maven__org_jboss_jandex_2_2_3_Final.xml create mode 100644 .idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_2_Final.xml create mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_7_2.xml create mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_2.xml create mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_2.xml create mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_7_2.xml create mode 100644 .idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_2.xml create mode 100644 .idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_2.xml create mode 100644 .idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml create mode 100644 .idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_9_0.xml create mode 100644 .idea/libraries/Maven__org_objenesis_objenesis_3_2.xml create mode 100644 .idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_9_1.xml create mode 100644 .idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml create mode 100644 .idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_32.xml create mode 100644 .idea/libraries/Maven__org_slf4j_slf4j_api_1_7_32.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_data_spring_data_commons_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_aop_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_aspects_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_beans_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_context_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_core_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_expression_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_jcl_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_jdbc_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_orm_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_test_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_tx_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_web_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_webmvc_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_xmlunit_xmlunit_core_2_8_2.xml create mode 100644 .idea/libraries/Maven__org_yaml_snakeyaml_1_28.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 HELP.md create mode 100644 demo.iml create mode 100755 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/example/demo/DemoApplication.java create mode 100644 src/main/resources/application.properties create mode 100644 src/test/java/com/example/demo/DemoApplicationTests.java create mode 100644 target/classes/application.properties create mode 100644 target/classes/com/example/demo/DemoApplication.class create mode 100644 target/test-classes/com/example/demo/DemoApplicationTests.class diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a59f59db9eae4e09e3f7269b8d0146eb8fc16d79 GIT binary patch literal 6148 zcmeHK%TB{E5FED^ZN;TWj{X5EaRG5lN{c`O3BeDbrpH1Mh{rL%!zaMcm09n$q@-LC zf?a7n&U)5K##S~45Jr!)JzxN!M;C1M*=#Tw7jIb0B3s0e<{07zv(tH5Oy>=@2Y#ah zvUXjZV1hGTptgSHlq0e&Ug`NF8GAs7Yy5;;JnK3yd104h$2DGW$>XfW=e}6+-^o9! z@w>P~N!}1IZ0GBzMCuH z3b+FQK>^lmvEH_#x2}LI;0ml1kncmJ3ucCuV)}HjNk;%;hv8)G%TJ@^M8nLmQsf9N zXev=tgB>w~rZXOmml;-ynvP(Hk6?EWc0vj1?wmg+Izp!Ctt;RPtSivg%YoGY$@k~~ z^(4P?1zdqYr9kM6uf`+3lGWD6%So+`^lQ49@G8Ys3OlJ3lPjfohn|e_C>>&ESSd0> P^B;jEgEy|gk1Fs1lHFMU literal 0 HcmV?d00001 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 000000000..bb1644a14 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 000000000..63e900193 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 000000000..712ab9d98 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__antlr_antlr_2_7_7.xml b/.idea/libraries/Maven__antlr_antlr_2_7_7.xml new file mode 100644 index 000000000..b8d93d8e0 --- /dev/null +++ b/.idea/libraries/Maven__antlr_antlr_2_7_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_5.xml b/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_5.xml new file mode 100644 index 000000000..3b769cbef --- /dev/null +++ b/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_5.xml b/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_5.xml new file mode 100644 index 000000000..568aa1333 --- /dev/null +++ b/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml b/.idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml new file mode 100644 index 000000000..bc7d7fd86 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml new file mode 100644 index 000000000..5351aad07 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml new file mode 100644 index 000000000..b61928ee9 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml new file mode 100644 index 000000000..3088e4d32 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_12_4.xml new file mode 100644 index 000000000..03661abee --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_12_4.xml new file mode 100644 index 000000000..518a6c986 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_12_4.xml b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_12_4.xml new file mode 100644 index 000000000..9c5251c32 --- /dev/null +++ b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_12_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_5_0.xml b/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_5_0.xml new file mode 100644 index 000000000..b76ecb038 --- /dev/null +++ b/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_activation_jakarta_activation_1_2_2.xml b/.idea/libraries/Maven__com_sun_activation_jakarta_activation_1_2_2.xml new file mode 100644 index 000000000..fea99f026 --- /dev/null +++ b/.idea/libraries/Maven__com_sun_activation_jakarta_activation_1_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml b/.idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml new file mode 100644 index 000000000..9f0fc0526 --- /dev/null +++ b/.idea/libraries/Maven__com_sun_istack_istack_commons_runtime_3_0_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml b/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml new file mode 100644 index 000000000..b8581a6f5 --- /dev/null +++ b/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml b/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml new file mode 100644 index 000000000..9314c366f --- /dev/null +++ b/.idea/libraries/Maven__com_zaxxer_HikariCP_4_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml b/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml new file mode 100644 index 000000000..be90656e6 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml b/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml new file mode 100644 index 000000000..cba9dd244 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml b/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml new file mode 100644 index 000000000..c11957d98 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_persistence_jakarta_persistence_api_2_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml b/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml new file mode 100644 index 000000000..5b31fe500 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_transaction_jakarta_transaction_api_1_3_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml b/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml new file mode 100644 index 000000000..04213f738 --- /dev/null +++ b/.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_22.xml b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_22.xml new file mode 100644 index 000000000..db4968eab --- /dev/null +++ b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_22.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_22.xml b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_22.xml new file mode 100644 index 000000000..910ad03fd --- /dev/null +++ b/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_22.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_minidev_accessors_smart_2_4_7.xml b/.idea/libraries/Maven__net_minidev_accessors_smart_2_4_7.xml new file mode 100644 index 000000000..8157bb414 --- /dev/null +++ b/.idea/libraries/Maven__net_minidev_accessors_smart_2_4_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_minidev_json_smart_2_4_7.xml b/.idea/libraries/Maven__net_minidev_json_smart_2_4_7.xml new file mode 100644 index 000000000..a17f648a6 --- /dev/null +++ b/.idea/libraries/Maven__net_minidev_json_smart_2_4_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml new file mode 100644 index 000000000..700b41b8e --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_14_1.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_14_1.xml new file mode 100644 index 000000000..ae5c0b5db --- /dev/null +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_14_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_52.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_52.xml new file mode 100644 index 000000000..241b61d11 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_52.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_52.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_52.xml new file mode 100644 index 000000000..5fdce7ccc --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_52.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_52.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_52.xml new file mode 100644 index 000000000..74e5155a0 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_52.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml b/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml new file mode 100644 index 000000000..f854ab00f --- /dev/null +++ b/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml b/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml new file mode 100644 index 000000000..bbaf9a7fc --- /dev/null +++ b/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_assertj_assertj_core_3_19_0.xml b/.idea/libraries/Maven__org_assertj_assertj_core_3_19_0.xml new file mode 100644 index 000000000..94e438d84 --- /dev/null +++ b/.idea/libraries/Maven__org_assertj_assertj_core_3_19_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_dom4j_dom4j_2_1_3.xml b/.idea/libraries/Maven__org_dom4j_dom4j_2_1_3.xml new file mode 100644 index 000000000..10fb46ae0 --- /dev/null +++ b/.idea/libraries/Maven__org_dom4j_dom4j_2_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_5.xml b/.idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_5.xml new file mode 100644 index 000000000..310bfb8ee --- /dev/null +++ b/.idea/libraries/Maven__org_glassfish_jaxb_jaxb_runtime_2_3_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_5.xml b/.idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_5.xml new file mode 100644 index 000000000..5ad6256c4 --- /dev/null +++ b/.idea/libraries/Maven__org_glassfish_jaxb_txw2_2_3_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml new file mode 100644 index 000000000..6b5496ff0 --- /dev/null +++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml b/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml new file mode 100644 index 000000000..a775836a0 --- /dev/null +++ b/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_1_2_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hibernate_hibernate_core_5_4_32_Final.xml b/.idea/libraries/Maven__org_hibernate_hibernate_core_5_4_32_Final.xml new file mode 100644 index 000000000..a4d5f4d7f --- /dev/null +++ b/.idea/libraries/Maven__org_hibernate_hibernate_core_5_4_32_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_javassist_javassist_3_27_0_GA.xml b/.idea/libraries/Maven__org_javassist_javassist_3_27_0_GA.xml new file mode 100644 index 000000000..39550dac7 --- /dev/null +++ b/.idea/libraries/Maven__org_javassist_javassist_3_27_0_GA.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_jandex_2_2_3_Final.xml b/.idea/libraries/Maven__org_jboss_jandex_2_2_3_Final.xml new file mode 100644 index 000000000..e4e6c8c88 --- /dev/null +++ b/.idea/libraries/Maven__org_jboss_jandex_2_2_3_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_2_Final.xml b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_2_Final.xml new file mode 100644 index 000000000..5fb518147 --- /dev/null +++ b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_2_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_7_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_7_2.xml new file mode 100644 index 000000000..a9a026606 --- /dev/null +++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_2.xml new file mode 100644 index 000000000..2b9b50663 --- /dev/null +++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_2.xml new file mode 100644 index 000000000..636171a62 --- /dev/null +++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_7_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_7_2.xml new file mode 100644 index 000000000..380c9dd7e --- /dev/null +++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_2.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_2.xml new file mode 100644 index 000000000..66260e69a --- /dev/null +++ b/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_2.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_2.xml new file mode 100644 index 000000000..af6fc851f --- /dev/null +++ b/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_7_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml b/.idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml new file mode 100644 index 000000000..a46e35535 --- /dev/null +++ b/.idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_9_0.xml b/.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_9_0.xml new file mode 100644 index 000000000..0fc879a4b --- /dev/null +++ b/.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_9_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml b/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml new file mode 100644 index 000000000..6613def61 --- /dev/null +++ b/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml b/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml new file mode 100644 index 000000000..fbc1b1635 --- /dev/null +++ b/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_9_1.xml b/.idea/libraries/Maven__org_ow2_asm_asm_9_1.xml new file mode 100644 index 000000000..67127c293 --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml b/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml new file mode 100644 index 000000000..c4c54d6d5 --- /dev/null +++ b/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_32.xml b/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_32.xml new file mode 100644 index 000000000..a758eac2a --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_32.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_32.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_32.xml new file mode 100644 index 000000000..e5a84fb0f --- /dev/null +++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_32.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_5_4.xml new file mode 100644 index 000000000..0a1945ab8 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_5_4.xml new file mode 100644 index 000000000..61745f64a --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_5_4.xml new file mode 100644 index 000000000..fc29bb874 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_5_4.xml new file mode 100644 index 000000000..3381161c1 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_5_4.xml new file mode 100644 index 000000000..51cd898df --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_5_4.xml new file mode 100644 index 000000000..c9657d716 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_4.xml new file mode 100644 index 000000000..c66e22ca7 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_5_4.xml new file mode 100644 index 000000000..8014349c9 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_5_4.xml new file mode 100644 index 000000000..b5ab97e2b --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_5_4.xml new file mode 100644 index 000000000..b581ee56b --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_5_4.xml new file mode 100644 index 000000000..503acb788 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_5_4.xml new file mode 100644 index 000000000..230bb3cdb --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_5_4.xml new file mode 100644 index 000000000..10114d4c5 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_5_4.xml new file mode 100644 index 000000000..8d1c0a139 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_5_4.xml b/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_5_4.xml new file mode 100644 index 000000000..3c13af1e9 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_5_4.xml b/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_5_4.xml new file mode 100644 index 000000000..1b905c93d --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_aop_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_aop_5_3_9.xml new file mode 100644 index 000000000..06b191bb0 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_aop_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_aspects_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_aspects_5_3_9.xml new file mode 100644 index 000000000..c8f627cf7 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_aspects_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_beans_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_9.xml new file mode 100644 index 000000000..c5bd2d378 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_beans_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_context_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_context_5_3_9.xml new file mode 100644 index 000000000..4c2900a0e --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_context_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_core_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_core_5_3_9.xml new file mode 100644 index 000000000..2529cbf64 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_core_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_expression_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_expression_5_3_9.xml new file mode 100644 index 000000000..dea9689dc --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_expression_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_9.xml new file mode 100644 index 000000000..feea851c0 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_9.xml new file mode 100644 index 000000000..31e814404 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_jdbc_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_orm_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_orm_5_3_9.xml new file mode 100644 index 000000000..a334be5a8 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_orm_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_test_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_test_5_3_9.xml new file mode 100644 index 000000000..b90da2f0d --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_test_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_tx_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_9.xml new file mode 100644 index 000000000..d8a0e6752 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_tx_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_web_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_web_5_3_9.xml new file mode 100644 index 000000000..eeb831a9e --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_web_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_webmvc_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_webmvc_5_3_9.xml new file mode 100644 index 000000000..b4ee97bcb --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_webmvc_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_8_2.xml b/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_8_2.xml new file mode 100644 index 000000000..e6506e078 --- /dev/null +++ b/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_8_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_yaml_snakeyaml_1_28.xml b/.idea/libraries/Maven__org_yaml_snakeyaml_1_28.xml new file mode 100644 index 000000000..1f853f704 --- /dev/null +++ b/.idea/libraries/Maven__org_yaml_snakeyaml_1_28.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..25daa30c8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..0fb971708 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HELP.md b/HELP.md new file mode 100644 index 000000000..befc34a15 --- /dev/null +++ b/HELP.md @@ -0,0 +1,20 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/#build-image) +* [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#boot-features-developing-web-applications) +* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#boot-features-jpa-and-spring-data) +* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.5.4/reference/htmlsingle/#using-boot-devtools) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) +* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) + diff --git a/demo.iml b/demo.iml new file mode 100644 index 000000000..865e1ef84 --- /dev/null +++ b/demo.iml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mvnw b/mvnw new file mode 100755 index 000000000..a16b5431b --- /dev/null +++ b/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 000000000..c8d43372c --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..9d4377c9a --- /dev/null +++ b/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.5.4 + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Boot + + 1.8 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 000000000..64b538a17 --- /dev/null +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/src/test/java/com/example/demo/DemoApplicationTests.java b/src/test/java/com/example/demo/DemoApplicationTests.java new file mode 100644 index 000000000..2778a6a7e --- /dev/null +++ b/src/test/java/com/example/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1 @@ + diff --git a/target/classes/com/example/demo/DemoApplication.class b/target/classes/com/example/demo/DemoApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..25a3a3a6b963a50e4f39dabf4d68dc5745fc038f GIT binary patch literal 733 zcmah{%TC)s6g?9X9NbW7pio{?=_+K=*`RJxAwjCHOj|W5ELe@5i5Y6oMB_2#x4LS@ zf)C)M5O)kxqAFD_`Ci@UIcH|>A8zje9AYm-9j^mygxJKJ09y=;AC*?_h+&~~Fl4Cr z%}6q=L`usqWgbg=CgO}T?Z_k|8w#s@{G6=2OI0wuixQJ_c_Z>kCizI_hJPY+Jeg!F z5l$K1qs_Tcnqi}J5nYLE!84&#K5$m)v{xYuo6@eeIc0{`Q|T_v=$o)2mrh!03w+O?ff#1jc^tPh)@Z*cit}=}cnu zSf!V3#yZWq*yYWa1dQ|D^B)Is-@-WJ@}~xHEHn z{Y(@^Z_bGw%oRtPoV;& z%bs%=$Z?>*#e~Gb2k=pd zo3sNG3|R7goO{o?*Z%x^{{V1;trlw7@X_e>+VtI40~a0QZDBr%@WBcGBx~~%pl7W6$__~9?9J0XAD7X zw3Ble8ZjYa|Gv;prE;utMXCd>jjQ^pwjCNf<+FmeBbzBFEf<;Mr4%W(hNiHwyiw(H z{lCT?&&0D}IIVQ@%ql&7up*T&#y;`L7{?t+@#RK*San Date: Wed, 25 Aug 2021 19:18:50 -0400 Subject: [PATCH 02/29] test classes added --- src/test/java/com/example/demo/config/TestChannelConfig.java | 4 ++++ src/test/java/com/example/demo/config/TestMessageConfig.java | 4 ++++ src/test/java/com/example/demo/config/TestProfileConfig.java | 4 ++++ .../com/example/demo/controllers/TestChannelController.java | 4 ++++ .../com/example/demo/controllers/TestMessageController.java | 4 ++++ .../com/example/demo/controllers/TestProfileController.java | 4 ++++ src/test/java/com/example/demo/models/TestChannel.java | 4 ++++ src/test/java/com/example/demo/models/TestMessage.java | 4 ++++ src/test/java/com/example/demo/models/TestProfile.java | 4 ++++ .../java/com/example/demo/repositories/TestChannelRepo.java | 4 ++++ .../java/com/example/demo/repositories/TestMessageRepo.java | 4 ++++ .../java/com/example/demo/repositories/TestProfileRepo.java | 4 ++++ .../java/com/example/demo/services/TestChannelService.java | 4 ++++ .../java/com/example/demo/services/TestMessageService.java | 4 ++++ .../java/com/example/demo/services/TestProfileService.java | 4 ++++ 15 files changed, 60 insertions(+) create mode 100644 src/test/java/com/example/demo/config/TestChannelConfig.java create mode 100644 src/test/java/com/example/demo/config/TestMessageConfig.java create mode 100644 src/test/java/com/example/demo/config/TestProfileConfig.java create mode 100644 src/test/java/com/example/demo/controllers/TestChannelController.java create mode 100644 src/test/java/com/example/demo/controllers/TestMessageController.java create mode 100644 src/test/java/com/example/demo/controllers/TestProfileController.java create mode 100644 src/test/java/com/example/demo/models/TestChannel.java create mode 100644 src/test/java/com/example/demo/models/TestMessage.java create mode 100644 src/test/java/com/example/demo/models/TestProfile.java create mode 100644 src/test/java/com/example/demo/repositories/TestChannelRepo.java create mode 100644 src/test/java/com/example/demo/repositories/TestMessageRepo.java create mode 100644 src/test/java/com/example/demo/repositories/TestProfileRepo.java create mode 100644 src/test/java/com/example/demo/services/TestChannelService.java create mode 100644 src/test/java/com/example/demo/services/TestMessageService.java create mode 100644 src/test/java/com/example/demo/services/TestProfileService.java diff --git a/src/test/java/com/example/demo/config/TestChannelConfig.java b/src/test/java/com/example/demo/config/TestChannelConfig.java new file mode 100644 index 000000000..2fe53f97c --- /dev/null +++ b/src/test/java/com/example/demo/config/TestChannelConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class TestChannelConfig { +} diff --git a/src/test/java/com/example/demo/config/TestMessageConfig.java b/src/test/java/com/example/demo/config/TestMessageConfig.java new file mode 100644 index 000000000..8bf17e1b0 --- /dev/null +++ b/src/test/java/com/example/demo/config/TestMessageConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class TestMessageConfig { +} diff --git a/src/test/java/com/example/demo/config/TestProfileConfig.java b/src/test/java/com/example/demo/config/TestProfileConfig.java new file mode 100644 index 000000000..f8499d7c7 --- /dev/null +++ b/src/test/java/com/example/demo/config/TestProfileConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class TestProfileConfig { +} diff --git a/src/test/java/com/example/demo/controllers/TestChannelController.java b/src/test/java/com/example/demo/controllers/TestChannelController.java new file mode 100644 index 000000000..ffc14aefa --- /dev/null +++ b/src/test/java/com/example/demo/controllers/TestChannelController.java @@ -0,0 +1,4 @@ +package com.example.demo.controllers; + +public class TestChannelController { +} diff --git a/src/test/java/com/example/demo/controllers/TestMessageController.java b/src/test/java/com/example/demo/controllers/TestMessageController.java new file mode 100644 index 000000000..ede1eb280 --- /dev/null +++ b/src/test/java/com/example/demo/controllers/TestMessageController.java @@ -0,0 +1,4 @@ +package com.example.demo.controllers; + +public class TestMessageController { +} diff --git a/src/test/java/com/example/demo/controllers/TestProfileController.java b/src/test/java/com/example/demo/controllers/TestProfileController.java new file mode 100644 index 000000000..b5f2ea750 --- /dev/null +++ b/src/test/java/com/example/demo/controllers/TestProfileController.java @@ -0,0 +1,4 @@ +package com.example.demo.controllers; + +public class TestProfileController { +} diff --git a/src/test/java/com/example/demo/models/TestChannel.java b/src/test/java/com/example/demo/models/TestChannel.java new file mode 100644 index 000000000..fe39d01ec --- /dev/null +++ b/src/test/java/com/example/demo/models/TestChannel.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class TestChannel { +} diff --git a/src/test/java/com/example/demo/models/TestMessage.java b/src/test/java/com/example/demo/models/TestMessage.java new file mode 100644 index 000000000..c04aa263d --- /dev/null +++ b/src/test/java/com/example/demo/models/TestMessage.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class TestMessage { +} diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java new file mode 100644 index 000000000..77e89757e --- /dev/null +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class TestProfile { +} diff --git a/src/test/java/com/example/demo/repositories/TestChannelRepo.java b/src/test/java/com/example/demo/repositories/TestChannelRepo.java new file mode 100644 index 000000000..e90bb50af --- /dev/null +++ b/src/test/java/com/example/demo/repositories/TestChannelRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repositories; + +public class TestChannelRepo { +} diff --git a/src/test/java/com/example/demo/repositories/TestMessageRepo.java b/src/test/java/com/example/demo/repositories/TestMessageRepo.java new file mode 100644 index 000000000..5f6a204a3 --- /dev/null +++ b/src/test/java/com/example/demo/repositories/TestMessageRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repositories; + +public class TestMessageRepo { +} diff --git a/src/test/java/com/example/demo/repositories/TestProfileRepo.java b/src/test/java/com/example/demo/repositories/TestProfileRepo.java new file mode 100644 index 000000000..dd4fd2ec2 --- /dev/null +++ b/src/test/java/com/example/demo/repositories/TestProfileRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repositories; + +public class TestProfileRepo { +} diff --git a/src/test/java/com/example/demo/services/TestChannelService.java b/src/test/java/com/example/demo/services/TestChannelService.java new file mode 100644 index 000000000..07d8cae8b --- /dev/null +++ b/src/test/java/com/example/demo/services/TestChannelService.java @@ -0,0 +1,4 @@ +package com.example.demo.services; + +public class TestChannelService { +} diff --git a/src/test/java/com/example/demo/services/TestMessageService.java b/src/test/java/com/example/demo/services/TestMessageService.java new file mode 100644 index 000000000..10995a0f4 --- /dev/null +++ b/src/test/java/com/example/demo/services/TestMessageService.java @@ -0,0 +1,4 @@ +package com.example.demo.services; + +public class TestMessageService { +} diff --git a/src/test/java/com/example/demo/services/TestProfileService.java b/src/test/java/com/example/demo/services/TestProfileService.java new file mode 100644 index 000000000..d9713f630 --- /dev/null +++ b/src/test/java/com/example/demo/services/TestProfileService.java @@ -0,0 +1,4 @@ +package com.example.demo.services; + +public class TestProfileService { +} From af881a1830f4c827cb1772c48c22ced23ff2e8b7 Mon Sep 17 00:00:00 2001 From: laura Date: Wed, 25 Aug 2021 19:21:05 -0400 Subject: [PATCH 03/29] classes --- .idea/uiDesigner.xml | 124 ++++++++++++++++++ .../example/demo/config/ChannelConfig.java | 4 + .../example/demo/config/MessageConfig.java | 4 + .../example/demo/config/ProfileConfig.java | 4 + .../demo/controller/ChannelController.java | 4 + .../demo/controller/MessageController.java | 4 + .../demo/controller/ProfileController.java | 4 + .../java/com/example/demo/models/Channel.java | 4 + .../java/com/example/demo/models/Message.java | 4 + .../java/com/example/demo/models/Profile.java | 4 + .../example/demo/repository/ChannelRepo.java | 4 + .../example/demo/repository/MessageRepo.java | 4 + .../example/demo/repository/ProfileRepo.java | 4 + .../example/demo/service/ChannelService.java | 4 + .../example/demo/service/MessageService.java | 4 + .../example/demo/service/ProfileService.java | 4 + 16 files changed, 184 insertions(+) create mode 100644 .idea/uiDesigner.xml create mode 100644 src/main/java/com/example/demo/config/ChannelConfig.java create mode 100644 src/main/java/com/example/demo/config/MessageConfig.java create mode 100644 src/main/java/com/example/demo/config/ProfileConfig.java create mode 100644 src/main/java/com/example/demo/controller/ChannelController.java create mode 100644 src/main/java/com/example/demo/controller/MessageController.java create mode 100644 src/main/java/com/example/demo/controller/ProfileController.java create mode 100644 src/main/java/com/example/demo/models/Channel.java create mode 100644 src/main/java/com/example/demo/models/Message.java create mode 100644 src/main/java/com/example/demo/models/Profile.java create mode 100644 src/main/java/com/example/demo/repository/ChannelRepo.java create mode 100644 src/main/java/com/example/demo/repository/MessageRepo.java create mode 100644 src/main/java/com/example/demo/repository/ProfileRepo.java create mode 100644 src/main/java/com/example/demo/service/ChannelService.java create mode 100644 src/main/java/com/example/demo/service/MessageService.java create mode 100644 src/main/java/com/example/demo/service/ProfileService.java diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 000000000..e96534fb2 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/example/demo/config/ChannelConfig.java b/src/main/java/com/example/demo/config/ChannelConfig.java new file mode 100644 index 000000000..1bc7de583 --- /dev/null +++ b/src/main/java/com/example/demo/config/ChannelConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class ChannelConfig { +} diff --git a/src/main/java/com/example/demo/config/MessageConfig.java b/src/main/java/com/example/demo/config/MessageConfig.java new file mode 100644 index 000000000..4f0899d94 --- /dev/null +++ b/src/main/java/com/example/demo/config/MessageConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class MessageConfig { +} diff --git a/src/main/java/com/example/demo/config/ProfileConfig.java b/src/main/java/com/example/demo/config/ProfileConfig.java new file mode 100644 index 000000000..3592edec7 --- /dev/null +++ b/src/main/java/com/example/demo/config/ProfileConfig.java @@ -0,0 +1,4 @@ +package com.example.demo.config; + +public class ProfileConfig { +} diff --git a/src/main/java/com/example/demo/controller/ChannelController.java b/src/main/java/com/example/demo/controller/ChannelController.java new file mode 100644 index 000000000..4a1250f97 --- /dev/null +++ b/src/main/java/com/example/demo/controller/ChannelController.java @@ -0,0 +1,4 @@ +package com.example.demo.controller; + +public class ChannelController { +} diff --git a/src/main/java/com/example/demo/controller/MessageController.java b/src/main/java/com/example/demo/controller/MessageController.java new file mode 100644 index 000000000..2129c124f --- /dev/null +++ b/src/main/java/com/example/demo/controller/MessageController.java @@ -0,0 +1,4 @@ +package com.example.demo.controller; + +public class MessageController { +} diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java new file mode 100644 index 000000000..97475ef17 --- /dev/null +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -0,0 +1,4 @@ +package com.example.demo.controller; + +public class ProfileController { +} diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java new file mode 100644 index 000000000..83ff1c997 --- /dev/null +++ b/src/main/java/com/example/demo/models/Channel.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class Channel { +} diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java new file mode 100644 index 000000000..7f846d245 --- /dev/null +++ b/src/main/java/com/example/demo/models/Message.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class Message { +} diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java new file mode 100644 index 000000000..4dc657e68 --- /dev/null +++ b/src/main/java/com/example/demo/models/Profile.java @@ -0,0 +1,4 @@ +package com.example.demo.models; + +public class Profile { +} diff --git a/src/main/java/com/example/demo/repository/ChannelRepo.java b/src/main/java/com/example/demo/repository/ChannelRepo.java new file mode 100644 index 000000000..963f4c85e --- /dev/null +++ b/src/main/java/com/example/demo/repository/ChannelRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repository; + +public interface ChannelRepo { +} diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java new file mode 100644 index 000000000..38eca51bb --- /dev/null +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repository; + +public class MessageRepo { +} diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java new file mode 100644 index 000000000..afd83c35b --- /dev/null +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -0,0 +1,4 @@ +package com.example.demo.repository; + +public interface ProfileRepo { +} diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java new file mode 100644 index 000000000..a3c42224a --- /dev/null +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -0,0 +1,4 @@ +package com.example.demo.service; + +public class ChannelService { +} diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java new file mode 100644 index 000000000..b953cf94b --- /dev/null +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -0,0 +1,4 @@ +package com.example.demo.service; + +public class MessageService { +} diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java new file mode 100644 index 000000000..891f72bc0 --- /dev/null +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -0,0 +1,4 @@ +package com.example.demo.service; + +public class ProfileService { +} From bca788b664015c7d2b265b6bbdfb7b26504a65b2 Mon Sep 17 00:00:00 2001 From: Zachary Kitto Date: Wed, 25 Aug 2021 20:35:55 -0400 Subject: [PATCH 04/29] Added basic skeleton to profile --- .idea/compiler.xml | 2 +- ...rk_security_spring_security_core_5_5_2.xml | 13 +++ ..._security_spring_security_crypto_5_5_2.xml | 13 +++ demo.iml | 10 ++- pom.xml | 8 ++ .../example/demo/config/ProfileConfig.java | 11 +++ .../demo/controller/ProfileController.java | 8 ++ .../java/com/example/demo/models/Profile.java | 85 +++++++++++++++++++ .../example/demo/repository/ProfileRepo.java | 7 +- .../example/demo/service/ProfileService.java | 12 +++ .../com/example/demo/models/TestProfile.java | 7 ++ 11 files changed, 170 insertions(+), 6 deletions(-) create mode 100644 .idea/libraries/Maven__org_springframework_security_spring_security_core_5_5_2.xml create mode 100644 .idea/libraries/Maven__org_springframework_security_spring_security_crypto_5_5_2.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index bb1644a14..e65307f0f 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -9,7 +9,7 @@ - + diff --git a/.idea/libraries/Maven__org_springframework_security_spring_security_core_5_5_2.xml b/.idea/libraries/Maven__org_springframework_security_spring_security_core_5_5_2.xml new file mode 100644 index 000000000..dde7dd2e4 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_security_spring_security_core_5_5_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_security_spring_security_crypto_5_5_2.xml b/.idea/libraries/Maven__org_springframework_security_spring_security_crypto_5_5_2.xml new file mode 100644 index 000000000..9a74b3aa5 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_security_spring_security_crypto_5_5_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 865e1ef84..0192cbbc8 100644 --- a/demo.iml +++ b/demo.iml @@ -13,7 +13,6 @@ - @@ -36,9 +35,7 @@ - - @@ -64,7 +61,6 @@ - @@ -97,5 +93,11 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9d4377c9a..1ee56501f 100644 --- a/pom.xml +++ b/pom.xml @@ -37,6 +37,14 @@ spring-boot-starter-test test + + + + org.springframework.security + spring-security-core + 5.5.2 + + diff --git a/src/main/java/com/example/demo/config/ProfileConfig.java b/src/main/java/com/example/demo/config/ProfileConfig.java index 3592edec7..d215a7a6a 100644 --- a/src/main/java/com/example/demo/config/ProfileConfig.java +++ b/src/main/java/com/example/demo/config/ProfileConfig.java @@ -1,4 +1,15 @@ package com.example.demo.config; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +@Configuration public class ProfileConfig { + + @Bean + public PasswordEncoder encoder() { + return new BCryptPasswordEncoder(); + } } diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index 97475ef17..5c55c85ec 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -1,4 +1,12 @@ package com.example.demo.controller; +import com.example.demo.service.ProfileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RestController; + +@RestController(value = "/profile") public class ProfileController { + + @Autowired + ProfileService service; } diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 4dc657e68..11efbf683 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -1,4 +1,89 @@ package com.example.demo.models; +import javax.persistence.*; +import java.util.List; + +@Entity public class Profile { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long id; + private String firstName; + private String lastName; + private String username; + private String password; + private String email; + + @OneToMany + private List channelList; + + public Profile() { + } + + public Profile(Long id, String firstName, String lastName, String username, String password, String email, List channelList) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.username = username; + this.password = password; + this.email = email; + this.channelList = channelList; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public List getChannelList() { + return channelList; + } + + public void setChannelList(List channelList) { + this.channelList = channelList; + } } diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java index afd83c35b..f546f36c7 100644 --- a/src/main/java/com/example/demo/repository/ProfileRepo.java +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -1,4 +1,9 @@ package com.example.demo.repository; -public interface ProfileRepo { +import com.example.demo.models.Profile; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ProfileRepo extends JpaRepository { } diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index 891f72bc0..f53395d46 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -1,4 +1,16 @@ package com.example.demo.service; +import com.example.demo.repository.ProfileRepo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; + +@Service public class ProfileService { + + @Autowired + PasswordEncoder passwordEncoder; + + @Autowired + ProfileRepo repository; } diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java index 77e89757e..55ac3ddec 100644 --- a/src/test/java/com/example/demo/models/TestProfile.java +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -1,4 +1,11 @@ package com.example.demo.models; +import org.junit.jupiter.api.Test; + public class TestProfile { + + @Test + public void nullableConstructor() { + // Given + } } From 0b4de53bb589b2293a2739add47af4b3b69a9204 Mon Sep 17 00:00:00 2001 From: Zachary Kitto Date: Wed, 25 Aug 2021 21:12:22 -0400 Subject: [PATCH 05/29] Added tests for profile --- .idea/libraries/Maven__junit_junit_4_13_2.xml | 13 ++++ .../Maven__org_hamcrest_hamcrest_core_2_2.xml | 13 ++++ demo.iml | 2 + pom.xml | 17 +++-- .../com/example/demo/models/TestProfile.java | 65 +++++++++++++++++- .../example/demo/config/ChannelConfig.class | Bin 0 -> 312 bytes .../example/demo/config/MessageConfig.class | Bin 0 -> 312 bytes .../example/demo/config/ProfileConfig.class | Bin 0 -> 685 bytes .../demo/controller/ChannelController.class | Bin 0 -> 332 bytes .../demo/controller/MessageController.class | Bin 0 -> 332 bytes .../demo/controller/ProfileController.class | Bin 0 -> 588 bytes .../com/example/demo/models/Channel.class | Bin 0 -> 294 bytes .../com/example/demo/models/Message.class | Bin 0 -> 294 bytes .../com/example/demo/models/Profile.class | Bin 0 -> 2986 bytes .../example/demo/repository/ChannelRepo.class | Bin 0 -> 131 bytes .../example/demo/repository/MessageRepo.class | Bin 0 -> 314 bytes .../example/demo/repository/ProfileRepo.class | Bin 0 -> 425 bytes .../example/demo/service/ChannelService.class | Bin 0 -> 317 bytes .../example/demo/service/MessageService.class | Bin 0 -> 317 bytes .../example/demo/service/ProfileService.class | Bin 0 -> 639 bytes .../demo/config/TestChannelConfig.class | Bin 0 -> 324 bytes .../demo/config/TestMessageConfig.class | Bin 0 -> 324 bytes .../demo/config/TestProfileConfig.class | Bin 0 -> 324 bytes .../controllers/TestChannelController.class | Bin 0 -> 346 bytes .../controllers/TestMessageController.class | Bin 0 -> 346 bytes .../controllers/TestProfileController.class | Bin 0 -> 346 bytes .../com/example/demo/models/TestChannel.class | Bin 0 -> 306 bytes .../com/example/demo/models/TestMessage.class | Bin 0 -> 306 bytes .../com/example/demo/models/TestProfile.class | Bin 0 -> 2921 bytes .../demo/repositories/TestChannelRepo.class | Bin 0 -> 330 bytes .../demo/repositories/TestMessageRepo.class | Bin 0 -> 330 bytes .../demo/repositories/TestProfileRepo.class | Bin 0 -> 330 bytes .../demo/services/TestChannelService.class | Bin 0 -> 331 bytes .../demo/services/TestMessageService.class | Bin 0 -> 331 bytes .../demo/services/TestProfileService.class | Bin 0 -> 331 bytes 35 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 .idea/libraries/Maven__junit_junit_4_13_2.xml create mode 100644 .idea/libraries/Maven__org_hamcrest_hamcrest_core_2_2.xml create mode 100644 target/classes/com/example/demo/config/ChannelConfig.class create mode 100644 target/classes/com/example/demo/config/MessageConfig.class create mode 100644 target/classes/com/example/demo/config/ProfileConfig.class create mode 100644 target/classes/com/example/demo/controller/ChannelController.class create mode 100644 target/classes/com/example/demo/controller/MessageController.class create mode 100644 target/classes/com/example/demo/controller/ProfileController.class create mode 100644 target/classes/com/example/demo/models/Channel.class create mode 100644 target/classes/com/example/demo/models/Message.class create mode 100644 target/classes/com/example/demo/models/Profile.class create mode 100644 target/classes/com/example/demo/repository/ChannelRepo.class create mode 100644 target/classes/com/example/demo/repository/MessageRepo.class create mode 100644 target/classes/com/example/demo/repository/ProfileRepo.class create mode 100644 target/classes/com/example/demo/service/ChannelService.class create mode 100644 target/classes/com/example/demo/service/MessageService.class create mode 100644 target/classes/com/example/demo/service/ProfileService.class create mode 100644 target/test-classes/com/example/demo/config/TestChannelConfig.class create mode 100644 target/test-classes/com/example/demo/config/TestMessageConfig.class create mode 100644 target/test-classes/com/example/demo/config/TestProfileConfig.class create mode 100644 target/test-classes/com/example/demo/controllers/TestChannelController.class create mode 100644 target/test-classes/com/example/demo/controllers/TestMessageController.class create mode 100644 target/test-classes/com/example/demo/controllers/TestProfileController.class create mode 100644 target/test-classes/com/example/demo/models/TestChannel.class create mode 100644 target/test-classes/com/example/demo/models/TestMessage.class create mode 100644 target/test-classes/com/example/demo/models/TestProfile.class create mode 100644 target/test-classes/com/example/demo/repositories/TestChannelRepo.class create mode 100644 target/test-classes/com/example/demo/repositories/TestMessageRepo.class create mode 100644 target/test-classes/com/example/demo/repositories/TestProfileRepo.class create mode 100644 target/test-classes/com/example/demo/services/TestChannelService.class create mode 100644 target/test-classes/com/example/demo/services/TestMessageService.class create mode 100644 target/test-classes/com/example/demo/services/TestProfileService.class diff --git a/.idea/libraries/Maven__junit_junit_4_13_2.xml b/.idea/libraries/Maven__junit_junit_4_13_2.xml new file mode 100644 index 000000000..606c352d5 --- /dev/null +++ b/.idea/libraries/Maven__junit_junit_4_13_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_2_2.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_2_2.xml new file mode 100644 index 000000000..15f1e4c17 --- /dev/null +++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 0192cbbc8..9393d74a0 100644 --- a/demo.iml +++ b/demo.iml @@ -99,5 +99,7 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1ee56501f..50fb36703 100644 --- a/pom.xml +++ b/pom.xml @@ -45,15 +45,14 @@ 5.5.2 - + + + junit + junit + 4.13.2 + test + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java index 55ac3ddec..d0aa01838 100644 --- a/src/test/java/com/example/demo/models/TestProfile.java +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -1,11 +1,72 @@ package com.example.demo.models; -import org.junit.jupiter.api.Test; +import org.junit.Assert; +import org.junit.Test; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; public class TestProfile { @Test - public void nullableConstructor() { + public void nullableConstructorTest() { + // Given + Profile profile = new Profile(); + + // Then + Assert.assertNull(profile.getId()); Assert.assertNull(profile.getFirstName()); + Assert.assertNull(profile.getLastName()); Assert.assertNull(profile.getUsername()); + Assert.assertNull(profile.getPassword()); Assert.assertNull(profile.getEmail()); + Assert.assertNull(profile.getChannelList()); + } + + @Test + public void constructorTest() { + // Given + Long expectedId = 1L; + String expectedFirstName = "Ben"; + String expectedLastName = "Smith"; + String expectedUsername = "Batman"; + String expectedPassword = "Secret"; + String expectedEmail = "bens@gmail.com"; + List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); + + // When + Profile profile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels); + + // Then + Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); + Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); + Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); + Assert.assertEquals(expectedChannels, profile.getChannelList()); + } + + @Test + public void settersTest() { // Given + Long expectedId = 1L; + String expectedFirstName = "Ben"; + String expectedLastName = "Smith"; + String expectedUsername = "Batman"; + String expectedPassword = "Secret"; + String expectedEmail = "bens@gmail.com"; + List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); + Profile profile = new Profile(); + + // When + profile.setId(expectedId); + profile.setFirstName(expectedFirstName); + profile.setLastName(expectedLastName); + profile.setUsername(expectedUsername); + profile.setPassword(expectedPassword); + profile.setEmail(expectedEmail); + profile.setChannelList(expectedChannels); + + // Then + Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); + Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); + Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); + Assert.assertEquals(expectedChannels, profile.getChannelList()); } } diff --git a/target/classes/com/example/demo/config/ChannelConfig.class b/target/classes/com/example/demo/config/ChannelConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..bb261267573bfdf67ca19e244d8af90d101b7cdb GIT binary patch literal 312 zcma)%Jx;?w5QX13{t3n;5jRMI_$k_xj literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/MessageConfig.class b/target/classes/com/example/demo/config/MessageConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..de19b497b191da866eddabb449e8868905773e4c GIT binary patch literal 312 zcma)%Jx;?w5QX13{sG63h#OEKeu`{E2cn5YWk?a^e!U*dMz$B(4&qu=NGUh~heC`k znsm%aPxHOeJZZjvc3%LlF^@69QH0|NGeUT48{6LzCKs0(!C$(93A5BT{J5=iZl82s ziF1-VqpM7}cHlqL?_X?3I8TkM6~F8HwPICp?UZrNvn|yFcbzVIInoUwUb}5;_}-3@ zd)viEzv%=%0>at9@(A2V5Az8i|9B}_CFQX>Pw)hFmf3=ffLC^qEa RKr|WW0EdW$2vboH$uD&HM_&K{ literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/ProfileConfig.class b/target/classes/com/example/demo/config/ProfileConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..664a13e3bb40d7a9830a59160a562858a5f451af GIT binary patch literal 685 zcma)3%Sr<=6g{c6)7D4pTbC}x2WUXVjUw8jtD>S(aG6finmUt|OvcAw=}J)W1N@g78 z!da}H3T0hIiZmT)ZJcn*Xp*%4FFC1l^3HMbHOebeXyPiKo7npDh{TfDU$Qqk;zlrR z56ajx8{1UM&M0#5$nGFs8>wersV3I{_+?lc=qEFj6TLhTy3J1-9qBtPB1=!7d>PP- z!=sp|j#Flohu5CK9@FCj#as#&P^5aaH-HhUK=l~Li6mLxOv!-!3o@5a7q_cnvsu(vDgMf_S;f`uQz4<*h8 zv9WRn9`k<8Jebd~_YVN)n3Wh|zraC(DIveK-u737(c*YXNb9g-!nCoTZ?;{_@m{x1 z$YB$Vc1s=Y;D2D+uk8~-H70b5Uv&5ASgp7V$^_rX;2cL)ueJB=>R)m}DDT2H8oste z^wFPLh$i6*GN0mnB`RR910 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/controller/MessageController.class b/target/classes/com/example/demo/controller/MessageController.class new file mode 100644 index 0000000000000000000000000000000000000000..0f631f61e1bf0c2cb2faad4cca1cc898fafd6989 GIT binary patch literal 332 zcmb7evq@R;{w=D~b^y?+3>z$C{2qYOtG#)NcX8{1tG2J@2@Azu156UL=&_;y!U93FJ# zgdCUNXt&bA_WlRP-J@*@sx-b<{G#h8$7;>BSH?G8@Xm2iH{7;*!^>ZCNyzX0E*QSH zef0Ft#`#u1>jE(n!r8yF36uU-Io)j3UA1M?VTMRP?u(=)R5TT*_8v%1-$1VdB4nbe VV93ExwAjxH4v>o@9EwILz5(B7PE@#sxVv=_Verg0|3t9pbB}|b70?rHUlR{Gm}0t=(xU)I6jML8X^xc(tKIt z_ePIoh=T?6lEGm=QC3Dcl(F?)z9RwD0Y yS>l8WMOBJ8`4m??c?0%JmmJi{reGjgoosypfGyb0>W$1cv!OMr?a*n(u=@>+!Jwr8 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/models/Channel.class b/target/classes/com/example/demo/models/Channel.class new file mode 100644 index 0000000000000000000000000000000000000000..7ffa3fe05b0e8793b32599bd57abf623c8a3d0bf GIT binary patch literal 294 zcmaivy-osA5QWby`yFg7Gs8!aI8cbAD=a(~RS5MRs6#KH&gp^USH z-kIcN&X<{!%+K%FH-I@tIeNIxaFbz3NFR(h?IWQ#yWJ4tW!N%dSQ^jIM^|yP)|C}9 zE<>&DMmMJO7Z|rYb0AF1IylAe+Pzs;TXsP?iLnQ@+-dLGE(rN59GjY-Ocz#M`2Aj= zbb%NNVe(G~VbpCatNp8bsrFpAm?Dy2x*}v9Ptb>e2$^Uq7;d;!8vTzEI^FlY%xI~zjQ^?5+fRmQ)drE_g|o+fB=bTEEsao7tPLd Nge#=t2m{do*&j!}KxY5| literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class new file mode 100644 index 0000000000000000000000000000000000000000..fe01528590a58fe30c70a0f02a12bb90ec251a93 GIT binary patch literal 2986 zcmc(g-E!Mh5XblUL$(u>hNKC&BqS}+I!;;@Qrdz;N-<6v>L#X61GkEO>Zl`28A*ob zf_LE&U$l&D=pMDEXo|ilQHdIC zzGTy6v%_YW%@a0z1^TK$PX%Sno}k&*E8{yuw+y?lw;a1)7gTvZw0(0Rk4(=zw&Y{m zc6`G(9orMMsJ6e>Po?Xbo-ggL)c1P$=tj!IuC%3V__B9oSVM_TMbGDP|LkA)Bhum7 zsoLLZe*L1k-)IUdy)<3V-!}$Q&|HkUG5}E$~O@ANr=H^9(3U9kXv6{?J9J%^*~?yw&PD16{s02B((Pdvf6D1E(h~ zPj3WX>)Y_KoFc}7Ef1Y%hJA*0ZOgPxe_K$tx^^Te*MJK_S6Zem_lJXH=^h#oo)7AD z4eQ8oO&*7nIse4OOm_2ZZ|d#mHTgJBBAPhu*Hk~xYY0rv(Kb| z;`G{vi(B%MOM-s<|5z_`seGJ#U;2B*Y=pIT^d5L^JSt+X89b087Q*ffX2Zk| zo=bG}@kI;z`1~}{Uwbe zN_Ks^juJeDf?c2thaf?3VDu(NGia}1JS#Dr!vun3D#P(r3k21ILbU)g6C_3CJ@* zo~I>@mVwAoR%jh@nBjR4CuBgxP%G}SEKIzigvqKNOOsPQ7ALQIERUvoEKq@Nq92@X z12LB{a|<)e1-K?SWeErp5N??<37aTXwF(*5s0O==IUTK%sP+qGe!@hcBa2QTPSbE5 zv>EmBHd?0Flzz!uxCQpA@~{}}iWJa71(-RH8h}R7ZMp-yihi6an`Bx~Wzy+x8dEmO zq=V`11SY-

zZjYbfZ$RHj^#X)~4SqjaWRlIa1M9!_B5=MpjTo#Hp1%9Kws)l-@7 zr8DJ|Opn0y`2;4;&xnb03{^9gNlP*{Qkm|jGigbtT`)bFz{D>lV&a?^^dOa~kYswA z%JeXusgPtk08@Jc6TjJriQk~0Pw3MyP2)LUOfq#+n1Yg6hm$S(EUaN|IE&t2tU3i% m@EfpwJAsX>h=^4YO;wSIc3ds^i9Z5+2I;`XoeRTbqQ3#=eHe8B literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/repository/ChannelRepo.class b/target/classes/com/example/demo/repository/ChannelRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..91a30cadd69983efffff179289711a328696c44f GIT binary patch literal 131 zcmX^0Z`VEs1_l!bc6J6aFF#N2|MRQ;6H+5L3a QKd;?dA3-5-V#0?3nqKO*zw`GEtw7ulE5Pd9GCN6vc9?CE! zE?7E~oXq(qbCNmye*XX%V-TZ*%LrEy`h;*|D$_g?I=7<*!JpbC6Z)yC_-R{a?A~-% z2)Ryeu8W0sruBc&Z{AH!7^S%_6@Tb*Q?OccX_e!RtxaRyrlMEUc_75EcI$GU znKpEAw!2^Jolf8*APoPRCkgG9Ds;6{&)J&u1~>5JzqUwP;zUDn>g0jo?hCXR;2{zX V1w#(HqRD9vaDiAHp(pAgIRePTNc8{! literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/repository/ProfileRepo.class b/target/classes/com/example/demo/repository/ProfileRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..5c817fec30b54b9af47e8742cc556679118b244d GIT binary patch literal 425 zcmbV}!AitH42CnSw(hFn)hF14U@m&92wpr$LD>cG**06Ib|%BjR9*1NJoo@UlsGG* zMfc<(2_Yf>m*nmJ@T2&9tSJ(lkY`f<|iY0^WLA>W+(nQYp46 zE(!&cx%9r`t5jET_|>@{da}k+a5U>})Q0bL(2I^Qt(8boiwz2nH-d)9o+Yjv;}2X? un*PBXY%&l|7{4!~;Ot)~$rLCUCEH3bfaJH6AHfb}pD~Bs6th$x1AG8yScmig literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/service/ChannelService.class b/target/classes/com/example/demo/service/ChannelService.class new file mode 100644 index 0000000000000000000000000000000000000000..bee65a8960841bdf827eeefa50742f072a1df00a GIT binary patch literal 317 zcma)%Jx;?w5QX13{sH5V2u?r+pZ!Z(Pr0pebA-t9=6Bayx4`rO9 z8+ObjC-a@joMgU#_6GnD7{=(}GD1JXfDle>X`3fP=XN|N_*1uF!XULJzix_*t9PB{ z;#{T9=zOj#+w#BZHy^epj8o$Z#XDWBb5;v3oT|CnTEpsv>sl{)_J@yzc;+^h;b+^1 zUZ1Y-S9+@x_y`E2Gb0JZ_DbctT&lNh#iqdxJbAG#l9o8pP)Hpa2=2Z>pJI53L_@J5 T2N$BraSqT$EJWyudPsf&)>cW& literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/service/ProfileService.class b/target/classes/com/example/demo/service/ProfileService.class new file mode 100644 index 0000000000000000000000000000000000000000..9e0390a2fcd2be8911bcf9d4a50fdb2ec6b64a0c GIT binary patch literal 639 zcmZuuyG{c!5FA4w5W@Ql=VWY*sLdwKCSr*brFER0xmGcP^}U9r6OFHRpRWWZu|b*Q=Bm zy_bP>?oI4V?fY4DazvB$-~3~NtwwI6NvUOmX(x1Mt&1ueXM@1e*x_wbHps5h(fPhq z-voJ-`D24*n(rzf~(S&mi4C1=5TYX1e|nGX|~=U5B?Qx`Z^2N$r2r7wK> KE3SMCtpcCi^{);9 literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/config/TestChannelConfig.class b/target/test-classes/com/example/demo/config/TestChannelConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..20ae897984d102b962b618cd871fff694489f9ba GIT binary patch literal 324 zcma)%y-veG5QJwP|9~+hqM)ZEAaM;Hh{h6?MGB(y=gX2@biPB5gLo|}BnlpYheE6^ zx-{%cqn%H?BklLk=NEt*Omd8HoZ%$Hn2_FCZ@YWK=wiAc#AR4AVO&|ykGrPkcCKqD zj%U8y;5yK=3)XIBp7mXJS%U2FKk z_OWMs8`m5Cstd$O2-AP(5+?nfa@w!dtlqHcaE?em?Te%(P&5^%1`i~cAE0*u5i-$K UFy!Dsv>4_Dhsebdjzl9AznLmbCjbBd literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/config/TestMessageConfig.class b/target/test-classes/com/example/demo/config/TestMessageConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..3cff01262e8f5a6b4e9916d6c9f347f6481810a8 GIT binary patch literal 324 zcma)%y-veG5QJwP|9~+hqM)ZEAaPB)pfr)F3=~A^&zHqqWcwo9iSk;hB2n-FJQQMW z(b2Fgjdnimj`(2=$z+0nG)hxx2+97 z+Aj9$&&K^)?{oqm0b%^_T*9ckQ-!W_^^&dGw77;RpLRvk5-1vqQ@sa*+au^8z(XV& V3Wgk=(xQOm6@H literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/controllers/TestChannelController.class b/target/test-classes/com/example/demo/controllers/TestChannelController.class new file mode 100644 index 0000000000000000000000000000000000000000..c7cb4ee5745213a7c68b80facda6e86e1a4ce878 GIT binary patch literal 346 zcmb7N!nYYZ>_s1uIDJD5aIL>gAVN6Kxj5Fb$FuJ&065`UYm@ux4?hnM%$(C%;0}u9M+~MOsmGXieGj6Y+0?i^{VkMblzI-dbQv_lxyuA+wvFR67sp< zb`3w6A^+^psq2k?(FI~8gq#0=LYNEz%4+wdX7z@ffOAB0|4<|?$)c$^wf8`B^$vOy Z5Fryy1w$4NM2r19!69;Sgd@=i#SU+ARw)1g literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/controllers/TestMessageController.class b/target/test-classes/com/example/demo/controllers/TestMessageController.class new file mode 100644 index 0000000000000000000000000000000000000000..0c30170cf7b4536c80ce1a7343fe852b9a3d893d GIT binary patch literal 346 zcmb7EL~_(iu*j@6P|uZ-_v@Xm4Q)tviy%YCm`Jp09$gz~{} zg5euGY5Qg8m+=rg036^$tYT<&UQ)~iOhYE)Ddz(==?A^-VM*Le=f`vc8A0^HO zv9fUnUgmw659agh{R6-hlM*BB7T7B=Cgc~kv+nltd`t*WqcQdcaB4^=G@2I;P0*D*)KjPly`m| z3||Q+9Q@gJy3)_OLW+!V_WvV<$*@2<-94zAX2mAr5Q+Rh1WC$f(OjI`cpy7@1HB4J YP>AM&Ap={Y)uzs{jZz$8M>Ik84WMvVaR2}S literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/models/TestChannel.class b/target/test-classes/com/example/demo/models/TestChannel.class new file mode 100644 index 0000000000000000000000000000000000000000..9ee3d414d15900439bcb8fe3b54552df716561e1 GIT binary patch literal 306 zcma)%%}N775QM8Y`=je>f^Q%qs0Zhgo8l$lX)%X{+-En9nJ_0^gWJ0WA)bUK6NaVn{JM1&H*;NC zaW2bHYrD{m>GiJ}cPrBpZpu11#qZi}EUP8Epq$j$R?WHXCM)ed+ebn^3)`mV7t}@+9Qo1Ncy4 zZ}8yJ9{A|0rV8fkd;baG7ULWPoMbr7Fe0S)rZL@=Fu1&05#k5GX2Pg64bOM3;&!Pk zE6!QzYi(D$HNE~d#8@?mtPkz_dJTraa z_|NTTt6z127zyG0A6=5}6UyplqZZYc>kbn{@~?hKo>U1_QR<+96yaDHq4)tTXGK#0 literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/models/TestProfile.class b/target/test-classes/com/example/demo/models/TestProfile.class new file mode 100644 index 0000000000000000000000000000000000000000..0df572955a7e0c464502ad84a8ad688feabe16da GIT binary patch literal 2921 zcmcIl+jA3D82@dWWS3;2C56`IR<2U$B`AoRmKG>2f}tRRN~K=5>5^_ucFXRDi-;Gz zj^m>bKKS5_Gd$>n<4cM%US^naMrY(ta{Qg$&1P$5Fqegy5$084UK8eZVcw9T%b1mr9yTr08Xh!7VjeCgy?N7>u%}qIYkA{_UR$gh z`8lIz=W9$;b@LYt*E{FfSInw0B%#}?SF7Uqm~FY9Q!jhABO)Zoi$Rct9joSQ<JS&+cC?sJ>4^zR6t44VUb?n< zaJ;6QRTj~lkIn0rMd+fs>YiE67fsh=U0usbxVhLQ;$YB26g#{siedht5vI$!hUXcM z8*q>**>$IEOpq&H9%F7$G_GP7c1!44jp>jb6=lrHFjQPYMa4W!6$`?=DNI$EnlKh@ z8H*~e!lCqz8`sQO!b4rg zH5J!!L&Z(J#XLTP5lEt?TPohhZ58j}T@~-)eHC|v`9PQth51OBkMW6wU8}VogNnel zRC0E9fg)pL6~hxk%k}PCDYcH4T#va_4C6CY37ttk76}`BV`qYlL*k*TOd3pJ32T!oSi>Li9dA>MxwU6<>n3yUg=DUykjkwuq~)KHn{K;LvxLsl zbTaZ%k(X|I_psp}HvWjN1b#zzK^E=y^$%!CEv2P3c?nMxls--Io7eh-?SK&5aO2k;c3QSc2xJ4hI_j6X!LjXA%)*G3SyfgxX4HL>~>t Y3ej9JIuq^)gR}DmA)eYL6Go-!_+i^t?B=>^ zgq)PN*3CjY)B8UdhZo}ss;q6R_)WK)hSic=s~m5vH^Dl?Ud`Eud-h(h_(}K;A%C`8 zSM$vD(WiU+tF?aB1!5$G%YP*k#{I2obhlEE)tc*o2_pHoFOrr}(Nvt;c_6v?0KE%{ Ykcp;(AqPXzVmBu^KrW7OC>o*o1==l7bpQYW literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/repositories/TestProfileRepo.class b/target/test-classes/com/example/demo/repositories/TestProfileRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..8a519520ab80fb5fb54c031d2a11ff65a3f7a92c GIT binary patch literal 330 zcmb7<&q~8U5XQer^QXpWi}(V)si1rDrg$mz6jZeIzDY;jvdNasR(vf_f(IYKhY}~n zQ*X||$9%ux8<_8(&o2O%80Q$^Aj4sX5h1-ctqC`T!O7`@5KrBb38T`qe7k8X_H$iX zAxEXFwOwd$djALG@M1cGDr?s$e$&m`vRZQEl;^eUOmN&+d+(l%<-9D?kYQ=TH1d;sP7fH)e(Nvt;dLTLb0KE%{ Ykcp;(A%UT2v7Hm_As0v37mZN-0`R;~nE(I) literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestChannelService.class b/target/test-classes/com/example/demo/services/TestChannelService.class new file mode 100644 index 0000000000000000000000000000000000000000..1f069309f8b6cad10c7b7f5e61ed658a79023061 GIT binary patch literal 331 zcmb7#Z&jBO%-#l1&)(r^;#nqNdfFO@~WF@^D`yEt#UJIJNgca`ORt7Z4#6 WO$9>^jzo+7oZuL_IKqi&gklE__D_2N literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestMessageService.class b/target/test-classes/com/example/demo/services/TestMessageService.class new file mode 100644 index 0000000000000000000000000000000000000000..10d33fe70270fcf7b54ae5c2ab75110187169bc9 GIT binary patch literal 331 zcmb7UIT5c#g+##v@KA_# zprc|}8tr`A9ce$m-ai1`Vw9qX(*$P;hJ^Uu*0y~h^u|{!Lip&`Oc>_2=Gnd~xLN9= z6mp(Bqsx_UZ0CPr*gjiNnB>M)ieGfKD_O0%a>{dau!g-_vTvW*d%fYs54$6z3%73! zPi>cc@pomi)d!s+L`1mxPc~uHovKpT8#OPsY+76*kcYb>X~`6g#i^qQqU$%%tAGHB WXe=0Va3Y!==LmhI;s^uL0NFPru1}u; literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestProfileService.class b/target/test-classes/com/example/demo/services/TestProfileService.class new file mode 100644 index 0000000000000000000000000000000000000000..278cabb0a5a7e2cf2513cd14ef5b404b0217d150 GIT binary patch literal 331 zcmb7$SW+;4*6 zi9o{1-<9!NZ*_qf3E}cTw+W*@s+?{f)wEi(>2Qij9`1{z<)&yVPVGF9T)cr^1w_b1 WQ^AnHo@lX~6YL`wM>r6TP<#VBwNJwU literal 0 HcmV?d00001 From 6ebb7281feb491fd7f01318c3c71512c68440d99 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 25 Aug 2021 21:41:19 -0400 Subject: [PATCH 06/29] Added channel properties --- .idea/jpa-buddy.xml | 6 +++ .idea/runConfigurations.xml | 10 ++++ .../java/com/example/demo/models/Channel.java | 46 +++++++++++++++++++ .../example/demo/service/ChannelService.java | 1 + 4 files changed, 63 insertions(+) create mode 100644 .idea/jpa-buddy.xml create mode 100644 .idea/runConfigurations.xml diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml new file mode 100644 index 000000000..d08f40080 --- /dev/null +++ b/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 000000000..797acea53 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 83ff1c997..36bf7e819 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -1,4 +1,50 @@ package com.example.demo.models; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.util.List; + +@Entity public class Channel { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + private String name; + private List profileList; + private List messages; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getProfileList() { + return profileList; + } + + public void setProfileList(List profileList) { + this.profileList = profileList; + } + + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } } diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index a3c42224a..51a851ae6 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -1,4 +1,5 @@ package com.example.demo.service; public class ChannelService { + } From 1a373239c30b1f64b85d9e9a2fb466991213bd0e Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 25 Aug 2021 22:18:51 -0400 Subject: [PATCH 07/29] Channels are almost complete --- .../example/demo/config/ChannelConfig.java | 17 ++++++ .../demo/controller/ChannelController.java | 45 ++++++++++++++++ .../example/demo/repository/ChannelRepo.java | 5 +- .../example/demo/service/ChannelService.java | 53 +++++++++++++++++++ 4 files changed, 119 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/config/ChannelConfig.java b/src/main/java/com/example/demo/config/ChannelConfig.java index 1bc7de583..8ca35e678 100644 --- a/src/main/java/com/example/demo/config/ChannelConfig.java +++ b/src/main/java/com/example/demo/config/ChannelConfig.java @@ -1,4 +1,21 @@ package com.example.demo.config; +import com.example.demo.models.Channel; +import com.example.demo.service.ChannelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; + +@Configuration public class ChannelConfig { + @Autowired + private ChannelService service; + + @PostConstruct + public void setup() { + service.createChannel(new Channel()); + service.createChannel(new Channel()); + service.createChannel(new Channel()); + } } diff --git a/src/main/java/com/example/demo/controller/ChannelController.java b/src/main/java/com/example/demo/controller/ChannelController.java index 4a1250f97..99d2cee29 100644 --- a/src/main/java/com/example/demo/controller/ChannelController.java +++ b/src/main/java/com/example/demo/controller/ChannelController.java @@ -1,4 +1,49 @@ package com.example.demo.controller; +import com.example.demo.models.Channel; +import com.example.demo.service.ChannelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Controller +@RequestMapping(value = "/channel-controller") public class ChannelController { + @Autowired + private ChannelService service; + + @RequestMapping(method = RequestMethod.POST, value = "/create") + public ResponseEntity createChannel(@RequestBody Channel channel) { + return new ResponseEntity<>(service.createChannel(channel), HttpStatus.CREATED); + } + + @RequestMapping(method = RequestMethod.GET, value = "/read/{id}") + public ResponseEntity readChannel(@PathVariable Long id) { + if(service.readChannel(id) != null){ + return new ResponseEntity<>(service.readChannel(id), HttpStatus.OK); + } + return new ResponseEntity<>(service.readChannel(id),HttpStatus.NOT_FOUND); + } + + @RequestMapping(method = RequestMethod.GET, value = "/readAll") + public ResponseEntity> readAllChannels() { + return new ResponseEntity<>(service.readAllChannels(), HttpStatus.OK); + } + + @RequestMapping(method = RequestMethod.PUT, value = "/update/{id}") + public ResponseEntity update(@PathVariable Long id,@RequestBody Channel channel) { + if(service.readChannel(id) != null) { + return new ResponseEntity<>(service.update(id, channel), HttpStatus.OK); + } + return new ResponseEntity<>(service.createChannel(channel), HttpStatus.CREATED); + } + + @RequestMapping(method = RequestMethod.DELETE, value = "/delete/{id}") + public ResponseEntity delete(@PathVariable Long id) { + return new ResponseEntity<>(service.delete(id), HttpStatus.NO_CONTENT); + } } diff --git a/src/main/java/com/example/demo/repository/ChannelRepo.java b/src/main/java/com/example/demo/repository/ChannelRepo.java index 963f4c85e..552c3f776 100644 --- a/src/main/java/com/example/demo/repository/ChannelRepo.java +++ b/src/main/java/com/example/demo/repository/ChannelRepo.java @@ -1,4 +1,7 @@ package com.example.demo.repository; -public interface ChannelRepo { +import com.example.demo.models.Channel; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ChannelRepo extends JpaRepository { } diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 51a851ae6..649bf9091 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -1,5 +1,58 @@ package com.example.demo.service; +import com.example.demo.models.Channel; +import com.example.demo.repository.ChannelRepo; +import com.example.demo.repository.ProfileRepo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service public class ChannelService { + private ChannelRepo channelRepo; + private ProfileRepo profileRepo; + + @Autowired + public ChannelService(ChannelRepo channelRepo, ProfileRepo profileRepo) { + this.channelRepo = channelRepo; + this.profileRepo = profileRepo; + } + + public Channel createChannel(Channel channel) { + return channelRepo.save(channel); + } + + public Channel readChannel(Long id) { + return channelRepo.findById(id).get(); + } + + public List readAllChannels() { + Iterable channelIterable = channelRepo.findAll(); + List result = new ArrayList<>(); + channelIterable.forEach(result::add); + return result; + } + + public Channel update(Long id, Channel channel) { + Channel channelInDb = readChannel(id); + channelInDb.setId(channel.getId()); + channelInDb = channelRepo.save(channelInDb); + return channelInDb; + } + + public Channel delete(Long id) { + Channel channelInDb = readChannel(id); + channelRepo.delete(channelInDb); + return channelInDb; + } + + public Boolean deleteAllChannels() { + readAllChannels().forEach(channel -> delete(channel.getId())); + return true; + } + + } From 24fdd50b0eda47cce097b0d04e7154e46caaa982 Mon Sep 17 00:00:00 2001 From: Zachary Kitto Date: Thu, 26 Aug 2021 07:28:17 -0400 Subject: [PATCH 08/29] Added profile services --- ...aven__org_mockito_mockito_core_2_24_0.xml} | 8 ++-- ...=> Maven__org_objenesis_objenesis_2_6.xml} | 8 ++-- demo.iml | 18 ++++---- pom.xml | 11 +++++ .../example/demo/repository/ProfileRepo.java | 1 + .../example/demo/service/ProfileService.java | 25 +++++++++++ .../demo/services/TestProfileService.java | 39 ++++++++++++++++++ .../TestProfileServiceConfiguration.java | 19 +++++++++ .../example/demo/repository/ProfileRepo.class | Bin 425 -> 591 bytes .../example/demo/service/ProfileService.class | Bin 639 -> 2210 bytes .../demo/services/TestProfileService.class | Bin 331 -> 2688 bytes .../TestProfileServiceConfiguration.class | Bin 0 -> 915 bytes 12 files changed, 112 insertions(+), 17 deletions(-) rename .idea/libraries/{Maven__org_mockito_mockito_core_3_9_0.xml => Maven__org_mockito_mockito_core_2_24_0.xml} (63%) rename .idea/libraries/{Maven__org_objenesis_objenesis_3_2.xml => Maven__org_objenesis_objenesis_2_6.xml} (67%) create mode 100644 src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java create mode 100644 target/test-classes/com/example/demo/services/TestProfileServiceConfiguration.class diff --git a/.idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml b/.idea/libraries/Maven__org_mockito_mockito_core_2_24_0.xml similarity index 63% rename from .idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml rename to .idea/libraries/Maven__org_mockito_mockito_core_2_24_0.xml index a46e35535..5176b3673 100644 --- a/.idea/libraries/Maven__org_mockito_mockito_core_3_9_0.xml +++ b/.idea/libraries/Maven__org_mockito_mockito_core_2_24_0.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml b/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml similarity index 67% rename from .idea/libraries/Maven__org_objenesis_objenesis_3_2.xml rename to .idea/libraries/Maven__org_objenesis_objenesis_2_6.xml index 6613def61..af41e3b61 100644 --- a/.idea/libraries/Maven__org_objenesis_objenesis_3_2.xml +++ b/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 9393d74a0..64c7ef9f4 100644 --- a/demo.iml +++ b/demo.iml @@ -22,7 +22,6 @@ - @@ -76,17 +75,9 @@ - - - - - - - - @@ -101,5 +92,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 50fb36703..a0d7ff77b 100644 --- a/pom.xml +++ b/pom.xml @@ -53,6 +53,17 @@ test + + org.mockito + mockito-core + 2.24.0 + + + org.mockito + mockito-junit-jupiter + test + + diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java index f546f36c7..c472e69f4 100644 --- a/src/main/java/com/example/demo/repository/ProfileRepo.java +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -6,4 +6,5 @@ @Repository public interface ProfileRepo extends JpaRepository { + Profile findByUsernameAndPassword(String username, String password); } diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index f53395d46..fb6d7c3d5 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -1,5 +1,6 @@ package com.example.demo.service; +import com.example.demo.models.Profile; import com.example.demo.repository.ProfileRepo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; @@ -13,4 +14,28 @@ public class ProfileService { @Autowired ProfileRepo repository; + + public Profile createProfile(Profile profileData) { + profileData.setPassword(passwordEncoder.encode(profileData.getPassword())); + return repository.save(profileData); + } + + public Profile findById(Long id) { + return repository.findById(id).get(); + } + + public Profile login(String username, String password) { + String encodedPassword = passwordEncoder.encode(password); + return repository.findByUsernameAndPassword(username, encodedPassword); + } + + public Profile update(Profile profileData) { + return repository.save(profileData); + } + + public Profile deleteProfileById(Long id) { + Profile profileToDelete = findById(id); + repository.deleteById(id); + return profileToDelete; + } } diff --git a/src/test/java/com/example/demo/services/TestProfileService.java b/src/test/java/com/example/demo/services/TestProfileService.java index d9713f630..d5ac20a5e 100644 --- a/src/test/java/com/example/demo/services/TestProfileService.java +++ b/src/test/java/com/example/demo/services/TestProfileService.java @@ -1,4 +1,43 @@ package com.example.demo.services; +import com.example.demo.DemoApplication; +import com.example.demo.models.Channel; +import com.example.demo.models.Profile; +import com.example.demo.service.ProfileService; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@ActiveProfiles("test") +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest(classes = DemoApplication.class) public class TestProfileService { + + @Autowired + private ProfileService service; + + Long expectedId = 1L; + String expectedFirstName = "Ben"; + String expectedLastName = "Smith"; + String expectedUsername = "Batman"; + String expectedPassword = "Secret"; + String expectedEmail = "bens@gmail.com"; + List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); + Profile mockProfile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels); + + @Test + public void createProfileTest() { + Mockito.when(service.createProfile(mockProfile)).thenReturn(mockProfile); + String actualFirstName = service.createProfile(mockProfile).getFirstName(); + Assert.assertEquals(expectedFirstName, actualFirstName); + } } diff --git a/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java b/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java new file mode 100644 index 000000000..054c313b6 --- /dev/null +++ b/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java @@ -0,0 +1,19 @@ +package com.example.demo.services; + +import com.example.demo.service.ProfileService; +import org.mockito.Mockito; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.context.annotation.Profile; + +@Profile("test") +@Configuration +public class TestProfileServiceConfiguration { + + @Bean + @Primary + public ProfileService profileService() { + return Mockito.mock(ProfileService.class); + } +} diff --git a/target/classes/com/example/demo/repository/ProfileRepo.class b/target/classes/com/example/demo/repository/ProfileRepo.class index 5c817fec30b54b9af47e8742cc556679118b244d..7d9b4f2ce8d2873174917f8d72b0fb11c82b239f 100644 GIT binary patch delta 197 zcmZ3Y&Q()EK&iZb)ktuaM3CuS>ZGBODGrj}&n19cYxjVVbjDrRKh zD218|WEMb8-6&knXvWCG$iTwD%D~9L26PZ769YSt;s9c122LQ!#K6VC4W@Y*c!4w< JP$3@!0{|`IE zI{3lyvwxK1vv-$E0_oTphhcYb_xJWZzh^gp|MSP603PB+7GwDI3i5c6#V8);@EJbW zt1tB4qa41(R~fA6c{Pi#v8Gp#vpoAouhuiz$Y4`otSNo}mFrcv9m}mMPhhR=dNtE; zdbU$L@nl2s^e59-R?D-4wrP3oX5g9~H*>$=e??&CpydR1Lmk<^eOy=Tj^hS0uwBO& zcr-Bhv67B&o=7Wjy|yV62Xnm@xUXzaRT(zxsiy1O+C-pKw%mrPevyr4U71zYaLw+q zx$n6rc3mCNfsP}qwqplt0_kGuNMLA_I0?LLJ8HMpI9A@FWSIgJW!IARBk9@tJKh`$ zPHombAfKWX`L0@?l7Whg5ZEeSF1EoM>VC&}WkC1~76Q3uglbC$Qef^s zV+xG#sNmGC?n~XpKzYP5dSW}(jrQ}Zz=LA>r96{nT{<^ik~sv>36b^M~Iz;NBI z*^a=|-l&y8i)f|CI^KB~yrV5L?67j(nQofffrU%n zBy4~r*{?2rd&e)86;Mqz6?EyEDwYOOy!wA$0yZIPi@rRhqvyoUMmGG?Eg(P|bcW}2G{Z1Ht9t&}Fi)e*uMYg)q&n$SX-R5i>YKJonkD TRHsv#%M`_=$Bz>Ueggapr|lC0 delta 161 zcmZ9EJraU26okK!m}o#06|6mjw#p5lVmw%G;0aS Rvj`W7~PXzrcDPZ;Zp91AWZ{yKq?|ZBrR0IK#@SP;%zcLO{Yv|!puoq6udux zui{z>6j{3b?IZXwF87&C(kZFv4}WyNbNRmgUC&Pc`0JP708HS=G!A1rjrZ{WAP(W` z0In(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/demo/services/TestProfileServiceConfiguration.class b/target/test-classes/com/example/demo/services/TestProfileServiceConfiguration.class new file mode 100644 index 0000000000000000000000000000000000000000..5da3b5b2049f9801e2f756a82966135194fba8f3 GIT binary patch literal 915 zcmb7CNpBM|6#kqh88U<}DO=e}B~TL(7zu=gf{-8*rvWNj<-*CCI;qQDKEwMt2z&$1`q*`|ZwLKt78_>1*!`?Nu)O$|>sXrPjum z(A3z2#MlvcW2^LNXhkkR8hgM~qrE)zT>K5?ucQdAJUVOqmQ}g1pC~2XHib>)YnqSY z&MDJA+!qt^UuDY0QJLCAWCc~IdfF$$)3Y`@yX+?Fh!{5Ko$H_NM!40)I&L#Oo0oCw zff<&=&^!}*#NQ3}WlHU@hO^`*Jy728H&aft1q;L7c5Bcz Date: Thu, 26 Aug 2021 12:10:02 -0400 Subject: [PATCH 09/29] message --- .../demo/controller/MessageController.java | 51 ++++++++++++++- .../java/com/example/demo/models/Channel.java | 45 ------------- .../java/com/example/demo/models/Message.java | 60 ++++++++++++++++++ .../example/demo/repository/MessageRepo.java | 8 ++- .../example/demo/service/MessageService.java | 48 ++++++++++++++ .../example/demo/config/ChannelConfig.class | Bin 0 -> 312 bytes .../example/demo/config/MessageConfig.class | Bin 0 -> 312 bytes .../example/demo/config/ProfileConfig.class | Bin 0 -> 312 bytes .../demo/controller/ChannelController.class | Bin 0 -> 332 bytes .../demo/controller/MessageController.class | Bin 0 -> 332 bytes .../demo/controller/ProfileController.class | Bin 0 -> 332 bytes .../com/example/demo/models/Channel.class | Bin 0 -> 1968 bytes .../com/example/demo/models/Message.class | Bin 0 -> 1875 bytes .../com/example/demo/models/Profile.class | Bin 0 -> 294 bytes .../example/demo/repository/ChannelRepo.class | Bin 0 -> 131 bytes .../example/demo/repository/MessageRepo.class | Bin 0 -> 425 bytes .../example/demo/repository/ProfileRepo.class | Bin 0 -> 131 bytes .../example/demo/service/ChannelService.class | Bin 0 -> 317 bytes .../example/demo/service/MessageService.class | Bin 0 -> 1064 bytes .../example/demo/service/ProfileService.class | Bin 0 -> 317 bytes .../demo/config/TestChannelConfig.class | Bin 0 -> 324 bytes .../demo/config/TestMessageConfig.class | Bin 0 -> 324 bytes .../demo/config/TestProfileConfig.class | Bin 0 -> 324 bytes .../controllers/TestChannelController.class | Bin 0 -> 346 bytes .../controllers/TestMessageController.class | Bin 0 -> 346 bytes .../controllers/TestProfileController.class | Bin 0 -> 346 bytes .../com/example/demo/models/TestChannel.class | Bin 0 -> 306 bytes .../com/example/demo/models/TestMessage.class | Bin 0 -> 306 bytes .../com/example/demo/models/TestProfile.class | Bin 0 -> 306 bytes .../demo/repositories/TestChannelRepo.class | Bin 0 -> 330 bytes .../demo/repositories/TestMessageRepo.class | Bin 0 -> 330 bytes .../demo/repositories/TestProfileRepo.class | Bin 0 -> 330 bytes .../demo/services/TestChannelService.class | Bin 0 -> 331 bytes .../demo/services/TestMessageService.class | Bin 0 -> 331 bytes .../demo/services/TestProfileService.class | Bin 0 -> 331 bytes 35 files changed, 165 insertions(+), 47 deletions(-) create mode 100644 target/classes/com/example/demo/config/ChannelConfig.class create mode 100644 target/classes/com/example/demo/config/MessageConfig.class create mode 100644 target/classes/com/example/demo/config/ProfileConfig.class create mode 100644 target/classes/com/example/demo/controller/ChannelController.class create mode 100644 target/classes/com/example/demo/controller/MessageController.class create mode 100644 target/classes/com/example/demo/controller/ProfileController.class create mode 100644 target/classes/com/example/demo/models/Channel.class create mode 100644 target/classes/com/example/demo/models/Message.class create mode 100644 target/classes/com/example/demo/models/Profile.class create mode 100644 target/classes/com/example/demo/repository/ChannelRepo.class create mode 100644 target/classes/com/example/demo/repository/MessageRepo.class create mode 100644 target/classes/com/example/demo/repository/ProfileRepo.class create mode 100644 target/classes/com/example/demo/service/ChannelService.class create mode 100644 target/classes/com/example/demo/service/MessageService.class create mode 100644 target/classes/com/example/demo/service/ProfileService.class create mode 100644 target/test-classes/com/example/demo/config/TestChannelConfig.class create mode 100644 target/test-classes/com/example/demo/config/TestMessageConfig.class create mode 100644 target/test-classes/com/example/demo/config/TestProfileConfig.class create mode 100644 target/test-classes/com/example/demo/controllers/TestChannelController.class create mode 100644 target/test-classes/com/example/demo/controllers/TestMessageController.class create mode 100644 target/test-classes/com/example/demo/controllers/TestProfileController.class create mode 100644 target/test-classes/com/example/demo/models/TestChannel.class create mode 100644 target/test-classes/com/example/demo/models/TestMessage.class create mode 100644 target/test-classes/com/example/demo/models/TestProfile.class create mode 100644 target/test-classes/com/example/demo/repositories/TestChannelRepo.class create mode 100644 target/test-classes/com/example/demo/repositories/TestMessageRepo.class create mode 100644 target/test-classes/com/example/demo/repositories/TestProfileRepo.class create mode 100644 target/test-classes/com/example/demo/services/TestChannelService.class create mode 100644 target/test-classes/com/example/demo/services/TestMessageService.class create mode 100644 target/test-classes/com/example/demo/services/TestProfileService.class diff --git a/src/main/java/com/example/demo/controller/MessageController.java b/src/main/java/com/example/demo/controller/MessageController.java index 2129c124f..251c94ea4 100644 --- a/src/main/java/com/example/demo/controller/MessageController.java +++ b/src/main/java/com/example/demo/controller/MessageController.java @@ -1,4 +1,53 @@ package com.example.demo.controller; +import com.example.demo.models.Message; +import com.example.demo.repository.MessageRepo; +import com.example.demo.service.MessageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Controller +@RequestMapping("/message") public class MessageController { -} + + private MessageService messageService; + + @Autowired + public MessageController(MessageService messageService) { + this.messageService = messageService; + + } + + @PostMapping(value = "/create") + public ResponseEntity create(@RequestBody Message message) { + return new ResponseEntity<>(messageService.create(message), HttpStatus.CREATED); + } + + @GetMapping(value = "/read/{id}") + public ResponseEntity read(@PathVariable Long id ){ + return new ResponseEntity<>(messageService.read(id), HttpStatus.OK); + + } + + @GetMapping(value = "/all") + public ResponseEntity> readAll(){ + return new ResponseEntity<>(messageService.readAll(), HttpStatus.OK); + } + + @PutMapping(value = "/update{id}") + public ResponseEntity update (@PathVariable Long id, @RequestBody Message newMessageData){ + return new ResponseEntity<>(messageService.update(id, newMessageData), HttpStatus.OK); + } + + @DeleteMapping(value = "delete{id}") + public ResponseEntity delete(@PathVariable Long id ){ + return new ResponseEntity<>(messageService.delete(id), HttpStatus.OK); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 36bf7e819..4964093eb 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -1,50 +1,5 @@ package com.example.demo.models; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import java.util.List; - -@Entity public class Channel { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - private String name; - private List profileList; - private List messages; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getProfileList() { - return profileList; - } - - public void setProfileList(List profileList) { - this.profileList = profileList; - } - - public List getMessages() { - return messages; - } - - public void setMessages(List messages) { - this.messages = messages; - } } diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 7f846d245..563851cc1 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -1,4 +1,64 @@ package com.example.demo.models; +import org.apache.catalina.User; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.util.Date; + +@Entity public class Message { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + Long id; + Profile profile; + String body; + Date timestamp; + + + public Message() { + } + + public Message(Long id, Profile profile, String body, Date timestamp) { + this.id = id; + this.profile = profile; + this.body = body; + this.timestamp = timestamp; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Profile getProfile() { + return profile; + } + + public void setProfile(Profile profile) { + this.profile = profile; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + } diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java index 38eca51bb..d4c9bd8ef 100644 --- a/src/main/java/com/example/demo/repository/MessageRepo.java +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -1,4 +1,10 @@ package com.example.demo.repository; -public class MessageRepo { +import com.example.demo.models.Message; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface MessageRepo extends JpaRepository { + } diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java index b953cf94b..c36f67100 100644 --- a/src/main/java/com/example/demo/service/MessageService.java +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -1,4 +1,52 @@ package com.example.demo.service; +import com.example.demo.models.Message; +import com.example.demo.repository.MessageRepo; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + public class MessageService { + private MessageRepo messageRepo; + + + @Autowired + public MessageService(MessageRepo messageRepo){ + this.messageRepo = messageRepo; + } + + + public Message create (Message message){ + return messageRepo.save(message); + } + + public Message read(Long id){ + return messageRepo.getById(id); + } + + public List readAll(){ + return messageRepo.findAll(); + } + + public Message update(Long id, Message newMessageData){ + Message messageInDB = read(id); + messageInDB.setBody(newMessageData.getBody()); + messageInDB.setProfile(newMessageData.getProfile()); + messageInDB.setTimestamp(newMessageData.getTimestamp()); + messageRepo.save(messageInDB); + return messageInDB; + } + + public Message delete(Long id){ + Message messageInDB = read(id); + messageRepo.delete(messageInDB); + return messageInDB; + } + + public void deleteAll(){ + messageRepo.deleteAll(); + } + + + } diff --git a/target/classes/com/example/demo/config/ChannelConfig.class b/target/classes/com/example/demo/config/ChannelConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..bb261267573bfdf67ca19e244d8af90d101b7cdb GIT binary patch literal 312 zcma)%Jx;?w5QX13{t3n;5jRMI_$k_xj literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/MessageConfig.class b/target/classes/com/example/demo/config/MessageConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..de19b497b191da866eddabb449e8868905773e4c GIT binary patch literal 312 zcma)%Jx;?w5QX13{sG63h#OEKeu`{E2cn5YWk?a^e!U*dMz$B(4&qu=NGUh~heC`k znsm%aPxHOeJZZjvc3%LlF^@69QH0|NGeUT48{6LzCKs0(!C$(93A5BT{J5=iZl82s ziF1-VqpM7}cHlqL?_X?3I8TkM6~F8HwPICp?UZrNvn|yFcbzVIInoUwUb}5;_}-3@ zd)viEzv%=%0>at9@(A2V5Az8i|9B}_CFQX>Pw)hFmf3=ffLC^qEa RKr|WW0EdW$2vboH$uD&HM_&K{ literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/ProfileConfig.class b/target/classes/com/example/demo/config/ProfileConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..dea009db9a8f6c5097c66dc4bc6ebbd5080aa92b GIT binary patch literal 312 zcma)%%}T>S6ot=C^P@4frElOu{8=~~cNRAVSHTuqx}QvM>y$}GVk&*Dt^^l8fDa|! zgl^n91Bd&4!#yzHKc8O!?lDZ!LqEZJf&n2O+sZbNgx>Ydk`PY(iV1_gsa^6Qt@7wua4DD=#X!%yO* z^3UttR=?{EAtJ)%zxoKnc1Jl~ZPc{bvT1OEKz`RAk}GABv5@K*h;BbX2N3}h$yhXG S;Y2d)<_M=qg$QSo0kU6;_eX;O literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/controller/ChannelController.class b/target/classes/com/example/demo/controller/ChannelController.class new file mode 100644 index 0000000000000000000000000000000000000000..16bf677d403c7311c3a2b4c12a27ec1765e19cc4 GIT binary patch literal 332 zcmb7q_cnvsu(vDgMf_S;f`uQz4<*h8 zv9WRn9`k<8Jebd~_YVN)n3Wh|zraC(DIveK-u737(c*YXNb9g-!nCoTZ?;{_@m{x1 z$YB$Vc1s=Y;D2D+uk8~-H70b5Uv&5ASgp7V$^_rX;2cL)ueJB=>R)m}DDT2H8oste z^wFPLh$i6*GN0mnB`RR910 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/controller/MessageController.class b/target/classes/com/example/demo/controller/MessageController.class new file mode 100644 index 0000000000000000000000000000000000000000..0f631f61e1bf0c2cb2faad4cca1cc898fafd6989 GIT binary patch literal 332 zcmb7evq@R;{w=D~b^y?+3>z$C{2qYOtG#)NcX8{1tG2J@2@Azu156UL=&_;y!U93FJ# zgdCUNXt&bA_WlRP-J@*@sx-b<{G#h8$7;>BSH?G8@Xm2iH{7;*!^>ZCNyzX0E*QSH zef0Ft#`#u1>jE(n!r8yF36uU-Io)j3UA1M?VTMRP?u(=)R5TT*_8v%1-$1VdB4nbe VV93ExwAjxH4v>o@9EwILz5(B7Pv|H$4JHLl<`)pqcsx-b<{I2U4$7;#7SH?GO@Xm2i_rX6}$CF=jO~~hd9Sl!} z6HfnZT(0z+E)XLjjQ@3;FzB+%>E=n@RVy|v&JfARU6HgL6-~vdod=T9C+I^!giJIQ U3<(^F7P~pYA#!nqBhd)O5BBCzod5s; literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/models/Channel.class b/target/classes/com/example/demo/models/Channel.class new file mode 100644 index 0000000000000000000000000000000000000000..021a446065d7e1d32a8c102a2b06653506d94ef9 GIT binary patch literal 1968 zcmb7_YflqF6o$`iZ%`_fLW`iNMbWkhDp?-L|#{zsz*bob#S%&Y9W%`u*c45k03jX-d)NC?)BI9A3)dl^kBDsG6cJ zMvC5Kl&zg>pEcFctd?4{tyY!M?1zpebd%S0S3foQj%C?G6S{4=j0&Fnh1%whtGj|* z4X*Ar5wtL1<2|>yqY2)uYet8|X~Y$B-MajzKQf(Mwxxf3=i|vCCQCCpqg)s2v2b(` zcC78#pLB!QKog#(BXmQR7HEtf>n%$Y9R~{QzCyUYRcqL$$}cptZE&^8O{>=sU{TNRmxusjW*k%+fmFqapE^;uMsOc6z=$NP6InhvOc|g0N z8FkIku*k#`u8MLcAtwgyLqHJ zD78Ry8Kt0h;1zzlM=vaW3W~l%zFRZcm#X8C2rB9KCnO770PKxx`OtW?zKkP(kNWk| zLY=CFDD+kpH!G;@WK3o1DPJv6Xf`dDb~+a z1k=J0CRuw%0aMmvDp5I*jf#9l@qVVo0Ze}HDo|Xarxf$pjvyA+D=yh$UbX#tmBCgS z!sg$HWkmR`OyY**BibA`{DdnosspJL{nX1tsh>e)bue|JpL!M4YeT60TiZ=tpqYre V5K^z9EbCY)_-~ePL*CsDqCd6Nh-3f& literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class new file mode 100644 index 0000000000000000000000000000000000000000..953bcac9caf0011d5e078a63a35652ca6913c270 GIT binary patch literal 1875 zcmah}TW=Ck5S{}I6kK~R6}(hxt3WSn?M0hv6Ypt4ZDW!51&(wZ*d^>@+BbiaCK3}L z`~m(b<2Pqlpa}MXnRCw0eDi%X=kV+IkDo-eMY{=#(W5v;X_L(sn{75bF?t-MCxSv& zRnTPN%=}~;bLE4aaCWRatk9V?TtG%1#vpru&4Qcr8mwi?c4*LwZ+v+q3G%E3iUp^r>ZA z-oBu4Hdg}DOJEC{C|I_9*KU+$t7xJjjO|p+ddX~AyblgF@6ocmW^De<$%3ix8z$PzW}OD)W@aig6J{H|Z8U1KdU=1AK;$z^54?ztW*l zezim4{91>!d`jz3q=%XYcLKf!%s8;dfi?rA6x~r(wtS?Z3NQnOykarTDXrv$)rtja z$c26lp{$tI61vMI7w9f5lQiIcmES1z1qZ&$s5;E3+Jg!+v=}Jdhv&*srLLzYp-z{< z`MyF(`cYl>(SSYki{K9q4o`)aUvmC2&c#(r`@5P)}Ve!pZad1 eKf7n(v_FCq->ohuzE2_CBDN3JgX62SLG%ZG_EK^H literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class new file mode 100644 index 0000000000000000000000000000000000000000..75bf6f1708519e126c69da0f19c2bbcacca62d96 GIT binary patch literal 294 zcmaiv&1%9x6ot=?`O%nG@dd=4cHwNgYw4!YRcHmp{Ul!P$V{fhSo&IB6}spH^r1>` z#JzLjFyF__f&2US{R7|@!xSA{CAdy7AjJ2kGR*^_Go7so;iKO$VUU}OpO3EKdZi01 zW|aF<+qJGu%V!xjujW9QGv3y5Jm;P9n{3Jxk&VIhv z?>a+>h%mm;K^V5LmDSZwy%c*c8%z+$F6|*1sgaC@)QN%U<_q*GB0wS;i-vsYN@k~f NgdS2MLSHgK_77YPK#KqX literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/repository/ChannelRepo.class b/target/classes/com/example/demo/repository/ChannelRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..91a30cadd69983efffff179289711a328696c44f GIT binary patch literal 131 zcmX^0Z`VEs1_l!bc6J6aFF#N2|MRQ;6H+5L3a QK>2~j?yBqg6F!U2g075#+!M^O{!`M8lw-! z>AOIdA0^ylONp@agn_+8lO!zh%G2~KJF6S9$WLT_&)BjRw9;}P@tR{K&DB7u7N@K8 zO2K3%i_q|;=`+jzx^p%3c!j0lV7hS0SiUvU%zM6YP7);}E-Eo?zz0YLhtL23 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/repository/ProfileRepo.class b/target/classes/com/example/demo/repository/ProfileRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..017fd49fc0930fc3fa68da9b2ca8e99220e012a7 GIT binary patch literal 131 zcmX^0Z`VEs1_l!bc6J6I%2==B7Md<@XYr1UyDsiA zRAZT@B9eP@pc&eJpkprIi+IqNJe0BKhW<#E)#iln&ZJumt9!%5s#tbas(O97og~@{ zt8|hwJodGTcsejDi4Kg2<*_#Jcu$HX%J60>Mz1nctS;Ois_y_BF@q_1teBrmj@U=+7 z`0w|8t#`UWjD#@#=Ssq;n^I0UkLtEsvuQCwBqw%{q-33BDx~%dB&TnnR}m31$y79C Spf6eM`veEbg$M)52*o$-wMp*) literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/config/TestChannelConfig.class b/target/test-classes/com/example/demo/config/TestChannelConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..20ae897984d102b962b618cd871fff694489f9ba GIT binary patch literal 324 zcma)%y-veG5QJwP|9~+hqM)ZEAaM;Hh{h6?MGB(y=gX2@biPB5gLo|}BnlpYheE6^ zx-{%cqn%H?BklLk=NEt*Omd8HoZ%$Hn2_FCZ@YWK=wiAc#AR4AVO&|ykGrPkcCKqD zj%U8y;5yK=3)XIBp7mXJS%U2FKk z_OWMs8`m5Cstd$O2-AP(5+?nfa@w!dtlqHcaE?em?Te%(P&5^%1`i~cAE0*u5i-$K UFy!Dsv>4_Dhsebdjzl9AznLmbCjbBd literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/config/TestMessageConfig.class b/target/test-classes/com/example/demo/config/TestMessageConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..3cff01262e8f5a6b4e9916d6c9f347f6481810a8 GIT binary patch literal 324 zcma)%y-veG5QJwP|9~+hqM)ZEAaPB)pfr)F3=~A^&zHqqWcwo9iSk;hB2n-FJQQMW z(b2Fgjdnimj`(2=$z+0nG)hxx2+97 z+Aj9$&&K^)?{oqm0b%^_T*9ckQ-!W_^^&dGw77;RpLRvk5-1vqQ@sa*+au^8z(XV& V3Wgk=(xQOm6@H literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/controllers/TestChannelController.class b/target/test-classes/com/example/demo/controllers/TestChannelController.class new file mode 100644 index 0000000000000000000000000000000000000000..c7cb4ee5745213a7c68b80facda6e86e1a4ce878 GIT binary patch literal 346 zcmb7N!nYYZ>_s1uIDJD5aIL>gAVN6Kxj5Fb$FuJ&065`UYm@ux4?hnM%$(C%;0}u9M+~MOsmGXieGj6Y+0?i^{VkMblzI-dbQv_lxyuA+wvFR67sp< zb`3w6A^+^psq2k?(FI~8gq#0=LYNEz%4+wdX7z@ffOAB0|4<|?$)c$^wf8`B^$vOy Z5Fryy1w$4NM2r19!69;Sgd@=i#SU+ARw)1g literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/controllers/TestMessageController.class b/target/test-classes/com/example/demo/controllers/TestMessageController.class new file mode 100644 index 0000000000000000000000000000000000000000..0c30170cf7b4536c80ce1a7343fe852b9a3d893d GIT binary patch literal 346 zcmb7EL~_(iu*j@6P|uZ-_v@Xm4Q)tviy%YCm`Jp09$gz~{} zg5euGY5Qg8m+=rg036^$tYT<&UQ)~iOhYE)Ddz(==?A^-VM*Le=f`vc8A0^HO zv9fUnUgmw659agh{R6-hlM*BB7T7B=Cgc~kv+nltd`t*WqcQdcaB4^=G@2I;P0*D*)KjPly`m| z3||Q+9Q@gJy3)_OLW+!V_WvV<$*@2<-94zAX2mAr5Q+Rh1WC$f(OjI`cpy7@1HB4J YP>AM&Ap={Y)uzs{jZz$8M>Ik84WMvVaR2}S literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/models/TestChannel.class b/target/test-classes/com/example/demo/models/TestChannel.class new file mode 100644 index 0000000000000000000000000000000000000000..9ee3d414d15900439bcb8fe3b54552df716561e1 GIT binary patch literal 306 zcma)%%}N775QM8Y`=je>f^Q%qs0Zhgo8l$lX)%X{+-En9nJ_0^gWJ0WA)bUK6NaVn{JM1&H*;NC zaW2bHYrD{m>GiJ}cPrBpZpu11#qZi}EUP8Epq$j$R?WHXCM)ed+ebn^3)`mV7t}@+9Qo1Ncy4 zZ}8yJ9{A|0rV8fkd;baG7ULWPoMbr7Fe0S)rZL@=Fu1&05#k5GX2Pg64bOM3;&!Pk zE6!QzYi(D$HNE~d#8@?mtPkz_dJTraa z_|NTTt6z127zyG0A6=5}6UyplqZZYc>kbn{@~?hKo>U1_QR<+96yaDHq4)tTXGK#0 literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/models/TestProfile.class b/target/test-classes/com/example/demo/models/TestProfile.class new file mode 100644 index 0000000000000000000000000000000000000000..9784c6fab7bb901891089e7f31e965014474dc0a GIT binary patch literal 306 zcma)%%}T>S6ot=C^P_2Oi*Fzzs0(M~&f-SsD%gUh`$>A$DKnXpq{Y{ARp`P8@S((; z;=*O`z~O%9at_S*&;AR*Jw_>dI7=`{FeJodQ`4o>Ym(Lh8Ukbh`t6iV+|Yjm3rp SPDHcA9^n+J5TP#`Ao~SDMn!i3 literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/repositories/TestChannelRepo.class b/target/test-classes/com/example/demo/repositories/TestChannelRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..7224277b12c84d8a508d8c8f47e470dedff63453 GIT binary patch literal 330 zcmb7X4HL>~>t Y3ej9JIuq^)gR}DmA)eYL6Go-!_+i^t?B=>^ zgq)PN*3CjY)B8UdhZo}ss;q6R_)WK)hSic=s~m5vH^Dl?Ud`Eud-h(h_(}K;A%C`8 zSM$vD(WiU+tF?aB1!5$G%YP*k#{I2obhlEE)tc*o2_pHoFOrr}(Nvt;c_6v?0KE%{ Ykcp;(AqPXzVmBu^KrW7OC>o*o1==l7bpQYW literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/repositories/TestProfileRepo.class b/target/test-classes/com/example/demo/repositories/TestProfileRepo.class new file mode 100644 index 0000000000000000000000000000000000000000..8a519520ab80fb5fb54c031d2a11ff65a3f7a92c GIT binary patch literal 330 zcmb7<&q~8U5XQer^QXpWi}(V)si1rDrg$mz6jZeIzDY;jvdNasR(vf_f(IYKhY}~n zQ*X||$9%ux8<_8(&o2O%80Q$^Aj4sX5h1-ctqC`T!O7`@5KrBb38T`qe7k8X_H$iX zAxEXFwOwd$djALG@M1cGDr?s$e$&m`vRZQEl;^eUOmN&+d+(l%<-9D?kYQ=TH1d;sP7fH)e(Nvt;dLTLb0KE%{ Ykcp;(A%UT2v7Hm_As0v37mZN-0`R;~nE(I) literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestChannelService.class b/target/test-classes/com/example/demo/services/TestChannelService.class new file mode 100644 index 0000000000000000000000000000000000000000..1f069309f8b6cad10c7b7f5e61ed658a79023061 GIT binary patch literal 331 zcmb7#Z&jBO%-#l1&)(r^;#nqNdfFO@~WF@^D`yEt#UJIJNgca`ORt7Z4#6 WO$9>^jzo+7oZuL_IKqi&gklE__D_2N literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestMessageService.class b/target/test-classes/com/example/demo/services/TestMessageService.class new file mode 100644 index 0000000000000000000000000000000000000000..10d33fe70270fcf7b54ae5c2ab75110187169bc9 GIT binary patch literal 331 zcmb7UIT5c#g+##v@KA_# zprc|}8tr`A9ce$m-ai1`Vw9qX(*$P;hJ^Uu*0y~h^u|{!Lip&`Oc>_2=Gnd~xLN9= z6mp(Bqsx_UZ0CPr*gjiNnB>M)ieGfKD_O0%a>{dau!g-_vTvW*d%fYs54$6z3%73! zPi>cc@pomi)d!s+L`1mxPc~uHovKpT8#OPsY+76*kcYb>X~`6g#i^qQqU$%%tAGHB WXe=0Va3Y!==LmhI;s^uL0NFPru1}u; literal 0 HcmV?d00001 diff --git a/target/test-classes/com/example/demo/services/TestProfileService.class b/target/test-classes/com/example/demo/services/TestProfileService.class new file mode 100644 index 0000000000000000000000000000000000000000..278cabb0a5a7e2cf2513cd14ef5b404b0217d150 GIT binary patch literal 331 zcmb7$SW+;4*6 zi9o{1-<9!NZ*_qf3E}cTw+W*@s+?{f)wEi(>2Qij9`1{z<)&yVPVGF9T)cr^1w_b1 WQ^AnHo@lX~6YL`wM>r6TP<#VBwNJwU literal 0 HcmV?d00001 From 36fc88445414533bb1d6be5878dc757c56db1654 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 26 Aug 2021 12:35:51 -0400 Subject: [PATCH 10/29] Comment added --- src/main/java/com/example/demo/models/Channel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 36bf7e819..3fa7b9eb3 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -8,7 +8,7 @@ @Entity public class Channel { - +// Comment yo @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; From b1b4cb3a96705536c9ae6e5370c16155bc107047 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 26 Aug 2021 12:42:16 -0400 Subject: [PATCH 11/29] fixed --- src/main/java/com/example/demo/models/Channel.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index b6c576f64..7fbf80a71 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -1,5 +1,13 @@ package com.example.demo.models; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.util.List; + + +@Entity public class Channel { // Comment yo @Id From 660f7a5a297e0635289b18b6b4553a929d7d1b2e Mon Sep 17 00:00:00 2001 From: Zachary Kitto Date: Thu, 26 Aug 2021 21:39:59 -0400 Subject: [PATCH 12/29] Added tests for profile service --- node_modules/.bin/loose-envify | 1 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 ++ node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 64 + node_modules/loose-envify/LICENSE | 21 + node_modules/loose-envify/README.md | 45 + node_modules/loose-envify/cli.js | 16 + node_modules/loose-envify/custom.js | 4 + node_modules/loose-envify/index.js | 3 + node_modules/loose-envify/loose-envify.js | 36 + node_modules/loose-envify/package.json | 67 + node_modules/loose-envify/replace.js | 65 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 74 + node_modules/object-assign/readme.md | 61 + node_modules/react/LICENSE | 21 + node_modules/react/README.md | 13 + node_modules/react/build-info.json | 8 + .../cjs/react-jsx-dev-runtime.development.js | 1203 ++++++ .../react-jsx-dev-runtime.production.min.js | 9 + .../react-jsx-dev-runtime.profiling.min.js | 9 + .../cjs/react-jsx-runtime.development.js | 1221 ++++++ .../cjs/react-jsx-runtime.production.min.js | 10 + .../cjs/react-jsx-runtime.profiling.min.js | 10 + node_modules/react/cjs/react.development.js | 2333 ++++++++++++ .../react/cjs/react.production.min.js | 23 + node_modules/react/index.js | 7 + node_modules/react/jsx-dev-runtime.js | 7 + node_modules/react/jsx-runtime.js | 7 + node_modules/react/package.json | 67 + node_modules/react/umd/react.development.js | 3357 +++++++++++++++++ .../react/umd/react.production.min.js | 31 + node_modules/react/umd/react.profiling.min.js | 36 + package-lock.json | 33 + .../example/demo/config/ProfileConfig.java | 2 +- .../demo/controller/ProfileController.java | 37 +- .../java/com/example/demo/models/Profile.java | 2 +- .../example/demo/service/ProfileService.java | 21 +- src/main/resources/application.properties | 7 +- .../demo/services/TestProfileService.java | 101 +- .../TestProfileServiceConfiguration.java | 19 - target/classes/application.properties | 7 +- .../example/demo/config/ProfileConfig.class | Bin 685 -> 693 bytes .../demo/controller/ProfileController.class | Bin 588 -> 3376 bytes .../com/example/demo/models/Profile.class | Bin 2986 -> 2982 bytes .../example/demo/service/ProfileService.class | Bin 2210 -> 2673 bytes .../demo/services/TestProfileService.class | Bin 2688 -> 4098 bytes .../TestProfileServiceConfiguration.class | Bin 915 -> 0 bytes 51 files changed, 9560 insertions(+), 44 deletions(-) create mode 120000 node_modules/.bin/loose-envify create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/loose-envify/LICENSE create mode 100644 node_modules/loose-envify/README.md create mode 100755 node_modules/loose-envify/cli.js create mode 100644 node_modules/loose-envify/custom.js create mode 100644 node_modules/loose-envify/index.js create mode 100644 node_modules/loose-envify/loose-envify.js create mode 100644 node_modules/loose-envify/package.json create mode 100644 node_modules/loose-envify/replace.js create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/react/LICENSE create mode 100644 node_modules/react/README.md create mode 100644 node_modules/react/build-info.json create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.min.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.production.min.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.min.js create mode 100644 node_modules/react/cjs/react.development.js create mode 100644 node_modules/react/cjs/react.production.min.js create mode 100644 node_modules/react/index.js create mode 100644 node_modules/react/jsx-dev-runtime.js create mode 100644 node_modules/react/jsx-runtime.js create mode 100644 node_modules/react/package.json create mode 100644 node_modules/react/umd/react.development.js create mode 100644 node_modules/react/umd/react.production.min.js create mode 100644 node_modules/react/umd/react.profiling.min.js create mode 100644 package-lock.json delete mode 100644 src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java delete mode 100644 target/test-classes/com/example/demo/services/TestProfileServiceConfiguration.class diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 000000000..ed9009c5a --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100644 index 000000000..755e6f6ec --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,151 @@ +### Version 4.0.0 (2018-01-28) ### + +- Added: Support for ES2018. The only change needed was recognizing the `s` + regex flag. +- Changed: _All_ tokens returned by the `matchToToken` function now have a + `closed` property. It is set to `undefined` for the tokens where “closed” + doesn’t make sense. This means that all tokens objects have the same shape, + which might improve performance. + +These are the breaking changes: + +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but + `['/a/s']`. (There are of course other variations of this.) +- Code that rely on some token objects not having the `closed` property could + now behave differently. + + +### Version 3.0.2 (2017-06-28) ### + +- No code changes. Just updates to the readme. + + +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100644 index 000000000..54aef52f3 --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100644 index 000000000..00cdf1634 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,240 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest ECMAScript version whose feature +set has been finalized. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, ECMAScript 2018 is supported. + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). Note: See also +the [ES2018](#es2018) section. + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also +look backwards. See the [ES2018](#es2018) section). + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + +### ES2018 ### + +ES2018 added some nice regex improvements to the language. + +- [Unicode property escapes] should allow telling names and invalid non-ASCII + characters apart without blowing up the regex size. +- [Lookbehind assertions] should allow matching telling division and regex + literals apart in more cases. +- [Named capture groups] might simplify some things. + +These things would be nice to do, but are not critical. They probably have to +wait until the oldest maintained Node.js LTS release supports those features. + +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100644 index 000000000..b23a4a0e7 --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100644 index 000000000..a518c5abf --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,64 @@ +{ + "_from": "js-tokens@^3.0.0 || ^4.0.0", + "_id": "js-tokens@4.0.0", + "_inBundle": false, + "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "_location": "/js-tokens", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "js-tokens@^3.0.0 || ^4.0.0", + "name": "js-tokens", + "escapedName": "js-tokens", + "rawSpec": "^3.0.0 || ^4.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0 || ^4.0.0" + }, + "_requiredBy": [ + "/loose-envify" + ], + "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499", + "_spec": "js-tokens@^3.0.0 || ^4.0.0", + "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/loose-envify", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/js-tokens/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A regex that tokenizes JavaScript.", + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/lydell/js-tokens#readme", + "keywords": [ + "JavaScript", + "js", + "token", + "tokenize", + "regex" + ], + "license": "MIT", + "name": "js-tokens", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/js-tokens.git" + }, + "scripts": { + "build": "node generate-index.js", + "dev": "npm run build && npm test", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "test": "mocha --ui tdd" + }, + "version": "4.0.0" +} diff --git a/node_modules/loose-envify/LICENSE b/node_modules/loose-envify/LICENSE new file mode 100644 index 000000000..fbafb4875 --- /dev/null +++ b/node_modules/loose-envify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Andres Suarez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/loose-envify/README.md b/node_modules/loose-envify/README.md new file mode 100644 index 000000000..7f4e07b00 --- /dev/null +++ b/node_modules/loose-envify/README.md @@ -0,0 +1,45 @@ +# loose-envify + +[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) + +Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. + +## Gotchas + +* Doesn't handle broken syntax. +* Doesn't look inside embedded expressions in template strings. + - **this won't work:** + ```js + console.log(`the current env is ${process.env.NODE_ENV}`); + ``` +* Doesn't replace oddly-spaced or oddly-commented expressions. + - **this won't work:** + ```js + console.log(process./*won't*/env./*work*/NODE_ENV); + ``` + +## Usage/Options + +loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. + +## Benchmark + +``` +envify: + + $ for i in {1..5}; do node bench/bench.js 'envify'; done + 708ms + 727ms + 791ms + 719ms + 720ms + +loose-envify: + + $ for i in {1..5}; do node bench/bench.js '../'; done + 51ms + 52ms + 52ms + 52ms + 52ms +``` diff --git a/node_modules/loose-envify/cli.js b/node_modules/loose-envify/cli.js new file mode 100755 index 000000000..c0b63cb1d --- /dev/null +++ b/node_modules/loose-envify/cli.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; + +var looseEnvify = require('./'); +var fs = require('fs'); + +if (process.argv[2]) { + fs.createReadStream(process.argv[2], {encoding: 'utf8'}) + .pipe(looseEnvify(process.argv[2])) + .pipe(process.stdout); +} else { + process.stdin.resume() + process.stdin + .pipe(looseEnvify(__filename)) + .pipe(process.stdout); +} diff --git a/node_modules/loose-envify/custom.js b/node_modules/loose-envify/custom.js new file mode 100644 index 000000000..6389bfac5 --- /dev/null +++ b/node_modules/loose-envify/custom.js @@ -0,0 +1,4 @@ +// envify compatibility +'use strict'; + +module.exports = require('./loose-envify'); diff --git a/node_modules/loose-envify/index.js b/node_modules/loose-envify/index.js new file mode 100644 index 000000000..8cd8305dd --- /dev/null +++ b/node_modules/loose-envify/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./loose-envify')(process.env); diff --git a/node_modules/loose-envify/loose-envify.js b/node_modules/loose-envify/loose-envify.js new file mode 100644 index 000000000..b5a5be220 --- /dev/null +++ b/node_modules/loose-envify/loose-envify.js @@ -0,0 +1,36 @@ +'use strict'; + +var stream = require('stream'); +var util = require('util'); +var replace = require('./replace'); + +var jsonExtRe = /\.json$/; + +module.exports = function(rootEnv) { + rootEnv = rootEnv || process.env; + return function (file, trOpts) { + if (jsonExtRe.test(file)) { + return stream.PassThrough(); + } + var envs = trOpts ? [rootEnv, trOpts] : [rootEnv]; + return new LooseEnvify(envs); + }; +}; + +function LooseEnvify(envs) { + stream.Transform.call(this); + this._data = ''; + this._envs = envs; +} +util.inherits(LooseEnvify, stream.Transform); + +LooseEnvify.prototype._transform = function(buf, enc, cb) { + this._data += buf; + cb(); +}; + +LooseEnvify.prototype._flush = function(cb) { + var replaced = replace(this._data, this._envs); + this.push(replaced); + cb(); +}; diff --git a/node_modules/loose-envify/package.json b/node_modules/loose-envify/package.json new file mode 100644 index 000000000..b57fbf394 --- /dev/null +++ b/node_modules/loose-envify/package.json @@ -0,0 +1,67 @@ +{ + "_from": "loose-envify@^1.1.0", + "_id": "loose-envify@1.4.0", + "_inBundle": false, + "_integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "_location": "/loose-envify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "loose-envify@^1.1.0", + "name": "loose-envify", + "escapedName": "loose-envify", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/react" + ], + "_resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "_shasum": "71ee51fa7be4caec1a63839f7e682d8132d30caf", + "_spec": "loose-envify@^1.1.0", + "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/react", + "author": { + "name": "Andres Suarez", + "email": "zertosh@gmail.com" + }, + "bin": { + "loose-envify": "cli.js" + }, + "bugs": { + "url": "https://github.com/zertosh/loose-envify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "deprecated": false, + "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST", + "devDependencies": { + "browserify": "^13.1.1", + "envify": "^3.4.0", + "tap": "^8.0.0" + }, + "homepage": "https://github.com/zertosh/loose-envify", + "keywords": [ + "environment", + "variables", + "browserify", + "browserify-transform", + "transform", + "source", + "configuration" + ], + "license": "MIT", + "main": "index.js", + "name": "loose-envify", + "repository": { + "type": "git", + "url": "git://github.com/zertosh/loose-envify.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/loose-envify/replace.js b/node_modules/loose-envify/replace.js new file mode 100644 index 000000000..ec15e81c2 --- /dev/null +++ b/node_modules/loose-envify/replace.js @@ -0,0 +1,65 @@ +'use strict'; + +var jsTokens = require('js-tokens').default; + +var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/; +var spaceOrCommentRe = /^(?:\s|\/[/*])/; + +function replace(src, envs) { + if (!processEnvRe.test(src)) { + return src; + } + + var out = []; + var purge = envs.some(function(env) { + return env._ && env._.indexOf('purge') !== -1; + }); + + jsTokens.lastIndex = 0 + var parts = src.match(jsTokens); + + for (var i = 0; i < parts.length; i++) { + if (parts[i ] === 'process' && + parts[i + 1] === '.' && + parts[i + 2] === 'env' && + parts[i + 3] === '.') { + var prevCodeToken = getAdjacentCodeToken(-1, parts, i); + var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4); + var replacement = getReplacementString(envs, parts[i + 4], purge); + if (prevCodeToken !== '.' && + nextCodeToken !== '.' && + nextCodeToken !== '=' && + typeof replacement === 'string') { + out.push(replacement); + i += 4; + continue; + } + } + out.push(parts[i]); + } + + return out.join(''); +} + +function getAdjacentCodeToken(dir, parts, i) { + while (true) { + var part = parts[i += dir]; + if (!spaceOrCommentRe.test(part)) { + return part; + } + } +} + +function getReplacementString(envs, name, purge) { + for (var j = 0; j < envs.length; j++) { + var env = envs[j]; + if (typeof env[name] !== 'undefined') { + return JSON.stringify(env[name]); + } + } + if (purge) { + return 'undefined'; + } +} + +module.exports = replace; diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 000000000..0930cf889 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 000000000..7f7add83b --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,74 @@ +{ + "_from": "object-assign@^4.1.1", + "_id": "object-assign@4.1.1", + "_inBundle": false, + "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "_location": "/object-assign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-assign@^4.1.1", + "name": "object-assign", + "escapedName": "object-assign", + "rawSpec": "^4.1.1", + "saveSpec": null, + "fetchSpec": "^4.1.1" + }, + "_requiredBy": [ + "/react" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "_spec": "object-assign@^4.1.1", + "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/react", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 `Object.assign()` ponyfill", + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "name": "object-assign", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && ava" + }, + "version": "4.1.1" +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 000000000..1be09d35c --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/react/LICENSE b/node_modules/react/LICENSE new file mode 100644 index 000000000..b96dcb048 --- /dev/null +++ b/node_modules/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react/README.md b/node_modules/react/README.md new file mode 100644 index 000000000..0033e23bd --- /dev/null +++ b/node_modules/react/README.md @@ -0,0 +1,13 @@ +# `react` + +React is a JavaScript library for creating user interfaces. + +The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments. + +**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application. + +## Example Usage + +```js +var React = require('react'); +``` diff --git a/node_modules/react/build-info.json b/node_modules/react/build-info.json new file mode 100644 index 000000000..db5dbe5e2 --- /dev/null +++ b/node_modules/react/build-info.json @@ -0,0 +1,8 @@ +{ + "branch": "pull/21051", + "buildNumber": "287151", + "checksum": "94f5c65", + "commit": "12adaffef", + "environment": "ci", + "reactVersion": "17.0.0-12adaffef" +} diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 000000000..9885b5f46 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,1203 @@ +/** @license React v17.0.2 + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var _assign = require('object-assign'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.

+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev + +var jsxDEV$1 = jsxWithValidation ; + +exports.jsxDEV = jsxDEV$1; + })(); +} diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js b/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js new file mode 100644 index 000000000..02c1a5b3a --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js @@ -0,0 +1,9 @@ +/** @license React v17.0.2 + * react-jsx-dev-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js new file mode 100644 index 000000000..9c8898a30 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js @@ -0,0 +1,9 @@ +/** @license React v17.0.2 + * react-jsx-dev-runtime.profiling.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0; diff --git a/node_modules/react/cjs/react-jsx-runtime.development.js b/node_modules/react/cjs/react-jsx-runtime.development.js new file mode 100644 index 000000000..38c92242c --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.development.js @@ -0,0 +1,1221 @@ +/** @license React v17.0.2 + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var _assign = require('object-assign'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev +// even with the prod transform. This means that jsxDEV is purely +// opt-in behavior for better messages but that we won't stop +// giving you warnings if you use production apis. + +function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } +} +function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } +} + +var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. +// for now we can ship identical prod functions + +var jsxs = jsxWithValidationStatic ; + +exports.jsx = jsx; +exports.jsxs = jsxs; + })(); +} diff --git a/node_modules/react/cjs/react-jsx-runtime.production.min.js b/node_modules/react/cjs/react-jsx-runtime.production.min.js new file mode 100644 index 000000000..240488cf2 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.production.min.js @@ -0,0 +1,10 @@ +/** @license React v17.0.2 + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/node_modules/react/cjs/react-jsx-runtime.profiling.min.js b/node_modules/react/cjs/react-jsx-runtime.profiling.min.js new file mode 100644 index 000000000..e6516f7b4 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.profiling.min.js @@ -0,0 +1,10 @@ +/** @license React v17.0.2 + * react-jsx-runtime.profiling.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/node_modules/react/cjs/react.development.js b/node_modules/react/cjs/react.development.js new file mode 100644 index 000000000..7f48126eb --- /dev/null +++ b/node_modules/react/cjs/react.development.js @@ -0,0 +1,2333 @@ +/** @license React v17.0.2 + * react.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var _assign = require('object-assign'); + +// TODO: this is special because it gets imported during build. +var ReactVersion = '17.0.2'; + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +exports.StrictMode = 0xeacc; +exports.Profiler = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +exports.Suspense = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + exports.StrictMode = symbolFor('react.strict_mode'); + exports.Profiler = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + exports.Suspense = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +/** + * Keeps track of the current dispatcher. + */ +var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null +}; + +/** + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. + */ +var ReactCurrentBatchConfig = { + transition: 0 +}; + +/** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ +var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null +}; + +var ReactDebugCurrentFrame = {}; +var currentExtraStackFrame = null; +function setExtraStackFrame(stack) { + { + currentExtraStackFrame = stack; + } +} + +{ + ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { + { + currentExtraStackFrame = stack; + } + }; // Stack implementation injected by the current renderer. + + + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentExtraStackFrame) { + stack += currentExtraStackFrame; + } // Delegate to the injected renderer-specific implementation + + + var impl = ReactDebugCurrentFrame.getCurrentStack; + + if (impl) { + stack += impl() || ''; + } + + return stack; + }; +} + +/** + * Used by act() to track whether you're inside an act() scope. + */ +var IsSomeRendererActing = { + current: false +}; + +var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: _assign +}; + +{ + ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; +} + +// by calls to these methods by a Babel plugin. +// +// In PROD (or in packages without access to React internals), +// they are left as they are instead. + +function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } +} +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +var didWarnStateUpdateForUnmountedComponent = {}; + +function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; + var warningKey = componentName + "." + callerName; + + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } +} +/** + * This is the abstract API for an update queue. + */ + + +var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueForceUpdate: function (publicInstance, callback, callerName) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */ + enqueueSetState: function (publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, 'setState'); + } +}; + +var emptyObject = {}; + +{ + Object.freeze(emptyObject); +} +/** + * Base class helpers for the updating state of a component. + */ + + +function Component(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the + // renderer. + + this.updater = updater || ReactNoopUpdateQueue; +} + +Component.prototype.isReactComponent = {}; +/** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + +Component.prototype.setState = function (partialState, callback) { + if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { + { + throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); + } + } + + this.updater.enqueueSetState(this, partialState, callback, 'setState'); +}; +/** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + + +Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); +}; +/** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + + +{ + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + + var defineDeprecationWarning = function (methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function () { + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + + return undefined; + } + }); + }; + + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } +} + +function ComponentDummy() {} + +ComponentDummy.prototype = Component.prototype; +/** + * Convenience component with default shallow equality check for sCU. + */ + +function PureComponent(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; +} + +var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); +pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. + +_assign(pureComponentPrototype, Component.prototype); + +pureComponentPrototype.isPureReactComponent = true; + +// an immutable object with a single mutable value +function createRef() { + var refObject = { + current: null + }; + + { + Object.seal(refObject); + } + + return refObject; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case exports.Profiler: + return 'Profiler'; + + case exports.StrictMode: + return 'StrictMode'; + + case exports.Suspense: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); +} + +function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); +} + +function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */ + +function createElement(type, config, children) { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + + props.children = childArray; + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + { + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); +} +function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + return newElement; +} +/** + * Clone and return a new ReactElement using element as the starting point. + * See https://reactjs.org/docs/react-api.html#cloneelement + */ + +function cloneElement(element, config, children) { + if (!!(element === null || element === undefined)) { + { + throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); + } + } + + var propName; // Original props are copied + + var props = _assign({}, element.props); // Reserved names are extracted + + + var key = element.key; + var ref = element.ref; // Self is preserved since the owner is preserved. + + var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + + var source = element._source; // Owner will be preserved, unless ref is overridden + + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } // Remaining properties override existing props + + + var defaultProps; + + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; +/** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = key.replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + return '$' + escapedString; +} +/** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + +var didWarnAboutMaps = false; +var userProvidedKeyEscapeRegex = /\/+/g; + +function escapeUserProvidedKey(text) { + return text.replace(userProvidedKeyEscapeRegex, '$&/'); +} +/** + * Generate a key string that identifies a element within a set. + * + * @param {*} element A element that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + + +function getElementKey(element, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (typeof element === 'object' && element !== null && element.key != null) { + // Explicit key + return escape('' + element.key); + } // Implicit key determined by the index in the set + + + return index.toString(36); +} + +function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + var invokeCallback = false; + + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case 'string': + case 'number': + invokeCallback = true; + break; + + case 'object': + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + + } + } + + if (invokeCallback) { + var _child = children; + var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows: + + var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; + + if (Array.isArray(mappedChild)) { + var escapedChildKey = ''; + + if (childKey != null) { + escapedChildKey = escapeUserProvidedKey(childKey) + '/'; + } + + mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key + mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number + escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); + } + + array.push(mappedChild); + } + + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getElementKey(child, i); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else { + var iteratorFn = getIteratorFn(children); + + if (typeof iteratorFn === 'function') { + var iterableChildren = children; + + { + // Warn about using Maps as children + if (iteratorFn === iterableChildren.entries) { + if (!didWarnAboutMaps) { + warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); + } + + didWarnAboutMaps = true; + } + } + + var iterator = iteratorFn.call(iterableChildren); + var step; + var ii = 0; + + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getElementKey(child, ii++); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else if (type === 'object') { + var childrenString = '' + children; + + { + { + throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." ); + } + } + } + } + + return subtreeCount; +} + +/** + * Maps children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenmap + * + * The provided mapFunction(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ +function mapChildren(children, func, context) { + if (children == null) { + return children; + } + + var result = []; + var count = 0; + mapIntoArray(children, result, '', '', function (child) { + return func.call(context, child, count++); + }); + return result; +} +/** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrencount + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + + +function countChildren(children) { + var n = 0; + mapChildren(children, function () { + n++; // Don't return anything + }); + return n; +} + +/** + * Iterates through children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenforeach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ +function forEachChildren(children, forEachFunc, forEachContext) { + mapChildren(children, function () { + forEachFunc.apply(this, arguments); // Don't return anything. + }, forEachContext); +} +/** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://reactjs.org/docs/react-api.html#reactchildrentoarray + */ + + +function toArray(children) { + return mapChildren(children, function (child) { + return child; + }) || []; +} +/** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenonly + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ + + +function onlyChild(children) { + if (!isValidElement(children)) { + { + throw Error( "React.Children.only expected to receive a single React element child." ); + } + } + + return children; +} + +function createContext(defaultValue, calculateChangedBits) { + if (calculateChangedBits === undefined) { + calculateChangedBits = null; + } else { + { + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } + } + } + + var context = { + $$typeof: REACT_CONTEXT_TYPE, + _calculateChangedBits: calculateChangedBits, + // As a workaround to support multiple concurrent renderers, we categorize + // some renderers as primary and others as secondary. We only expect + // there to be two concurrent renderers at most: React Native (primary) and + // Fabric (secondary); React DOM (primary) and React ART (secondary). + // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, + _currentValue2: defaultValue, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, + // These are circular + Provider: null, + Consumer: null + }; + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + var hasWarnedAboutDisplayNameOnConsumer = false; + + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context, + _calculateChangedBits: context._calculateChangedBits + }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here + + Object.defineProperties(Consumer, { + Provider: { + get: function () { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Provider; + }, + set: function (_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function () { + return context._currentValue; + }, + set: function (_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function () { + return context._currentValue2; + }, + set: function (_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function () { + return context._threadCount; + }, + set: function (_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + get: function () { + if (!hasWarnedAboutUsingNestedContextConsumers) { + hasWarnedAboutUsingNestedContextConsumers = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Consumer; + } + }, + displayName: { + get: function () { + return context.displayName; + }, + set: function (displayName) { + if (!hasWarnedAboutDisplayNameOnConsumer) { + warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); + + hasWarnedAboutDisplayNameOnConsumer = true; + } + } + } + }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + + context.Consumer = Consumer; + } + + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + + return context; +} + +var Uninitialized = -1; +var Pending = 0; +var Resolved = 1; +var Rejected = 2; + +function lazyInitializer(payload) { + if (payload._status === Uninitialized) { + var ctor = payload._result; + var thenable = ctor(); // Transition to the next state. + + var pending = payload; + pending._status = Pending; + pending._result = thenable; + thenable.then(function (moduleObject) { + if (payload._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. + 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); + } + } // Transition to the next state. + + + var resolved = payload; + resolved._status = Resolved; + resolved._result = defaultExport; + } + }, function (error) { + if (payload._status === Pending) { + // Transition to the next state. + var rejected = payload; + rejected._status = Rejected; + rejected._result = error; + } + }); + } + + if (payload._status === Resolved) { + return payload._result; + } else { + throw payload._result; + } +} + +function lazy(ctor) { + var payload = { + // We use these fields to store the result. + _status: -1, + _result: ctor + }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: payload, + _init: lazyInitializer + }; + + { + // In production, this would just set it on the object. + var defaultProps; + var propTypes; // $FlowFixMe + + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + return defaultProps; + }, + set: function (newDefaultProps) { + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + defaultProps = newDefaultProps; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function () { + return propTypes; + }, + set: function (newPropTypes) { + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + propTypes = newPropTypes; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + + return lazyType; +} + +function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } + } + + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } + } + } + + var elementType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: render + }; + + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + + if (render.displayName == null) { + render.displayName = name; + } + } + }); + } + + return elementType; +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + +function memo(type, compare) { + { + if (!isValidElementType(type)) { + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + } + } + + var elementType = { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + + if (type.displayName == null) { + type.displayName = name; + } + } + }); + } + + return elementType; +} + +function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + + if (!(dispatcher !== null)) { + { + throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." ); + } + } + + return dispatcher; +} + +function useContext(Context, unstable_observedBits) { + var dispatcher = resolveDispatcher(); + + { + if (unstable_observedBits !== undefined) { + error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : ''); + } // TODO: add a more generic warning for invalid values. + + + if (Context._context !== undefined) { + var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs + // and nobody should be using this in existing code. + + if (realContext.Consumer === Context) { + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + } else if (realContext.Provider === Context) { + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } + } + } + + return dispatcher.useContext(Context, unstable_observedBits); +} +function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); +} +function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); +} +function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); +} +function useEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); +} +function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); +} +function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); +} +function useMemo(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, deps); +} +function useImperativeHandle(ref, create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, deps); +} +function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$1.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$1.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case exports.Suspense: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + setExtraStackFrame(stack); + } else { + setExtraStackFrame(null); + } + } +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} + +function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentName(ReactCurrentOwner.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; +} + +function getSourceInfoErrorAddendum(source) { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; +} + +function getSourceInfoErrorAddendumForProps(elementProps) { + if (elementProps !== null && elementProps !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + + return ''; +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + { + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} +function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendumForProps(props); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + } + + var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; +} +var didWarnAboutDeprecatedCreateFactory = false; +function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + + return validatedFactory; +} +function cloneElementWithValidation(element, props, children) { + var newElement = cloneElement.apply(this, arguments); + + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + + validatePropTypes(newElement); + return newElement; +} + +{ + + try { + var frozenObject = Object.freeze({}); + /* eslint-disable no-new */ + + new Map([[frozenObject, null]]); + new Set([frozenObject]); + /* eslint-enable no-new */ + } catch (e) { + } +} + +var createElement$1 = createElementWithValidation ; +var cloneElement$1 = cloneElementWithValidation ; +var createFactory = createFactoryWithValidation ; +var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild +}; + +exports.Children = Children; +exports.Component = Component; +exports.PureComponent = PureComponent; +exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; +exports.cloneElement = cloneElement$1; +exports.createContext = createContext; +exports.createElement = createElement$1; +exports.createFactory = createFactory; +exports.createRef = createRef; +exports.forwardRef = forwardRef; +exports.isValidElement = isValidElement; +exports.lazy = lazy; +exports.memo = memo; +exports.useCallback = useCallback; +exports.useContext = useContext; +exports.useDebugValue = useDebugValue; +exports.useEffect = useEffect; +exports.useImperativeHandle = useImperativeHandle; +exports.useLayoutEffect = useLayoutEffect; +exports.useMemo = useMemo; +exports.useReducer = useReducer; +exports.useRef = useRef; +exports.useState = useState; +exports.version = ReactVersion; + })(); +} diff --git a/node_modules/react/cjs/react.production.min.js b/node_modules/react/cjs/react.production.min.js new file mode 100644 index 000000000..912869567 --- /dev/null +++ b/node_modules/react/cjs/react.production.min.js @@ -0,0 +1,23 @@ +/** @license React v17.0.2 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';var l=require("object-assign"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116; +if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy")}var x="function"===typeof Symbol&&Symbol.iterator; +function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return"function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c=0.10.0" + }, + "files": [ + "LICENSE", + "README.md", + "build-info.json", + "index.js", + "cjs/", + "umd/", + "jsx-runtime.js", + "jsx-dev-runtime.js" + ], + "homepage": "https://reactjs.org/", + "keywords": [ + "react" + ], + "license": "MIT", + "main": "index.js", + "name": "react", + "repository": { + "type": "git", + "url": "git+https://github.com/facebook/react.git", + "directory": "packages/react" + }, + "version": "17.0.2" +} diff --git a/node_modules/react/umd/react.development.js b/node_modules/react/umd/react.development.js new file mode 100644 index 000000000..1124191bb --- /dev/null +++ b/node_modules/react/umd/react.development.js @@ -0,0 +1,3357 @@ +/** @license React v17.0.2 + * react.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.React = {})); +}(this, (function (exports) { 'use strict'; + + // TODO: this is special because it gets imported during build. + var ReactVersion = '17.0.2'; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var REACT_ELEMENT_TYPE = 0xeac7; + var REACT_PORTAL_TYPE = 0xeaca; + exports.Fragment = 0xeacb; + exports.StrictMode = 0xeacc; + exports.Profiler = 0xead2; + var REACT_PROVIDER_TYPE = 0xeacd; + var REACT_CONTEXT_TYPE = 0xeace; + var REACT_FORWARD_REF_TYPE = 0xead0; + exports.Suspense = 0xead1; + var REACT_SUSPENSE_LIST_TYPE = 0xead8; + var REACT_MEMO_TYPE = 0xead3; + var REACT_LAZY_TYPE = 0xead4; + var REACT_BLOCK_TYPE = 0xead9; + var REACT_SERVER_BLOCK_TYPE = 0xeada; + var REACT_FUNDAMENTAL_TYPE = 0xead5; + var REACT_SCOPE_TYPE = 0xead7; + var REACT_OPAQUE_ID_TYPE = 0xeae0; + var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; + var REACT_OFFSCREEN_TYPE = 0xeae2; + var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + + if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + exports.StrictMode = symbolFor('react.strict_mode'); + exports.Profiler = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + exports.Suspense = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); + } + + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var _assign = function (to, from) { + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + }; + + var assign = Object.assign || function (target, sources) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + + var to = Object(target); + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + + if (nextSource != null) { + _assign(to, Object(nextSource)); + } + } + + return to; + }; + + /** + * Keeps track of the current dispatcher. + */ + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + /** + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. + */ + var ReactCurrentBatchConfig = { + transition: 0 + }; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + var ReactDebugCurrentFrame = {}; + var currentExtraStackFrame = null; + function setExtraStackFrame(stack) { + { + currentExtraStackFrame = stack; + } + } + + { + ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { + { + currentExtraStackFrame = stack; + } + }; // Stack implementation injected by the current renderer. + + + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentExtraStackFrame) { + stack += currentExtraStackFrame; + } // Delegate to the injected renderer-specific implementation + + + var impl = ReactDebugCurrentFrame.getCurrentStack; + + if (impl) { + stack += impl() || ''; + } + + return stack; + }; + } + + /** + * Used by act() to track whether you're inside an act() scope. + */ + var IsSomeRendererActing = { + current: false + }; + + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: assign + }; + + { + ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; + } + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } + } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + + var didWarnStateUpdateForUnmountedComponent = {}; + + function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; + var warningKey = componentName + "." + callerName; + + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } + } + /** + * This is the abstract API for an update queue. + */ + + + var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueForceUpdate: function (publicInstance, callback, callerName) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */ + enqueueSetState: function (publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, 'setState'); + } + }; + + var emptyObject = {}; + + { + Object.freeze(emptyObject); + } + /** + * Base class helpers for the updating state of a component. + */ + + + function Component(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the + // renderer. + + this.updater = updater || ReactNoopUpdateQueue; + } + + Component.prototype.isReactComponent = {}; + /** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + + Component.prototype.setState = function (partialState, callback) { + if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { + { + throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); + } + } + + this.updater.enqueueSetState(this, partialState, callback, 'setState'); + }; + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + + + Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); + }; + /** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + + + { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + + var defineDeprecationWarning = function (methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function () { + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + + return undefined; + } + }); + }; + + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + + function ComponentDummy() {} + + ComponentDummy.prototype = Component.prototype; + /** + * Convenience component with default shallow equality check for sCU. + */ + + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + + var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); + pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. + + assign(pureComponentPrototype, Component.prototype); + + pureComponentPrototype.isPureReactComponent = true; + + // an immutable object with a single mutable value + function createRef() { + var refObject = { + current: null + }; + + { + Object.seal(refObject); + } + + return refObject; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); + } + + function getContextName(type) { + return type.displayName || 'Context'; + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case exports.Profiler: + return 'Profiler'; + + case exports.StrictMode: + return 'StrictMode'; + + case exports.Suspense: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; + } + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + + { + didWarnAboutStringRefs = {}; + } + + function hasValidRef(config) { + { + if (hasOwnProperty$1.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; + } + + function hasValidKey(config) { + { + if (hasOwnProperty$1.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; + } + + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; + }; + /** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */ + + function createElement(type, config, children) { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + + props.children = childArray; + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + { + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + return newElement; + } + /** + * Clone and return a new ReactElement using element as the starting point. + * See https://reactjs.org/docs/react-api.html#cloneelement + */ + + function cloneElement(element, config, children) { + if (!!(element === null || element === undefined)) { + { + throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); + } + } + + var propName; // Original props are copied + + var props = assign({}, element.props); // Reserved names are extracted + + + var key = element.key; + var ref = element.ref; // Self is preserved since the owner is preserved. + + var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + + var source = element._source; // Owner will be preserved, unless ref is overridden + + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } // Remaining properties override existing props + + + var defaultProps; + + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + + for (propName in config) { + if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + + var childrenLength = arguments.length - 2; + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); + } + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + + function isValidElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + + var SEPARATOR = '.'; + var SUBSEPARATOR = ':'; + /** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + + function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = key.replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + return '$' + escapedString; + } + /** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + + var didWarnAboutMaps = false; + var userProvidedKeyEscapeRegex = /\/+/g; + + function escapeUserProvidedKey(text) { + return text.replace(userProvidedKeyEscapeRegex, '$&/'); + } + /** + * Generate a key string that identifies a element within a set. + * + * @param {*} element A element that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + + + function getElementKey(element, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (typeof element === 'object' && element !== null && element.key != null) { + // Explicit key + return escape('' + element.key); + } // Implicit key determined by the index in the set + + + return index.toString(36); + } + + function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + var invokeCallback = false; + + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case 'string': + case 'number': + invokeCallback = true; + break; + + case 'object': + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + + } + } + + if (invokeCallback) { + var _child = children; + var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows: + + var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; + + if (Array.isArray(mappedChild)) { + var escapedChildKey = ''; + + if (childKey != null) { + escapedChildKey = escapeUserProvidedKey(childKey) + '/'; + } + + mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key + mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number + escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); + } + + array.push(mappedChild); + } + + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getElementKey(child, i); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else { + var iteratorFn = getIteratorFn(children); + + if (typeof iteratorFn === 'function') { + var iterableChildren = children; + + { + // Warn about using Maps as children + if (iteratorFn === iterableChildren.entries) { + if (!didWarnAboutMaps) { + warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); + } + + didWarnAboutMaps = true; + } + } + + var iterator = iteratorFn.call(iterableChildren); + var step; + var ii = 0; + + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getElementKey(child, ii++); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else if (type === 'object') { + var childrenString = '' + children; + + { + { + throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." ); + } + } + } + } + + return subtreeCount; + } + + /** + * Maps children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenmap + * + * The provided mapFunction(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + + var result = []; + var count = 0; + mapIntoArray(children, result, '', '', function (child) { + return func.call(context, child, count++); + }); + return result; + } + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrencount + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + + + function countChildren(children) { + var n = 0; + mapChildren(children, function () { + n++; // Don't return anything + }); + return n; + } + + /** + * Iterates through children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenforeach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ + function forEachChildren(children, forEachFunc, forEachContext) { + mapChildren(children, function () { + forEachFunc.apply(this, arguments); // Don't return anything. + }, forEachContext); + } + /** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://reactjs.org/docs/react-api.html#reactchildrentoarray + */ + + + function toArray(children) { + return mapChildren(children, function (child) { + return child; + }) || []; + } + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenonly + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ + + + function onlyChild(children) { + if (!isValidElement(children)) { + { + throw Error( "React.Children.only expected to receive a single React element child." ); + } + } + + return children; + } + + function createContext(defaultValue, calculateChangedBits) { + if (calculateChangedBits === undefined) { + calculateChangedBits = null; + } else { + { + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } + } + } + + var context = { + $$typeof: REACT_CONTEXT_TYPE, + _calculateChangedBits: calculateChangedBits, + // As a workaround to support multiple concurrent renderers, we categorize + // some renderers as primary and others as secondary. We only expect + // there to be two concurrent renderers at most: React Native (primary) and + // Fabric (secondary); React DOM (primary) and React ART (secondary). + // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, + _currentValue2: defaultValue, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, + // These are circular + Provider: null, + Consumer: null + }; + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + var hasWarnedAboutDisplayNameOnConsumer = false; + + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context, + _calculateChangedBits: context._calculateChangedBits + }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here + + Object.defineProperties(Consumer, { + Provider: { + get: function () { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Provider; + }, + set: function (_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function () { + return context._currentValue; + }, + set: function (_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function () { + return context._currentValue2; + }, + set: function (_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function () { + return context._threadCount; + }, + set: function (_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + get: function () { + if (!hasWarnedAboutUsingNestedContextConsumers) { + hasWarnedAboutUsingNestedContextConsumers = true; + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + + return context.Consumer; + } + }, + displayName: { + get: function () { + return context.displayName; + }, + set: function (displayName) { + if (!hasWarnedAboutDisplayNameOnConsumer) { + warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); + + hasWarnedAboutDisplayNameOnConsumer = true; + } + } + } + }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + + context.Consumer = Consumer; + } + + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + + return context; + } + + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + + function lazyInitializer(payload) { + if (payload._status === Uninitialized) { + var ctor = payload._result; + var thenable = ctor(); // Transition to the next state. + + var pending = payload; + pending._status = Pending; + pending._result = thenable; + thenable.then(function (moduleObject) { + if (payload._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. + 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); + } + } // Transition to the next state. + + + var resolved = payload; + resolved._status = Resolved; + resolved._result = defaultExport; + } + }, function (error) { + if (payload._status === Pending) { + // Transition to the next state. + var rejected = payload; + rejected._status = Rejected; + rejected._result = error; + } + }); + } + + if (payload._status === Resolved) { + return payload._result; + } else { + throw payload._result; + } + } + + function lazy(ctor) { + var payload = { + // We use these fields to store the result. + _status: -1, + _result: ctor + }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: payload, + _init: lazyInitializer + }; + + { + // In production, this would just set it on the object. + var defaultProps; + var propTypes; // $FlowFixMe + + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + return defaultProps; + }, + set: function (newDefaultProps) { + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + defaultProps = newDefaultProps; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function () { + return propTypes; + }, + set: function (newPropTypes) { + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + propTypes = newPropTypes; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + + return lazyType; + } + + function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } + } + + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } + } + } + + var elementType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: render + }; + + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + + if (render.displayName == null) { + render.displayName = name; + } + } + }); + } + + return elementType; + } + + // Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + + var enableScopeAPI = false; // Experimental Create Event Handle API. + + function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; + } + + function memo(type, compare) { + { + if (!isValidElementType(type)) { + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + } + } + + var elementType = { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + + if (type.displayName == null) { + type.displayName = name; + } + } + }); + } + + return elementType; + } + + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + + if (!(dispatcher !== null)) { + { + throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." ); + } + } + + return dispatcher; + } + + function useContext(Context, unstable_observedBits) { + var dispatcher = resolveDispatcher(); + + { + if (unstable_observedBits !== undefined) { + error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : ''); + } // TODO: add a more generic warning for invalid values. + + + if (Context._context !== undefined) { + var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs + // and nobody should be using this in existing code. + + if (realContext.Consumer === Context) { + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + } else if (realContext.Provider === Context) { + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } + } + } + + return dispatcher.useContext(Context, unstable_observedBits); + } + function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); + } + function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); + } + function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); + } + function useEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); + } + function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); + } + function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); + } + function useMemo(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, deps); + } + function useImperativeHandle(ref, create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, deps); + } + function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } + } + + // Helpers to patch console.logs to avoid logging during side-effect free + // replaying on render function. This currently only patches the object + // lazily which won't cover if the log function was extracted eagerly. + // We could also eagerly patch the method. + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + + function disabledLog() {} + + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } + } + + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } + } + var reentry = false; + var componentFrameCache; + + { + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$1.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$1.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case exports.Suspense: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; + } + + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } + } + + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } + } + + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + setExtraStackFrame(stack); + } else { + setExtraStackFrame(null); + } + } + } + + var propTypesMisspellWarningShown; + + { + propTypesMisspellWarningShown = false; + } + + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentName(ReactCurrentOwner.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } + + function getSourceInfoErrorAddendum(source) { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } + + function getSourceInfoErrorAddendumForProps(elementProps) { + if (elementProps !== null && elementProps !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + + return ''; + } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + + var ownerHasKeyUseWarning = {}; + + function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + { + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } + } + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + + function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + + function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } + } + function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendumForProps(props); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + } + + var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } + var didWarnAboutDeprecatedCreateFactory = false; + function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + + return validatedFactory; + } + function cloneElementWithValidation(element, props, children) { + var newElement = cloneElement.apply(this, arguments); + + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + + validatePropTypes(newElement); + return newElement; + } + + var enableSchedulerDebugging = false; + var enableProfiling = false; + + var requestHostCallback; + var requestHostTimeout; + var cancelHostTimeout; + var shouldYieldToHost; + var requestPaint; + var getCurrentTime; + var forceFrameRate; + var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; + + if (hasPerformanceNow) { + var localPerformance = performance; + + getCurrentTime = function () { + return localPerformance.now(); + }; + } else { + var localDate = Date; + var initialTime = localDate.now(); + + getCurrentTime = function () { + return localDate.now() - initialTime; + }; + } + + if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive + // implementation using setTimeout. + typeof window === 'undefined' || // Check if MessageChannel is supported, too. + typeof MessageChannel !== 'function') { + // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, + // fallback to a naive implementation. + var _callback = null; + var _timeoutID = null; + + var _flushCallback = function () { + if (_callback !== null) { + try { + var currentTime = getCurrentTime(); + var hasRemainingTime = true; + + _callback(hasRemainingTime, currentTime); + + _callback = null; + } catch (e) { + setTimeout(_flushCallback, 0); + throw e; + } + } + }; + + requestHostCallback = function (cb) { + if (_callback !== null) { + // Protect against re-entrancy. + setTimeout(requestHostCallback, 0, cb); + } else { + _callback = cb; + setTimeout(_flushCallback, 0); + } + }; + + requestHostTimeout = function (cb, ms) { + _timeoutID = setTimeout(cb, ms); + }; + + cancelHostTimeout = function () { + clearTimeout(_timeoutID); + }; + + shouldYieldToHost = function () { + return false; + }; + + requestPaint = forceFrameRate = function () {}; + } else { + // Capture local references to native APIs, in case a polyfill overrides them. + var _setTimeout = window.setTimeout; + var _clearTimeout = window.clearTimeout; + + if (typeof console !== 'undefined') { + // TODO: Scheduler no longer requires these methods to be polyfilled. But + // maybe we want to continue warning if they don't exist, to preserve the + // option to rely on it in the future? + var requestAnimationFrame = window.requestAnimationFrame; + var cancelAnimationFrame = window.cancelAnimationFrame; + + if (typeof requestAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); + } + + if (typeof cancelAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); + } + } + + var isMessageLoopRunning = false; + var scheduledHostCallback = null; + var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main + // thread, like user events. By default, it yields multiple times per frame. + // It does not attempt to align with frame boundaries, since most tasks don't + // need to be frame aligned; for those that do, use requestAnimationFrame. + + var yieldInterval = 5; + var deadline = 0; // TODO: Make this configurable + + { + // `isInputPending` is not available. Since we have no way of knowing if + // there's pending input, always yield at the end of the frame. + shouldYieldToHost = function () { + return getCurrentTime() >= deadline; + }; // Since we yield every frame regardless, `requestPaint` has no effect. + + + requestPaint = function () {}; + } + + forceFrameRate = function (fps) { + if (fps < 0 || fps > 125) { + // Using console['error'] to evade Babel and ESLint + console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported'); + return; + } + + if (fps > 0) { + yieldInterval = Math.floor(1000 / fps); + } else { + // reset the framerate + yieldInterval = 5; + } + }; + + var performWorkUntilDeadline = function () { + if (scheduledHostCallback !== null) { + var currentTime = getCurrentTime(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync + // cycle. This means there's always time remaining at the beginning of + // the message event. + + deadline = currentTime + yieldInterval; + var hasTimeRemaining = true; + + try { + var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + + if (!hasMoreWork) { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } else { + // If there's more work, schedule the next message event at the end + // of the preceding one. + port.postMessage(null); + } + } catch (error) { + // If a scheduler task throws, exit the current browser task so the + // error can be observed. + port.postMessage(null); + throw error; + } + } else { + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can + }; + + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = performWorkUntilDeadline; + + requestHostCallback = function (callback) { + scheduledHostCallback = callback; + + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + port.postMessage(null); + } + }; + + requestHostTimeout = function (callback, ms) { + taskTimeoutID = _setTimeout(function () { + callback(getCurrentTime()); + }, ms); + }; + + cancelHostTimeout = function () { + _clearTimeout(taskTimeoutID); + + taskTimeoutID = -1; + }; + } + + function push(heap, node) { + var index = heap.length; + heap.push(node); + siftUp(heap, node, index); + } + function peek(heap) { + var first = heap[0]; + return first === undefined ? null : first; + } + function pop(heap) { + var first = heap[0]; + + if (first !== undefined) { + var last = heap.pop(); + + if (last !== first) { + heap[0] = last; + siftDown(heap, last, 0); + } + + return first; + } else { + return null; + } + } + + function siftUp(heap, node, i) { + var index = i; + + while (true) { + var parentIndex = index - 1 >>> 1; + var parent = heap[parentIndex]; + + if (parent !== undefined && compare(parent, node) > 0) { + // The parent is larger. Swap positions. + heap[parentIndex] = node; + heap[index] = parent; + index = parentIndex; + } else { + // The parent is smaller. Exit. + return; + } + } + } + + function siftDown(heap, node, i) { + var index = i; + var length = heap.length; + + while (index < length) { + var leftIndex = (index + 1) * 2 - 1; + var left = heap[leftIndex]; + var rightIndex = leftIndex + 1; + var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. + + if (left !== undefined && compare(left, node) < 0) { + if (right !== undefined && compare(right, left) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + heap[index] = left; + heap[leftIndex] = node; + index = leftIndex; + } + } else if (right !== undefined && compare(right, node) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + // Neither child is smaller. Exit. + return; + } + } + } + + function compare(a, b) { + // Compare sort index first, then task id. + var diff = a.sortIndex - b.sortIndex; + return diff !== 0 ? diff : a.id - b.id; + } + + // TODO: Use symbols? + var ImmediatePriority = 1; + var UserBlockingPriority = 2; + var NormalPriority = 3; + var LowPriority = 4; + var IdlePriority = 5; + + function markTaskErrored(task, ms) { + } + + /* eslint-disable no-var */ + // Math.pow(2, 30) - 1 + // 0b111111111111111111111111111111 + + var maxSigned31BitInt = 1073741823; // Times out immediately + + var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out + + var USER_BLOCKING_PRIORITY_TIMEOUT = 250; + var NORMAL_PRIORITY_TIMEOUT = 5000; + var LOW_PRIORITY_TIMEOUT = 10000; // Never times out + + var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap + + var taskQueue = []; + var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. + + var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. + var currentTask = null; + var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. + + var isPerformingWork = false; + var isHostCallbackScheduled = false; + var isHostTimeoutScheduled = false; + + function advanceTimers(currentTime) { + // Check for tasks that are no longer delayed and add them to the queue. + var timer = peek(timerQueue); + + while (timer !== null) { + if (timer.callback === null) { + // Timer was cancelled. + pop(timerQueue); + } else if (timer.startTime <= currentTime) { + // Timer fired. Transfer to the task queue. + pop(timerQueue); + timer.sortIndex = timer.expirationTime; + push(taskQueue, timer); + } else { + // Remaining timers are pending. + return; + } + + timer = peek(timerQueue); + } + } + + function handleTimeout(currentTime) { + isHostTimeoutScheduled = false; + advanceTimers(currentTime); + + if (!isHostCallbackScheduled) { + if (peek(taskQueue) !== null) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + } + } + } + + function flushWork(hasTimeRemaining, initialTime) { + + + isHostCallbackScheduled = false; + + if (isHostTimeoutScheduled) { + // We scheduled a timeout but it's no longer needed. Cancel it. + isHostTimeoutScheduled = false; + cancelHostTimeout(); + } + + isPerformingWork = true; + var previousPriorityLevel = currentPriorityLevel; + + try { + if (enableProfiling) { + try { + return workLoop(hasTimeRemaining, initialTime); + } catch (error) { + if (currentTask !== null) { + var currentTime = getCurrentTime(); + markTaskErrored(currentTask, currentTime); + currentTask.isQueued = false; + } + + throw error; + } + } else { + // No catch in prod code path. + return workLoop(hasTimeRemaining, initialTime); + } + } finally { + currentTask = null; + currentPriorityLevel = previousPriorityLevel; + isPerformingWork = false; + } + } + + function workLoop(hasTimeRemaining, initialTime) { + var currentTime = initialTime; + advanceTimers(currentTime); + currentTask = peek(taskQueue); + + while (currentTask !== null && !(enableSchedulerDebugging )) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { + // This currentTask hasn't expired, and we've reached the deadline. + break; + } + + var callback = currentTask.callback; + + if (typeof callback === 'function') { + currentTask.callback = null; + currentPriorityLevel = currentTask.priorityLevel; + var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; + + var continuationCallback = callback(didUserCallbackTimeout); + currentTime = getCurrentTime(); + + if (typeof continuationCallback === 'function') { + currentTask.callback = continuationCallback; + } else { + + if (currentTask === peek(taskQueue)) { + pop(taskQueue); + } + } + + advanceTimers(currentTime); + } else { + pop(taskQueue); + } + + currentTask = peek(taskQueue); + } // Return whether there's additional work + + + if (currentTask !== null) { + return true; + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + + return false; + } + } + + function unstable_runWithPriority(priorityLevel, eventHandler) { + switch (priorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + case LowPriority: + case IdlePriority: + break; + + default: + priorityLevel = NormalPriority; + } + + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + } + + function unstable_next(eventHandler) { + var priorityLevel; + + switch (currentPriorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + // Shift down to normal priority + priorityLevel = NormalPriority; + break; + + default: + // Anything lower than normal priority should remain at the current level. + priorityLevel = currentPriorityLevel; + break; + } + + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + } + + function unstable_wrapCallback(callback) { + var parentPriorityLevel = currentPriorityLevel; + return function () { + // This is a fork of runWithPriority, inlined for performance. + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = parentPriorityLevel; + + try { + return callback.apply(this, arguments); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + }; + } + + function unstable_scheduleCallback(priorityLevel, callback, options) { + var currentTime = getCurrentTime(); + var startTime; + + if (typeof options === 'object' && options !== null) { + var delay = options.delay; + + if (typeof delay === 'number' && delay > 0) { + startTime = currentTime + delay; + } else { + startTime = currentTime; + } + } else { + startTime = currentTime; + } + + var timeout; + + switch (priorityLevel) { + case ImmediatePriority: + timeout = IMMEDIATE_PRIORITY_TIMEOUT; + break; + + case UserBlockingPriority: + timeout = USER_BLOCKING_PRIORITY_TIMEOUT; + break; + + case IdlePriority: + timeout = IDLE_PRIORITY_TIMEOUT; + break; + + case LowPriority: + timeout = LOW_PRIORITY_TIMEOUT; + break; + + case NormalPriority: + default: + timeout = NORMAL_PRIORITY_TIMEOUT; + break; + } + + var expirationTime = startTime + timeout; + var newTask = { + id: taskIdCounter++, + callback: callback, + priorityLevel: priorityLevel, + startTime: startTime, + expirationTime: expirationTime, + sortIndex: -1 + }; + + if (startTime > currentTime) { + // This is a delayed task. + newTask.sortIndex = startTime; + push(timerQueue, newTask); + + if (peek(taskQueue) === null && newTask === peek(timerQueue)) { + // All tasks are delayed, and this is the task with the earliest delay. + if (isHostTimeoutScheduled) { + // Cancel an existing timeout. + cancelHostTimeout(); + } else { + isHostTimeoutScheduled = true; + } // Schedule a timeout. + + + requestHostTimeout(handleTimeout, startTime - currentTime); + } + } else { + newTask.sortIndex = expirationTime; + push(taskQueue, newTask); + // wait until the next time we yield. + + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + + return newTask; + } + + function unstable_pauseExecution() { + } + + function unstable_continueExecution() { + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + + function unstable_getFirstCallbackNode() { + return peek(taskQueue); + } + + function unstable_cancelCallback(task) { + // remove from the queue because you can't remove arbitrary nodes from an + // array based heap, only the first one.) + + + task.callback = null; + } + + function unstable_getCurrentPriorityLevel() { + return currentPriorityLevel; + } + + var unstable_requestPaint = requestPaint; + var unstable_Profiling = null; + + + + var Scheduler = /*#__PURE__*/Object.freeze({ + __proto__: null, + unstable_ImmediatePriority: ImmediatePriority, + unstable_UserBlockingPriority: UserBlockingPriority, + unstable_NormalPriority: NormalPriority, + unstable_IdlePriority: IdlePriority, + unstable_LowPriority: LowPriority, + unstable_runWithPriority: unstable_runWithPriority, + unstable_next: unstable_next, + unstable_scheduleCallback: unstable_scheduleCallback, + unstable_cancelCallback: unstable_cancelCallback, + unstable_wrapCallback: unstable_wrapCallback, + unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, + get unstable_shouldYield () { return shouldYieldToHost; }, + unstable_requestPaint: unstable_requestPaint, + unstable_continueExecution: unstable_continueExecution, + unstable_pauseExecution: unstable_pauseExecution, + unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, + get unstable_now () { return getCurrentTime; }, + get unstable_forceFrameRate () { return forceFrameRate; }, + unstable_Profiling: unstable_Profiling + }); + + var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs. + + var interactionIDCounter = 0; + var threadIDCounter = 0; // Set of currently traced interactions. + // Interactions "stack"– + // Meaning that newly traced interactions are appended to the previously active set. + // When an interaction goes out of scope, the previous set (if any) is restored. + + var interactionsRef = null; // Listener(s) to notify when interactions begin and end. + + var subscriberRef = null; + + { + interactionsRef = { + current: new Set() + }; + subscriberRef = { + current: null + }; + } + function unstable_clear(callback) { + + var prevInteractions = interactionsRef.current; + interactionsRef.current = new Set(); + + try { + return callback(); + } finally { + interactionsRef.current = prevInteractions; + } + } + function unstable_getCurrent() { + { + return interactionsRef.current; + } + } + function unstable_getThreadID() { + return ++threadIDCounter; + } + function unstable_trace(name, timestamp, callback) { + var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; + + var interaction = { + __count: 1, + id: interactionIDCounter++, + name: name, + timestamp: timestamp + }; + var prevInteractions = interactionsRef.current; // Traced interactions should stack/accumulate. + // To do that, clone the current interactions. + // The previous set will be restored upon completion. + + var interactions = new Set(prevInteractions); + interactions.add(interaction); + interactionsRef.current = interactions; + var subscriber = subscriberRef.current; + var returnValue; + + try { + if (subscriber !== null) { + subscriber.onInteractionTraced(interaction); + } + } finally { + try { + if (subscriber !== null) { + subscriber.onWorkStarted(interactions, threadID); + } + } finally { + try { + returnValue = callback(); + } finally { + interactionsRef.current = prevInteractions; + + try { + if (subscriber !== null) { + subscriber.onWorkStopped(interactions, threadID); + } + } finally { + interaction.__count--; // If no async work was scheduled for this interaction, + // Notify subscribers that it's completed. + + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + } + } + } + } + + return returnValue; + } + function unstable_wrap(callback) { + var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; + + var wrappedInteractions = interactionsRef.current; + var subscriber = subscriberRef.current; + + if (subscriber !== null) { + subscriber.onWorkScheduled(wrappedInteractions, threadID); + } // Update the pending async work count for the current interactions. + // Update after calling subscribers in case of error. + + + wrappedInteractions.forEach(function (interaction) { + interaction.__count++; + }); + var hasRun = false; + + function wrapped() { + var prevInteractions = interactionsRef.current; + interactionsRef.current = wrappedInteractions; + subscriber = subscriberRef.current; + + try { + var returnValue; + + try { + if (subscriber !== null) { + subscriber.onWorkStarted(wrappedInteractions, threadID); + } + } finally { + try { + returnValue = callback.apply(undefined, arguments); + } finally { + interactionsRef.current = prevInteractions; + + if (subscriber !== null) { + subscriber.onWorkStopped(wrappedInteractions, threadID); + } + } + } + + return returnValue; + } finally { + if (!hasRun) { + // We only expect a wrapped function to be executed once, + // But in the event that it's executed more than once– + // Only decrement the outstanding interaction counts once. + hasRun = true; // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + } + } + + wrapped.cancel = function cancel() { + subscriber = subscriberRef.current; + + try { + if (subscriber !== null) { + subscriber.onWorkCanceled(wrappedInteractions, threadID); + } + } finally { + // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + }; + + return wrapped; + } + + var subscribers = null; + + { + subscribers = new Set(); + } + + function unstable_subscribe(subscriber) { + { + subscribers.add(subscriber); + + if (subscribers.size === 1) { + subscriberRef.current = { + onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted, + onInteractionTraced: onInteractionTraced, + onWorkCanceled: onWorkCanceled, + onWorkScheduled: onWorkScheduled, + onWorkStarted: onWorkStarted, + onWorkStopped: onWorkStopped + }; + } + } + } + function unstable_unsubscribe(subscriber) { + { + subscribers.delete(subscriber); + + if (subscribers.size === 0) { + subscriberRef.current = null; + } + } + } + + function onInteractionTraced(interaction) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionTraced(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onInteractionScheduledWorkCompleted(interaction) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkScheduled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkScheduled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStarted(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStarted(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStopped(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStopped(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkCanceled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkCanceled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + + + var SchedulerTracing = /*#__PURE__*/Object.freeze({ + __proto__: null, + get __interactionsRef () { return interactionsRef; }, + get __subscriberRef () { return subscriberRef; }, + unstable_clear: unstable_clear, + unstable_getCurrent: unstable_getCurrent, + unstable_getThreadID: unstable_getThreadID, + unstable_trace: unstable_trace, + unstable_wrap: unstable_wrap, + unstable_subscribe: unstable_subscribe, + unstable_unsubscribe: unstable_unsubscribe + }); + + var ReactSharedInternals$1 = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: assign, + // Re-export the schedule API(s) for UMD bundles. + // This avoids introducing a dependency on a new UMD global in a minor update, + // Since that would be a breaking change (e.g. for all existing CodeSandboxes). + // This re-export is only required for UMD bundles; + // CJS bundles use the shared NPM package. + Scheduler: Scheduler, + SchedulerTracing: SchedulerTracing + }; + + { + ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame; + } + + { + + try { + var frozenObject = Object.freeze({}); + /* eslint-disable no-new */ + + new Map([[frozenObject, null]]); + new Set([frozenObject]); + /* eslint-enable no-new */ + } catch (e) { + } + } + + var createElement$1 = createElementWithValidation ; + var cloneElement$1 = cloneElementWithValidation ; + var createFactory = createFactoryWithValidation ; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild + }; + + exports.Children = Children; + exports.Component = Component; + exports.PureComponent = PureComponent; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1; + exports.cloneElement = cloneElement$1; + exports.createContext = createContext; + exports.createElement = createElement$1; + exports.createFactory = createFactory; + exports.createRef = createRef; + exports.forwardRef = forwardRef; + exports.isValidElement = isValidElement; + exports.lazy = lazy; + exports.memo = memo; + exports.useCallback = useCallback; + exports.useContext = useContext; + exports.useDebugValue = useDebugValue; + exports.useEffect = useEffect; + exports.useImperativeHandle = useImperativeHandle; + exports.useLayoutEffect = useLayoutEffect; + exports.useMemo = useMemo; + exports.useReducer = useReducer; + exports.useRef = useRef; + exports.useState = useState; + exports.version = ReactVersion; + +}))); diff --git a/node_modules/react/umd/react.production.min.js b/node_modules/react/umd/react.production.min.js new file mode 100644 index 000000000..95f2ce7af --- /dev/null +++ b/node_modules/react/umd/react.production.min.js @@ -0,0 +1,31 @@ +/** @license React v17.0.2 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=Y&&a[Y]||a["@@iterator"];return"function"===typeof a?a:null}function y(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=1;e>>1,f=a[c];if(void 0!==f&&0E(g,e))void 0!==h&&0>E(h,g)?(a[c]=h,a[k]=e,c=k):(a[c]=g,a[d]=e,c=d);else if(void 0!==h&&0>E(h,e))a[c]=h,a[k]=e,c=k;else break a}}return b}return null}function E(a,b){var e=a.sortIndex-b.sortIndex;return 0!==e?e:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)F(r);else if(b.startTime<=a)F(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}} +function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,A(R);else{var b=p(r);null!==b&&G(Q,b.startTime-a)}}function R(a,b){u=!1;z&&(z=!1,S());H=!0;var e=g;try{P(b);for(m=p(q);null!==m&&(!(m.expirationTime>b)||a&&!T());){var c=m.callback;if("function"===typeof c){m.callback=null;g=m.priorityLevel;var f=c(m.expirationTime<=b);b=t();"function"===typeof f?m.callback=f:m===p(q)&&F(q);P(b)}else F(q);m=p(q)}if(null!==m)var d=!0;else{var n=p(r);null!==n&&G(Q,n.startTime-b);d=!1}return d}finally{m=null,g=e,H=!1}} +var w=60103,ha=60106;c.Fragment=60107;c.StrictMode=60108;c.Profiler=60114;var ka=60109,la=60110,ma=60112;c.Suspense=60113;var na=60115,oa=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;w=d("react.element");ha=d("react.portal");c.Fragment=d("react.fragment");c.StrictMode=d("react.strict_mode");c.Profiler=d("react.profiler");ka=d("react.provider");la=d("react.context");ma=d("react.forward_ref");c.Suspense=d("react.suspense");na=d("react.memo");oa=d("react.lazy")}var Y="function"=== +typeof Symbol&&Symbol.iterator,ya=Object.prototype.hasOwnProperty,U=Object.assign||function(a,b){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(a),c=1;c=ta};d=function(){};V=function(a){0>a||125d?(a.sortIndex= +c,O(r,a),null===p(q)&&a===p(r)&&(z?S():z=!0,G(Q,c-d))):(a.sortIndex=e,O(q,a),u||H||(u=!0,A(R)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=g;return function(){var c=g;g=b;try{return a.apply(this,arguments)}finally{g=c}}},unstable_getCurrentPriorityLevel:function(){return g},get unstable_shouldYield(){return T},unstable_requestPaint:d,unstable_continueExecution:function(){u||H||(u=!0,A(R))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)}, +get unstable_now(){return t},get unstable_forceFrameRate(){return V},unstable_Profiling:null},SchedulerTracing:{__proto__:null,__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Ea},unstable_trace:function(a,b,c){return c()},unstable_wrap:function(a){return a},unstable_subscribe:function(a){},unstable_unsubscribe:function(a){}}};c.Children={map:D,forEach:function(a,b,c){D(a,function(){b.apply(this, +arguments)},c)},count:function(a){var b=0;D(a,function(){b++});return b},toArray:function(a){return D(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error(y(143));return a}};c.Component=v;c.PureComponent=K;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(y(267,a));var d=U({},a.props),e=a.key,g=a.ref,n=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,n=L.current);void 0!==b.key&&(e=""+b.key);if(a.type&&a.type.defaultProps)var k= +a.type.defaultProps;for(h in b)ea.call(b,h)&&!fa.hasOwnProperty(h)&&(d[h]=void 0===b[h]&&void 0!==k?k[h]:b[h])}var h=arguments.length-2;if(1===h)d.children=c;else if(1>>1,d=a[e];if(void 0!==d&&0J(h,c))void 0!==n&&0>J(n,h)?(a[e]=n,a[k]=c,e=k):(a[e]=h,a[f]=c,e=f);else if(void 0!==n&&0>J(n,c))a[e]=n,a[k]=c,e=k;else break a}}return b}return null}function J(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function U(a){for(var b=r(w);null!==b;){if(null===b.callback)K(w);else if(b.startTime<=a)K(w),b.sortIndex=b.expirationTime,T(u,b);else break;b=r(w)}} +function V(a){E=!1;U(a);if(!z)if(null!==r(u))z=!0,F(W);else{var b=r(w);null!==b&&L(V,b.startTime-a)}}function W(a,b){z=!1;E&&(E=!1,X());M=!0;var c=m;try{U(b);for(q=r(u);null!==q&&(!(q.expirationTime>b)||a&&!Y());){var e=q.callback;if("function"===typeof e){q.callback=null;m=q.priorityLevel;var d=e(q.expirationTime<=b);b=x();"function"===typeof d?q.callback=d:q===r(u)&&K(u);U(b)}else K(u);q=r(u)}if(null!==q)var f=!0;else{var h=r(w);null!==h&&L(V,h.startTime-b);f=!1}return f}finally{q=null,m=c,M=!1}} +function Ca(a){var b=!1,c=null;t.forEach(function(e){try{e.onInteractionTraced(a)}catch(d){b||(b=!0,c=d)}});if(b)throw c;}function Da(a){var b=!1,c=null;t.forEach(function(e){try{e.onInteractionScheduledWorkCompleted(a)}catch(d){b||(b=!0,c=d)}});if(b)throw c;}function Ea(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkScheduled(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}function Fa(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkStarted(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e; +}function Ga(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkStopped(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}function Ha(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkCanceled(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}var B=60103,la=60106;f.Fragment=60107;f.StrictMode=60108;f.Profiler=60114;var oa=60109,pa=60110,qa=60112;f.Suspense=60113;var ra=60115,sa=60116;if("function"===typeof Symbol&&Symbol.for){var g=Symbol.for;B=g("react.element");la=g("react.portal");f.Fragment=g("react.fragment"); +f.StrictMode=g("react.strict_mode");f.Profiler=g("react.profiler");oa=g("react.provider");pa=g("react.context");qa=g("react.forward_ref");f.Suspense=g("react.suspense");ra=g("react.memo");sa=g("react.lazy")}var da="function"===typeof Symbol&&Symbol.iterator,Ia=Object.prototype.hasOwnProperty,Z=Object.assign||function(a,b){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var c=Object(a),e=1;e=xa};g=function(){};aa=function(a){0>a||125e?(a.sortIndex=c,T(w,a),null===r(u)&&a===r(w)&&(E?X():E=!0,L(V,c-e))):(a.sortIndex=d,T(u,a),z||M||(z=!0,F(W)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=m;return function(){var c=m;m=b;try{return a.apply(this,arguments)}finally{m=c}}},unstable_getCurrentPriorityLevel:function(){return m},get unstable_shouldYield(){return Y},unstable_requestPaint:g,unstable_continueExecution:function(){z||M||(z=!0,F(W))},unstable_pauseExecution:function(){}, +unstable_getFirstCallbackNode:function(){return r(u)},get unstable_now(){return x},get unstable_forceFrameRate(){return aa},unstable_Profiling:null};var Oa=0,Pa=0,p=null,y=null;p={current:new Set};y={current:null};var t=null;t=new Set;g={ReactCurrentDispatcher:na,ReactCurrentOwner:Q,IsSomeRendererActing:{current:!1},ReactCurrentBatchConfig:{transition:0},assign:Z,Scheduler:g,SchedulerTracing:{__proto__:null,get __interactionsRef(){return p},get __subscriberRef(){return y},unstable_clear:function(a){var b= +p.current;p.current=new Set;try{return a()}finally{p.current=b}},unstable_getCurrent:function(){return p.current},unstable_getThreadID:function(){return++Pa},unstable_trace:function(a,b,c){var e=3 createProfile(@RequestBody Profile profile) { + return new ResponseEntity<>(service.createProfile(profile), HttpStatus.CREATED); + } + + @GetMapping(value = "/find/{id}") + public ResponseEntity findProfileById(@PathVariable Long id) { + return new ResponseEntity<>(service.findById(id), HttpStatus.OK); + } + + @GetMapping(value = "/findAll") + public ResponseEntity> findAllProfiles() { + return new ResponseEntity<>(service.findAllProfiles(), HttpStatus.OK); + } + + @GetMapping(value = "/login") + public ResponseEntity login(@RequestBody String username, @RequestBody String password) { + return new ResponseEntity<>(service.login(username, password), HttpStatus.OK); + } + + @PutMapping(value = "/update") + public ResponseEntity updateProfile(@RequestBody Profile profile) { + return new ResponseEntity<>(service.update(profile), HttpStatus.OK); + } + + @DeleteMapping(value = "/delete/{id}") + public ResponseEntity deleteById(@PathVariable Long id) { + return new ResponseEntity<>(service.deleteProfileById(id), HttpStatus.OK); + } } diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 11efbf683..405fffa19 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -7,7 +7,7 @@ public class Profile { @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) + @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String firstName; private String lastName; diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index fb6d7c3d5..cadc6465c 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -3,9 +3,12 @@ import com.example.demo.models.Profile; import com.example.demo.repository.ProfileRepo; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class ProfileService { @@ -13,15 +16,25 @@ public class ProfileService { PasswordEncoder passwordEncoder; @Autowired - ProfileRepo repository; + private ProfileRepo repository; public Profile createProfile(Profile profileData) { - profileData.setPassword(passwordEncoder.encode(profileData.getPassword())); - return repository.save(profileData); + Profile profile = new Profile(); + profile.setFirstName(profileData.getFirstName()); + profile.setLastName(profileData.getLastName()); + profile.setUsername(profileData.getUsername()); + profile.setPassword(passwordEncoder.encode(profileData.getPassword())); + profile.setEmail(profileData.getEmail()); + profile.setChannelList(profileData.getChannelList()); + return repository.save(profile); } public Profile findById(Long id) { - return repository.findById(id).get(); + return repository.getById(id); + } + + public List findAllProfiles() { + return repository.findAll(); } public Profile login(String username, String password) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8b1378917..20ef8336f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,6 @@ - +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://localhost:3306/chatter-box +spring.datasource.username=zach +spring.datasource.password=zipcode0 +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true \ No newline at end of file diff --git a/src/test/java/com/example/demo/services/TestProfileService.java b/src/test/java/com/example/demo/services/TestProfileService.java index d5ac20a5e..e49be9076 100644 --- a/src/test/java/com/example/demo/services/TestProfileService.java +++ b/src/test/java/com/example/demo/services/TestProfileService.java @@ -3,41 +3,110 @@ import com.example.demo.DemoApplication; import com.example.demo.models.Channel; import com.example.demo.models.Profile; +import com.example.demo.repository.ProfileRepo; import com.example.demo.service.ProfileService; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.core.parameters.P; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; -@ActiveProfiles("test") -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = DemoApplication.class) +@RunWith(MockitoJUnitRunner.class) public class TestProfileService { - @Autowired - private ProfileService service; + @Mock + ProfileRepo repository; - Long expectedId = 1L; - String expectedFirstName = "Ben"; - String expectedLastName = "Smith"; - String expectedUsername = "Batman"; - String expectedPassword = "Secret"; - String expectedEmail = "bens@gmail.com"; - List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); - Profile mockProfile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels); + @Mock + PasswordEncoder passwordEncoder; + + @InjectMocks + ProfileService service; @Test public void createProfileTest() { - Mockito.when(service.createProfile(mockProfile)).thenReturn(mockProfile); - String actualFirstName = service.createProfile(mockProfile).getFirstName(); - Assert.assertEquals(expectedFirstName, actualFirstName); + Profile expectedProfile = new Profile(); + expectedProfile.setUsername("test username"); + expectedProfile.setPassword(passwordEncoder.encode("test password")); + + Mockito.when(repository.save(Mockito.any(Profile.class))).thenReturn(new Profile()); + Profile actualProfile = service.createProfile(expectedProfile); + + Assert.assertEquals(expectedProfile.getFirstName(), actualProfile.getFirstName()); + } + + @Test + public void findByIdTest() { + Long id = 5L; + Profile expectedProfile = new Profile(); + expectedProfile.setId(id); + + Mockito.when(repository.getById(id)).thenReturn(expectedProfile); + Profile actualProfile = service.findById(id); + + Assert.assertEquals(expectedProfile.getId(), actualProfile.getId()); + } + + @Test + public void findAllProfilesTest() { + List expectedProfiles = new ArrayList<>(); + expectedProfiles.add(new Profile()); expectedProfiles.add(new Profile()); expectedProfiles.add(new Profile()); expectedProfiles.add(new Profile()); + + Mockito.when(repository.findAll()).thenReturn(expectedProfiles); + List actualProfiles = service.findAllProfiles(); + + Assert.assertEquals(expectedProfiles, actualProfiles); + } + + @Test + public void loginTest() { + Profile expectedProfile = new Profile(); + String username = "test username"; + String password = passwordEncoder.encode("test password"); + expectedProfile.setPassword(password); + expectedProfile.setUsername(username); + + Mockito.when(repository.findByUsernameAndPassword(username, password)).thenReturn(expectedProfile); + Profile actualProfile = service.login(username, password); + + Assert.assertEquals(expectedProfile.getUsername(), actualProfile.getUsername()); + } + + @Test + public void updateTest() { + Profile expectedProfile = new Profile(); + expectedProfile.setUsername("test username"); + expectedProfile.setPassword(passwordEncoder.encode("test password")); + + Mockito.when(repository.save(Mockito.any(Profile.class))).thenReturn(new Profile()); + Profile actualProfile = service.update(expectedProfile); + + Assert.assertEquals(expectedProfile.getFirstName(), actualProfile.getFirstName()); + } + + @Test + public void deleteByIdTest() { + Profile profile = new Profile(); + Long id = 4L; + profile.setId(id); + + service.deleteProfileById(id); + service.deleteProfileById(id); + + Mockito.verify(repository, Mockito.times(2)).deleteById(id); } } diff --git a/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java b/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java deleted file mode 100644 index 054c313b6..000000000 --- a/src/test/java/com/example/demo/services/TestProfileServiceConfiguration.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example.demo.services; - -import com.example.demo.service.ProfileService; -import org.mockito.Mockito; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; -import org.springframework.context.annotation.Profile; - -@Profile("test") -@Configuration -public class TestProfileServiceConfiguration { - - @Bean - @Primary - public ProfileService profileService() { - return Mockito.mock(ProfileService.class); - } -} diff --git a/target/classes/application.properties b/target/classes/application.properties index 8b1378917..20ef8336f 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1 +1,6 @@ - +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://localhost:3306/chatter-box +spring.datasource.username=zach +spring.datasource.password=zipcode0 +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true \ No newline at end of file diff --git a/target/classes/com/example/demo/config/ProfileConfig.class b/target/classes/com/example/demo/config/ProfileConfig.class index 664a13e3bb40d7a9830a59160a562858a5f451af..b88a9368ccb8c2ff1682bfda0e0fb295fbdb8d7f 100644 GIT binary patch delta 21 ccmZ3>x|MZ8FBgA7VsUYKeo>0+#(p^_09OkKy8r+H delta 13 UcmdnWx|Vf9FB5y}#_4iQ03nM6U;qFB diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index 0b2c27f341bc25100bcdcf396a717e68ac2b53e3..0a45916cd1ab07478ba738051ddab2883abf9c05 100644 GIT binary patch literal 3376 zcmb_eYjfK~6g}%a6uZi!X$XWzX&OqMq=}$!Y7@w-X{pl~I|SN7scdf?6z*|t|Z%Pqr?i+58BnPcJDp+?Ad$u^3~t}0=SAN84O`r!Acr~Sk2%z z*3!6xyBVbLjU3*S!-9NUm(6|IY{;gl;9CVH2F2yhu2JO-(}k+t(D-k9qiJ%j#v8U4 ze$$GMy=|Dh94yT-Oq4uJ7!AH|qlPLSnkD z?YZgL7gWf)oKV#lr(b;+FI4n>qM8+A(;orXA#K z`bqAv#DDd;E0*k<btsT>Q-GV*aYh&=aw?a#K@Z#7#{zB ztH~I@nwar59w9uVNdmOrjoKd!*Av?)>SCvLlUgh;nr28O$!|7$64st1U!4!Q^@L$+ z1yV>7cBCQ){6GmKiOjU?hQ+WEJ(IGKsV5gXxp3wraSV8r{4BbIGTU@i6j~w>P2F`V zvyn!ex9dC!4U{UiF!VvMS&L?`5WM~z`7*SAG z@jf;ce5Yay-%A@msCa;fDjvz{Cyfb8;Jc|(K`@C zmrJx&*7*UMxB|UhiP{NMcK4`K8~5m%Qs(g)ZYLDNwHCE^Ok(KnqrY`OP6xVbth>ytRSz6u4 zXaIcdZ#?Hi9->c^^qhYL=3)w;&^JZmy+AJvpW@;%K$K?~hygNj1duGI$z%v5+Xgbz z1~S_Qa;XDk&IdA2H1_z6{;y>mi1{A@A4-nrZR>niu(pBBp z`NvP+-{%WJfoX&e#u}-{q*+U0Z>pThb6KA%fgs->cAITo83YIgGP@9&z3b$HB|IJi zg5yJy6_p}ux8*THx`-|(w>`OfKr|E{Vq#kcYldk41$5DKdEeo{J&lFo29%ik# z$ImK^J*s+)X#ushmyh`Ymmp$_((g05e-k-YN0fkL3|NT(na zmd1~REf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BtMn4E598bkOkh8=RPjCN=qTn)(cXks>_P7% zq@hQ+O&G;KObuT#@Qx`SuH`nGV53PFd)VD)d~5>o%aS9B3JV@54W!o)BYcrKaRcS$3JqeMEHZmNAY9COR&W z?bQWDX%ujXM8twkPh+Y?k)G~qW8(!L+HM1-V4yW$U-UoY^R(r*X^VCO&gj2pR}N-( zpV&J2;x_L|F8K_5G?cbn+a diff --git a/target/test-classes/com/example/demo/services/TestProfileService.class b/target/test-classes/com/example/demo/services/TestProfileService.class index b985a3e62502dc2cdff1d355c8a25cbd38a23adb..0e483ec66a7fe4d17d3f3ada2f6d72d4c262ea11 100644 GIT binary patch literal 4098 zcmb_f`F9iN6}=-%j4TbdF$4+?38W3k$Yh#AlNJ+-12{F6mtYVjBn@L}EDuOCVrFD; z_ciH~rD>b)>E3i-(x$|2&gsd|{iXj=Pw$&eBg+l6r#?qB-}2u3?tR-g{>Q)m_IChB z@z(;%sH(VFKnB%3J|gc+gE)jI^0-{YlXyy2J}N6u7jOke5hX0js8&QBrfe(~(7>|D zSp{6hwH!^$U#@^ATC#47mLpZO3i8M=1rs3Zkl@CY&m*&Tc3BGC97$k zqr!xO-RC;CZ?(*->NKV#RN zy6Gx75r}zh*RmT+uF*2NdrkMuTF15gRlVk}wy7Sg>GQq%G^u)~yJFSMO_4`?G38vMv9Ff`QUlRYCR?krH~vvd!5}YteMi8zdVrtQpO!;aW0} z7PJ1cMfMN$dojY|>E}()kNnsLw5{fvhHpmeBElohn{DDU>(Q!${rzTJMA!6UhJ?S> zsQDeEndpoJRIhf(DL9%U+LC40A6=cUhv#Ihx`L6)Rb$1_n}*%cD~{cu*me<{Y{sU% zPt2PewMZ_Dun?GHAchGmC{@*Vot zX6{H#x-1raNh-?br{mVlDdxI@T_PU&Gm6*) za*TpKDc`ys+csUDC2`U6mw9Y%#b|b@exN7U!azu_u`bSDU{t6<#R(1X!$S)0?JK|D z2s6Mw;p~e!Yxo>Kui-s-Fy4vTs`!G2FX9;u&x*u24y*W*h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OWF81(mQDKEwMt2z&$1`q*`|ZwLKt78_>1*!`?Nu)O$|>sXrPjum z(A3z2#MlvcW2^LNXhkkR8hgM~qrE)zT>K5?ucQdAJUVOqmQ}g1pC~2XHib>)YnqSY z&MDJA+!qt^UuDY0QJLCAWCc~IdfF$$)3Y`@yX+?Fh!{5Ko$H_NM!40)I&L#Oo0oCw zff<&=&^!}*#NQ3}WlHU@hO^`*Jy728H&aft1q;L7c5Bcz Date: Fri, 27 Aug 2021 09:11:34 -0400 Subject: [PATCH 13/29] Added relations to entity columns --- ...ven__mysql_mysql_connector_java_8_0_26.xml | 13 +++++++ demo.iml | 1 + pom.xml | 7 ++++ .../demo/controller/ProfileController.java | 3 +- .../java/com/example/demo/models/Channel.java | 7 ++-- .../java/com/example/demo/models/Message.java | 14 +++++--- .../java/com/example/demo/models/Profile.java | 32 +++++++++++++----- .../example/demo/service/MessageService.java | 2 ++ .../example/demo/service/ProfileService.java | 3 +- src/main/resources/application.properties | 6 ++-- .../com/example/demo/models/TestProfile.java | 13 ++++--- target/classes/application.properties | 6 ++-- .../example/demo/config/ChannelConfig.class | Bin 312 -> 905 bytes .../example/demo/config/ProfileConfig.class | Bin 312 -> 693 bytes .../demo/controller/ChannelController.class | Bin 332 -> 3296 bytes .../demo/controller/MessageController.class | Bin 332 -> 3285 bytes .../demo/controller/ProfileController.class | Bin 332 -> 3442 bytes .../com/example/demo/models/Channel.class | Bin 1968 -> 2189 bytes .../com/example/demo/models/Message.class | Bin 1875 -> 2170 bytes .../com/example/demo/models/Profile.class | Bin 294 -> 3753 bytes .../example/demo/repository/ChannelRepo.class | Bin 131 -> 339 bytes .../example/demo/repository/ProfileRepo.class | Bin 131 -> 591 bytes .../example/demo/service/ChannelService.class | Bin 317 -> 3659 bytes .../example/demo/service/MessageService.class | Bin 1064 -> 2245 bytes .../example/demo/service/ProfileService.class | Bin 317 -> 2667 bytes .../com/example/demo/models/TestProfile.class | Bin 306 -> 3302 bytes .../demo/services/TestProfileService.class | Bin 331 -> 4098 bytes 27 files changed, 76 insertions(+), 31 deletions(-) create mode 100644 .idea/libraries/Maven__mysql_mysql_connector_java_8_0_26.xml diff --git a/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_26.xml b/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_26.xml new file mode 100644 index 000000000..89b981286 --- /dev/null +++ b/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 64c7ef9f4..e164b4e83 100644 --- a/demo.iml +++ b/demo.iml @@ -101,5 +101,6 @@ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index a0d7ff77b..df0fbc8ef 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,13 @@ mockito-junit-jupiter test + + + mysql + mysql-connector-java + 8.0.26 + + diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index 351a31871..33c185321 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -9,7 +9,8 @@ import java.util.List; -@RestController(value = "/profile") +@RestController +@RequestMapping(value = "/profile") public class ProfileController { @Autowired diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 7fbf80a71..2d6a08f2f 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -1,9 +1,6 @@ package com.example.demo.models; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import javax.persistence.*; import java.util.List; @@ -14,7 +11,9 @@ public class Channel { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; + @ManyToMany(mappedBy = "channels") private List profileList; + @OneToMany(mappedBy = "channel") private List messages; public Long getId() { diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 563851cc1..aeb5834cb 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -1,11 +1,10 @@ package com.example.demo.models; +import com.fasterxml.jackson.annotation.JsonBackReference; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.apache.catalina.User; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import javax.persistence.*; import java.util.Date; @Entity @@ -14,9 +13,16 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; + @ManyToOne + @JoinColumn(name = "profile_id") + @JsonIgnoreProperties("messages") Profile profile; String body; Date timestamp; + @ManyToOne + @JoinColumn(name = "channel_id") + @JsonIgnoreProperties("messages") + Channel channel; public Message() { diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 405fffa19..3f4f5a8a0 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -1,5 +1,8 @@ package com.example.demo.models; +import com.fasterxml.jackson.annotation.JsonBackReference; +import com.fasterxml.jackson.annotation.JsonManagedReference; + import javax.persistence.*; import java.util.List; @@ -14,21 +17,32 @@ public class Profile { private String username; private String password; private String email; - - @OneToMany - private List channelList; + @ManyToMany + @JoinColumn(name = "channel_id", referencedColumnName = "id") + private List channels; + @OneToMany(mappedBy = "profile") + List messages; public Profile() { } - public Profile(Long id, String firstName, String lastName, String username, String password, String email, List channelList) { + public Profile(Long id, String firstName, String lastName, String username, String password, String email, List channels, List messages) { this.id = id; this.firstName = firstName; this.lastName = lastName; this.username = username; this.password = password; this.email = email; - this.channelList = channelList; + this.channels = channels; + this.messages = messages; + } + + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; } public Long getId() { @@ -79,11 +93,11 @@ public void setEmail(String email) { this.email = email; } - public List getChannelList() { - return channelList; + public List getChannels() { + return channels; } - public void setChannelList(List channelList) { - this.channelList = channelList; + public void setChannels(List channels) { + this.channels = channels; } } diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java index c36f67100..8b6026b30 100644 --- a/src/main/java/com/example/demo/service/MessageService.java +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -3,9 +3,11 @@ import com.example.demo.models.Message; import com.example.demo.repository.MessageRepo; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import java.util.List; +@Service public class MessageService { private MessageRepo messageRepo; diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index cadc6465c..07c0e016a 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -3,7 +3,6 @@ import com.example.demo.models.Profile; import com.example.demo.repository.ProfileRepo; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; @@ -25,7 +24,7 @@ public Profile createProfile(Profile profileData) { profile.setUsername(profileData.getUsername()); profile.setPassword(passwordEncoder.encode(profileData.getPassword())); profile.setEmail(profileData.getEmail()); - profile.setChannelList(profileData.getChannelList()); + profile.setChannels(profileData.getChannels()); return repository.save(profile); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 20ef8336f..532817cf8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/chatter-box +spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box spring.datasource.username=zach spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true \ No newline at end of file +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java index d0aa01838..d25a09f3c 100644 --- a/src/test/java/com/example/demo/models/TestProfile.java +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -18,7 +18,7 @@ public void nullableConstructorTest() { Assert.assertNull(profile.getId()); Assert.assertNull(profile.getFirstName()); Assert.assertNull(profile.getLastName()); Assert.assertNull(profile.getUsername()); Assert.assertNull(profile.getPassword()); Assert.assertNull(profile.getEmail()); - Assert.assertNull(profile.getChannelList()); + Assert.assertNull(profile.getChannels()); Assert.assertNull(profile.getMessages()); } @Test @@ -31,15 +31,16 @@ public void constructorTest() { String expectedPassword = "Secret"; String expectedEmail = "bens@gmail.com"; List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); + List expectedMessages = Stream.of(new Message(), new Message(), new Message(), new Message()).collect(Collectors.toList()); // When - Profile profile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels); + Profile profile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels, expectedMessages); // Then Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); - Assert.assertEquals(expectedChannels, profile.getChannelList()); + Assert.assertEquals(expectedChannels, profile.getChannels()); Assert.assertEquals(expectedMessages, profile.getMessages()); } @Test @@ -52,6 +53,7 @@ public void settersTest() { String expectedPassword = "Secret"; String expectedEmail = "bens@gmail.com"; List expectedChannels = Stream.of(new Channel(), new Channel(), new Channel(), new Channel()).collect(Collectors.toList()); + List expectedMessages = Stream.of(new Message(), new Message(), new Message(), new Message()).collect(Collectors.toList()); Profile profile = new Profile(); // When @@ -61,12 +63,13 @@ public void settersTest() { profile.setUsername(expectedUsername); profile.setPassword(expectedPassword); profile.setEmail(expectedEmail); - profile.setChannelList(expectedChannels); + profile.setChannels(expectedChannels); + profile.setMessages(expectedMessages); // Then Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); - Assert.assertEquals(expectedChannels, profile.getChannelList()); + Assert.assertEquals(expectedChannels, profile.getChannels()); Assert.assertEquals(expectedMessages, profile.getMessages()); } } diff --git a/target/classes/application.properties b/target/classes/application.properties index 20ef8336f..532817cf8 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,6 +1,6 @@ -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/chatter-box +spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box spring.datasource.username=zach spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true \ No newline at end of file +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file diff --git a/target/classes/com/example/demo/config/ChannelConfig.class b/target/classes/com/example/demo/config/ChannelConfig.class index bb261267573bfdf67ca19e244d8af90d101b7cdb..c8ac032171d181c671ceab4225a5153a1ead2b75 100644 GIT binary patch literal 905 zcmaJZjv1;o_zd&pYW?n>uh)^Ov1r;k1A19khI(2s@%+9v)X9;3K z!5`p{67Oy{8r|T_z1*F1?z!jg{qghbcL0yD@59693L4n*aN9=}n?CN~u7`Ubwi&!c z+H)03hQnTHVlJm5oq|imVK3|K_rj0HcmKYbi(kY zXY80K6RY%iWJN45jQzj|Qs{(_MCgqD$f;dH;K!*m7s|>ZwQW3ATDfNo)q}%6L#=Cu zG+48zw0xPy18Lt1Qe$ZKOemthuqvyIk2QCyNd7_DMria%jpr`9c|~gVM7ngsu-iKm z=VH1z)N7MC!X?h8p(Ch&Vp1E*7b;gT)-h|;&d3apm%1ipC#P<)^^BF;d|jOY0agQC z!3x7pY5y_#kCOS|9(DrkVvpf|2}wdFiwtYoY&;Tr%wG-8Wawx;CF=5@%&;0-DV!|K zGCV&hZ}#s2J4;UJ9|ZR35R+e%Cr!Q*Qnx@8Rh!XCD^C@xk)ht zgWzivgBbwpXi>#*oye7(Jfu_4aP6bdsC+~9{UvH&P=ELT@{dXjHDa%$Nu9T;??Y@X WD7Fj5`S2Trt>8u;Z~nG)3-|@3-RUv_ delta 127 zcmeBV-@zn$>ff$?3=9k=3<6vX%nZEj41DYi{1dknO!j9~VC7+8VPKtnhtWEiL6Lz8 zC=UXRKnN5Dl59YpKA6wIz^b*KfpH^HfQf+}NU{Ni8Gsr%fFuu?&C0;Zzy;(nGH?S) HCI%h=pXUrz diff --git a/target/classes/com/example/demo/config/ProfileConfig.class b/target/classes/com/example/demo/config/ProfileConfig.class index dea009db9a8f6c5097c66dc4bc6ebbd5080aa92b..b88a9368ccb8c2ff1682bfda0e0fb295fbdb8d7f 100644 GIT binary patch literal 693 zcma)4$xg#C6dae*jiqIWBL~DHfhB~vfDp8TQw0^EN*vwPEiQ>&IS$KT!3hZ@K7fxx zyreCgI5da1`ORb|@%zWi8-N`w7BGt0EanPG#d$u91%}MN(#jn$jI6EK8PXNglnlkH z((*J48q!{hhEJ2}s_}$h7goi6f0%aHDr8u#dM4oVUIblV@}>+7_l$0-Hm_OJQogJt z-5&9FMHt>0+dS4Dy~r{guB}&%ZS$~em2S7J2qc}~@KAb@Rqla%_Mz(x9{_pnHv^F_ zok!ZKK-N{LNZXOt#tEm4CTW}hl9M_o?;RIktGq0QCa%JTiL572NHlr=C4Z|UZUw{c zu#7#^kxiuRjU$6B*&W7fBk|13mDu_pzYHrweQbtOte5*jxA|G4BRz*@r0EL8PYU$s zk)@cUj#FloM>n3qo|5A{#Y{5Hqd@g|ZvkUef$9lN5=ji+PRM}VD^gd_7GE48Ti;4_$SI1Ox9ymVC7+8VPKtnp3zR22`C8y rj6et!1Cnf$6_~`-*@0qgKpq27o&!kofZ41JoD5uG)!aamiGc?IWUC5- diff --git a/target/classes/com/example/demo/controller/ChannelController.class b/target/classes/com/example/demo/controller/ChannelController.class index 16bf677d403c7311c3a2b4c12a27ec1765e19cc4..850ff04974b0e08ebc5a20eabbd8bc4da50d0581 100644 GIT binary patch literal 3296 zcmcImZBrXn6h1crwuDeHSo)$;pjN_5yFzWLC89J0stpN}fUT{io8%U@-R#EA4ahi- z<3F;DLuYixkNwae<@ns)n-@rIf}OHE zjAF^+dVv=mUA@!eyM}FZE91K^FuJ%=v4vUWTV~nJS$xU19bpL5vCE8ZCmnZ3FPB`? z-g)L4MZWL2FZ3KY?6UsM$P33k&=F28(3dL0**9HYK-iv`X`5n^Q7}5W#i%Rp6aZ`> zY1%whDdxDFHLx3_NYcq0)|TO#(pHmQV%Nm>dNYl@V++@@EbdmB#A`FywLkB2LvTfs zQ8L;bq6j2bxw?E|vL(k|AxioNFPESLPe34Xfbd%0SC7$H+qjGd*SOeq3hRbcPH-2D zdNbyZZHS5s=FWeJE!Gy!BH*`9=RVKrInypQW^#jnU*To3W|T@uy-X(WM3ru(^KG=97SYkD0k#ha(y_pVcrDeFT)6l(Rb5KTTe_6*%J z>>WMnfZA!&A21=n;K>N6x{NULFCdmG-zWcmm(CIyTung9kS@9DKbnP~7~SevpLIj* zR?iy*8jwMjEK6yGBAt$&MwF+Wd&hj~D#En%q*)f7kd<|N#v=-hsKZLBfCJ9xag)Yv zkHBeI{ro?M?}Rq`=K3ab9M*lpD$6}+U1%lHVL6dZWE0ZCpHdE?j8k#*e8rT#by(%J z-XgEd>PLoK7E2jDiaX+<#P#|L$Umg3ws)=GeZ%xFonti7>V9a^JHs?c?`V__(|fe3 z(N>tgp$9U?!!S+Jw_$oD&ByZZ27MQ%d3qA2n0&EK4;W$N6W3WCNwtyJA>)kJ4|zKG zoaY6QHic+?BQjdIYg&9Gv6M|LGrHO`C!Ut|1<1yo z#>({BEp)V0Uc)yU7pwl)o=PBnA6Hi@o!wqZZ>E4Xf-~<)Tsz7DmTijN!HI0Yc_@|M zj;B-EL@G;T_&^%KHxt8`5ef=p1Xd5mAvK~ZVGYC5F*1zZQ?H1<#6y72D@kyh>g0CmQ;L0uQHtqu}%rbsbXoE9&_b(~Y6dd7*}VcNGc?=>r-; z$jk8VW-y3Gy@g{QpR za05E+kj_YS$ESJ~;GoC-ECmtt67_-U2rx+veBiS+;IlMC*Rb(*ybBT=sWO;>J&Iod z!b;IkGWb|An5{FIgBwZ?U${X})EF4Zj6|v!k0_*2dx7ie8E;5WL_r(%d~UvV^IM2N zPq&p~zhIPv=jw``uWmg(b3}b7B*RogjvFPLfMii9G3DVJ^`q7#n^TfuCok)Ps(6<@ z@p=PzPYosTX-f`wlzGE48Ti;4_$S_}m>kNc!pg(I!oWINlifL(L6Lz8 zC=UXRKnN5Dl59YpKA6wIz^b*KfpH^HfQf+}NU{Ni8Gsr%fFuu?&C0;Zzy;(nGH?S) HCI%h=z2OXN diff --git a/target/classes/com/example/demo/controller/MessageController.class b/target/classes/com/example/demo/controller/MessageController.class index 0f631f61e1bf0c2cb2faad4cca1cc898fafd6989..175e2774b557953fc6f82c8de4f514ddd1e2f917 100644 GIT binary patch literal 3285 zcmcImZBraY5PoJkxZLF+2#ASB4T+KWj2IGPKqBESnj_#r(3F8rgysg>8E>o=EXmMJqIw2M|pJPP7Vcpmc>FI zcd?km5|;Dmz>1!(>ghc_`dq)h(69Sh6th@k=&4E16FYKKx_f3tGK>~0PL0c-M6GT~ zUX?Y6d*MI6c4X-+L)V;Xn`)k6VkEWJ=r%)U(W#QFb4AmZ5ByqLx?7@bk)*HaRD`uH zTvN{@VMgtm9s_T8QE_bLI+i8f2DZgmLhyRmq}p|=8^RSesiaFrE|h#*nKij>dM0^T zux&>PWjZ$fyH#}D9q!d#)82WkRrVeC2VR!K_V{B_QI31SMXbOVeC6z$uB>VzDy|fY z0w^XBQKMijuYquOG||njQgvREUY(%GWx}Wq$Zj^u4#QA;^e@?E$ZeWCwotxHK%D;& z$lQs(=LzeL#JKilnU_tw+REI9y z>8ZO;Ra2UwOjQ|XM~Y9xp5T_ScX-huB&W%XVUmg7mn|@S_xe`TkvyH6hkN= zU>|iNM9KneoJMX?JiqE5*$le$Kh z0*&T&&W9#Kd-+YrcPnzm)XjY`VyxMtujwsF)s*PWqmC^dbx@bQsX?huZqrG9CffK- zY-f1XPYdY9g93VRj$t^d>nF71EY=Hn8yi`CSwIP!+QwD^SMjibZ9SdDR|QPr>jGx* zkYTdz96j#1qIS~kN9*M$vZ5F|M)YYp+-4~GKxSA<)AZY{wVfkZUdhNkI;A%0!1U?3 z%r2Ie7q*s{7_KJfFQBlgK$*MUx=F$qXH%(a7OuA{M-BVrP>l8abgQ8L6ObFX6#}!> zW-mpDILRS~=o;2d*D?k}R~L=CXxxi8=rYzvvlWsX^v#bw0~;Iv6UOf}Gtf`(9$Evu zi3|pj!+8wQY%p9+(m|S$USO5sEgE;y?TtR?>CsLu(3eqxzJt!d)hZd%uKNE*$D^@7 zV2mFk^Aw%W(DfUML!Vj^xY**WKlas6@^|Tfto^v5XMV3 zaGg?M1d-GE48Ti;4_!$}4Y%=pQOY9gKm^CKu$ez5EO@)<* zfrWu}@_csZU_CzYD9ixVzyTzA Vz-(3qP6jR@kCA~JNHQ_-002C&4`ToT diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index bac3177191f36758b4b4024aa761e262506d9578..3356a417f2111c1263976c04aa32b30e32105060 100644 GIT binary patch literal 3442 zcmb_eYjfK~6g}%a6dUEyG!3*o+Vnx4q|HL#)FF^p(^97~b{Z&wQrX@(DzapxRYHd0 zKS8IH&cF;mfFH$hSCVbDQDTSb2d}j2z4xAb_Uyg-=ifj725N6x8#th-D&3?vZ<~5wgcH(a|r%$f}UrPPJet=A>{bqjbrv*@pC8%G`O2 z*k(JznIrf&6I0z4W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NU{NW`d~f-1FP0{2F8s*0VW1^Ajt+4W&mp70FpdlHY)=s0~e6T$iNLG HnHYEg9Jmc{ diff --git a/target/classes/com/example/demo/models/Channel.class b/target/classes/com/example/demo/models/Channel.class index 021a446065d7e1d32a8c102a2b06653506d94ef9..b1edeb85b9ab47a59905bc391d4748506e6df4c3 100644 GIT binary patch literal 2189 zcmb7_Yg5xe6o${HHz*Yl1eA*iiWUTd7epmul;gWeNH3-ie%a0Lo_)`=XWwpr{r>Tjh#u0bEM@3fH>GJ!HP2P^LN)6ddYPdO zMw(G!)L%U2pSf;wS=EcStQHtudtaBHVTqFA8V9CWm(upQXV}tZH0+0;=r!TEhU*Dg z7W!rdo2FwH-U=xk?ukl?n{|PpF4t4z>ghk@k!k<5rs9+9ANF_9Np1;715K!Vo@4m1 zJvGNZG)z$hO>~;NXPCO0fkyY9QI*`QJ5YEKC`8Mv#jM9>`DWSk<#TP&1sFHJHnffs=e{yZ9V?C^= z{tn~Ks(3W!~td@I=FlTXBu??@4WXF^&==~Y7--WsDs zezt^)Z=ei}`ih1W+jZ+eIQtw{Pv zzu7-Mz;CGh2TVgm!DRRBx>FW!@H1tU3(c^o-W^7xF&2G|=f^uOx1l)P(sz^`OsTd`VC*^*yK! z)ZBMsU;Sj$Xw&{=mTux((IJ3t(F}S^Krm_zJ^8RG40&1qGbL-W1*`bd2uOd<;{fo#{p_(*i9b$6ri|cBWfk zn(4r#ZjDjM)bBItv=quVihM@NcBXs`Q*i6|pm?7iP{L>1g;-Rtq+(0>)eh=454MF4 zY|2Rt|H|iAnTBPC8ngpg2of%1@=+{xs-1eNBlQYI9>-Is+NmFcdbtC&vUDr;7>zfm V$0F({D9clfG%EPcSKeJE`U5nS$6f#c delta 798 zcmZ{jTTa4I5QhIAXo04QT%^S+Dkx%$h~Nb;VB!vpi*Osn1^9Fl*8x#qd|&~_O}G*D zKRrs3&qNeZDmEEW6Wc16eut;ZGs72%F&%-pxV*HuhB~uU@ikAu(+XR!5R+N;z>XfT z!DO21@9MPQ{)&xn%Dy|iGYtj`Y8MS!Up`oFGiInRW!OWLlD?c;Ui7lMVT}#z2@N^b zxM4nOxQ{@I(4U_|dT|PkB?NjAAr)IA93T~`+)`~eja9;y5k`qcK%}zd8xK%E^@aMxsRyQ)z~th_3qWQHDs5Ny#z@8$<0H$@M1`J U2HE2jju{F532dI~OFRXB06y3-3IG5A diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index 953bcac9caf0011d5e078a63a35652ca6913c270..2e1832482fc3ee5429d7c3a146af5e9f8485f7a2 100644 GIT binary patch literal 2170 zcmah}T~ixn7(JV8k`ki@+M=XV%7-=t+EqbOp|mtrhYm=`#@u+(S(3M5>3%S~n-1Lh zlXOPL887?+{wSyCd3Q}h+?0!bzxH|0bIy65-GBc5>u&%XXp~XH_5_M}D8r5nk7RgU z!fpvq4CI`Sfyw<7`;Be6w%@h(1HZdvVD_h;A3L6EIgxYZs$Jg?Vmo#MKQb_*!_TZ! z6-G`JE5EI*y$&xeX1w@8`6{$y)oIyoPci6P6wAJQ{?2%2YM!4;yt(^x^Uy%)Gz?xj zt}?K&-wr%Wo!Q>0tE`Ul0?P|J%8jh&NeC~^WiUCg{qtsU=nLqbjQ7t1$8Q8~&+{d# zZ+pyDPP4ugn>KagS2iVwXP#@F*zMO*;9GXz9P1hPdtE;W6}ix#*ijMD3U5R_wRCdLNo_m(bqa~ zhcQGMiuq6SAVf=k5%j{g`d)uZm9%0HJ)&5=nu)pJPAU@x!;4T&_xQ2-eCNWjP zEUFdU#>WQc$C;LbvuK0g%i+<9YR6dMKd8iCRDlmM!BTKFg&f}FT;cwGg%5C@8)i#i z-$owOJh{RB%?P(J!^MZcz=-e>kI9H5gp{7=a3}lX{H2R!22mTwMP6IyY;Z2r|Ag^7 z7db3(EOQ2NP0V4LD`6hbd1mIWBqN*wY_0T4Is*Y97ztk0SkC=5`m zbOD$r>Ro!UK*5U?w?rk&I?G0alx87j>Xod-7U5LYy7PJ^%1zX`o-!FK-ia+@iI7}D zouiPnI43IqK<+mlBr1#g@Ls0ERjj27cQ{MtqE4Zx@ znWLPx$Z2~FC+TEE*O5L+{S17GuQE6lMmaso= OZ}j-B{&b~vwt%@+BbiaCK3}L z`~m(b<2Pqlpa}MXnRCw0eDi%X=kV+IkDo-eMY{=#(W5v;X_L(sn{75bF?t-MCxSv& zRnTPN%=}~;bLE4aaCWRatk9V?TtG%1#vpru&4Qcr8mwi?c4*LwZ+v+q3G%E3iUp^r>ZA z-oBu4Hdg}DOJEC{C|I_9*KU+$t7xJjjO|p+ddX~AyblgF@6ocmW^De<$%3ix8z$PzW}OD)W@aig6J{H|Z8U1KdU=1AK;$z^54?ztW*l zezim4{91>!d`jz3q=%XYcLKf!%s8;dfi?rA6x~r(wtS?Z3NQnOykarTDXrv$)rtja z$c26lp{$tI61vMI7w9f5lQiIcmES1z1qZ&$s5;E3+Jg!+v=}Jdhv&*srLLzYp-z{< z`MyF(`cYl>(SSYki{K9q4o`)aUvmC2&c#(r`@5P)}Ve!pZad1 eKf7n(v_FCq->ohuzE2_CBDN3JgX62SLG%ZG_EK^H diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index 75bf6f1708519e126c69da0f19c2bbcacca62d96..13aee942615a98dc403cdbb4144e8591b08742a5 100644 GIT binary patch literal 3753 zcmc(g>2lLn6vxl?sw8d+VXL7)5+I9N1R-oqni4_+p-$qGrBLXi*f)++Tk=RUB@fYe zX=m!`3?KRc{o2>)Gj#etSBk8tawp7mreE%U&-tC@p8NY>?|vhqY5Jz0257yH`e}ok zO>VZh`I4I#+`Q!GD{fxp>2;pI7L+n;f(FZb#v4O#7*<^`+g5!>Q1N-&^30~(GF@}K zA?Gd2_6*OoEmzQKb^NW~l8$S-p0uh`U#{WOXu`%5X-UWMWNpi6v?UH{uE+EG{=c4w zrj7j;pU=#1ZmbFF+c6#2TQ!>gjukAq3ZC_8gJzK8YOZhIVfW}DW6-Do#0HrZ$I4?w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2@XAY?VUT4>DX*IU0@?1Ihg!NxW5aJAq{7}9c` V^A)b)SyeDgAszVd<8t<#=x_P)*U10? delta 154 zcmZ1}yNpTn)W2Q(7#J8#7zDT&m>GE48Ti;4_$MD`%2MJA&Mz%WPIb%7No8c<2`I`> z1G4n863Y^K7+4rs85!g!2eL{`E@hVuU;=6d0Y)GMN&!hWAWt96XJBB}+RnhZ5h%dK hzz!tYfWizw4IDs{2h3(=;AG$e@)#Mofg}?H4*&zK6vhAm diff --git a/target/classes/com/example/demo/repository/ChannelRepo.class b/target/classes/com/example/demo/repository/ChannelRepo.class index 91a30cadd69983efffff179289711a328696c44f..10e569cb085c038447f5c637ee42644a766a71f9 100644 GIT binary patch literal 339 zcmbVIJ8r^25S=9f2WWB&I;Ke~M>I$&kR_yWg2A3_?CkEW)`kR$lTmO04ux0{LKf*# z%ujmr-kUibcY6SMfnfqq3G@>fDCjRr?WkD=R}z^8FnOUjKDSPl19?jEDF*h~48QccFKw$qDN9 BYqS6W delta 47 ycmcc2)XXSw>ff$?3=9k=4D9R-tn3VI6X(T>u`x0*GB5!}L4c8g8AviQumAx0wFa~R diff --git a/target/classes/com/example/demo/repository/ProfileRepo.class b/target/classes/com/example/demo/repository/ProfileRepo.class index 017fd49fc0930fc3fa68da9b2ca8e99220e012a7..7d9b4f2ce8d2873174917f8d72b0fb11c82b239f 100644 GIT binary patch literal 591 zcmbVK%}N6?5T3NP+t$D8%_mS1%tcQXK@SSDVrkKP+MTYcyP1$=)q+pv!3Xf6#91wN zp@QIHGMNy*zvTVn^$h@yU^{}%2)Yq$3D}uvlbp|PJvyUuJTpmOdH+N%5pcN|Pt~K6 znKG#y2B%HhTRz#3$COKaR=LekCYY1VDZ$LkzN3lGuqU8xRP{2!t>t-~?ap=Y5Qt54}WKu%0&Ig&Opybpl>Clqbf!s`9SvB~XPX1I_ zVTy@ep0ei7kP0`(3wFQ;=3YwB!!i_3Zcvz@bG*}Dk1|fqP*6dWVRHw+3ia$9Daff$?3=9k=4D9R-tn3VIlXV%DCeLKF7Gq;%U}RtdN`U|)12d3hVqgIP DD+C8| diff --git a/target/classes/com/example/demo/service/ChannelService.class b/target/classes/com/example/demo/service/ChannelService.class index bee65a8960841bdf827eeefa50742f072a1df00a..e3392311599341a4c1f03d6a8e10bfbb94e24c2d 100644 GIT binary patch literal 3659 zcmbVP`B&Uj6#gkq^O|^DWY85E8=m51)TI$v?^MI60GA0>X-1n{S z{v&#hrBcuF__N2q$>aBu%mOpE91mymlK1ZY?!Dh#68`$<{vQCI!cTGR!9)ul!3BAF zp%oV~sp3Vsz7$6WQ}S+F#Y`M6n2^$!lGL1U#Z_F3Q)MBJCR~@7SET5xa__Yy6ui-j z8&br;qTI`>$f*ztTC*#LZ42wNC^!lRGFd0Di`z!NU;qhHJ{_XtU8@F}=F6d%|5av!WFEZ1~6s+NXrS;^ZzFu8|kMaH+oca?$q9yqGsV zlh~uS?f8aoIyTSFWE^){_X@6QFE2@zTaLS`FABr<^d%!3kjpGY3i@c#cW#-k$kEd7 ztSby(MAR!dUx%_hqqV$}mm_tOxJ^QV8l_#qp;~5Zq+97juI$2zROY6!X6Tk-FY6h{ zUfz+#n3*GQ+clXai9Kpr5j@#SrUpW>qHkJy#`Jvhkcb?fB->#wyQ;8CyRx`k;T0{v zY^xfiXKVV`3#Ae`T?gyzLy0*@b0@aBx-+eoS##Mo{G!X6JXsU&&M=ybg&ZqG!CXx~ z9_sl{N~AOyChhZ!q?IMcN>|Vk-fYQOcPWIRB*q-aVri3{eU_15%o%+(Dt*Tl^zERM z*~{@+r|4$I1x^|Tol%uUop?;vp@LN1_VQRM!tt48z0|lG_G3xIUhLEGC>~R>tYHPF zf&(>UZ)*=|xQSI2mWDiR4G!pkXV3&ed5yZRu`UZ$LjiBH^hkm4`L0n2=Y*GNhT9G= z(E`66qZ*1>Q*lefZLDh;#E^!!@V16`@UDhu;c3uuJfY$}DfzyN4^(`p;Uj!3Plpsd zUgK{4Nkva8ojS94Q)Jl}4JkPyYa!|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X71yf(dA#^@<~CC61*YENJzl+K-Q1D2e;3CVpmmenOm(hejoPy~s{gIFlGBZFE!a zRv7CzE&(g3z3`x_twz_GxP;3J7f(#Z(Ka&iJ)WER0Y93sWwj-%f~<SU(0HE0 zwuusUOgM79D+VuQRmP-=3S1KxF`9yBqKcO$d=Y`@LfkWP6PAe@_7tw207QN}j14=f z#rEpft}cWMW=V&Ojvs_8Q9;f&x+Ln;W=YK8h}F3cy&z+sVX(a2h?SvJ+m5;?&BBYW zZAV?J#54crZDfbUJ)@9oNBLmK_BZs)8kL%(*CL{sqd;nb=p&?u727GZAE`)|k{~0w zE*}=AOGRsUCb_OPfI`X1;&gsP`DO<89-H)PJLK&K83=&T=nw%UUbTaJa(4io?}7zJ}oSM6~8?b zub_U7T&_?`0Kmitk&Fy*71y}q_+gyaiSy6s;vca32aIR0(6yYqUPpHwJ@W0XBPHLy zI{I@Hzah=79CdutGx1MC{f?JdFFKO+XFfW3CKZnwaLQ zE6SqZpaG~7l4hD^K2Fl{D#h8{_z#leN*v+;lP3R9i9tFjJHbX6UQViT!9cD>)<9%& mn>~4lO)wc<6Bj(&%q*MKqL=y1wijHgV&KzAe%73gIpAM?S$XUL delta 118 zcmaDYvX@Ep)W2Q(7#J8#7zDT&m>GE48Ti;4_$OyF7ENYmQRLuZU}0coWKf^Hkx_jz zKdZ19gCYYHP#p*`0wGWqNU}}NXBSgv2a2%)c?>{#4j{<`X0tMIGH`)aa|1~x1|9%9 CVGJGs diff --git a/target/test-classes/com/example/demo/models/TestProfile.class b/target/test-classes/com/example/demo/models/TestProfile.class index 9784c6fab7bb901891089e7f31e965014474dc0a..57155895fade5a2730ed24c7c978ec10995dd5e5 100644 GIT binary patch literal 3302 zcmd5;+jA3D82@dWWH;$TOA4(^!yTm1mLOix6p^;JTnq&XR14m=>9*aPWJ`9##rs`R z5YZQ&93S+>H(t^zcobf^59e-yp$rdQ%gU;B_eCInS-|hUq-*=L0 ze|`QXfV=QP61QVW#&8l53<*F`+#!;|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q4-xXi7^WL{5K@V7A0(jT1R`J$g$G7pRYG|brwD48AO&`Y(jn}D4X{rqu>Tpk z-FOpw==OJ3%85tsrbq95CKT7PSCOEQY8;MRxM!w39#IG zJ$(h!sTdeZ3@%Y-inK0M?=g-tlm&M3ormmACwtRei_`cdWfYuEh`vRl@_*25oL{5a z8DfreYqrb~43-&-oG=+bypDSZHgFlI$i8D)26X@KEFV1qJAgr2pCP7M6q!%EFps|)qwI2xed)*$n;8<@=|%>Iv+bKl!l z&Si3Yl9lrmE9YsZ;uTiKBAM1wQJYUV-L7)x68tZbuT=g-9GM+>7b}Qq6IRYJ-}eW# z9S;h*H5^#O!M9LiF^y&T-558Uu*e&Py39JTSU1-Qw}}I=3C&4Cok*Y_VW_0YhuIXQ Yf_jrE!ytff$?3=9k=3<6vX%nZEj41DYi{F5IrmQQ}htjfW|z{0@F$e=TM4x_|m z2PTopTUmw07!(wer_>!cAyv=kjDU&=KzvCU^XiQCj%E)H8+rC HV&DM)5}Xc2 From 6af07dd5ae962b4acef2649e8f03c9195adc1a4e Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 27 Aug 2021 09:55:03 -0400 Subject: [PATCH 14/29] added messages iterable --- .idea/runConfigurations.xml | 10 ++++++++++ .../java/com/example/demo/repository/MessageRepo.java | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 .idea/runConfigurations.xml diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 000000000..797acea53 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java index d4c9bd8ef..742951540 100644 --- a/src/main/java/com/example/demo/repository/MessageRepo.java +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -7,4 +7,7 @@ @Repository public interface MessageRepo extends JpaRepository { + + Iterable getMessageByChannel_Id(Long id); + } From ab81bcc0196551450a9aa2e8f27d771a281aa30f Mon Sep 17 00:00:00 2001 From: ZachKitto Date: Fri, 27 Aug 2021 13:52:19 -0400 Subject: [PATCH 15/29] changed password encryption --- .../demo/controller/ProfileController.java | 9 ++-- .../example/demo/repository/ProfileRepo.java | 2 + .../example/demo/service/ProfileService.java | 19 +++++--- .../demo/services/TestProfileService.java | 46 ++++++++---------- .../demo/controller/ProfileController.class | Bin 3442 -> 3609 bytes .../com/example/demo/models/Channel.class | Bin 2189 -> 2099 bytes .../com/example/demo/models/Profile.class | Bin 3753 -> 3649 bytes .../example/demo/repository/ProfileRepo.class | Bin 591 -> 683 bytes .../example/demo/service/ProfileService.class | Bin 2667 -> 3091 bytes .../demo/services/TestProfileService.class | Bin 4098 -> 3983 bytes 10 files changed, 39 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index 33c185321..b84624126 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -31,8 +31,8 @@ public ResponseEntity> findAllProfiles() { return new ResponseEntity<>(service.findAllProfiles(), HttpStatus.OK); } - @GetMapping(value = "/login") - public ResponseEntity login(@RequestBody String username, @RequestBody String password) { + @GetMapping(value = "/login/{username}/{password}") + public ResponseEntity login(@PathVariable String username, @PathVariable String password) { return new ResponseEntity<>(service.login(username, password), HttpStatus.OK); } @@ -42,7 +42,8 @@ public ResponseEntity updateProfile(@RequestBody Profile profile) { } @DeleteMapping(value = "/delete/{id}") - public ResponseEntity deleteById(@PathVariable Long id) { - return new ResponseEntity<>(service.deleteProfileById(id), HttpStatus.OK); + public ResponseEntity deleteById(@PathVariable Long id) { + service.deleteProfileById(id); + return new ResponseEntity<>("Your Profile Has Been Deleted", HttpStatus.OK); } } diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java index c472e69f4..7b4b5d8b3 100644 --- a/src/main/java/com/example/demo/repository/ProfileRepo.java +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -7,4 +7,6 @@ @Repository public interface ProfileRepo extends JpaRepository { Profile findByUsernameAndPassword(String username, String password); + + Profile findByUsername(String username); } diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index 07c0e016a..c145e0896 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -12,7 +12,7 @@ public class ProfileService { @Autowired - PasswordEncoder passwordEncoder; + private PasswordEncoder passwordEncoder; @Autowired private ProfileRepo repository; @@ -29,7 +29,7 @@ public Profile createProfile(Profile profileData) { } public Profile findById(Long id) { - return repository.getById(id); + return repository.findById(id).get(); } public List findAllProfiles() { @@ -37,17 +37,22 @@ public List findAllProfiles() { } public Profile login(String username, String password) { - String encodedPassword = passwordEncoder.encode(password); - return repository.findByUsernameAndPassword(username, encodedPassword); + Profile profileToCheckPassword = repository.findByUsername(username); + if (verifyPassword(password, profileToCheckPassword)) { + return profileToCheckPassword; + } + return null; } public Profile update(Profile profileData) { return repository.save(profileData); } - public Profile deleteProfileById(Long id) { - Profile profileToDelete = findById(id); + public void deleteProfileById(Long id) { repository.deleteById(id); - return profileToDelete; + } + + private boolean verifyPassword(String password, Profile profile) { + return passwordEncoder.matches(password, profile.getPassword()); } } diff --git a/src/test/java/com/example/demo/services/TestProfileService.java b/src/test/java/com/example/demo/services/TestProfileService.java index e49be9076..a3de52991 100644 --- a/src/test/java/com/example/demo/services/TestProfileService.java +++ b/src/test/java/com/example/demo/services/TestProfileService.java @@ -1,29 +1,25 @@ package com.example.demo.services; -import com.example.demo.DemoApplication; -import com.example.demo.models.Channel; import com.example.demo.models.Profile; import com.example.demo.repository.ProfileRepo; import com.example.demo.service.ProfileService; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Bean; import org.springframework.security.core.parameters.P; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; @RunWith(MockitoJUnitRunner.class) public class TestProfileService { @@ -31,22 +27,20 @@ public class TestProfileService { @Mock ProfileRepo repository; - @Mock - PasswordEncoder passwordEncoder; - @InjectMocks ProfileService service; + @Mock + PasswordEncoder passwordEncoder; + @Test public void createProfileTest() { Profile expectedProfile = new Profile(); - expectedProfile.setUsername("test username"); - expectedProfile.setPassword(passwordEncoder.encode("test password")); - Mockito.when(repository.save(Mockito.any(Profile.class))).thenReturn(new Profile()); - Profile actualProfile = service.createProfile(expectedProfile); + service.createProfile(expectedProfile); + service.createProfile(expectedProfile); - Assert.assertEquals(expectedProfile.getFirstName(), actualProfile.getFirstName()); + Mockito.verify(repository, Mockito.times(2)).save(Mockito.any(Profile.class)); } @Test @@ -55,7 +49,7 @@ public void findByIdTest() { Profile expectedProfile = new Profile(); expectedProfile.setId(id); - Mockito.when(repository.getById(id)).thenReturn(expectedProfile); + Mockito.when(repository.findById(id)).thenReturn(Optional.of(expectedProfile)); Profile actualProfile = service.findById(id); Assert.assertEquals(expectedProfile.getId(), actualProfile.getId()); @@ -74,25 +68,25 @@ public void findAllProfilesTest() { @Test public void loginTest() { - Profile expectedProfile = new Profile(); + Profile profile = new Profile(); String username = "test username"; - String password = passwordEncoder.encode("test password"); - expectedProfile.setPassword(password); - expectedProfile.setUsername(username); + String password = "test password"; + profile.setUsername(username); profile.setPassword(password); - Mockito.when(repository.findByUsernameAndPassword(username, password)).thenReturn(expectedProfile); - Profile actualProfile = service.login(username, password); + Mockito.when(repository.findByUsername(username)).thenReturn(profile); + service.login(username, password); + service.login(username, password); - Assert.assertEquals(expectedProfile.getUsername(), actualProfile.getUsername()); + Mockito.verify(repository, Mockito.times(2)).findByUsername(username); } @Test public void updateTest() { Profile expectedProfile = new Profile(); expectedProfile.setUsername("test username"); - expectedProfile.setPassword(passwordEncoder.encode("test password")); + expectedProfile.setPassword("test password"); - Mockito.when(repository.save(Mockito.any(Profile.class))).thenReturn(new Profile()); + Mockito.when(repository.save(expectedProfile)).thenReturn(expectedProfile); Profile actualProfile = service.update(expectedProfile); Assert.assertEquals(expectedProfile.getFirstName(), actualProfile.getFirstName()); diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index 3356a417f2111c1263976c04aa32b30e32105060..88052853410c8f4e1d38983c386bb1cd99ebdc0a 100644 GIT binary patch delta 1114 zcmah|O-~b16g@Mg9cW)cN~b7-j0#Et9TgQ7L;rm;@yuo_ug~wxo>{gy{RAh_GjZWfU~f}sKN~m z0~M&mU>HLfuE0&C!cZ|H-CNQfmDZRP<5Jv~Vxk;(G~CrNxi-8JY^XOgxrN27xw2fa z^I7Yey=tyJw+e-qx%~X96A8^JqfRl@{8GpuAVLhozAO(?)(bH zo!6nSfjD$$Mr)tkhiVP?1P)?KLt5ZIrUl}7An*_~0<+RJF(=RgOW+Zv1Ri5vK|?yX zoHxeuxhIPm+ZeP8Mz3vWjea|0FWK`SzGxA(sGz1L<@b`xv6JK^4wHo{5~J`Co;pS= zL|sFzQL{P91U-{l#syo~p{&tRQA;Uk+(sPMrH7*>{NDE$xlakj!r`q(_~x6Xec<27K!J47qvz0 zJ<8V+dgo^QuyuRDCeg|QTd+wc8E#@*3AUY|J=haI>`4YGWabnCE=S!cqYuP3o$*Mb z&xdW?!B1>!S`Xp$E(m8>q=T$Pf_j6is+6$l6%nj-|ck~$fL2_r_tNqWp8_I zcZ4*`ccHg_M4;^x#3s~qEL!|`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$hO>~;NXPCO0fkyY9QI*`QJ5YEKC`8Mv#jM9>`DWSk<#TP&1sFHJHnffs=e{yZ9V?C^= z{tn~Ks(3W!~td@I=FlTXBu??@4WXF^&==~Y7--WsDs zezt^)Z=ei}`ih1W+jZ+eIQtw{Pv zzu7-Mz;CGh2TVgm!DRRBx>FW!@H1tU3(c^o-W^7xF&2G|=f^uOx1l)P(sz^`OsTd`VC*^*yK! z)ZBMsU;Sj$Xw&{=mTux((IJ3t(F}S^Krm_zJ^8RG40&1qGbL-W1*`bd2uOd<;{fo#{p_(*i9b$6ri|cBWfk zn(4r#ZjDjM)bBItv=quVihM@NcBXs`Q*i6|pm?7iP{L>1g;-Rtq+(0>)eh=454MF4 zY|2Rt|H|iAnTBPC8ngpg2of%1@=+{xs-1eNBlQYI9>-Is+NmFcdbtC&vUDr;7>zfm V$0F({D9clfG%EPcSKeJE`U5nS$6f#c diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index 13aee942615a98dc403cdbb4144e8591b08742a5..b9a5f5a5b433e8ed6635a2aad24cb000b30c58e0 100644 GIT binary patch literal 3649 zcmc(hZBrXn6vxlzaRbp(O3_e(LTQDx5CK6e6r~g@H9WLHv_8&~T*7ve-OTPr%ZKp0 z=!_X>eBlT1tzW~>;Pij)E}Lb≈UQzTiHdobx;Xd+%BP`1`ltiRgX$s*n0hZa(Mci!43Q(w7<~%$i06MI%*p0zE{Y>JBM zn#T>XZdtZxc&2T+8VyVHm!+0)T+{W0RTZV}8h$jX*mx`~;TWE%Rg6Ykz({vJp4ZR* z)gF-!&suDsT0c76(R*nSnHZ^=S!hC zh3gu1fn+XEyW{^x(vB)<_bd^@>P@57619gou58P(Ps|2{$*h`|>8)v$oSvzGcLOSD zbfs)sVz=Eq7S5r8OT!0cSB*x+a7>;Diz)Ba1nxvnG57s25aP$_$Vtna8JPzs|KF~J zXT9S4?an#T;fwj;f(AJa>mBq0yiJANytQX)L|oKj~f;R-nHwykG@6 z4o=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f96ce26babbf3b9f1b 100644 GIT binary patch delta 128 zcmX@lvYJ)+)W2Q(7#J8#7)00^1lbvc*cpT;0wG^oW?qU@WoU6~QC?zhDkFob#za@M zjY~=yJ(*Y-8CV!t85kMZfEqcO7}$Xn2Ll68n3I7ED$L3V7G`GP21+t9@G$U#X+8#i MAk79;B*4G`08euemH+?% delta 86 zcmZ3@dY(o2)W2Q(7#J8#7=+jv_}Li**ck*T3Qyelwv^F~k%f_gg@KiUk%0}Uf|H4X f9Y}EiF*5@vkYr-uV&DeTJPf=*nhmIskAVRIiXI7M diff --git a/target/classes/com/example/demo/service/ProfileService.class b/target/classes/com/example/demo/service/ProfileService.class index 4bae43a83dbb50ae6869ad2dbfc62d23358eb0ba..0504bc6fa530c1eb8f872b8e5564402571b437e8 100644 GIT binary patch delta 1406 zcmZux*-{fh6g@oy3?xlbEXKHl3JE(RxZwu43xcw!xG^M?5Ezn}3@C2n$_F@4{(}!v zT3YyE`Rt1y;xAa1_fDolqIu8-QM{`mhrhG+gvS!37SN zI9%p1%wdGX6%M0S*nu%dSN*t#aYhpyCOJ%TxX$4Q^KSYvjawXU`)~($8QtSBiJ)eJ&$;Ab#$1Od!FrsHC^jXuOY6U8m zvT@xq1Zv`jX;{Ws;ppJXMdH^*hv)TWz01_o$*$o{I@#YcB@kFPa;e11hU}qI+PGDo zOA*r#C06iAq8pDjJdt>cXA(AZp5ukY5Y9-v#4Cx{cq0&T)7a6qoqZU&dwV#tG}ht?vj-Z9Hn*CJ0wKue_3 z@d48$vltDoOy-STT3;le`wI6u3H5*z(Dqdmc~Q4wb4FgE<88$@M_21kO;d9_=tY6v zfx@1E{G(qLv^Ka|YJO9$l75rX6q}rk7K$``d_W>XSkewqjwo7a6=+2pX*W6VwHeXu zR98l9W;H;iIO?$&wWEXBl{k-1LJGQAMNpbWx^aL-2%n`@p|z&<6KdPmQLo@LwtR>3 zfszU~s%dbm2^Gl2duq^Q;~*(|@;$D6FZzhb^1Zah_4`!zMyu#`f{KvlT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%(V9mOytO z=5G_Q4-xXi7^WL{5K@V7A0(jT1R`J$g$G7pRYG|brwD48AO&`Y(jn}D4X{rqu>Tpk z-FOpw==OJ3%85tsrbq95CKT7PSCOEQY8;MRxM!w39#IG zJ$(h!sTdeZ3@%Y-inK0M?=g-tlm&M3ormmACwtRei_`cdWfYuEh`vRl@_*25oL{5a z8DfreYqrb~43-&-oG=+bypDSZHgFlI$i8D)26X@KEFV1qJAgr2pCP7M6q!%EFps|)qwI2xed)*$n;8<@=|%>Iv+bKl!l z&Si3Yl9lrmE9YsZ;uTiKBAM1wQJYUV-L7)x68tZbuT=g-9GM+>7b}Qq6IRYJ-}eW# z9S;h*H5^#O!M9LiF^y&T-558Uu*e&Py39JTSU1-Qw}}I=3C&4Cok*Y_VW_0YhuIXQ Yf_jrE!yt Date: Fri, 27 Aug 2021 16:46:32 -0400 Subject: [PATCH 16/29] Added Web Socket Configuration --- ...ot_spring_boot_starter_websocket_2_5_4.xml | 13 +++++++++ ...springframework_spring_messaging_5_3_9.xml | 13 +++++++++ ...springframework_spring_websocket_5_3_9.xml | 13 +++++++++ demo.iml | 3 +++ pom.xml | 5 +++- .../example/demo/WebsocketApplication.java | 27 +++++++++++++++++++ .../example/demo/config/WebSocketConfig.java | 24 +++++++++++++++++ .../demo/controller/SocketController.java | 17 ++++++++++++ .../com/example/demo/models/TestChannel.java | 1 + 9 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_messaging_5_3_9.xml create mode 100644 .idea/libraries/Maven__org_springframework_spring_websocket_5_3_9.xml create mode 100644 src/main/java/com/example/demo/WebsocketApplication.java create mode 100644 src/main/java/com/example/demo/config/WebSocketConfig.java create mode 100644 src/main/java/com/example/demo/controller/SocketController.java diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_5_4.xml new file mode 100644 index 000000000..3b4a88919 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_websocket_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_9.xml new file mode 100644 index 000000000..ea46c2cba --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_messaging_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_9.xml b/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_9.xml new file mode 100644 index 000000000..c3c39879d --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_spring_websocket_5_3_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index e164b4e83..1d1385e1c 100644 --- a/demo.iml +++ b/demo.iml @@ -60,6 +60,9 @@ + + + diff --git a/pom.xml b/pom.xml index df0fbc8ef..f0602ffd1 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,10 @@ org.springframework.boot spring-boot-starter-web - + + org.springframework.boot + spring-boot-starter-websocket + org.springframework.boot spring-boot-devtools diff --git a/src/main/java/com/example/demo/WebsocketApplication.java b/src/main/java/com/example/demo/WebsocketApplication.java new file mode 100644 index 000000000..845009345 --- /dev/null +++ b/src/main/java/com/example/demo/WebsocketApplication.java @@ -0,0 +1,27 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +@SpringBootApplication +public class WebsocketApplication { + + public static void main(String[] args) { + SpringApplication.run(WebsocketApplication.class, args); + } + + @Bean + public WebMvcConfigurer corsConfigurer() { + return new WebMvcConfigurer() { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**").allowCredentials(true).allowedOrigins("*").allowedMethods("*"); + } + }; + } +} + diff --git a/src/main/java/com/example/demo/config/WebSocketConfig.java b/src/main/java/com/example/demo/config/WebSocketConfig.java new file mode 100644 index 000000000..9efe38e77 --- /dev/null +++ b/src/main/java/com/example/demo/config/WebSocketConfig.java @@ -0,0 +1,24 @@ +package com.example.demo.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.messaging.simp.config.MessageBrokerRegistry; +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; +import org.springframework.web.socket.config.annotation.StompEndpointRegistry; +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; + +@Configuration +@EnableWebSocketMessageBroker +public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { + @Override + public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { + stompEndpointRegistry.addEndpoint("/websocket-chat") + .setAllowedOrigins("*") + .withSockJS(); + } + + @Override + public void configureMessageBroker(MessageBrokerRegistry registry) { + registry.enableSimpleBroker("/topic/"); + registry.setApplicationDestinationPrefixes("/app"); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/SocketController.java b/src/main/java/com/example/demo/controller/SocketController.java new file mode 100644 index 000000000..a608632ed --- /dev/null +++ b/src/main/java/com/example/demo/controller/SocketController.java @@ -0,0 +1,17 @@ +package com.example.demo.controller; + +import org.springframework.messaging.Message; +import org.springframework.messaging.handler.annotation.MessageMapping; +import org.springframework.messaging.handler.annotation.Payload; +import org.springframework.messaging.handler.annotation.SendTo; +import org.springframework.stereotype.Controller; + +@Controller +public class SocketController { + + @MessageMapping("/profile-all") + @SendTo("/topic/profile") + public Message send(@Payload Message message) { + return message; + } +} \ No newline at end of file diff --git a/src/test/java/com/example/demo/models/TestChannel.java b/src/test/java/com/example/demo/models/TestChannel.java index fe39d01ec..43300ee9b 100644 --- a/src/test/java/com/example/demo/models/TestChannel.java +++ b/src/test/java/com/example/demo/models/TestChannel.java @@ -1,4 +1,5 @@ package com.example.demo.models; public class TestChannel { + } From 3e43f56517052911072d8a152e4ebf27c2870ce5 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 28 Aug 2021 14:04:34 -0400 Subject: [PATCH 17/29] Working on Postmen connections --- .../example/demo/config/WebSocketConfig.java | 2 +- .../java/com/example/demo/dto/MessageDTO.java | 14 ++++++++++++++ .../java/com/example/demo/models/Message.java | 4 ++-- src/main/resources/application.properties | 2 +- target/classes/application.properties | 2 +- .../example/demo/WebsocketApplication$1.class | Bin 0 -> 1577 bytes .../example/demo/WebsocketApplication.class | Bin 0 -> 1094 bytes .../example/demo/config/WebSocketConfig.class | Bin 0 -> 2047 bytes .../demo/controller/SocketController.class | Bin 0 -> 966 bytes .../com/example/demo/dto/MessageDTO.class | Bin 0 -> 586 bytes .../com/example/demo/models/Message.class | Bin 2170 -> 2069 bytes .../example/demo/repository/MessageRepo.class | Bin 425 -> 618 bytes 12 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/example/demo/dto/MessageDTO.java create mode 100644 target/classes/com/example/demo/WebsocketApplication$1.class create mode 100644 target/classes/com/example/demo/WebsocketApplication.class create mode 100644 target/classes/com/example/demo/config/WebSocketConfig.class create mode 100644 target/classes/com/example/demo/controller/SocketController.class create mode 100644 target/classes/com/example/demo/dto/MessageDTO.class diff --git a/src/main/java/com/example/demo/config/WebSocketConfig.java b/src/main/java/com/example/demo/config/WebSocketConfig.java index 9efe38e77..030b6e68b 100644 --- a/src/main/java/com/example/demo/config/WebSocketConfig.java +++ b/src/main/java/com/example/demo/config/WebSocketConfig.java @@ -11,7 +11,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { - stompEndpointRegistry.addEndpoint("/websocket-chat") + stompEndpointRegistry.addEndpoint("/chat") .setAllowedOrigins("*") .withSockJS(); } diff --git a/src/main/java/com/example/demo/dto/MessageDTO.java b/src/main/java/com/example/demo/dto/MessageDTO.java new file mode 100644 index 000000000..79e513e1c --- /dev/null +++ b/src/main/java/com/example/demo/dto/MessageDTO.java @@ -0,0 +1,14 @@ +package com.example.demo.dto; + +public class MessageDTO { + + private String message; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index aeb5834cb..a4076b5bf 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -15,13 +15,13 @@ public class Message { Long id; @ManyToOne @JoinColumn(name = "profile_id") - @JsonIgnoreProperties("messages") + // @JsonIgnoreProperties("messages") Profile profile; String body; Date timestamp; @ManyToOne @JoinColumn(name = "channel_id") - @JsonIgnoreProperties("messages") + // @JsonIgnoreProperties("messages") Channel channel; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 532817cf8..94980e58a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true diff --git a/target/classes/application.properties b/target/classes/application.properties index 532817cf8..94980e58a 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,5 +1,5 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true diff --git a/target/classes/com/example/demo/WebsocketApplication$1.class b/target/classes/com/example/demo/WebsocketApplication$1.class new file mode 100644 index 0000000000000000000000000000000000000000..0383987a45a90e655a3842face4c513406133acc GIT binary patch literal 1577 zcmcIkTTc@~6#j-5wk!*+RZ;LRi)@Rs;9W|H*oZMHV#I)`FVo$jENpk0*#-2?zvP3M znCK7iM;XtQB9-`1P`ByKnaMfdcdqmO$CqyaZeykwCa#$1!_^E%OxPGTaSdYzoD2$D zEb3+4z;y#R3`{WeBEJXv?eJ6>;u!u3U6x+|g@OK(#obB#tAcsvPYR3ej^ zAPSOMhN9DQg?h=WA>HIF(&OPWSAjmaF4NjA2J2}Q2~`ex z91A)YI^(ma$jjVI)JA3qC+WUjbNln*kIEGhF<#6gt$8oofVt*=+k@dqUR81a+ za;L0>FQO#iA&tlr=k-7GaG(h;{6!Vif{373oj3n29s6W^qY>jWy^MXJ7X>Vr(*r^e zW*7al$kBd+q*>bajaeN3MC0%oT_2k|d0KnO5;#deU~o?hr%2MD*+gSFLvlAm|A!nY zpT$rM_AR=b2KIP9wTpCm7v1Tv=vhtWjip^=+T`Aq146TDGl&s_Js`Dzk=hu>IpS%N c4ik3@=V|T21ze;(jY|~sX_8D*Gij&qC->sXod5s; literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/WebsocketApplication.class b/target/classes/com/example/demo/WebsocketApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..463f80fd04061f92936fa1f4924eba70d885c550 GIT binary patch literal 1094 zcma)5T~8B16g@**7M2P~6|LVWXlbGwqw%GN1e%bT6gAY87@uahLmAkeX=bOu&(bH2 zCjJ0_l=05e+I`rEZZdm!?wot>nS1a4`TO%XfY*5HV;*-s-1BiC4?H~dQN|+=8w}NV zN(s}Bd76rpVg9XD((W*n8rwaFa$ENW!%9ag@qUzq!hGUkOrEulj(FVTM!NmjS+*yV zIG%MPodn{NC&O3-eUa$kNQ9}5&V=0^4r3W{E46A7eZr+;SZ{pkobq!X#9R%6t~F8( zT3LE-21HmZIA&Nq5cWj(KXStpVTB>!a->b#*6LUeMn)Kh{l<1jn?aBc9p|w_UTAX` zT!=78g*lIf4WbMmaHX`(ggLbb=h2jhl-3VN%F0CaWGd;xyZ^zI^?6|mqP61E=6Ux7 zcenPtdSoK8FI^$)MWuP+s==^RNE~WStRt(hgwsWXZg#yrI>^_ziUlk(Y|YdS509&O zf=z1QO!&>0j(&^UFzwuj@Ki*Wp;=V&O!k$~oJblpGold)8@UO{rmX>-%(B7lv6QWF(o`3P@9+Ut8 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/WebSocketConfig.class b/target/classes/com/example/demo/config/WebSocketConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..ec0ecdd6e8afec7b6a572636782398dd49a78125 GIT binary patch literal 2047 zcmb_dYf}?36g?>|TiXhXh%c(*vw#}kucC;k<7gFi9T>(>+ifU;?q(;O3j8d;=;)08 z0DqL@-EFr}rsG)jOOl&S&bjA4vOj-)`vKr4=5pANa~95LaUqY3C}lC3#}uZc;Zhct zbGQPY#nouOX5qSp8y0Rd49-YjnuiPnrO8Ex^t`GGhT)3z#p|Y575cqXZP3n0MY&F6 z(a|!p+nZ^#Dno|JimN;>HXSc$2woGO;;!;nWSuXGs;%60Vdi7I%rK@!U4}+z+bA!1 z>em7#eM2BGOBJQ-JPfq->nqyv#D>!Ad_z=u7(*nOj_)hu7^!^Th4C&1)?4LB$Kh}% zeDaCm`TrteIPglCRaJZAM81+B(lFMN-PGch2t%hX9&5EOG{ckL;=K42>E)sHf<$1~ z-Nf}+Rkjs8y~QxsQ%FC63^`jhwJV;7%7`Ju z-Brg}xK+Sy++ko-7VZ{s4|fW<4|2ugMg`L47G?@~0BVFZcY>gRSv+F6_?Ly<#l28n z6Ru%++jl+pmX|~?Dx_z9WA^M3hP+d&CEdrcR{Buc9lY{n|5=L3Iw}(Ub`2-lxA&&u zkFX2}Lt*9`4YeU^3tHBtPX(IWkY+V{fL_=PuSBh-;B0?kmc=<+)6}c%WXp8^K-_@IK2e!(X zK!N^I3`6w88lah4md1l*ahe&;nW-;epJ!6&(M4p_zhoGX@&p* literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/controller/SocketController.class b/target/classes/com/example/demo/controller/SocketController.class new file mode 100644 index 0000000000000000000000000000000000000000..8d0b3e9525df5e9a7b5159b1175d083fd701633c GIT binary patch literal 966 zcmb7CO>Yx15PeRQEQGX43oW#KNN}O0rM@5}C_<_#aY`T}RW6*I-D%?1Yp=Xcq5ld_ zNF4Y9{3yiirVSJ!(X6!N`Fb<+?D_HY+jjuZ@SuSO+>LNA!hM1ID{XanEwHe;H4vyC zxP$~+9c}6DBps4JR71m_m5z&*87Qv{``lR#W1S1^c4C)G`lQm#kW46bGIln2XAF7S zcku~@gPCKGyX0gOf!=1v`H{>sukGl_tCT)EeAew@C;Kx_S zw7V3>F6pUaf&?Tr=H$Yh6%5JIk^C{}di8n-sj&40OSxtFnw~@deaQ zm6`C6O__Ojqzye)#t6KazjU8(^3ZX~B^g|%dZKmaLY#D zO?*smcz%J^zu$THSe+_??SFR2`JTyzvy9{)o6$rSHG!RZ)=8jUG?GT~!n_+EQylOR z72fgUtAMu+HI{X@B%gxM+LNykU&?UAvR*nHxW;;OntmjJ`#KJrs1OT1Y!c=zO9g^z#nCt zEhP9s;$_~IXG}?bhl*8Ik$a&)3@{~tHij?&2 zak5NZaUCe5)s5__y0;7q#WD&o8BYH3N!vG1G@31hE779IH0W^|G_`~>opRbqu|$zX7b{$1+OzehNiAkYPiHO&NYD zVXK6P3OT>6FthXC`^9qu&ve|K&~!Ew7GL#E?00q3kNo{WKQbnaz1R;;q_AMkKe&gw z7x_`FO-sAa+B|e6W8^~2EvmFNgt`V=s z>(W;__4-!QTYQN|F`DWE!NiANzs(n4wax)H?8t(ZT2Fw-Xau zms4x&wYcdUKi*Qv*H)T@*k-H>(>uP=FZ$hm-D`L(kYI%^FKBu_U*6M?PJH0AVv|$0 ztE0&42x7A~5|{0Q6Z1TBAWcN_Wf-{-&+O{>AZ)+%dQ54|o>3@tbo`7NovW>kXr!%I zh?33uPk=L9D~<(1t1_Hvfk_G_fJS4*R{9eqy`7l2+`tTv>&x&ELm&@n_!L_-LboOIWJl z6s9Ve!E6N!I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alx87j>Xod-7U5LYy7PJ^%1zX`o-!FK-ia+@iI7}D zouiPnI43IqK<+mlBr1#g@Ls0ERjj27cQ{MtqE4Zx@ znWLPx$Z2~FC+TEE*O5L+{S17GuQE6lMmaso= OZ}j-B{&b~vwt%bK*Ty z7#Y+we6kYD67_Qu^V0Qw^7GQIHIW27OHzvxlX6n685sn8Q%f@PQvwo;5_405!o`dX zOqoCfID<3O^Abx+i&7aGJb{KO5jJgNmJ*Yl^+x$@Mk_`ZMg|rJRt6>pHlUkX85!7t f6bBG9F>o?4Ls?u5++YzN23{b|#=ywH$G`vpx;{8K delta 72 zcmaFGvXWW;)W2Q(7#J8#7 Date: Sat, 28 Aug 2021 16:30:44 -0400 Subject: [PATCH 18/29] WebSockets confirmed --- node_modules/.bin/loose-envify | 1 - node_modules/js-tokens/CHANGELOG.md | 151 - node_modules/js-tokens/LICENSE | 21 - node_modules/js-tokens/README.md | 240 -- node_modules/js-tokens/index.js | 23 - node_modules/js-tokens/package.json | 64 - node_modules/loose-envify/LICENSE | 21 - node_modules/loose-envify/README.md | 45 - node_modules/loose-envify/cli.js | 16 - node_modules/loose-envify/custom.js | 4 - node_modules/loose-envify/index.js | 3 - node_modules/loose-envify/loose-envify.js | 36 - node_modules/loose-envify/package.json | 67 - node_modules/loose-envify/replace.js | 65 - node_modules/object-assign/index.js | 90 - node_modules/object-assign/license | 21 - node_modules/object-assign/package.json | 74 - node_modules/object-assign/readme.md | 61 - node_modules/react/LICENSE | 21 - node_modules/react/README.md | 13 - node_modules/react/build-info.json | 8 - .../cjs/react-jsx-dev-runtime.development.js | 1203 ------ .../react-jsx-dev-runtime.production.min.js | 9 - .../react-jsx-dev-runtime.profiling.min.js | 9 - .../cjs/react-jsx-runtime.development.js | 1221 ------ .../cjs/react-jsx-runtime.production.min.js | 10 - .../cjs/react-jsx-runtime.profiling.min.js | 10 - node_modules/react/cjs/react.development.js | 2333 ------------ .../react/cjs/react.production.min.js | 23 - node_modules/react/index.js | 7 - node_modules/react/jsx-dev-runtime.js | 7 - node_modules/react/jsx-runtime.js | 7 - node_modules/react/package.json | 67 - node_modules/react/umd/react.development.js | 3357 ----------------- .../react/umd/react.production.min.js | 31 - node_modules/react/umd/react.profiling.min.js | 36 - .../example/demo/WebsocketApplication.java | 2 +- .../example/demo/config/WebSocketConfig.java | 2 +- .../java/com/example/demo/dto/MessageDTO.java | 14 - .../java/com/example/demo/models/Message.java | 8 +- .../java/com/example/demo/models/Profile.java | 1 + .../example/demo/service/MessageService.java | 4 + .../example/demo/WebsocketApplication$1.class | Bin 1577 -> 1584 bytes .../example/demo/config/WebSocketConfig.class | Bin 2047 -> 2067 bytes .../com/example/demo/dto/MessageDTO.class | Bin 586 -> 0 bytes .../com/example/demo/models/Message.class | Bin 2069 -> 2009 bytes .../com/example/demo/models/Profile.class | Bin 3649 -> 3701 bytes .../example/demo/service/MessageService.class | Bin 2245 -> 2483 bytes 48 files changed, 11 insertions(+), 9395 deletions(-) delete mode 120000 node_modules/.bin/loose-envify delete mode 100644 node_modules/js-tokens/CHANGELOG.md delete mode 100644 node_modules/js-tokens/LICENSE delete mode 100644 node_modules/js-tokens/README.md delete mode 100644 node_modules/js-tokens/index.js delete mode 100644 node_modules/js-tokens/package.json delete mode 100644 node_modules/loose-envify/LICENSE delete mode 100644 node_modules/loose-envify/README.md delete mode 100755 node_modules/loose-envify/cli.js delete mode 100644 node_modules/loose-envify/custom.js delete mode 100644 node_modules/loose-envify/index.js delete mode 100644 node_modules/loose-envify/loose-envify.js delete mode 100644 node_modules/loose-envify/package.json delete mode 100644 node_modules/loose-envify/replace.js delete mode 100644 node_modules/object-assign/index.js delete mode 100644 node_modules/object-assign/license delete mode 100644 node_modules/object-assign/package.json delete mode 100644 node_modules/object-assign/readme.md delete mode 100644 node_modules/react/LICENSE delete mode 100644 node_modules/react/README.md delete mode 100644 node_modules/react/build-info.json delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.min.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.production.min.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.min.js delete mode 100644 node_modules/react/cjs/react.development.js delete mode 100644 node_modules/react/cjs/react.production.min.js delete mode 100644 node_modules/react/index.js delete mode 100644 node_modules/react/jsx-dev-runtime.js delete mode 100644 node_modules/react/jsx-runtime.js delete mode 100644 node_modules/react/package.json delete mode 100644 node_modules/react/umd/react.development.js delete mode 100644 node_modules/react/umd/react.production.min.js delete mode 100644 node_modules/react/umd/react.profiling.min.js delete mode 100644 src/main/java/com/example/demo/dto/MessageDTO.java delete mode 100644 target/classes/com/example/demo/dto/MessageDTO.class diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify deleted file mode 120000 index ed9009c5a..000000000 --- a/node_modules/.bin/loose-envify +++ /dev/null @@ -1 +0,0 @@ -../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md deleted file mode 100644 index 755e6f6ec..000000000 --- a/node_modules/js-tokens/CHANGELOG.md +++ /dev/null @@ -1,151 +0,0 @@ -### Version 4.0.0 (2018-01-28) ### - -- Added: Support for ES2018. The only change needed was recognizing the `s` - regex flag. -- Changed: _All_ tokens returned by the `matchToToken` function now have a - `closed` property. It is set to `undefined` for the tokens where “closed” - doesn’t make sense. This means that all tokens objects have the same shape, - which might improve performance. - -These are the breaking changes: - -- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but - `['/a/s']`. (There are of course other variations of this.) -- Code that rely on some token objects not having the `closed` property could - now behave differently. - - -### Version 3.0.2 (2017-06-28) ### - -- No code changes. Just updates to the readme. - - -### Version 3.0.1 (2017-01-30) ### - -- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched - correctly. - - -### Version 3.0.0 (2017-01-11) ### - -This release contains one breaking change, that should [improve performance in -V8][v8-perf]: - -> So how can you, as a JavaScript developer, ensure that your RegExps are fast? -> If you are not interested in hooking into RegExp internals, make sure that -> neither the RegExp instance, nor its prototype is modified in order to get the -> best performance: -> -> ```js -> var re = /./g; -> re.exec(''); // Fast path. -> re.new_property = 'slow'; -> ``` - -This module used to export a single regex, with `.matchToToken` bolted -on, just like in the above example. This release changes the exports of -the module to avoid this issue. - -Before: - -```js -import jsTokens from "js-tokens" -// or: -var jsTokens = require("js-tokens") -var matchToToken = jsTokens.matchToToken -``` - -After: - -```js -import jsTokens, {matchToToken} from "js-tokens" -// or: -var jsTokens = require("js-tokens").default -var matchToToken = require("js-tokens").matchToToken -``` - -[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html - - -### Version 2.0.0 (2016-06-19) ### - -- Added: Support for ES2016. In other words, support for the `**` exponentiation - operator. - -These are the breaking changes: - -- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. -- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. - - -### Version 1.0.3 (2016-03-27) ### - -- Improved: Made the regex ever so slightly smaller. -- Updated: The readme. - - -### Version 1.0.2 (2015-10-18) ### - -- Improved: Limited npm package contents for a smaller download. Thanks to - @zertosh! - - -### Version 1.0.1 (2015-06-20) ### - -- Fixed: Declared an undeclared variable. - - -### Version 1.0.0 (2015-02-26) ### - -- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That - type is now equivalent to the Punctuator token in the ECMAScript - specification. (Backwards-incompatible change.) -- Fixed: A `-` followed by a number is now correctly matched as a punctuator - followed by a number. It used to be matched as just a number, but there is no - such thing as negative number literals. (Possibly backwards-incompatible - change.) - - -### Version 0.4.1 (2015-02-21) ### - -- Added: Support for the regex `u` flag. - - -### Version 0.4.0 (2015-02-21) ### - -- Improved: `jsTokens.matchToToken` performance. -- Added: Support for octal and binary number literals. -- Added: Support for template strings. - - -### Version 0.3.1 (2015-01-06) ### - -- Fixed: Support for unicode spaces. They used to be allowed in names (which is - very confusing), and some unicode newlines were wrongly allowed in strings and - regexes. - - -### Version 0.3.0 (2014-12-19) ### - -- Changed: The `jsTokens.names` array has been replaced with the - `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no - longer part of the public API; instead use said function. See this [gist] for - an example. (Backwards-incompatible change.) -- Changed: The empty string is now considered an “invalid” token, instead an - “empty” token (its own group). (Backwards-incompatible change.) -- Removed: component support. (Backwards-incompatible change.) - -[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 - - -### Version 0.2.0 (2014-06-19) ### - -- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own - category (“functionArrow”), for simplicity. (Backwards-incompatible change.) -- Added: ES6 splats (`...`) are now matched as an operator (instead of three - punctuations). (Backwards-incompatible change.) - - -### Version 0.1.0 (2014-03-08) ### - -- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE deleted file mode 100644 index 54aef52f3..000000000 --- a/node_modules/js-tokens/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/js-tokens/README.md b/node_modules/js-tokens/README.md deleted file mode 100644 index 00cdf1634..000000000 --- a/node_modules/js-tokens/README.md +++ /dev/null @@ -1,240 +0,0 @@ -Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) -======== - -A regex that tokenizes JavaScript. - -```js -var jsTokens = require("js-tokens").default - -var jsString = "var foo=opts.foo;\n..." - -jsString.match(jsTokens) -// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] -``` - - -Installation -============ - -`npm install js-tokens` - -```js -import jsTokens from "js-tokens" -// or: -var jsTokens = require("js-tokens").default -``` - - -Usage -===== - -### `jsTokens` ### - -A regex with the `g` flag that matches JavaScript tokens. - -The regex _always_ matches, even invalid JavaScript and the empty string. - -The next match is always directly after the previous. - -### `var token = matchToToken(match)` ### - -```js -import {matchToToken} from "js-tokens" -// or: -var matchToToken = require("js-tokens").matchToToken -``` - -Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: -String, value: String}` object. The following types are available: - -- string -- comment -- regex -- number -- name -- punctuator -- whitespace -- invalid - -Multi-line comments and strings also have a `closed` property indicating if the -token was closed or not (see below). - -Comments and strings both come in several flavors. To distinguish them, check if -the token starts with `//`, `/*`, `'`, `"` or `` ` ``. - -Names are ECMAScript IdentifierNames, that is, including both identifiers and -keywords. You may use [is-keyword-js] to tell them apart. - -Whitespace includes both line terminators and other whitespace. - -[is-keyword-js]: https://github.com/crissdev/is-keyword-js - - -ECMAScript support -================== - -The intention is to always support the latest ECMAScript version whose feature -set has been finalized. - -If adding support for a newer version requires changes, a new version with a -major verion bump will be released. - -Currently, ECMAScript 2018 is supported. - - -Invalid code handling -===================== - -Unterminated strings are still matched as strings. JavaScript strings cannot -contain (unescaped) newlines, so unterminated strings simply end at the end of -the line. Unterminated template strings can contain unescaped newlines, though, -so they go on to the end of input. - -Unterminated multi-line comments are also still matched as comments. They -simply go on to the end of the input. - -Unterminated regex literals are likely matched as division and whatever is -inside the regex. - -Invalid ASCII characters have their own capturing group. - -Invalid non-ASCII characters are treated as names, to simplify the matching of -names (except unicode spaces which are treated as whitespace). Note: See also -the [ES2018](#es2018) section. - -Regex literals may contain invalid regex syntax. They are still matched as -regex literals. They may also contain repeated regex flags, to keep the regex -simple. - -Strings may contain invalid escape sequences. - - -Limitations -=========== - -Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be -perfect. But that’s not the point either. - -You may compare jsTokens with [esprima] by using `esprima-compare.js`. -See `npm run esprima-compare`! - -[esprima]: http://esprima.org/ - -### Template string interpolation ### - -Template strings are matched as single tokens, from the starting `` ` `` to the -ending `` ` ``, including interpolations (whose tokens are not matched -individually). - -Matching template string interpolations requires recursive balancing of `{` and -`}`—something that JavaScript regexes cannot do. Only one level of nesting is -supported. - -### Division and regex literals collision ### - -Consider this example: - -```js -var g = 9.82 -var number = bar / 2/g - -var regex = / 2/g -``` - -A human can easily understand that in the `number` line we’re dealing with -division, and in the `regex` line we’re dealing with a regex literal. How come? -Because humans can look at the whole code to put the `/` characters in context. -A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also -look backwards. See the [ES2018](#es2018) section). - -When the `jsTokens` regex scans throught the above, it will see the following -at the end of both the `number` and `regex` rows: - -```js -/ 2/g -``` - -It is then impossible to know if that is a regex literal, or part of an -expression dealing with division. - -Here is a similar case: - -```js -foo /= 2/g -foo(/= 2/g) -``` - -The first line divides the `foo` variable with `2/g`. The second line calls the -`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only -sees forwards, it cannot tell the two cases apart. - -There are some cases where we _can_ tell division and regex literals apart, -though. - -First off, we have the simple cases where there’s only one slash in the line: - -```js -var foo = 2/g -foo /= 2 -``` - -Regex literals cannot contain newlines, so the above cases are correctly -identified as division. Things are only problematic when there are more than -one non-comment slash in a single line. - -Secondly, not every character is a valid regex flag. - -```js -var number = bar / 2/e -``` - -The above example is also correctly identified as division, because `e` is not a -valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` -(any letter) as flags, but it is not worth it since it increases the amount of -ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are -allowed. This means that the above example will be identified as division as -long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 -characters long. - -Lastly, we can look _forward_ for information. - -- If the token following what looks like a regex literal is not valid after a - regex literal, but is valid in a division expression, then the regex literal - is treated as division instead. For example, a flagless regex cannot be - followed by a string, number or name, but all of those three can be the - denominator of a division. -- Generally, if what looks like a regex literal is followed by an operator, the - regex literal is treated as division instead. This is because regexes are - seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division - could likely be part of such an expression. - -Please consult the regex source and the test cases for precise information on -when regex or division is matched (should you need to know). In short, you -could sum it up as: - -If the end of a statement looks like a regex literal (even if it isn’t), it -will be treated as one. Otherwise it should work as expected (if you write sane -code). - -### ES2018 ### - -ES2018 added some nice regex improvements to the language. - -- [Unicode property escapes] should allow telling names and invalid non-ASCII - characters apart without blowing up the regex size. -- [Lookbehind assertions] should allow matching telling division and regex - literals apart in more cases. -- [Named capture groups] might simplify some things. - -These things would be nice to do, but are not critical. They probably have to -wait until the oldest maintained Node.js LTS release supports those features. - -[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html -[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html -[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html - - -License -======= - -[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js deleted file mode 100644 index b23a4a0e7..000000000 --- a/node_modules/js-tokens/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell -// License: MIT. (See LICENSE.) - -Object.defineProperty(exports, "__esModule", { - value: true -}) - -// This regex comes from regex.coffee, and is inserted here by generate-index.js -// (run `npm run build`). -exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g - -exports.matchToToken = function(match) { - var token = {type: "invalid", value: match[0], closed: undefined} - if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) - else if (match[ 5]) token.type = "comment" - else if (match[ 6]) token.type = "comment", token.closed = !!match[7] - else if (match[ 8]) token.type = "regex" - else if (match[ 9]) token.type = "number" - else if (match[10]) token.type = "name" - else if (match[11]) token.type = "punctuator" - else if (match[12]) token.type = "whitespace" - return token -} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json deleted file mode 100644 index a518c5abf..000000000 --- a/node_modules/js-tokens/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "js-tokens@^3.0.0 || ^4.0.0", - "_id": "js-tokens@4.0.0", - "_inBundle": false, - "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "_location": "/js-tokens", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "js-tokens@^3.0.0 || ^4.0.0", - "name": "js-tokens", - "escapedName": "js-tokens", - "rawSpec": "^3.0.0 || ^4.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0 || ^4.0.0" - }, - "_requiredBy": [ - "/loose-envify" - ], - "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499", - "_spec": "js-tokens@^3.0.0 || ^4.0.0", - "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/loose-envify", - "author": { - "name": "Simon Lydell" - }, - "bugs": { - "url": "https://github.com/lydell/js-tokens/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A regex that tokenizes JavaScript.", - "devDependencies": { - "coffeescript": "2.1.1", - "esprima": "4.0.0", - "everything.js": "1.0.3", - "mocha": "5.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/lydell/js-tokens#readme", - "keywords": [ - "JavaScript", - "js", - "token", - "tokenize", - "regex" - ], - "license": "MIT", - "name": "js-tokens", - "repository": { - "type": "git", - "url": "git+https://github.com/lydell/js-tokens.git" - }, - "scripts": { - "build": "node generate-index.js", - "dev": "npm run build && npm test", - "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", - "test": "mocha --ui tdd" - }, - "version": "4.0.0" -} diff --git a/node_modules/loose-envify/LICENSE b/node_modules/loose-envify/LICENSE deleted file mode 100644 index fbafb4875..000000000 --- a/node_modules/loose-envify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Andres Suarez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/loose-envify/README.md b/node_modules/loose-envify/README.md deleted file mode 100644 index 7f4e07b00..000000000 --- a/node_modules/loose-envify/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# loose-envify - -[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) - -Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. - -## Gotchas - -* Doesn't handle broken syntax. -* Doesn't look inside embedded expressions in template strings. - - **this won't work:** - ```js - console.log(`the current env is ${process.env.NODE_ENV}`); - ``` -* Doesn't replace oddly-spaced or oddly-commented expressions. - - **this won't work:** - ```js - console.log(process./*won't*/env./*work*/NODE_ENV); - ``` - -## Usage/Options - -loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. - -## Benchmark - -``` -envify: - - $ for i in {1..5}; do node bench/bench.js 'envify'; done - 708ms - 727ms - 791ms - 719ms - 720ms - -loose-envify: - - $ for i in {1..5}; do node bench/bench.js '../'; done - 51ms - 52ms - 52ms - 52ms - 52ms -``` diff --git a/node_modules/loose-envify/cli.js b/node_modules/loose-envify/cli.js deleted file mode 100755 index c0b63cb1d..000000000 --- a/node_modules/loose-envify/cli.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var looseEnvify = require('./'); -var fs = require('fs'); - -if (process.argv[2]) { - fs.createReadStream(process.argv[2], {encoding: 'utf8'}) - .pipe(looseEnvify(process.argv[2])) - .pipe(process.stdout); -} else { - process.stdin.resume() - process.stdin - .pipe(looseEnvify(__filename)) - .pipe(process.stdout); -} diff --git a/node_modules/loose-envify/custom.js b/node_modules/loose-envify/custom.js deleted file mode 100644 index 6389bfac5..000000000 --- a/node_modules/loose-envify/custom.js +++ /dev/null @@ -1,4 +0,0 @@ -// envify compatibility -'use strict'; - -module.exports = require('./loose-envify'); diff --git a/node_modules/loose-envify/index.js b/node_modules/loose-envify/index.js deleted file mode 100644 index 8cd8305dd..000000000 --- a/node_modules/loose-envify/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./loose-envify')(process.env); diff --git a/node_modules/loose-envify/loose-envify.js b/node_modules/loose-envify/loose-envify.js deleted file mode 100644 index b5a5be220..000000000 --- a/node_modules/loose-envify/loose-envify.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -var stream = require('stream'); -var util = require('util'); -var replace = require('./replace'); - -var jsonExtRe = /\.json$/; - -module.exports = function(rootEnv) { - rootEnv = rootEnv || process.env; - return function (file, trOpts) { - if (jsonExtRe.test(file)) { - return stream.PassThrough(); - } - var envs = trOpts ? [rootEnv, trOpts] : [rootEnv]; - return new LooseEnvify(envs); - }; -}; - -function LooseEnvify(envs) { - stream.Transform.call(this); - this._data = ''; - this._envs = envs; -} -util.inherits(LooseEnvify, stream.Transform); - -LooseEnvify.prototype._transform = function(buf, enc, cb) { - this._data += buf; - cb(); -}; - -LooseEnvify.prototype._flush = function(cb) { - var replaced = replace(this._data, this._envs); - this.push(replaced); - cb(); -}; diff --git a/node_modules/loose-envify/package.json b/node_modules/loose-envify/package.json deleted file mode 100644 index b57fbf394..000000000 --- a/node_modules/loose-envify/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "loose-envify@^1.1.0", - "_id": "loose-envify@1.4.0", - "_inBundle": false, - "_integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "_location": "/loose-envify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "loose-envify@^1.1.0", - "name": "loose-envify", - "escapedName": "loose-envify", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/react" - ], - "_resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "_shasum": "71ee51fa7be4caec1a63839f7e682d8132d30caf", - "_spec": "loose-envify@^1.1.0", - "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/react", - "author": { - "name": "Andres Suarez", - "email": "zertosh@gmail.com" - }, - "bin": { - "loose-envify": "cli.js" - }, - "bugs": { - "url": "https://github.com/zertosh/loose-envify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "deprecated": false, - "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST", - "devDependencies": { - "browserify": "^13.1.1", - "envify": "^3.4.0", - "tap": "^8.0.0" - }, - "homepage": "https://github.com/zertosh/loose-envify", - "keywords": [ - "environment", - "variables", - "browserify", - "browserify-transform", - "transform", - "source", - "configuration" - ], - "license": "MIT", - "main": "index.js", - "name": "loose-envify", - "repository": { - "type": "git", - "url": "git://github.com/zertosh/loose-envify.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.4.0" -} diff --git a/node_modules/loose-envify/replace.js b/node_modules/loose-envify/replace.js deleted file mode 100644 index ec15e81c2..000000000 --- a/node_modules/loose-envify/replace.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -var jsTokens = require('js-tokens').default; - -var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/; -var spaceOrCommentRe = /^(?:\s|\/[/*])/; - -function replace(src, envs) { - if (!processEnvRe.test(src)) { - return src; - } - - var out = []; - var purge = envs.some(function(env) { - return env._ && env._.indexOf('purge') !== -1; - }); - - jsTokens.lastIndex = 0 - var parts = src.match(jsTokens); - - for (var i = 0; i < parts.length; i++) { - if (parts[i ] === 'process' && - parts[i + 1] === '.' && - parts[i + 2] === 'env' && - parts[i + 3] === '.') { - var prevCodeToken = getAdjacentCodeToken(-1, parts, i); - var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4); - var replacement = getReplacementString(envs, parts[i + 4], purge); - if (prevCodeToken !== '.' && - nextCodeToken !== '.' && - nextCodeToken !== '=' && - typeof replacement === 'string') { - out.push(replacement); - i += 4; - continue; - } - } - out.push(parts[i]); - } - - return out.join(''); -} - -function getAdjacentCodeToken(dir, parts, i) { - while (true) { - var part = parts[i += dir]; - if (!spaceOrCommentRe.test(part)) { - return part; - } - } -} - -function getReplacementString(envs, name, purge) { - for (var j = 0; j < envs.length; j++) { - var env = envs[j]; - if (typeof env[name] !== 'undefined') { - return JSON.stringify(env[name]); - } - } - if (purge) { - return 'undefined'; - } -} - -module.exports = replace; diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf889..000000000 --- a/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json deleted file mode 100644 index 7f7add83b..000000000 --- a/node_modules/object-assign/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "object-assign@^4.1.1", - "_id": "object-assign@4.1.1", - "_inBundle": false, - "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "_location": "/object-assign", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-assign@^4.1.1", - "name": "object-assign", - "escapedName": "object-assign", - "rawSpec": "^4.1.1", - "saveSpec": null, - "fetchSpec": "^4.1.1" - }, - "_requiredBy": [ - "/react" - ], - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", - "_spec": "object-assign@^4.1.1", - "_where": "/Users/zach/dev/FullStack.MicroWebApplication-Server/node_modules/react", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 `Object.assign()` ponyfill", - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "license": "MIT", - "name": "object-assign", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.1.1" -} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c..000000000 --- a/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/react/LICENSE b/node_modules/react/LICENSE deleted file mode 100644 index b96dcb048..000000000 --- a/node_modules/react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/react/README.md b/node_modules/react/README.md deleted file mode 100644 index 0033e23bd..000000000 --- a/node_modules/react/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# `react` - -React is a JavaScript library for creating user interfaces. - -The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments. - -**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application. - -## Example Usage - -```js -var React = require('react'); -``` diff --git a/node_modules/react/build-info.json b/node_modules/react/build-info.json deleted file mode 100644 index db5dbe5e2..000000000 --- a/node_modules/react/build-info.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "branch": "pull/21051", - "buildNumber": "287151", - "checksum": "94f5c65", - "commit": "12adaffef", - "environment": "ci", - "reactVersion": "17.0.0-12adaffef" -} diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.development.js deleted file mode 100644 index 9885b5f46..000000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.development.js +++ /dev/null @@ -1,1203 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-dev-runtime.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -var React = require('react'); -var _assign = require('object-assign'); - -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE = 0xeac7; -var REACT_PORTAL_TYPE = 0xeaca; -exports.Fragment = 0xeacb; -var REACT_STRICT_MODE_TYPE = 0xeacc; -var REACT_PROFILER_TYPE = 0xead2; -var REACT_PROVIDER_TYPE = 0xeacd; -var REACT_CONTEXT_TYPE = 0xeace; -var REACT_FORWARD_REF_TYPE = 0xead0; -var REACT_SUSPENSE_TYPE = 0xead1; -var REACT_SUSPENSE_LIST_TYPE = 0xead8; -var REACT_MEMO_TYPE = 0xead3; -var REACT_LAZY_TYPE = 0xead4; -var REACT_BLOCK_TYPE = 0xead9; -var REACT_SERVER_BLOCK_TYPE = 0xeada; -var REACT_FUNDAMENTAL_TYPE = 0xead5; -var REACT_SCOPE_TYPE = 0xead7; -var REACT_OPAQUE_ID_TYPE = 0xeae0; -var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; -var REACT_OFFSCREEN_TYPE = 0xeae2; -var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; - -if (typeof Symbol === 'function' && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor('react.element'); - REACT_PORTAL_TYPE = symbolFor('react.portal'); - exports.Fragment = symbolFor('react.fragment'); - REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); - REACT_PROFILER_TYPE = symbolFor('react.profiler'); - REACT_PROVIDER_TYPE = symbolFor('react.provider'); - REACT_CONTEXT_TYPE = symbolFor('react.context'); - REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); - REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); - REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); - REACT_MEMO_TYPE = symbolFor('react.memo'); - REACT_LAZY_TYPE = symbolFor('react.lazy'); - REACT_BLOCK_TYPE = symbolFor('react.block'); - REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); - REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); - REACT_SCOPE_TYPE = symbolFor('react.scope'); - REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); - REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); - REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); -} - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -function error(format) { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } - - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. - -var enableScopeAPI = false; // Experimental Create Event Handle API. - -function isValidElementType(type) { - if (typeof type === 'string' || typeof type === 'function') { - return true; - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - - - if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { - return true; - } - - if (typeof type === 'object' && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { - return true; - } - } - - return false; -} - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} - -function getContextName(type) { - return type.displayName || 'Context'; -} - -function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case exports.Fragment: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return 'Profiler'; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + '.Consumer'; - - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + '.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_BLOCK_TYPE: - return getComponentName(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentName(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; -} - -// Helpers to patch console.logs to avoid logging during side-effect free -// replaying on render function. This currently only patches the object -// lazily which won't cover if the log function was extracted eagerly. -// We could also eagerly patch the method. -var disabledDepth = 0; -var prevLog; -var prevInfo; -var prevWarn; -var prevError; -var prevGroup; -var prevGroupCollapsed; -var prevGroupEnd; - -function disabledLog() {} - -disabledLog.__reactDisabledLog = true; -function disableLogs() { - { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; - } -} -function reenableLogs() { - { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - var props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: _assign({}, props, { - value: prevLog - }), - info: _assign({}, props, { - value: prevInfo - }), - warn: _assign({}, props, { - value: prevWarn - }), - error: _assign({}, props, { - value: prevError - }), - group: _assign({}, props, { - value: prevGroup - }), - groupCollapsed: _assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: _assign({}, props, { - value: prevGroupEnd - }) - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } - } -} - -var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; -var prefix; -function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; - } -} -var reentry = false; -var componentFrameCache; - -{ - var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); -} - -function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher.current = null; - disableLogs(); - } - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sample.stack.split('\n'); - var controlLines = control.stack.split('\n'); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - - var name = fn ? fn.displayName || fn.name : ''; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; -} -function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } -} - -function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); -} - -function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type); - } - - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame('Suspense'); - - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame('SuspenseList'); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - - case REACT_MEMO_TYPE: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - } - } - - return ''; -} - -var loggedTypeFailures = {}; -var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - -function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame.setExtraStackFrame(null); - } - } -} - -function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); - err.name = 'Invariant Violation'; - throw err; - } - - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); - } catch (ex) { - error$1 = ex; - } - - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - - error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); - - setCurrentlyValidatingElement(null); - } - - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - - error('Failed %s type: %s', location, error$1.message); - - setCurrentlyValidatingElement(null); - } - } - } - } -} - -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; -var specialPropKeyWarningShown; -var specialPropRefWarningShown; -var didWarnAboutStringRefs; - -{ - didWarnAboutStringRefs = {}; -} - -function hasValidRef(config) { - { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.ref !== undefined; -} - -function hasValidKey(config) { - { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.key !== undefined; -} - -function warnIfStringRefCannotBeAutoConverted(config, self) { - { - if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { - var componentName = getComponentName(ReactCurrentOwner.current.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} - -function defineKeyPropWarningGetter(props, displayName) { - { - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - - error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); - } -} - -function defineRefPropWarningGetter(props, displayName) { - { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } -} -/** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ - - -var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; - - { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); // self and source are DEV only properties. - - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; -}; -/** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ - -function jsxDEV(type, config, maybeKey, source, self) { - { - var propName; // Reserved names are extracted - - var props = {}; - var key = null; - var ref = null; // Currently, key can be spread in as a prop. This causes a potential - // issue if key is also explicitly declared (ie.
- // or
). We want to deprecate key spread, - // but as an intermediary step, we will use jsxDEV for everything except - //
, because we aren't currently able to tell if - // key is explicitly declared to be undefined or not. - - if (maybeKey !== undefined) { - key = '' + maybeKey; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - if (hasValidRef(config)) { - ref = config.ref; - warnIfStringRefCannotBeAutoConverted(config, self); - } // Remaining properties are added to a new props object - - - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } // Resolve default props - - - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } -} - -var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; -var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - -function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - } -} - -var propTypesMisspellWarningShown; - -{ - propTypesMisspellWarningShown = false; -} -/** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ - -function isValidElement(object) { - { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } -} - -function getDeclarationErrorAddendum() { - { - if (ReactCurrentOwner$1.current) { - var name = getComponentName(ReactCurrentOwner$1.current.type); - - if (name) { - return '\n\nCheck the render method of `' + name + '`.'; - } - } - - return ''; - } -} - -function getSourceInfoErrorAddendum(source) { - { - if (source !== undefined) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; - } - - return ''; - } -} -/** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - - -var ownerHasKeyUseWarning = {}; - -function getCurrentComponentErrorInfo(parentType) { - { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - - return info; - } -} -/** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ - - -function validateExplicitKey(element, parentType) { - { - if (!element._store || element._store.validated || element.key != null) { - return; - } - - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - - var childOwner = ''; - - if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { - // Give the component that originally created this child. - childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; - } - - setCurrentlyValidatingElement$1(element); - - error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - - setCurrentlyValidatingElement$1(null); - } -} -/** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ - - -function validateChildKeys(node, parentType) { - { - if (typeof node !== 'object') { - return; - } - - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - - if (typeof iteratorFn === 'function') { - // Entry iterators used to provide implicit keys, - // but now we print a separate warning for them later. - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } - } -} -/** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ - - -function validatePropTypes(element) { - { - var type = element.type; - - if (type === null || type === undefined || typeof type === 'string') { - return; - } - - var propTypes; - - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - - if (propTypes) { - // Intentionally inside to avoid triggering lazy initializers: - var name = getComponentName(type); - checkPropTypes(propTypes, element.props, 'prop', name, element); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: - - var _name = getComponentName(type); - - error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); - } - - if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { - error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); - } - } -} -/** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - - -function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - - if (key !== 'children' && key !== 'key') { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - - setCurrentlyValidatingElement$1(null); - break; - } - } - - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement$1(null); - } - } -} - -function jsxWithValidation(type, props, key, isStaticChildren, source, self) { - { - var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - - if (!validType) { - var info = ''; - - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - - var sourceInfo = getSourceInfoErrorAddendum(source); - - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - var typeString; - - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - - error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - - var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - - if (element == null) { - return element; - } // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - - - if (validType) { - var children = props.children; - - if (children !== undefined) { - if (isStaticChildren) { - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - validateChildKeys(children[i], type); - } - - if (Object.freeze) { - Object.freeze(children); - } - } else { - error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); - } - } else { - validateChildKeys(children, type); - } - } - } - - if (type === exports.Fragment) { - validateFragmentProps(element); - } else { - validatePropTypes(element); - } - - return element; - } -} // These two functions exist to still get child warnings in dev - -var jsxDEV$1 = jsxWithValidation ; - -exports.jsxDEV = jsxDEV$1; - })(); -} diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js b/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js deleted file mode 100644 index 02c1a5b3a..000000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-dev-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';require("object-assign");require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js deleted file mode 100644 index 9c8898a30..000000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-dev-runtime.profiling.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';require("object-assign");require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0; diff --git a/node_modules/react/cjs/react-jsx-runtime.development.js b/node_modules/react/cjs/react-jsx-runtime.development.js deleted file mode 100644 index 38c92242c..000000000 --- a/node_modules/react/cjs/react-jsx-runtime.development.js +++ /dev/null @@ -1,1221 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-runtime.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -var React = require('react'); -var _assign = require('object-assign'); - -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE = 0xeac7; -var REACT_PORTAL_TYPE = 0xeaca; -exports.Fragment = 0xeacb; -var REACT_STRICT_MODE_TYPE = 0xeacc; -var REACT_PROFILER_TYPE = 0xead2; -var REACT_PROVIDER_TYPE = 0xeacd; -var REACT_CONTEXT_TYPE = 0xeace; -var REACT_FORWARD_REF_TYPE = 0xead0; -var REACT_SUSPENSE_TYPE = 0xead1; -var REACT_SUSPENSE_LIST_TYPE = 0xead8; -var REACT_MEMO_TYPE = 0xead3; -var REACT_LAZY_TYPE = 0xead4; -var REACT_BLOCK_TYPE = 0xead9; -var REACT_SERVER_BLOCK_TYPE = 0xeada; -var REACT_FUNDAMENTAL_TYPE = 0xead5; -var REACT_SCOPE_TYPE = 0xead7; -var REACT_OPAQUE_ID_TYPE = 0xeae0; -var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; -var REACT_OFFSCREEN_TYPE = 0xeae2; -var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; - -if (typeof Symbol === 'function' && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor('react.element'); - REACT_PORTAL_TYPE = symbolFor('react.portal'); - exports.Fragment = symbolFor('react.fragment'); - REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); - REACT_PROFILER_TYPE = symbolFor('react.profiler'); - REACT_PROVIDER_TYPE = symbolFor('react.provider'); - REACT_CONTEXT_TYPE = symbolFor('react.context'); - REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); - REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); - REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); - REACT_MEMO_TYPE = symbolFor('react.memo'); - REACT_LAZY_TYPE = symbolFor('react.lazy'); - REACT_BLOCK_TYPE = symbolFor('react.block'); - REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); - REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); - REACT_SCOPE_TYPE = symbolFor('react.scope'); - REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); - REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); - REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); -} - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -function error(format) { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } - - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. - -var enableScopeAPI = false; // Experimental Create Event Handle API. - -function isValidElementType(type) { - if (typeof type === 'string' || typeof type === 'function') { - return true; - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - - - if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { - return true; - } - - if (typeof type === 'object' && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { - return true; - } - } - - return false; -} - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} - -function getContextName(type) { - return type.displayName || 'Context'; -} - -function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case exports.Fragment: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return 'Profiler'; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + '.Consumer'; - - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + '.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_BLOCK_TYPE: - return getComponentName(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentName(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; -} - -// Helpers to patch console.logs to avoid logging during side-effect free -// replaying on render function. This currently only patches the object -// lazily which won't cover if the log function was extracted eagerly. -// We could also eagerly patch the method. -var disabledDepth = 0; -var prevLog; -var prevInfo; -var prevWarn; -var prevError; -var prevGroup; -var prevGroupCollapsed; -var prevGroupEnd; - -function disabledLog() {} - -disabledLog.__reactDisabledLog = true; -function disableLogs() { - { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; - } -} -function reenableLogs() { - { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - var props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: _assign({}, props, { - value: prevLog - }), - info: _assign({}, props, { - value: prevInfo - }), - warn: _assign({}, props, { - value: prevWarn - }), - error: _assign({}, props, { - value: prevError - }), - group: _assign({}, props, { - value: prevGroup - }), - groupCollapsed: _assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: _assign({}, props, { - value: prevGroupEnd - }) - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } - } -} - -var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; -var prefix; -function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; - } -} -var reentry = false; -var componentFrameCache; - -{ - var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); -} - -function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher.current = null; - disableLogs(); - } - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sample.stack.split('\n'); - var controlLines = control.stack.split('\n'); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - - var name = fn ? fn.displayName || fn.name : ''; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; -} -function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } -} - -function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); -} - -function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type); - } - - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame('Suspense'); - - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame('SuspenseList'); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - - case REACT_MEMO_TYPE: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - } - } - - return ''; -} - -var loggedTypeFailures = {}; -var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - -function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame.setExtraStackFrame(null); - } - } -} - -function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); - err.name = 'Invariant Violation'; - throw err; - } - - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); - } catch (ex) { - error$1 = ex; - } - - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - - error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); - - setCurrentlyValidatingElement(null); - } - - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - - error('Failed %s type: %s', location, error$1.message); - - setCurrentlyValidatingElement(null); - } - } - } - } -} - -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; -var specialPropKeyWarningShown; -var specialPropRefWarningShown; -var didWarnAboutStringRefs; - -{ - didWarnAboutStringRefs = {}; -} - -function hasValidRef(config) { - { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.ref !== undefined; -} - -function hasValidKey(config) { - { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.key !== undefined; -} - -function warnIfStringRefCannotBeAutoConverted(config, self) { - { - if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { - var componentName = getComponentName(ReactCurrentOwner.current.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} - -function defineKeyPropWarningGetter(props, displayName) { - { - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - - error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); - } -} - -function defineRefPropWarningGetter(props, displayName) { - { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } -} -/** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ - - -var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; - - { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); // self and source are DEV only properties. - - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; -}; -/** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ - -function jsxDEV(type, config, maybeKey, source, self) { - { - var propName; // Reserved names are extracted - - var props = {}; - var key = null; - var ref = null; // Currently, key can be spread in as a prop. This causes a potential - // issue if key is also explicitly declared (ie.
- // or
). We want to deprecate key spread, - // but as an intermediary step, we will use jsxDEV for everything except - //
, because we aren't currently able to tell if - // key is explicitly declared to be undefined or not. - - if (maybeKey !== undefined) { - key = '' + maybeKey; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - if (hasValidRef(config)) { - ref = config.ref; - warnIfStringRefCannotBeAutoConverted(config, self); - } // Remaining properties are added to a new props object - - - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } // Resolve default props - - - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } -} - -var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; -var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - -function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - } -} - -var propTypesMisspellWarningShown; - -{ - propTypesMisspellWarningShown = false; -} -/** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ - -function isValidElement(object) { - { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } -} - -function getDeclarationErrorAddendum() { - { - if (ReactCurrentOwner$1.current) { - var name = getComponentName(ReactCurrentOwner$1.current.type); - - if (name) { - return '\n\nCheck the render method of `' + name + '`.'; - } - } - - return ''; - } -} - -function getSourceInfoErrorAddendum(source) { - { - if (source !== undefined) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; - } - - return ''; - } -} -/** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - - -var ownerHasKeyUseWarning = {}; - -function getCurrentComponentErrorInfo(parentType) { - { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - - return info; - } -} -/** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ - - -function validateExplicitKey(element, parentType) { - { - if (!element._store || element._store.validated || element.key != null) { - return; - } - - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - - var childOwner = ''; - - if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { - // Give the component that originally created this child. - childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; - } - - setCurrentlyValidatingElement$1(element); - - error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - - setCurrentlyValidatingElement$1(null); - } -} -/** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ - - -function validateChildKeys(node, parentType) { - { - if (typeof node !== 'object') { - return; - } - - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - - if (typeof iteratorFn === 'function') { - // Entry iterators used to provide implicit keys, - // but now we print a separate warning for them later. - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } - } -} -/** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ - - -function validatePropTypes(element) { - { - var type = element.type; - - if (type === null || type === undefined || typeof type === 'string') { - return; - } - - var propTypes; - - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - - if (propTypes) { - // Intentionally inside to avoid triggering lazy initializers: - var name = getComponentName(type); - checkPropTypes(propTypes, element.props, 'prop', name, element); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: - - var _name = getComponentName(type); - - error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); - } - - if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { - error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); - } - } -} -/** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - - -function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - - if (key !== 'children' && key !== 'key') { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - - setCurrentlyValidatingElement$1(null); - break; - } - } - - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement$1(null); - } - } -} - -function jsxWithValidation(type, props, key, isStaticChildren, source, self) { - { - var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - - if (!validType) { - var info = ''; - - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - - var sourceInfo = getSourceInfoErrorAddendum(source); - - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - var typeString; - - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - - error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - - var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - - if (element == null) { - return element; - } // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - - - if (validType) { - var children = props.children; - - if (children !== undefined) { - if (isStaticChildren) { - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - validateChildKeys(children[i], type); - } - - if (Object.freeze) { - Object.freeze(children); - } - } else { - error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); - } - } else { - validateChildKeys(children, type); - } - } - } - - if (type === exports.Fragment) { - validateFragmentProps(element); - } else { - validatePropTypes(element); - } - - return element; - } -} // These two functions exist to still get child warnings in dev -// even with the prod transform. This means that jsxDEV is purely -// opt-in behavior for better messages but that we won't stop -// giving you warnings if you use production apis. - -function jsxWithValidationStatic(type, props, key) { - { - return jsxWithValidation(type, props, key, true); - } -} -function jsxWithValidationDynamic(type, props, key) { - { - return jsxWithValidation(type, props, key, false); - } -} - -var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. -// for now we can ship identical prod functions - -var jsxs = jsxWithValidationStatic ; - -exports.jsx = jsx; -exports.jsxs = jsxs; - })(); -} diff --git a/node_modules/react/cjs/react-jsx-runtime.production.min.js b/node_modules/react/cjs/react-jsx-runtime.production.min.js deleted file mode 100644 index 240488cf2..000000000 --- a/node_modules/react/cjs/react-jsx-runtime.production.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; -function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/node_modules/react/cjs/react-jsx-runtime.profiling.min.js b/node_modules/react/cjs/react-jsx-runtime.profiling.min.js deleted file mode 100644 index e6516f7b4..000000000 --- a/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @license React v17.0.2 - * react-jsx-runtime.profiling.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; -function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/node_modules/react/cjs/react.development.js b/node_modules/react/cjs/react.development.js deleted file mode 100644 index 7f48126eb..000000000 --- a/node_modules/react/cjs/react.development.js +++ /dev/null @@ -1,2333 +0,0 @@ -/** @license React v17.0.2 - * react.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -var _assign = require('object-assign'); - -// TODO: this is special because it gets imported during build. -var ReactVersion = '17.0.2'; - -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE = 0xeac7; -var REACT_PORTAL_TYPE = 0xeaca; -exports.Fragment = 0xeacb; -exports.StrictMode = 0xeacc; -exports.Profiler = 0xead2; -var REACT_PROVIDER_TYPE = 0xeacd; -var REACT_CONTEXT_TYPE = 0xeace; -var REACT_FORWARD_REF_TYPE = 0xead0; -exports.Suspense = 0xead1; -var REACT_SUSPENSE_LIST_TYPE = 0xead8; -var REACT_MEMO_TYPE = 0xead3; -var REACT_LAZY_TYPE = 0xead4; -var REACT_BLOCK_TYPE = 0xead9; -var REACT_SERVER_BLOCK_TYPE = 0xeada; -var REACT_FUNDAMENTAL_TYPE = 0xead5; -var REACT_SCOPE_TYPE = 0xead7; -var REACT_OPAQUE_ID_TYPE = 0xeae0; -var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; -var REACT_OFFSCREEN_TYPE = 0xeae2; -var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; - -if (typeof Symbol === 'function' && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor('react.element'); - REACT_PORTAL_TYPE = symbolFor('react.portal'); - exports.Fragment = symbolFor('react.fragment'); - exports.StrictMode = symbolFor('react.strict_mode'); - exports.Profiler = symbolFor('react.profiler'); - REACT_PROVIDER_TYPE = symbolFor('react.provider'); - REACT_CONTEXT_TYPE = symbolFor('react.context'); - REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); - exports.Suspense = symbolFor('react.suspense'); - REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); - REACT_MEMO_TYPE = symbolFor('react.memo'); - REACT_LAZY_TYPE = symbolFor('react.lazy'); - REACT_BLOCK_TYPE = symbolFor('react.block'); - REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); - REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); - REACT_SCOPE_TYPE = symbolFor('react.scope'); - REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); - REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); - REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); -} - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} - -/** - * Keeps track of the current dispatcher. - */ -var ReactCurrentDispatcher = { - /** - * @internal - * @type {ReactComponent} - */ - current: null -}; - -/** - * Keeps track of the current batch's configuration such as how long an update - * should suspend for if it needs to. - */ -var ReactCurrentBatchConfig = { - transition: 0 -}; - -/** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ -var ReactCurrentOwner = { - /** - * @internal - * @type {ReactComponent} - */ - current: null -}; - -var ReactDebugCurrentFrame = {}; -var currentExtraStackFrame = null; -function setExtraStackFrame(stack) { - { - currentExtraStackFrame = stack; - } -} - -{ - ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { - { - currentExtraStackFrame = stack; - } - }; // Stack implementation injected by the current renderer. - - - ReactDebugCurrentFrame.getCurrentStack = null; - - ReactDebugCurrentFrame.getStackAddendum = function () { - var stack = ''; // Add an extra top frame while an element is being validated - - if (currentExtraStackFrame) { - stack += currentExtraStackFrame; - } // Delegate to the injected renderer-specific implementation - - - var impl = ReactDebugCurrentFrame.getCurrentStack; - - if (impl) { - stack += impl() || ''; - } - - return stack; - }; -} - -/** - * Used by act() to track whether you're inside an act() scope. - */ -var IsSomeRendererActing = { - current: false -}; - -var ReactSharedInternals = { - ReactCurrentDispatcher: ReactCurrentDispatcher, - ReactCurrentBatchConfig: ReactCurrentBatchConfig, - ReactCurrentOwner: ReactCurrentOwner, - IsSomeRendererActing: IsSomeRendererActing, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: _assign -}; - -{ - ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; -} - -// by calls to these methods by a Babel plugin. -// -// In PROD (or in packages without access to React internals), -// they are left as they are instead. - -function warn(format) { - { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } -} -function error(format) { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } - - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -var didWarnStateUpdateForUnmountedComponent = {}; - -function warnNoop(publicInstance, callerName) { - { - var _constructor = publicInstance.constructor; - var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; - var warningKey = componentName + "." + callerName; - - if (didWarnStateUpdateForUnmountedComponent[warningKey]) { - return; - } - - error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); - - didWarnStateUpdateForUnmountedComponent[warningKey] = true; - } -} -/** - * This is the abstract API for an update queue. - */ - - -var ReactNoopUpdateQueue = { - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function (publicInstance) { - return false; - }, - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueForceUpdate: function (publicInstance, callback, callerName) { - warnNoop(publicInstance, 'forceUpdate'); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { - warnNoop(publicInstance, 'replaceState'); - }, - - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @param {?function} callback Called after component is updated. - * @param {?string} Name of the calling function in the public API. - * @internal - */ - enqueueSetState: function (publicInstance, partialState, callback, callerName) { - warnNoop(publicInstance, 'setState'); - } -}; - -var emptyObject = {}; - -{ - Object.freeze(emptyObject); -} -/** - * Base class helpers for the updating state of a component. - */ - - -function Component(props, context, updater) { - this.props = props; - this.context = context; // If a component has string refs, we will assign a different object later. - - this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the - // renderer. - - this.updater = updater || ReactNoopUpdateQueue; -} - -Component.prototype.isReactComponent = {}; -/** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - -Component.prototype.setState = function (partialState, callback) { - if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { - { - throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); - } - } - - this.updater.enqueueSetState(this, partialState, callback, 'setState'); -}; -/** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ - - -Component.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); -}; -/** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ - - -{ - var deprecatedAPIs = { - isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], - replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] - }; - - var defineDeprecationWarning = function (methodName, info) { - Object.defineProperty(Component.prototype, methodName, { - get: function () { - warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); - - return undefined; - } - }); - }; - - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } -} - -function ComponentDummy() {} - -ComponentDummy.prototype = Component.prototype; -/** - * Convenience component with default shallow equality check for sCU. - */ - -function PureComponent(props, context, updater) { - this.props = props; - this.context = context; // If a component has string refs, we will assign a different object later. - - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; -} - -var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); -pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. - -_assign(pureComponentPrototype, Component.prototype); - -pureComponentPrototype.isPureReactComponent = true; - -// an immutable object with a single mutable value -function createRef() { - var refObject = { - current: null - }; - - { - Object.seal(refObject); - } - - return refObject; -} - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} - -function getContextName(type) { - return type.displayName || 'Context'; -} - -function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case exports.Fragment: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case exports.Profiler: - return 'Profiler'; - - case exports.StrictMode: - return 'StrictMode'; - - case exports.Suspense: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + '.Consumer'; - - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + '.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_BLOCK_TYPE: - return getComponentName(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentName(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; -} - -var hasOwnProperty = Object.prototype.hasOwnProperty; -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; -var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; - -{ - didWarnAboutStringRefs = {}; -} - -function hasValidRef(config) { - { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.ref !== undefined; -} - -function hasValidKey(config) { - { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.key !== undefined; -} - -function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function () { - { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - - error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - } - }; - - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); -} - -function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function () { - { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); -} - -function warnIfStringRefCannotBeAutoConverted(config) { - { - if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { - var componentName = getComponentName(ReactCurrentOwner.current.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } -} -/** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ - - -var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; - - { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); // self and source are DEV only properties. - - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; -}; -/** - * Create and return a new ReactElement of the given type. - * See https://reactjs.org/docs/react-api.html#createelement - */ - -function createElement(type, config, children) { - var propName; // Reserved names are extracted - - var props = {}; - var key = null; - var ref = null; - var self = null; - var source = null; - - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - - { - warnIfStringRefCannotBeAutoConverted(config); - } - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - self = config.__self === undefined ? null : config.__self; - source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object - - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - } // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - - - var childrenLength = arguments.length - 2; - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - - { - if (Object.freeze) { - Object.freeze(childArray); - } - } - - props.children = childArray; - } // Resolve default props - - - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - - { - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - } - - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); -} -function cloneAndReplaceKey(oldElement, newKey) { - var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - return newElement; -} -/** - * Clone and return a new ReactElement using element as the starting point. - * See https://reactjs.org/docs/react-api.html#cloneelement - */ - -function cloneElement(element, config, children) { - if (!!(element === null || element === undefined)) { - { - throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); - } - } - - var propName; // Original props are copied - - var props = _assign({}, element.props); // Reserved names are extracted - - - var key = element.key; - var ref = element.ref; // Self is preserved since the owner is preserved. - - var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a - // transpiler, and the original source is probably a better indicator of the - // true owner. - - var source = element._source; // Owner will be preserved, unless ref is overridden - - var owner = element._owner; - - if (config != null) { - if (hasValidRef(config)) { - // Silently steal the ref from the parent. - ref = config.ref; - owner = ReactCurrentOwner.current; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } // Remaining properties override existing props - - - var defaultProps; - - if (element.type && element.type.defaultProps) { - defaultProps = element.type.defaultProps; - } - - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - if (config[propName] === undefined && defaultProps !== undefined) { - // Resolve default props - props[propName] = defaultProps[propName]; - } else { - props[propName] = config[propName]; - } - } - } - } // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - - - var childrenLength = arguments.length - 2; - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - - props.children = childArray; - } - - return ReactElement(element.type, key, ref, self, source, owner, props); -} -/** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ - -function isValidElement(object) { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; -} - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; -/** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. - */ - -function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - '=': '=0', - ':': '=2' - }; - var escapedString = key.replace(escapeRegex, function (match) { - return escaperLookup[match]; - }); - return '$' + escapedString; -} -/** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - - -var didWarnAboutMaps = false; -var userProvidedKeyEscapeRegex = /\/+/g; - -function escapeUserProvidedKey(text) { - return text.replace(userProvidedKeyEscapeRegex, '$&/'); -} -/** - * Generate a key string that identifies a element within a set. - * - * @param {*} element A element that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ - - -function getElementKey(element, index) { - // Do some typechecking here since we call this blindly. We want to ensure - // that we don't block potential future ES APIs. - if (typeof element === 'object' && element !== null && element.key != null) { - // Explicit key - return escape('' + element.key); - } // Implicit key determined by the index in the set - - - return index.toString(36); -} - -function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - - if (type === 'undefined' || type === 'boolean') { - // All of the above are perceived as null. - children = null; - } - - var invokeCallback = false; - - if (children === null) { - invokeCallback = true; - } else { - switch (type) { - case 'string': - case 'number': - invokeCallback = true; - break; - - case 'object': - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = true; - } - - } - } - - if (invokeCallback) { - var _child = children; - var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows: - - var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; - - if (Array.isArray(mappedChild)) { - var escapedChildKey = ''; - - if (childKey != null) { - escapedChildKey = escapeUserProvidedKey(childKey) + '/'; - } - - mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { - return c; - }); - } else if (mappedChild != null) { - if (isValidElement(mappedChild)) { - mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key - mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number - escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); - } - - array.push(mappedChild); - } - - return 1; - } - - var child; - var nextName; - var subtreeCount = 0; // Count of children found in the current subtree. - - var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; - - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getElementKey(child, i); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else { - var iteratorFn = getIteratorFn(children); - - if (typeof iteratorFn === 'function') { - var iterableChildren = children; - - { - // Warn about using Maps as children - if (iteratorFn === iterableChildren.entries) { - if (!didWarnAboutMaps) { - warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); - } - - didWarnAboutMaps = true; - } - } - - var iterator = iteratorFn.call(iterableChildren); - var step; - var ii = 0; - - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getElementKey(child, ii++); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else if (type === 'object') { - var childrenString = '' + children; - - { - { - throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." ); - } - } - } - } - - return subtreeCount; -} - -/** - * Maps children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenmap - * - * The provided mapFunction(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ -function mapChildren(children, func, context) { - if (children == null) { - return children; - } - - var result = []; - var count = 0; - mapIntoArray(children, result, '', '', function (child) { - return func.call(context, child, count++); - }); - return result; -} -/** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrencount - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ - - -function countChildren(children) { - var n = 0; - mapChildren(children, function () { - n++; // Don't return anything - }); - return n; -} - -/** - * Iterates through children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenforeach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ -function forEachChildren(children, forEachFunc, forEachContext) { - mapChildren(children, function () { - forEachFunc.apply(this, arguments); // Don't return anything. - }, forEachContext); -} -/** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://reactjs.org/docs/react-api.html#reactchildrentoarray - */ - - -function toArray(children) { - return mapChildren(children, function (child) { - return child; - }) || []; -} -/** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenonly - * - * The current implementation of this function assumes that a single child gets - * passed without a wrapper, but the purpose of this helper function is to - * abstract away the particular structure of children. - * - * @param {?object} children Child collection structure. - * @return {ReactElement} The first and only `ReactElement` contained in the - * structure. - */ - - -function onlyChild(children) { - if (!isValidElement(children)) { - { - throw Error( "React.Children.only expected to receive a single React element child." ); - } - } - - return children; -} - -function createContext(defaultValue, calculateChangedBits) { - if (calculateChangedBits === undefined) { - calculateChangedBits = null; - } else { - { - if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { - error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); - } - } - } - - var context = { - $$typeof: REACT_CONTEXT_TYPE, - _calculateChangedBits: calculateChangedBits, - // As a workaround to support multiple concurrent renderers, we categorize - // some renderers as primary and others as secondary. We only expect - // there to be two concurrent renderers at most: React Native (primary) and - // Fabric (secondary); React DOM (primary) and React ART (secondary). - // Secondary renderers store their context values on separate fields. - _currentValue: defaultValue, - _currentValue2: defaultValue, - // Used to track how many concurrent renderers this context currently - // supports within in a single renderer. Such as parallel server rendering. - _threadCount: 0, - // These are circular - Provider: null, - Consumer: null - }; - context.Provider = { - $$typeof: REACT_PROVIDER_TYPE, - _context: context - }; - var hasWarnedAboutUsingNestedContextConsumers = false; - var hasWarnedAboutUsingConsumerProvider = false; - var hasWarnedAboutDisplayNameOnConsumer = false; - - { - // A separate object, but proxies back to the original context object for - // backwards compatibility. It has a different $$typeof, so we can properly - // warn for the incorrect usage of Context as a Consumer. - var Consumer = { - $$typeof: REACT_CONTEXT_TYPE, - _context: context, - _calculateChangedBits: context._calculateChangedBits - }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here - - Object.defineProperties(Consumer, { - Provider: { - get: function () { - if (!hasWarnedAboutUsingConsumerProvider) { - hasWarnedAboutUsingConsumerProvider = true; - - error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); - } - - return context.Provider; - }, - set: function (_Provider) { - context.Provider = _Provider; - } - }, - _currentValue: { - get: function () { - return context._currentValue; - }, - set: function (_currentValue) { - context._currentValue = _currentValue; - } - }, - _currentValue2: { - get: function () { - return context._currentValue2; - }, - set: function (_currentValue2) { - context._currentValue2 = _currentValue2; - } - }, - _threadCount: { - get: function () { - return context._threadCount; - }, - set: function (_threadCount) { - context._threadCount = _threadCount; - } - }, - Consumer: { - get: function () { - if (!hasWarnedAboutUsingNestedContextConsumers) { - hasWarnedAboutUsingNestedContextConsumers = true; - - error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); - } - - return context.Consumer; - } - }, - displayName: { - get: function () { - return context.displayName; - }, - set: function (displayName) { - if (!hasWarnedAboutDisplayNameOnConsumer) { - warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); - - hasWarnedAboutDisplayNameOnConsumer = true; - } - } - } - }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty - - context.Consumer = Consumer; - } - - { - context._currentRenderer = null; - context._currentRenderer2 = null; - } - - return context; -} - -var Uninitialized = -1; -var Pending = 0; -var Resolved = 1; -var Rejected = 2; - -function lazyInitializer(payload) { - if (payload._status === Uninitialized) { - var ctor = payload._result; - var thenable = ctor(); // Transition to the next state. - - var pending = payload; - pending._status = Pending; - pending._result = thenable; - thenable.then(function (moduleObject) { - if (payload._status === Pending) { - var defaultExport = moduleObject.default; - - { - if (defaultExport === undefined) { - error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. - 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); - } - } // Transition to the next state. - - - var resolved = payload; - resolved._status = Resolved; - resolved._result = defaultExport; - } - }, function (error) { - if (payload._status === Pending) { - // Transition to the next state. - var rejected = payload; - rejected._status = Rejected; - rejected._result = error; - } - }); - } - - if (payload._status === Resolved) { - return payload._result; - } else { - throw payload._result; - } -} - -function lazy(ctor) { - var payload = { - // We use these fields to store the result. - _status: -1, - _result: ctor - }; - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: payload, - _init: lazyInitializer - }; - - { - // In production, this would just set it on the object. - var defaultProps; - var propTypes; // $FlowFixMe - - Object.defineProperties(lazyType, { - defaultProps: { - configurable: true, - get: function () { - return defaultProps; - }, - set: function (newDefaultProps) { - error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - - defaultProps = newDefaultProps; // Match production behavior more closely: - // $FlowFixMe - - Object.defineProperty(lazyType, 'defaultProps', { - enumerable: true - }); - } - }, - propTypes: { - configurable: true, - get: function () { - return propTypes; - }, - set: function (newPropTypes) { - error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - - propTypes = newPropTypes; // Match production behavior more closely: - // $FlowFixMe - - Object.defineProperty(lazyType, 'propTypes', { - enumerable: true - }); - } - } - }); - } - - return lazyType; -} - -function forwardRef(render) { - { - if (render != null && render.$$typeof === REACT_MEMO_TYPE) { - error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); - } else if (typeof render !== 'function') { - error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); - } else { - if (render.length !== 0 && render.length !== 2) { - error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); - } - } - - if (render != null) { - if (render.defaultProps != null || render.propTypes != null) { - error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); - } - } - } - - var elementType = { - $$typeof: REACT_FORWARD_REF_TYPE, - render: render - }; - - { - var ownName; - Object.defineProperty(elementType, 'displayName', { - enumerable: false, - configurable: true, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - - if (render.displayName == null) { - render.displayName = name; - } - } - }); - } - - return elementType; -} - -// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. - -var enableScopeAPI = false; // Experimental Create Event Handle API. - -function isValidElementType(type) { - if (typeof type === 'string' || typeof type === 'function') { - return true; - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - - - if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { - return true; - } - - if (typeof type === 'object' && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { - return true; - } - } - - return false; -} - -function memo(type, compare) { - { - if (!isValidElementType(type)) { - error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); - } - } - - var elementType = { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: compare === undefined ? null : compare - }; - - { - var ownName; - Object.defineProperty(elementType, 'displayName', { - enumerable: false, - configurable: true, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - - if (type.displayName == null) { - type.displayName = name; - } - } - }); - } - - return elementType; -} - -function resolveDispatcher() { - var dispatcher = ReactCurrentDispatcher.current; - - if (!(dispatcher !== null)) { - { - throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." ); - } - } - - return dispatcher; -} - -function useContext(Context, unstable_observedBits) { - var dispatcher = resolveDispatcher(); - - { - if (unstable_observedBits !== undefined) { - error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : ''); - } // TODO: add a more generic warning for invalid values. - - - if (Context._context !== undefined) { - var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs - // and nobody should be using this in existing code. - - if (realContext.Consumer === Context) { - error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); - } else if (realContext.Provider === Context) { - error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); - } - } - } - - return dispatcher.useContext(Context, unstable_observedBits); -} -function useState(initialState) { - var dispatcher = resolveDispatcher(); - return dispatcher.useState(initialState); -} -function useReducer(reducer, initialArg, init) { - var dispatcher = resolveDispatcher(); - return dispatcher.useReducer(reducer, initialArg, init); -} -function useRef(initialValue) { - var dispatcher = resolveDispatcher(); - return dispatcher.useRef(initialValue); -} -function useEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useEffect(create, deps); -} -function useLayoutEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useLayoutEffect(create, deps); -} -function useCallback(callback, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useCallback(callback, deps); -} -function useMemo(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useMemo(create, deps); -} -function useImperativeHandle(ref, create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeHandle(ref, create, deps); -} -function useDebugValue(value, formatterFn) { - { - var dispatcher = resolveDispatcher(); - return dispatcher.useDebugValue(value, formatterFn); - } -} - -// Helpers to patch console.logs to avoid logging during side-effect free -// replaying on render function. This currently only patches the object -// lazily which won't cover if the log function was extracted eagerly. -// We could also eagerly patch the method. -var disabledDepth = 0; -var prevLog; -var prevInfo; -var prevWarn; -var prevError; -var prevGroup; -var prevGroupCollapsed; -var prevGroupEnd; - -function disabledLog() {} - -disabledLog.__reactDisabledLog = true; -function disableLogs() { - { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; - } -} -function reenableLogs() { - { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - var props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: _assign({}, props, { - value: prevLog - }), - info: _assign({}, props, { - value: prevInfo - }), - warn: _assign({}, props, { - value: prevWarn - }), - error: _assign({}, props, { - value: prevError - }), - group: _assign({}, props, { - value: prevGroup - }), - groupCollapsed: _assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: _assign({}, props, { - value: prevGroupEnd - }) - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } - } -} - -var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; -var prefix; -function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; - } -} -var reentry = false; -var componentFrameCache; - -{ - var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); -} - -function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$1.current = null; - disableLogs(); - } - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sample.stack.split('\n'); - var controlLines = control.stack.split('\n'); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$1.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - - var name = fn ? fn.displayName || fn.name : ''; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; -} -function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } -} - -function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); -} - -function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type); - } - - switch (type) { - case exports.Suspense: - return describeBuiltInComponentFrame('Suspense'); - - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame('SuspenseList'); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - - case REACT_MEMO_TYPE: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - } - } - - return ''; -} - -var loggedTypeFailures = {}; -var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - -function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - } -} - -function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); - err.name = 'Invariant Violation'; - throw err; - } - - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); - } catch (ex) { - error$1 = ex; - } - - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - - error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); - - setCurrentlyValidatingElement(null); - } - - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - - error('Failed %s type: %s', location, error$1.message); - - setCurrentlyValidatingElement(null); - } - } - } - } -} - -function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - setExtraStackFrame(stack); - } else { - setExtraStackFrame(null); - } - } -} - -var propTypesMisspellWarningShown; - -{ - propTypesMisspellWarningShown = false; -} - -function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = getComponentName(ReactCurrentOwner.current.type); - - if (name) { - return '\n\nCheck the render method of `' + name + '`.'; - } - } - - return ''; -} - -function getSourceInfoErrorAddendum(source) { - if (source !== undefined) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; - } - - return ''; -} - -function getSourceInfoErrorAddendumForProps(elementProps) { - if (elementProps !== null && elementProps !== undefined) { - return getSourceInfoErrorAddendum(elementProps.__source); - } - - return ''; -} -/** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - - -var ownerHasKeyUseWarning = {}; - -function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - - return info; -} -/** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ - - -function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) { - return; - } - - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - - var childOwner = ''; - - if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - // Give the component that originally created this child. - childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; - } - - { - setCurrentlyValidatingElement$1(element); - - error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - - setCurrentlyValidatingElement$1(null); - } -} -/** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ - - -function validateChildKeys(node, parentType) { - if (typeof node !== 'object') { - return; - } - - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - - if (typeof iteratorFn === 'function') { - // Entry iterators used to provide implicit keys, - // but now we print a separate warning for them later. - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } -} -/** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ - - -function validatePropTypes(element) { - { - var type = element.type; - - if (type === null || type === undefined || typeof type === 'string') { - return; - } - - var propTypes; - - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - - if (propTypes) { - // Intentionally inside to avoid triggering lazy initializers: - var name = getComponentName(type); - checkPropTypes(propTypes, element.props, 'prop', name, element); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: - - var _name = getComponentName(type); - - error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); - } - - if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { - error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); - } - } -} -/** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - - -function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - - if (key !== 'children' && key !== 'key') { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - - setCurrentlyValidatingElement$1(null); - break; - } - } - - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement$1(null); - } - } -} -function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - - if (!validType) { - var info = ''; - - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - - var sourceInfo = getSourceInfoErrorAddendumForProps(props); - - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - var typeString; - - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - - { - error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - } - - var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - - if (element == null) { - return element; - } // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - - - if (validType) { - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); - } - } - - if (type === exports.Fragment) { - validateFragmentProps(element); - } else { - validatePropTypes(element); - } - - return element; -} -var didWarnAboutDeprecatedCreateFactory = false; -function createFactoryWithValidation(type) { - var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; - - { - if (!didWarnAboutDeprecatedCreateFactory) { - didWarnAboutDeprecatedCreateFactory = true; - - warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); - } // Legacy hook: remove it - - - Object.defineProperty(validatedFactory, 'type', { - enumerable: false, - get: function () { - warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); - - Object.defineProperty(this, 'type', { - value: type - }); - return type; - } - }); - } - - return validatedFactory; -} -function cloneElementWithValidation(element, props, children) { - var newElement = cloneElement.apply(this, arguments); - - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - - validatePropTypes(newElement); - return newElement; -} - -{ - - try { - var frozenObject = Object.freeze({}); - /* eslint-disable no-new */ - - new Map([[frozenObject, null]]); - new Set([frozenObject]); - /* eslint-enable no-new */ - } catch (e) { - } -} - -var createElement$1 = createElementWithValidation ; -var cloneElement$1 = cloneElementWithValidation ; -var createFactory = createFactoryWithValidation ; -var Children = { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray: toArray, - only: onlyChild -}; - -exports.Children = Children; -exports.Component = Component; -exports.PureComponent = PureComponent; -exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; -exports.cloneElement = cloneElement$1; -exports.createContext = createContext; -exports.createElement = createElement$1; -exports.createFactory = createFactory; -exports.createRef = createRef; -exports.forwardRef = forwardRef; -exports.isValidElement = isValidElement; -exports.lazy = lazy; -exports.memo = memo; -exports.useCallback = useCallback; -exports.useContext = useContext; -exports.useDebugValue = useDebugValue; -exports.useEffect = useEffect; -exports.useImperativeHandle = useImperativeHandle; -exports.useLayoutEffect = useLayoutEffect; -exports.useMemo = useMemo; -exports.useReducer = useReducer; -exports.useRef = useRef; -exports.useState = useState; -exports.version = ReactVersion; - })(); -} diff --git a/node_modules/react/cjs/react.production.min.js b/node_modules/react/cjs/react.production.min.js deleted file mode 100644 index 912869567..000000000 --- a/node_modules/react/cjs/react.production.min.js +++ /dev/null @@ -1,23 +0,0 @@ -/** @license React v17.0.2 - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var l=require("object-assign"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116; -if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy")}var x="function"===typeof Symbol&&Symbol.iterator; -function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return"function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c=0.10.0" - }, - "files": [ - "LICENSE", - "README.md", - "build-info.json", - "index.js", - "cjs/", - "umd/", - "jsx-runtime.js", - "jsx-dev-runtime.js" - ], - "homepage": "https://reactjs.org/", - "keywords": [ - "react" - ], - "license": "MIT", - "main": "index.js", - "name": "react", - "repository": { - "type": "git", - "url": "git+https://github.com/facebook/react.git", - "directory": "packages/react" - }, - "version": "17.0.2" -} diff --git a/node_modules/react/umd/react.development.js b/node_modules/react/umd/react.development.js deleted file mode 100644 index 1124191bb..000000000 --- a/node_modules/react/umd/react.development.js +++ /dev/null @@ -1,3357 +0,0 @@ -/** @license React v17.0.2 - * react.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.React = {})); -}(this, (function (exports) { 'use strict'; - - // TODO: this is special because it gets imported during build. - var ReactVersion = '17.0.2'; - - // ATTENTION - // When adding new symbols to this file, - // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' - // The Symbol used to tag the ReactElement-like types. If there is no native Symbol - // nor polyfill, then a plain number is used for performance. - var REACT_ELEMENT_TYPE = 0xeac7; - var REACT_PORTAL_TYPE = 0xeaca; - exports.Fragment = 0xeacb; - exports.StrictMode = 0xeacc; - exports.Profiler = 0xead2; - var REACT_PROVIDER_TYPE = 0xeacd; - var REACT_CONTEXT_TYPE = 0xeace; - var REACT_FORWARD_REF_TYPE = 0xead0; - exports.Suspense = 0xead1; - var REACT_SUSPENSE_LIST_TYPE = 0xead8; - var REACT_MEMO_TYPE = 0xead3; - var REACT_LAZY_TYPE = 0xead4; - var REACT_BLOCK_TYPE = 0xead9; - var REACT_SERVER_BLOCK_TYPE = 0xeada; - var REACT_FUNDAMENTAL_TYPE = 0xead5; - var REACT_SCOPE_TYPE = 0xead7; - var REACT_OPAQUE_ID_TYPE = 0xeae0; - var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; - var REACT_OFFSCREEN_TYPE = 0xeae2; - var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; - - if (typeof Symbol === 'function' && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor('react.element'); - REACT_PORTAL_TYPE = symbolFor('react.portal'); - exports.Fragment = symbolFor('react.fragment'); - exports.StrictMode = symbolFor('react.strict_mode'); - exports.Profiler = symbolFor('react.profiler'); - REACT_PROVIDER_TYPE = symbolFor('react.provider'); - REACT_CONTEXT_TYPE = symbolFor('react.context'); - REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); - exports.Suspense = symbolFor('react.suspense'); - REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); - REACT_MEMO_TYPE = symbolFor('react.memo'); - REACT_LAZY_TYPE = symbolFor('react.lazy'); - REACT_BLOCK_TYPE = symbolFor('react.block'); - REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); - REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); - REACT_SCOPE_TYPE = symbolFor('react.scope'); - REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); - REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); - REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); - REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); - } - - var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; - } - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var _assign = function (to, from) { - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - }; - - var assign = Object.assign || function (target, sources) { - if (target == null) { - throw new TypeError('Object.assign target cannot be null or undefined'); - } - - var to = Object(target); - - for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { - var nextSource = arguments[nextIndex]; - - if (nextSource != null) { - _assign(to, Object(nextSource)); - } - } - - return to; - }; - - /** - * Keeps track of the current dispatcher. - */ - var ReactCurrentDispatcher = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - - /** - * Keeps track of the current batch's configuration such as how long an update - * should suspend for if it needs to. - */ - var ReactCurrentBatchConfig = { - transition: 0 - }; - - /** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ - var ReactCurrentOwner = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - - var ReactDebugCurrentFrame = {}; - var currentExtraStackFrame = null; - function setExtraStackFrame(stack) { - { - currentExtraStackFrame = stack; - } - } - - { - ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { - { - currentExtraStackFrame = stack; - } - }; // Stack implementation injected by the current renderer. - - - ReactDebugCurrentFrame.getCurrentStack = null; - - ReactDebugCurrentFrame.getStackAddendum = function () { - var stack = ''; // Add an extra top frame while an element is being validated - - if (currentExtraStackFrame) { - stack += currentExtraStackFrame; - } // Delegate to the injected renderer-specific implementation - - - var impl = ReactDebugCurrentFrame.getCurrentStack; - - if (impl) { - stack += impl() || ''; - } - - return stack; - }; - } - - /** - * Used by act() to track whether you're inside an act() scope. - */ - var IsSomeRendererActing = { - current: false - }; - - var ReactSharedInternals = { - ReactCurrentDispatcher: ReactCurrentDispatcher, - ReactCurrentBatchConfig: ReactCurrentBatchConfig, - ReactCurrentOwner: ReactCurrentOwner, - IsSomeRendererActing: IsSomeRendererActing, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: assign - }; - - { - ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; - } - - // by calls to these methods by a Babel plugin. - // - // In PROD (or in packages without access to React internals), - // they are left as they are instead. - - function warn(format) { - { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } - } - function error(format) { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } - - function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } - - var argsWithFormat = args.map(function (item) { - return '' + item; - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - } - - var didWarnStateUpdateForUnmountedComponent = {}; - - function warnNoop(publicInstance, callerName) { - { - var _constructor = publicInstance.constructor; - var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; - var warningKey = componentName + "." + callerName; - - if (didWarnStateUpdateForUnmountedComponent[warningKey]) { - return; - } - - error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); - - didWarnStateUpdateForUnmountedComponent[warningKey] = true; - } - } - /** - * This is the abstract API for an update queue. - */ - - - var ReactNoopUpdateQueue = { - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function (publicInstance) { - return false; - }, - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueForceUpdate: function (publicInstance, callback, callerName) { - warnNoop(publicInstance, 'forceUpdate'); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { - warnNoop(publicInstance, 'replaceState'); - }, - - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @param {?function} callback Called after component is updated. - * @param {?string} Name of the calling function in the public API. - * @internal - */ - enqueueSetState: function (publicInstance, partialState, callback, callerName) { - warnNoop(publicInstance, 'setState'); - } - }; - - var emptyObject = {}; - - { - Object.freeze(emptyObject); - } - /** - * Base class helpers for the updating state of a component. - */ - - - function Component(props, context, updater) { - this.props = props; - this.context = context; // If a component has string refs, we will assign a different object later. - - this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the - // renderer. - - this.updater = updater || ReactNoopUpdateQueue; - } - - Component.prototype.isReactComponent = {}; - /** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - - Component.prototype.setState = function (partialState, callback) { - if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { - { - throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); - } - } - - this.updater.enqueueSetState(this, partialState, callback, 'setState'); - }; - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ - - - Component.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); - }; - /** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ - - - { - var deprecatedAPIs = { - isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], - replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] - }; - - var defineDeprecationWarning = function (methodName, info) { - Object.defineProperty(Component.prototype, methodName, { - get: function () { - warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); - - return undefined; - } - }); - }; - - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } - } - - function ComponentDummy() {} - - ComponentDummy.prototype = Component.prototype; - /** - * Convenience component with default shallow equality check for sCU. - */ - - function PureComponent(props, context, updater) { - this.props = props; - this.context = context; // If a component has string refs, we will assign a different object later. - - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - - var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); - pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. - - assign(pureComponentPrototype, Component.prototype); - - pureComponentPrototype.isPureReactComponent = true; - - // an immutable object with a single mutable value - function createRef() { - var refObject = { - current: null - }; - - { - Object.seal(refObject); - } - - return refObject; - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); - } - - function getContextName(type) { - return type.displayName || 'Context'; - } - - function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case exports.Fragment: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case exports.Profiler: - return 'Profiler'; - - case exports.StrictMode: - return 'StrictMode'; - - case exports.Suspense: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + '.Consumer'; - - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + '.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_BLOCK_TYPE: - return getComponentName(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentName(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; - } - - var hasOwnProperty$1 = Object.prototype.hasOwnProperty; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; - var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; - - { - didWarnAboutStringRefs = {}; - } - - function hasValidRef(config) { - { - if (hasOwnProperty$1.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.ref !== undefined; - } - - function hasValidKey(config) { - { - if (hasOwnProperty$1.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - - if (getter && getter.isReactWarning) { - return false; - } - } - } - - return config.key !== undefined; - } - - function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function () { - { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - - error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - } - }; - - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); - } - - function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function () { - { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - } - }; - - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); - } - - function warnIfStringRefCannotBeAutoConverted(config) { - { - if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { - var componentName = getComponentName(ReactCurrentOwner.current.type); - - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); - - didWarnAboutStringRefs[componentName] = true; - } - } - } - } - /** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ - - - var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; - - { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); // self and source are DEV only properties. - - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; - }; - /** - * Create and return a new ReactElement of the given type. - * See https://reactjs.org/docs/react-api.html#createelement - */ - - function createElement(type, config, children) { - var propName; // Reserved names are extracted - - var props = {}; - var key = null; - var ref = null; - var self = null; - var source = null; - - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - - { - warnIfStringRefCannotBeAutoConverted(config); - } - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - self = config.__self === undefined ? null : config.__self; - source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object - - for (propName in config) { - if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - } // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - - - var childrenLength = arguments.length - 2; - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - - { - if (Object.freeze) { - Object.freeze(childArray); - } - } - - props.children = childArray; - } // Resolve default props - - - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - - { - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - } - - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } - function cloneAndReplaceKey(oldElement, newKey) { - var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - return newElement; - } - /** - * Clone and return a new ReactElement using element as the starting point. - * See https://reactjs.org/docs/react-api.html#cloneelement - */ - - function cloneElement(element, config, children) { - if (!!(element === null || element === undefined)) { - { - throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); - } - } - - var propName; // Original props are copied - - var props = assign({}, element.props); // Reserved names are extracted - - - var key = element.key; - var ref = element.ref; // Self is preserved since the owner is preserved. - - var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a - // transpiler, and the original source is probably a better indicator of the - // true owner. - - var source = element._source; // Owner will be preserved, unless ref is overridden - - var owner = element._owner; - - if (config != null) { - if (hasValidRef(config)) { - // Silently steal the ref from the parent. - ref = config.ref; - owner = ReactCurrentOwner.current; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } // Remaining properties override existing props - - - var defaultProps; - - if (element.type && element.type.defaultProps) { - defaultProps = element.type.defaultProps; - } - - for (propName in config) { - if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - if (config[propName] === undefined && defaultProps !== undefined) { - // Resolve default props - props[propName] = defaultProps[propName]; - } else { - props[propName] = config[propName]; - } - } - } - } // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - - - var childrenLength = arguments.length - 2; - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - - props.children = childArray; - } - - return ReactElement(element.type, key, ref, self, source, owner, props); - } - /** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ - - function isValidElement(object) { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - - var SEPARATOR = '.'; - var SUBSEPARATOR = ':'; - /** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. - */ - - function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - '=': '=0', - ':': '=2' - }; - var escapedString = key.replace(escapeRegex, function (match) { - return escaperLookup[match]; - }); - return '$' + escapedString; - } - /** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - - - var didWarnAboutMaps = false; - var userProvidedKeyEscapeRegex = /\/+/g; - - function escapeUserProvidedKey(text) { - return text.replace(userProvidedKeyEscapeRegex, '$&/'); - } - /** - * Generate a key string that identifies a element within a set. - * - * @param {*} element A element that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ - - - function getElementKey(element, index) { - // Do some typechecking here since we call this blindly. We want to ensure - // that we don't block potential future ES APIs. - if (typeof element === 'object' && element !== null && element.key != null) { - // Explicit key - return escape('' + element.key); - } // Implicit key determined by the index in the set - - - return index.toString(36); - } - - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - - if (type === 'undefined' || type === 'boolean') { - // All of the above are perceived as null. - children = null; - } - - var invokeCallback = false; - - if (children === null) { - invokeCallback = true; - } else { - switch (type) { - case 'string': - case 'number': - invokeCallback = true; - break; - - case 'object': - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = true; - } - - } - } - - if (invokeCallback) { - var _child = children; - var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows: - - var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; - - if (Array.isArray(mappedChild)) { - var escapedChildKey = ''; - - if (childKey != null) { - escapedChildKey = escapeUserProvidedKey(childKey) + '/'; - } - - mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { - return c; - }); - } else if (mappedChild != null) { - if (isValidElement(mappedChild)) { - mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key - mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number - escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); - } - - array.push(mappedChild); - } - - return 1; - } - - var child; - var nextName; - var subtreeCount = 0; // Count of children found in the current subtree. - - var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; - - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getElementKey(child, i); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else { - var iteratorFn = getIteratorFn(children); - - if (typeof iteratorFn === 'function') { - var iterableChildren = children; - - { - // Warn about using Maps as children - if (iteratorFn === iterableChildren.entries) { - if (!didWarnAboutMaps) { - warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); - } - - didWarnAboutMaps = true; - } - } - - var iterator = iteratorFn.call(iterableChildren); - var step; - var ii = 0; - - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getElementKey(child, ii++); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); - } - } else if (type === 'object') { - var childrenString = '' + children; - - { - { - throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." ); - } - } - } - } - - return subtreeCount; - } - - /** - * Maps children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenmap - * - * The provided mapFunction(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ - function mapChildren(children, func, context) { - if (children == null) { - return children; - } - - var result = []; - var count = 0; - mapIntoArray(children, result, '', '', function (child) { - return func.call(context, child, count++); - }); - return result; - } - /** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrencount - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ - - - function countChildren(children) { - var n = 0; - mapChildren(children, function () { - n++; // Don't return anything - }); - return n; - } - - /** - * Iterates through children that are typically specified as `props.children`. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenforeach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ - function forEachChildren(children, forEachFunc, forEachContext) { - mapChildren(children, function () { - forEachFunc.apply(this, arguments); // Don't return anything. - }, forEachContext); - } - /** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://reactjs.org/docs/react-api.html#reactchildrentoarray - */ - - - function toArray(children) { - return mapChildren(children, function (child) { - return child; - }) || []; - } - /** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://reactjs.org/docs/react-api.html#reactchildrenonly - * - * The current implementation of this function assumes that a single child gets - * passed without a wrapper, but the purpose of this helper function is to - * abstract away the particular structure of children. - * - * @param {?object} children Child collection structure. - * @return {ReactElement} The first and only `ReactElement` contained in the - * structure. - */ - - - function onlyChild(children) { - if (!isValidElement(children)) { - { - throw Error( "React.Children.only expected to receive a single React element child." ); - } - } - - return children; - } - - function createContext(defaultValue, calculateChangedBits) { - if (calculateChangedBits === undefined) { - calculateChangedBits = null; - } else { - { - if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { - error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); - } - } - } - - var context = { - $$typeof: REACT_CONTEXT_TYPE, - _calculateChangedBits: calculateChangedBits, - // As a workaround to support multiple concurrent renderers, we categorize - // some renderers as primary and others as secondary. We only expect - // there to be two concurrent renderers at most: React Native (primary) and - // Fabric (secondary); React DOM (primary) and React ART (secondary). - // Secondary renderers store their context values on separate fields. - _currentValue: defaultValue, - _currentValue2: defaultValue, - // Used to track how many concurrent renderers this context currently - // supports within in a single renderer. Such as parallel server rendering. - _threadCount: 0, - // These are circular - Provider: null, - Consumer: null - }; - context.Provider = { - $$typeof: REACT_PROVIDER_TYPE, - _context: context - }; - var hasWarnedAboutUsingNestedContextConsumers = false; - var hasWarnedAboutUsingConsumerProvider = false; - var hasWarnedAboutDisplayNameOnConsumer = false; - - { - // A separate object, but proxies back to the original context object for - // backwards compatibility. It has a different $$typeof, so we can properly - // warn for the incorrect usage of Context as a Consumer. - var Consumer = { - $$typeof: REACT_CONTEXT_TYPE, - _context: context, - _calculateChangedBits: context._calculateChangedBits - }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here - - Object.defineProperties(Consumer, { - Provider: { - get: function () { - if (!hasWarnedAboutUsingConsumerProvider) { - hasWarnedAboutUsingConsumerProvider = true; - - error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); - } - - return context.Provider; - }, - set: function (_Provider) { - context.Provider = _Provider; - } - }, - _currentValue: { - get: function () { - return context._currentValue; - }, - set: function (_currentValue) { - context._currentValue = _currentValue; - } - }, - _currentValue2: { - get: function () { - return context._currentValue2; - }, - set: function (_currentValue2) { - context._currentValue2 = _currentValue2; - } - }, - _threadCount: { - get: function () { - return context._threadCount; - }, - set: function (_threadCount) { - context._threadCount = _threadCount; - } - }, - Consumer: { - get: function () { - if (!hasWarnedAboutUsingNestedContextConsumers) { - hasWarnedAboutUsingNestedContextConsumers = true; - - error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); - } - - return context.Consumer; - } - }, - displayName: { - get: function () { - return context.displayName; - }, - set: function (displayName) { - if (!hasWarnedAboutDisplayNameOnConsumer) { - warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); - - hasWarnedAboutDisplayNameOnConsumer = true; - } - } - } - }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty - - context.Consumer = Consumer; - } - - { - context._currentRenderer = null; - context._currentRenderer2 = null; - } - - return context; - } - - var Uninitialized = -1; - var Pending = 0; - var Resolved = 1; - var Rejected = 2; - - function lazyInitializer(payload) { - if (payload._status === Uninitialized) { - var ctor = payload._result; - var thenable = ctor(); // Transition to the next state. - - var pending = payload; - pending._status = Pending; - pending._result = thenable; - thenable.then(function (moduleObject) { - if (payload._status === Pending) { - var defaultExport = moduleObject.default; - - { - if (defaultExport === undefined) { - error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. - 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); - } - } // Transition to the next state. - - - var resolved = payload; - resolved._status = Resolved; - resolved._result = defaultExport; - } - }, function (error) { - if (payload._status === Pending) { - // Transition to the next state. - var rejected = payload; - rejected._status = Rejected; - rejected._result = error; - } - }); - } - - if (payload._status === Resolved) { - return payload._result; - } else { - throw payload._result; - } - } - - function lazy(ctor) { - var payload = { - // We use these fields to store the result. - _status: -1, - _result: ctor - }; - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: payload, - _init: lazyInitializer - }; - - { - // In production, this would just set it on the object. - var defaultProps; - var propTypes; // $FlowFixMe - - Object.defineProperties(lazyType, { - defaultProps: { - configurable: true, - get: function () { - return defaultProps; - }, - set: function (newDefaultProps) { - error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - - defaultProps = newDefaultProps; // Match production behavior more closely: - // $FlowFixMe - - Object.defineProperty(lazyType, 'defaultProps', { - enumerable: true - }); - } - }, - propTypes: { - configurable: true, - get: function () { - return propTypes; - }, - set: function (newPropTypes) { - error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - - propTypes = newPropTypes; // Match production behavior more closely: - // $FlowFixMe - - Object.defineProperty(lazyType, 'propTypes', { - enumerable: true - }); - } - } - }); - } - - return lazyType; - } - - function forwardRef(render) { - { - if (render != null && render.$$typeof === REACT_MEMO_TYPE) { - error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); - } else if (typeof render !== 'function') { - error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); - } else { - if (render.length !== 0 && render.length !== 2) { - error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); - } - } - - if (render != null) { - if (render.defaultProps != null || render.propTypes != null) { - error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); - } - } - } - - var elementType = { - $$typeof: REACT_FORWARD_REF_TYPE, - render: render - }; - - { - var ownName; - Object.defineProperty(elementType, 'displayName', { - enumerable: false, - configurable: true, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - - if (render.displayName == null) { - render.displayName = name; - } - } - }); - } - - return elementType; - } - - // Filter certain DOM attributes (e.g. src, href) if their values are empty strings. - - var enableScopeAPI = false; // Experimental Create Event Handle API. - - function isValidElementType(type) { - if (typeof type === 'string' || typeof type === 'function') { - return true; - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - - - if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { - return true; - } - - if (typeof type === 'object' && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { - return true; - } - } - - return false; - } - - function memo(type, compare) { - { - if (!isValidElementType(type)) { - error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); - } - } - - var elementType = { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: compare === undefined ? null : compare - }; - - { - var ownName; - Object.defineProperty(elementType, 'displayName', { - enumerable: false, - configurable: true, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - - if (type.displayName == null) { - type.displayName = name; - } - } - }); - } - - return elementType; - } - - function resolveDispatcher() { - var dispatcher = ReactCurrentDispatcher.current; - - if (!(dispatcher !== null)) { - { - throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." ); - } - } - - return dispatcher; - } - - function useContext(Context, unstable_observedBits) { - var dispatcher = resolveDispatcher(); - - { - if (unstable_observedBits !== undefined) { - error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : ''); - } // TODO: add a more generic warning for invalid values. - - - if (Context._context !== undefined) { - var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs - // and nobody should be using this in existing code. - - if (realContext.Consumer === Context) { - error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); - } else if (realContext.Provider === Context) { - error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); - } - } - } - - return dispatcher.useContext(Context, unstable_observedBits); - } - function useState(initialState) { - var dispatcher = resolveDispatcher(); - return dispatcher.useState(initialState); - } - function useReducer(reducer, initialArg, init) { - var dispatcher = resolveDispatcher(); - return dispatcher.useReducer(reducer, initialArg, init); - } - function useRef(initialValue) { - var dispatcher = resolveDispatcher(); - return dispatcher.useRef(initialValue); - } - function useEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useEffect(create, deps); - } - function useLayoutEffect(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useLayoutEffect(create, deps); - } - function useCallback(callback, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useCallback(callback, deps); - } - function useMemo(create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useMemo(create, deps); - } - function useImperativeHandle(ref, create, deps) { - var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeHandle(ref, create, deps); - } - function useDebugValue(value, formatterFn) { - { - var dispatcher = resolveDispatcher(); - return dispatcher.useDebugValue(value, formatterFn); - } - } - - // Helpers to patch console.logs to avoid logging during side-effect free - // replaying on render function. This currently only patches the object - // lazily which won't cover if the log function was extracted eagerly. - // We could also eagerly patch the method. - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - - function disabledLog() {} - - disabledLog.__reactDisabledLog = true; - function disableLogs() { - { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; - } - } - function reenableLogs() { - { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - var props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: assign({}, props, { - value: prevLog - }), - info: assign({}, props, { - value: prevInfo - }), - warn: assign({}, props, { - value: prevWarn - }), - error: assign({}, props, { - value: prevError - }), - group: assign({}, props, { - value: prevGroup - }), - groupCollapsed: assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: assign({}, props, { - value: prevGroupEnd - }) - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } - } - } - - var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; - } - } - var reentry = false; - var componentFrameCache; - - { - var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); - } - - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$1.current = null; - disableLogs(); - } - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sample.stack.split('\n'); - var controlLines = control.stack.split('\n'); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$1.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - - var name = fn ? fn.displayName || fn.name : ''; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - - function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); - } - - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); - } - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type); - } - - switch (type) { - case exports.Suspense: - return describeBuiltInComponentFrame('Suspense'); - - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame('SuspenseList'); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - - case REACT_MEMO_TYPE: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); - - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - } - } - - return ''; - } - - var loggedTypeFailures = {}; - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - - function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); - } - } - } - - function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); - err.name = 'Invariant Violation'; - throw err; - } - - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); - } catch (ex) { - error$1 = ex; - } - - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - - error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); - - setCurrentlyValidatingElement(null); - } - - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - - error('Failed %s type: %s', location, error$1.message); - - setCurrentlyValidatingElement(null); - } - } - } - } - } - - function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - setExtraStackFrame(stack); - } else { - setExtraStackFrame(null); - } - } - } - - var propTypesMisspellWarningShown; - - { - propTypesMisspellWarningShown = false; - } - - function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = getComponentName(ReactCurrentOwner.current.type); - - if (name) { - return '\n\nCheck the render method of `' + name + '`.'; - } - } - - return ''; - } - - function getSourceInfoErrorAddendum(source) { - if (source !== undefined) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; - } - - return ''; - } - - function getSourceInfoErrorAddendumForProps(elementProps) { - if (elementProps !== null && elementProps !== undefined) { - return getSourceInfoErrorAddendum(elementProps.__source); - } - - return ''; - } - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - - - var ownerHasKeyUseWarning = {}; - - function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - - return info; - } - /** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ - - - function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) { - return; - } - - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - - var childOwner = ''; - - if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - // Give the component that originally created this child. - childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; - } - - { - setCurrentlyValidatingElement$1(element); - - error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - - setCurrentlyValidatingElement$1(null); - } - } - /** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ - - - function validateChildKeys(node, parentType) { - if (typeof node !== 'object') { - return; - } - - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - - if (typeof iteratorFn === 'function') { - // Entry iterators used to provide implicit keys, - // but now we print a separate warning for them later. - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } - } - /** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ - - - function validatePropTypes(element) { - { - var type = element.type; - - if (type === null || type === undefined || typeof type === 'string') { - return; - } - - var propTypes; - - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - - if (propTypes) { - // Intentionally inside to avoid triggering lazy initializers: - var name = getComponentName(type); - checkPropTypes(propTypes, element.props, 'prop', name, element); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: - - var _name = getComponentName(type); - - error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); - } - - if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { - error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); - } - } - } - /** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - - - function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - - if (key !== 'children' && key !== 'key') { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - - setCurrentlyValidatingElement$1(null); - break; - } - } - - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - - setCurrentlyValidatingElement$1(null); - } - } - } - function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - - if (!validType) { - var info = ''; - - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - - var sourceInfo = getSourceInfoErrorAddendumForProps(props); - - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - var typeString; - - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - - { - error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - } - - var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - - if (element == null) { - return element; - } // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - - - if (validType) { - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); - } - } - - if (type === exports.Fragment) { - validateFragmentProps(element); - } else { - validatePropTypes(element); - } - - return element; - } - var didWarnAboutDeprecatedCreateFactory = false; - function createFactoryWithValidation(type) { - var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; - - { - if (!didWarnAboutDeprecatedCreateFactory) { - didWarnAboutDeprecatedCreateFactory = true; - - warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); - } // Legacy hook: remove it - - - Object.defineProperty(validatedFactory, 'type', { - enumerable: false, - get: function () { - warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); - - Object.defineProperty(this, 'type', { - value: type - }); - return type; - } - }); - } - - return validatedFactory; - } - function cloneElementWithValidation(element, props, children) { - var newElement = cloneElement.apply(this, arguments); - - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - - validatePropTypes(newElement); - return newElement; - } - - var enableSchedulerDebugging = false; - var enableProfiling = false; - - var requestHostCallback; - var requestHostTimeout; - var cancelHostTimeout; - var shouldYieldToHost; - var requestPaint; - var getCurrentTime; - var forceFrameRate; - var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; - - if (hasPerformanceNow) { - var localPerformance = performance; - - getCurrentTime = function () { - return localPerformance.now(); - }; - } else { - var localDate = Date; - var initialTime = localDate.now(); - - getCurrentTime = function () { - return localDate.now() - initialTime; - }; - } - - if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive - // implementation using setTimeout. - typeof window === 'undefined' || // Check if MessageChannel is supported, too. - typeof MessageChannel !== 'function') { - // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, - // fallback to a naive implementation. - var _callback = null; - var _timeoutID = null; - - var _flushCallback = function () { - if (_callback !== null) { - try { - var currentTime = getCurrentTime(); - var hasRemainingTime = true; - - _callback(hasRemainingTime, currentTime); - - _callback = null; - } catch (e) { - setTimeout(_flushCallback, 0); - throw e; - } - } - }; - - requestHostCallback = function (cb) { - if (_callback !== null) { - // Protect against re-entrancy. - setTimeout(requestHostCallback, 0, cb); - } else { - _callback = cb; - setTimeout(_flushCallback, 0); - } - }; - - requestHostTimeout = function (cb, ms) { - _timeoutID = setTimeout(cb, ms); - }; - - cancelHostTimeout = function () { - clearTimeout(_timeoutID); - }; - - shouldYieldToHost = function () { - return false; - }; - - requestPaint = forceFrameRate = function () {}; - } else { - // Capture local references to native APIs, in case a polyfill overrides them. - var _setTimeout = window.setTimeout; - var _clearTimeout = window.clearTimeout; - - if (typeof console !== 'undefined') { - // TODO: Scheduler no longer requires these methods to be polyfilled. But - // maybe we want to continue warning if they don't exist, to preserve the - // option to rely on it in the future? - var requestAnimationFrame = window.requestAnimationFrame; - var cancelAnimationFrame = window.cancelAnimationFrame; - - if (typeof requestAnimationFrame !== 'function') { - // Using console['error'] to evade Babel and ESLint - console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); - } - - if (typeof cancelAnimationFrame !== 'function') { - // Using console['error'] to evade Babel and ESLint - console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); - } - } - - var isMessageLoopRunning = false; - var scheduledHostCallback = null; - var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main - // thread, like user events. By default, it yields multiple times per frame. - // It does not attempt to align with frame boundaries, since most tasks don't - // need to be frame aligned; for those that do, use requestAnimationFrame. - - var yieldInterval = 5; - var deadline = 0; // TODO: Make this configurable - - { - // `isInputPending` is not available. Since we have no way of knowing if - // there's pending input, always yield at the end of the frame. - shouldYieldToHost = function () { - return getCurrentTime() >= deadline; - }; // Since we yield every frame regardless, `requestPaint` has no effect. - - - requestPaint = function () {}; - } - - forceFrameRate = function (fps) { - if (fps < 0 || fps > 125) { - // Using console['error'] to evade Babel and ESLint - console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported'); - return; - } - - if (fps > 0) { - yieldInterval = Math.floor(1000 / fps); - } else { - // reset the framerate - yieldInterval = 5; - } - }; - - var performWorkUntilDeadline = function () { - if (scheduledHostCallback !== null) { - var currentTime = getCurrentTime(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync - // cycle. This means there's always time remaining at the beginning of - // the message event. - - deadline = currentTime + yieldInterval; - var hasTimeRemaining = true; - - try { - var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); - - if (!hasMoreWork) { - isMessageLoopRunning = false; - scheduledHostCallback = null; - } else { - // If there's more work, schedule the next message event at the end - // of the preceding one. - port.postMessage(null); - } - } catch (error) { - // If a scheduler task throws, exit the current browser task so the - // error can be observed. - port.postMessage(null); - throw error; - } - } else { - isMessageLoopRunning = false; - } // Yielding to the browser will give it a chance to paint, so we can - }; - - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = performWorkUntilDeadline; - - requestHostCallback = function (callback) { - scheduledHostCallback = callback; - - if (!isMessageLoopRunning) { - isMessageLoopRunning = true; - port.postMessage(null); - } - }; - - requestHostTimeout = function (callback, ms) { - taskTimeoutID = _setTimeout(function () { - callback(getCurrentTime()); - }, ms); - }; - - cancelHostTimeout = function () { - _clearTimeout(taskTimeoutID); - - taskTimeoutID = -1; - }; - } - - function push(heap, node) { - var index = heap.length; - heap.push(node); - siftUp(heap, node, index); - } - function peek(heap) { - var first = heap[0]; - return first === undefined ? null : first; - } - function pop(heap) { - var first = heap[0]; - - if (first !== undefined) { - var last = heap.pop(); - - if (last !== first) { - heap[0] = last; - siftDown(heap, last, 0); - } - - return first; - } else { - return null; - } - } - - function siftUp(heap, node, i) { - var index = i; - - while (true) { - var parentIndex = index - 1 >>> 1; - var parent = heap[parentIndex]; - - if (parent !== undefined && compare(parent, node) > 0) { - // The parent is larger. Swap positions. - heap[parentIndex] = node; - heap[index] = parent; - index = parentIndex; - } else { - // The parent is smaller. Exit. - return; - } - } - } - - function siftDown(heap, node, i) { - var index = i; - var length = heap.length; - - while (index < length) { - var leftIndex = (index + 1) * 2 - 1; - var left = heap[leftIndex]; - var rightIndex = leftIndex + 1; - var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. - - if (left !== undefined && compare(left, node) < 0) { - if (right !== undefined && compare(right, left) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else { - heap[index] = left; - heap[leftIndex] = node; - index = leftIndex; - } - } else if (right !== undefined && compare(right, node) < 0) { - heap[index] = right; - heap[rightIndex] = node; - index = rightIndex; - } else { - // Neither child is smaller. Exit. - return; - } - } - } - - function compare(a, b) { - // Compare sort index first, then task id. - var diff = a.sortIndex - b.sortIndex; - return diff !== 0 ? diff : a.id - b.id; - } - - // TODO: Use symbols? - var ImmediatePriority = 1; - var UserBlockingPriority = 2; - var NormalPriority = 3; - var LowPriority = 4; - var IdlePriority = 5; - - function markTaskErrored(task, ms) { - } - - /* eslint-disable no-var */ - // Math.pow(2, 30) - 1 - // 0b111111111111111111111111111111 - - var maxSigned31BitInt = 1073741823; // Times out immediately - - var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out - - var USER_BLOCKING_PRIORITY_TIMEOUT = 250; - var NORMAL_PRIORITY_TIMEOUT = 5000; - var LOW_PRIORITY_TIMEOUT = 10000; // Never times out - - var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap - - var taskQueue = []; - var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. - - var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. - var currentTask = null; - var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. - - var isPerformingWork = false; - var isHostCallbackScheduled = false; - var isHostTimeoutScheduled = false; - - function advanceTimers(currentTime) { - // Check for tasks that are no longer delayed and add them to the queue. - var timer = peek(timerQueue); - - while (timer !== null) { - if (timer.callback === null) { - // Timer was cancelled. - pop(timerQueue); - } else if (timer.startTime <= currentTime) { - // Timer fired. Transfer to the task queue. - pop(timerQueue); - timer.sortIndex = timer.expirationTime; - push(taskQueue, timer); - } else { - // Remaining timers are pending. - return; - } - - timer = peek(timerQueue); - } - } - - function handleTimeout(currentTime) { - isHostTimeoutScheduled = false; - advanceTimers(currentTime); - - if (!isHostCallbackScheduled) { - if (peek(taskQueue) !== null) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } else { - var firstTimer = peek(timerQueue); - - if (firstTimer !== null) { - requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - } - } - } - } - - function flushWork(hasTimeRemaining, initialTime) { - - - isHostCallbackScheduled = false; - - if (isHostTimeoutScheduled) { - // We scheduled a timeout but it's no longer needed. Cancel it. - isHostTimeoutScheduled = false; - cancelHostTimeout(); - } - - isPerformingWork = true; - var previousPriorityLevel = currentPriorityLevel; - - try { - if (enableProfiling) { - try { - return workLoop(hasTimeRemaining, initialTime); - } catch (error) { - if (currentTask !== null) { - var currentTime = getCurrentTime(); - markTaskErrored(currentTask, currentTime); - currentTask.isQueued = false; - } - - throw error; - } - } else { - // No catch in prod code path. - return workLoop(hasTimeRemaining, initialTime); - } - } finally { - currentTask = null; - currentPriorityLevel = previousPriorityLevel; - isPerformingWork = false; - } - } - - function workLoop(hasTimeRemaining, initialTime) { - var currentTime = initialTime; - advanceTimers(currentTime); - currentTask = peek(taskQueue); - - while (currentTask !== null && !(enableSchedulerDebugging )) { - if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { - // This currentTask hasn't expired, and we've reached the deadline. - break; - } - - var callback = currentTask.callback; - - if (typeof callback === 'function') { - currentTask.callback = null; - currentPriorityLevel = currentTask.priorityLevel; - var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; - - var continuationCallback = callback(didUserCallbackTimeout); - currentTime = getCurrentTime(); - - if (typeof continuationCallback === 'function') { - currentTask.callback = continuationCallback; - } else { - - if (currentTask === peek(taskQueue)) { - pop(taskQueue); - } - } - - advanceTimers(currentTime); - } else { - pop(taskQueue); - } - - currentTask = peek(taskQueue); - } // Return whether there's additional work - - - if (currentTask !== null) { - return true; - } else { - var firstTimer = peek(timerQueue); - - if (firstTimer !== null) { - requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); - } - - return false; - } - } - - function unstable_runWithPriority(priorityLevel, eventHandler) { - switch (priorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - case LowPriority: - case IdlePriority: - break; - - default: - priorityLevel = NormalPriority; - } - - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - - function unstable_next(eventHandler) { - var priorityLevel; - - switch (currentPriorityLevel) { - case ImmediatePriority: - case UserBlockingPriority: - case NormalPriority: - // Shift down to normal priority - priorityLevel = NormalPriority; - break; - - default: - // Anything lower than normal priority should remain at the current level. - priorityLevel = currentPriorityLevel; - break; - } - - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = priorityLevel; - - try { - return eventHandler(); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - } - - function unstable_wrapCallback(callback) { - var parentPriorityLevel = currentPriorityLevel; - return function () { - // This is a fork of runWithPriority, inlined for performance. - var previousPriorityLevel = currentPriorityLevel; - currentPriorityLevel = parentPriorityLevel; - - try { - return callback.apply(this, arguments); - } finally { - currentPriorityLevel = previousPriorityLevel; - } - }; - } - - function unstable_scheduleCallback(priorityLevel, callback, options) { - var currentTime = getCurrentTime(); - var startTime; - - if (typeof options === 'object' && options !== null) { - var delay = options.delay; - - if (typeof delay === 'number' && delay > 0) { - startTime = currentTime + delay; - } else { - startTime = currentTime; - } - } else { - startTime = currentTime; - } - - var timeout; - - switch (priorityLevel) { - case ImmediatePriority: - timeout = IMMEDIATE_PRIORITY_TIMEOUT; - break; - - case UserBlockingPriority: - timeout = USER_BLOCKING_PRIORITY_TIMEOUT; - break; - - case IdlePriority: - timeout = IDLE_PRIORITY_TIMEOUT; - break; - - case LowPriority: - timeout = LOW_PRIORITY_TIMEOUT; - break; - - case NormalPriority: - default: - timeout = NORMAL_PRIORITY_TIMEOUT; - break; - } - - var expirationTime = startTime + timeout; - var newTask = { - id: taskIdCounter++, - callback: callback, - priorityLevel: priorityLevel, - startTime: startTime, - expirationTime: expirationTime, - sortIndex: -1 - }; - - if (startTime > currentTime) { - // This is a delayed task. - newTask.sortIndex = startTime; - push(timerQueue, newTask); - - if (peek(taskQueue) === null && newTask === peek(timerQueue)) { - // All tasks are delayed, and this is the task with the earliest delay. - if (isHostTimeoutScheduled) { - // Cancel an existing timeout. - cancelHostTimeout(); - } else { - isHostTimeoutScheduled = true; - } // Schedule a timeout. - - - requestHostTimeout(handleTimeout, startTime - currentTime); - } - } else { - newTask.sortIndex = expirationTime; - push(taskQueue, newTask); - // wait until the next time we yield. - - - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - - return newTask; - } - - function unstable_pauseExecution() { - } - - function unstable_continueExecution() { - - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } - } - - function unstable_getFirstCallbackNode() { - return peek(taskQueue); - } - - function unstable_cancelCallback(task) { - // remove from the queue because you can't remove arbitrary nodes from an - // array based heap, only the first one.) - - - task.callback = null; - } - - function unstable_getCurrentPriorityLevel() { - return currentPriorityLevel; - } - - var unstable_requestPaint = requestPaint; - var unstable_Profiling = null; - - - - var Scheduler = /*#__PURE__*/Object.freeze({ - __proto__: null, - unstable_ImmediatePriority: ImmediatePriority, - unstable_UserBlockingPriority: UserBlockingPriority, - unstable_NormalPriority: NormalPriority, - unstable_IdlePriority: IdlePriority, - unstable_LowPriority: LowPriority, - unstable_runWithPriority: unstable_runWithPriority, - unstable_next: unstable_next, - unstable_scheduleCallback: unstable_scheduleCallback, - unstable_cancelCallback: unstable_cancelCallback, - unstable_wrapCallback: unstable_wrapCallback, - unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, - get unstable_shouldYield () { return shouldYieldToHost; }, - unstable_requestPaint: unstable_requestPaint, - unstable_continueExecution: unstable_continueExecution, - unstable_pauseExecution: unstable_pauseExecution, - unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, - get unstable_now () { return getCurrentTime; }, - get unstable_forceFrameRate () { return forceFrameRate; }, - unstable_Profiling: unstable_Profiling - }); - - var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs. - - var interactionIDCounter = 0; - var threadIDCounter = 0; // Set of currently traced interactions. - // Interactions "stack"– - // Meaning that newly traced interactions are appended to the previously active set. - // When an interaction goes out of scope, the previous set (if any) is restored. - - var interactionsRef = null; // Listener(s) to notify when interactions begin and end. - - var subscriberRef = null; - - { - interactionsRef = { - current: new Set() - }; - subscriberRef = { - current: null - }; - } - function unstable_clear(callback) { - - var prevInteractions = interactionsRef.current; - interactionsRef.current = new Set(); - - try { - return callback(); - } finally { - interactionsRef.current = prevInteractions; - } - } - function unstable_getCurrent() { - { - return interactionsRef.current; - } - } - function unstable_getThreadID() { - return ++threadIDCounter; - } - function unstable_trace(name, timestamp, callback) { - var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; - - var interaction = { - __count: 1, - id: interactionIDCounter++, - name: name, - timestamp: timestamp - }; - var prevInteractions = interactionsRef.current; // Traced interactions should stack/accumulate. - // To do that, clone the current interactions. - // The previous set will be restored upon completion. - - var interactions = new Set(prevInteractions); - interactions.add(interaction); - interactionsRef.current = interactions; - var subscriber = subscriberRef.current; - var returnValue; - - try { - if (subscriber !== null) { - subscriber.onInteractionTraced(interaction); - } - } finally { - try { - if (subscriber !== null) { - subscriber.onWorkStarted(interactions, threadID); - } - } finally { - try { - returnValue = callback(); - } finally { - interactionsRef.current = prevInteractions; - - try { - if (subscriber !== null) { - subscriber.onWorkStopped(interactions, threadID); - } - } finally { - interaction.__count--; // If no async work was scheduled for this interaction, - // Notify subscribers that it's completed. - - if (subscriber !== null && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - } - } - } - } - - return returnValue; - } - function unstable_wrap(callback) { - var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; - - var wrappedInteractions = interactionsRef.current; - var subscriber = subscriberRef.current; - - if (subscriber !== null) { - subscriber.onWorkScheduled(wrappedInteractions, threadID); - } // Update the pending async work count for the current interactions. - // Update after calling subscribers in case of error. - - - wrappedInteractions.forEach(function (interaction) { - interaction.__count++; - }); - var hasRun = false; - - function wrapped() { - var prevInteractions = interactionsRef.current; - interactionsRef.current = wrappedInteractions; - subscriber = subscriberRef.current; - - try { - var returnValue; - - try { - if (subscriber !== null) { - subscriber.onWorkStarted(wrappedInteractions, threadID); - } - } finally { - try { - returnValue = callback.apply(undefined, arguments); - } finally { - interactionsRef.current = prevInteractions; - - if (subscriber !== null) { - subscriber.onWorkStopped(wrappedInteractions, threadID); - } - } - } - - return returnValue; - } finally { - if (!hasRun) { - // We only expect a wrapped function to be executed once, - // But in the event that it's executed more than once– - // Only decrement the outstanding interaction counts once. - hasRun = true; // Update pending async counts for all wrapped interactions. - // If this was the last scheduled async work for any of them, - // Mark them as completed. - - wrappedInteractions.forEach(function (interaction) { - interaction.__count--; - - if (subscriber !== null && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - }); - } - } - } - - wrapped.cancel = function cancel() { - subscriber = subscriberRef.current; - - try { - if (subscriber !== null) { - subscriber.onWorkCanceled(wrappedInteractions, threadID); - } - } finally { - // Update pending async counts for all wrapped interactions. - // If this was the last scheduled async work for any of them, - // Mark them as completed. - wrappedInteractions.forEach(function (interaction) { - interaction.__count--; - - if (subscriber && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - }); - } - }; - - return wrapped; - } - - var subscribers = null; - - { - subscribers = new Set(); - } - - function unstable_subscribe(subscriber) { - { - subscribers.add(subscriber); - - if (subscribers.size === 1) { - subscriberRef.current = { - onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted, - onInteractionTraced: onInteractionTraced, - onWorkCanceled: onWorkCanceled, - onWorkScheduled: onWorkScheduled, - onWorkStarted: onWorkStarted, - onWorkStopped: onWorkStopped - }; - } - } - } - function unstable_unsubscribe(subscriber) { - { - subscribers.delete(subscriber); - - if (subscribers.size === 0) { - subscriberRef.current = null; - } - } - } - - function onInteractionTraced(interaction) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onInteractionTraced(interaction); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - function onInteractionScheduledWorkCompleted(interaction) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - function onWorkScheduled(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onWorkScheduled(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - function onWorkStarted(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onWorkStarted(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - function onWorkStopped(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onWorkStopped(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - function onWorkCanceled(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function (subscriber) { - try { - subscriber.onWorkCanceled(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - - if (didCatchError) { - throw caughtError; - } - } - - - - var SchedulerTracing = /*#__PURE__*/Object.freeze({ - __proto__: null, - get __interactionsRef () { return interactionsRef; }, - get __subscriberRef () { return subscriberRef; }, - unstable_clear: unstable_clear, - unstable_getCurrent: unstable_getCurrent, - unstable_getThreadID: unstable_getThreadID, - unstable_trace: unstable_trace, - unstable_wrap: unstable_wrap, - unstable_subscribe: unstable_subscribe, - unstable_unsubscribe: unstable_unsubscribe - }); - - var ReactSharedInternals$1 = { - ReactCurrentDispatcher: ReactCurrentDispatcher, - ReactCurrentOwner: ReactCurrentOwner, - IsSomeRendererActing: IsSomeRendererActing, - ReactCurrentBatchConfig: ReactCurrentBatchConfig, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: assign, - // Re-export the schedule API(s) for UMD bundles. - // This avoids introducing a dependency on a new UMD global in a minor update, - // Since that would be a breaking change (e.g. for all existing CodeSandboxes). - // This re-export is only required for UMD bundles; - // CJS bundles use the shared NPM package. - Scheduler: Scheduler, - SchedulerTracing: SchedulerTracing - }; - - { - ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame; - } - - { - - try { - var frozenObject = Object.freeze({}); - /* eslint-disable no-new */ - - new Map([[frozenObject, null]]); - new Set([frozenObject]); - /* eslint-enable no-new */ - } catch (e) { - } - } - - var createElement$1 = createElementWithValidation ; - var cloneElement$1 = cloneElementWithValidation ; - var createFactory = createFactoryWithValidation ; - var Children = { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray: toArray, - only: onlyChild - }; - - exports.Children = Children; - exports.Component = Component; - exports.PureComponent = PureComponent; - exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1; - exports.cloneElement = cloneElement$1; - exports.createContext = createContext; - exports.createElement = createElement$1; - exports.createFactory = createFactory; - exports.createRef = createRef; - exports.forwardRef = forwardRef; - exports.isValidElement = isValidElement; - exports.lazy = lazy; - exports.memo = memo; - exports.useCallback = useCallback; - exports.useContext = useContext; - exports.useDebugValue = useDebugValue; - exports.useEffect = useEffect; - exports.useImperativeHandle = useImperativeHandle; - exports.useLayoutEffect = useLayoutEffect; - exports.useMemo = useMemo; - exports.useReducer = useReducer; - exports.useRef = useRef; - exports.useState = useState; - exports.version = ReactVersion; - -}))); diff --git a/node_modules/react/umd/react.production.min.js b/node_modules/react/umd/react.production.min.js deleted file mode 100644 index 95f2ce7af..000000000 --- a/node_modules/react/umd/react.production.min.js +++ /dev/null @@ -1,31 +0,0 @@ -/** @license React v17.0.2 - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -(function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=Y&&a[Y]||a["@@iterator"];return"function"===typeof a?a:null}function y(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=1;e>>1,f=a[c];if(void 0!==f&&0E(g,e))void 0!==h&&0>E(h,g)?(a[c]=h,a[k]=e,c=k):(a[c]=g,a[d]=e,c=d);else if(void 0!==h&&0>E(h,e))a[c]=h,a[k]=e,c=k;else break a}}return b}return null}function E(a,b){var e=a.sortIndex-b.sortIndex;return 0!==e?e:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)F(r);else if(b.startTime<=a)F(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}} -function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,A(R);else{var b=p(r);null!==b&&G(Q,b.startTime-a)}}function R(a,b){u=!1;z&&(z=!1,S());H=!0;var e=g;try{P(b);for(m=p(q);null!==m&&(!(m.expirationTime>b)||a&&!T());){var c=m.callback;if("function"===typeof c){m.callback=null;g=m.priorityLevel;var f=c(m.expirationTime<=b);b=t();"function"===typeof f?m.callback=f:m===p(q)&&F(q);P(b)}else F(q);m=p(q)}if(null!==m)var d=!0;else{var n=p(r);null!==n&&G(Q,n.startTime-b);d=!1}return d}finally{m=null,g=e,H=!1}} -var w=60103,ha=60106;c.Fragment=60107;c.StrictMode=60108;c.Profiler=60114;var ka=60109,la=60110,ma=60112;c.Suspense=60113;var na=60115,oa=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;w=d("react.element");ha=d("react.portal");c.Fragment=d("react.fragment");c.StrictMode=d("react.strict_mode");c.Profiler=d("react.profiler");ka=d("react.provider");la=d("react.context");ma=d("react.forward_ref");c.Suspense=d("react.suspense");na=d("react.memo");oa=d("react.lazy")}var Y="function"=== -typeof Symbol&&Symbol.iterator,ya=Object.prototype.hasOwnProperty,U=Object.assign||function(a,b){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(a),c=1;c=ta};d=function(){};V=function(a){0>a||125d?(a.sortIndex= -c,O(r,a),null===p(q)&&a===p(r)&&(z?S():z=!0,G(Q,c-d))):(a.sortIndex=e,O(q,a),u||H||(u=!0,A(R)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=g;return function(){var c=g;g=b;try{return a.apply(this,arguments)}finally{g=c}}},unstable_getCurrentPriorityLevel:function(){return g},get unstable_shouldYield(){return T},unstable_requestPaint:d,unstable_continueExecution:function(){u||H||(u=!0,A(R))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)}, -get unstable_now(){return t},get unstable_forceFrameRate(){return V},unstable_Profiling:null},SchedulerTracing:{__proto__:null,__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Ea},unstable_trace:function(a,b,c){return c()},unstable_wrap:function(a){return a},unstable_subscribe:function(a){},unstable_unsubscribe:function(a){}}};c.Children={map:D,forEach:function(a,b,c){D(a,function(){b.apply(this, -arguments)},c)},count:function(a){var b=0;D(a,function(){b++});return b},toArray:function(a){return D(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error(y(143));return a}};c.Component=v;c.PureComponent=K;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(y(267,a));var d=U({},a.props),e=a.key,g=a.ref,n=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,n=L.current);void 0!==b.key&&(e=""+b.key);if(a.type&&a.type.defaultProps)var k= -a.type.defaultProps;for(h in b)ea.call(b,h)&&!fa.hasOwnProperty(h)&&(d[h]=void 0===b[h]&&void 0!==k?k[h]:b[h])}var h=arguments.length-2;if(1===h)d.children=c;else if(1>>1,d=a[e];if(void 0!==d&&0J(h,c))void 0!==n&&0>J(n,h)?(a[e]=n,a[k]=c,e=k):(a[e]=h,a[f]=c,e=f);else if(void 0!==n&&0>J(n,c))a[e]=n,a[k]=c,e=k;else break a}}return b}return null}function J(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function U(a){for(var b=r(w);null!==b;){if(null===b.callback)K(w);else if(b.startTime<=a)K(w),b.sortIndex=b.expirationTime,T(u,b);else break;b=r(w)}} -function V(a){E=!1;U(a);if(!z)if(null!==r(u))z=!0,F(W);else{var b=r(w);null!==b&&L(V,b.startTime-a)}}function W(a,b){z=!1;E&&(E=!1,X());M=!0;var c=m;try{U(b);for(q=r(u);null!==q&&(!(q.expirationTime>b)||a&&!Y());){var e=q.callback;if("function"===typeof e){q.callback=null;m=q.priorityLevel;var d=e(q.expirationTime<=b);b=x();"function"===typeof d?q.callback=d:q===r(u)&&K(u);U(b)}else K(u);q=r(u)}if(null!==q)var f=!0;else{var h=r(w);null!==h&&L(V,h.startTime-b);f=!1}return f}finally{q=null,m=c,M=!1}} -function Ca(a){var b=!1,c=null;t.forEach(function(e){try{e.onInteractionTraced(a)}catch(d){b||(b=!0,c=d)}});if(b)throw c;}function Da(a){var b=!1,c=null;t.forEach(function(e){try{e.onInteractionScheduledWorkCompleted(a)}catch(d){b||(b=!0,c=d)}});if(b)throw c;}function Ea(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkScheduled(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}function Fa(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkStarted(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e; -}function Ga(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkStopped(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}function Ha(a,b){var c=!1,e=null;t.forEach(function(d){try{d.onWorkCanceled(a,b)}catch(l){c||(c=!0,e=l)}});if(c)throw e;}var B=60103,la=60106;f.Fragment=60107;f.StrictMode=60108;f.Profiler=60114;var oa=60109,pa=60110,qa=60112;f.Suspense=60113;var ra=60115,sa=60116;if("function"===typeof Symbol&&Symbol.for){var g=Symbol.for;B=g("react.element");la=g("react.portal");f.Fragment=g("react.fragment"); -f.StrictMode=g("react.strict_mode");f.Profiler=g("react.profiler");oa=g("react.provider");pa=g("react.context");qa=g("react.forward_ref");f.Suspense=g("react.suspense");ra=g("react.memo");sa=g("react.lazy")}var da="function"===typeof Symbol&&Symbol.iterator,Ia=Object.prototype.hasOwnProperty,Z=Object.assign||function(a,b){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var c=Object(a),e=1;e=xa};g=function(){};aa=function(a){0>a||125e?(a.sortIndex=c,T(w,a),null===r(u)&&a===r(w)&&(E?X():E=!0,L(V,c-e))):(a.sortIndex=d,T(u,a),z||M||(z=!0,F(W)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=m;return function(){var c=m;m=b;try{return a.apply(this,arguments)}finally{m=c}}},unstable_getCurrentPriorityLevel:function(){return m},get unstable_shouldYield(){return Y},unstable_requestPaint:g,unstable_continueExecution:function(){z||M||(z=!0,F(W))},unstable_pauseExecution:function(){}, -unstable_getFirstCallbackNode:function(){return r(u)},get unstable_now(){return x},get unstable_forceFrameRate(){return aa},unstable_Profiling:null};var Oa=0,Pa=0,p=null,y=null;p={current:new Set};y={current:null};var t=null;t=new Set;g={ReactCurrentDispatcher:na,ReactCurrentOwner:Q,IsSomeRendererActing:{current:!1},ReactCurrentBatchConfig:{transition:0},assign:Z,Scheduler:g,SchedulerTracing:{__proto__:null,get __interactionsRef(){return p},get __subscriberRef(){return y},unstable_clear:function(a){var b= -p.current;p.current=new Set;try{return a()}finally{p.current=b}},unstable_getCurrent:function(){return p.current},unstable_getThreadID:function(){return++Pa},unstable_trace:function(a,b,c){var e=3&Bau#XP#GIV`^3)XnqRjNnynw`#lGLKSVn&8Yjp)g1m?Qc4pzmjJ`#KJrs1OT1Y!c=zO9g^z#nCt zEhP9s;$_~IXG}?bhl*8Ik$a&)3@{~tHij?&2 zak5NZaUCe5)s5__y0;7q#WD&o8BYH3N!vG1G@31hE779IH0W^|G_`~>opRbqu|$g8vAps354|Pok9tl`*yy6c!j0h%K#^g*QHdF91+9|{t7CG1Jqw@|cD zY9}w0eo#;9Qs<2`ed`H5-y4=1x9io$`Bkl2Z&YeG`pZ*vW-x1G41OCSgl$CN*q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EyW{^x(vB)<_bd^@>P@57619gou58P(Ps|2{$*h`|>8)v$oSvzGcLOSD zbfs)sVz=Eq7S5r8OT!0cSB*x+a7>;Diz)Ba1nxvnG57s25aP$_$Vtna8JPzs|KF~J zXT9S4?an#T;fwj;f(AJa>mBq0yiJANytQX)L|oKj~f;R-nHwykG@6 z4o=U+{NT`*{;_x&=Wy*tU0)02yLbT0@zu+?X6`h&xABZZ;%Ko;BQkHE$L#L$PxJWc zR=4;Jou?_A=9C3v5@VM zUM%Px%5k)$j8;TEqESQ}gRgNg--I?3IEhKjZh?IYcDHGs?ns)i{fGe#Vh1Agi1lRl z1*vFKj#$%_9I>itIbvNia>UAJ<%pHj={<~x10N%xI^UbZ-aPgubSd+YG$ULb!o4BD zvS2Jf1;?}ip%(E^R6+_>!pv9t7s~wvBVXx^T%1v;?4R`#_Lu2{K<$0}inGhG(h&vy z^O{9&bJCN~p9vMp$XlVw-2AiTl_~h+NCHAs0a zN}Gt^t|ibe_n`G3O~A&NTB8TFreI3OneHo@KBiApOvyOY12C=iVB(t<>cyw8(Ylf; z6=zykGCfo?rQ%GRVA|@z#8o3?8kS5ON~Uz2X|!Ne6PWa8?f z(YCT$=y4`P!Q@wqCvftax?1SW=GR-lS_rV6^kCzfc(Gb=B@Ah~&iMh$cvd@@C2$@1 K8^`5rkLVRM(6%K2 diff --git a/target/classes/com/example/demo/service/MessageService.class b/target/classes/com/example/demo/service/MessageService.class index d285f5e1a4b4657f34f7eecbdba68bbdd9b520ee..6f36dafbd534870ec2efab654f962ab2b8bdbfc4 100644 GIT binary patch literal 2483 zcma)8TUQ%Z7~LnNObOEzDFrENTc9N*(5X@?3Rbx)8ZMFuwO(*YPSUB#3~Ocr@(cVs z>e47axP10Ux!h-Fl28&X4>{Lwf0upsIg@|>{qrvXk5Ecr0PptT2IdlY5AXM29t&#p zK>}Ctq!%CJBMpnHUsBC-f~G5KZ&fvGs`*$opQvVCnS836&opE;YzXvLrRSMtxg!r9 zfyr#asT%SJvwB#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$DPs()yjV6;}cgjV1 zb-n{zN4`Icw;B#R=D8pRmp|dIOSs1$?(&;ZF01}`NnC|x)yXT1QKmm2@G%X0Q%rkX XVbKE@xPTLfsI2owkQ2SFy9n$9*u`e= From cfec706964f4a5faac8616eb3c85bf0fe2f4e6be Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 2 Sep 2021 14:18:36 -0400 Subject: [PATCH 19/29] deleted javaProject? --- ...m_datastax_oss_java_driver_core_4_13_0.xml | 13 ++++++ ...iver_shaded_guava_25_1_jre_graal_sub_1.xml | 13 ++++++ ...com_datastax_oss_native_protocol_1_5_0.xml | 13 ++++++ ..._esri_geometry_esri_geometry_api_1_2_1.xml | 13 ++++++ .../Maven__com_github_jnr_jffi_1_3_1.xml | 13 ++++++ ...aven__com_github_jnr_jffi_native_1_3_1.xml | 13 ++++++ ...Maven__com_github_jnr_jnr_a64asm_1_0_0.xml | 13 ++++++ ...n__com_github_jnr_jnr_constants_0_10_1.xml | 13 ++++++ .../Maven__com_github_jnr_jnr_ffi_2_2_2.xml | 13 ++++++ .../Maven__com_github_jnr_jnr_posix_3_1_5.xml | 13 ++++++ ...Maven__com_github_jnr_jnr_x86asm_1_0_2.xml | 13 ++++++ ...b_spotbugs_spotbugs_annotations_3_1_12.xml | 13 ++++++ ...b_stephenc_jcip_jcip_annotations_1_0_1.xml | 13 ++++++ ..._com_google_code_findbugs_jsr305_3_0_2.xml | 13 ++++++ .../Maven__com_typesafe_config_1_4_1.xml | 13 ++++++ ...dropwizard_metrics_metrics_core_4_1_25.xml | 13 ++++++ ...en__io_netty_netty_buffer_4_1_67_Final.xml | 13 ++++++ ...ven__io_netty_netty_codec_4_1_67_Final.xml | 13 ++++++ ...en__io_netty_netty_common_4_1_67_Final.xml | 13 ++++++ ...n__io_netty_netty_handler_4_1_67_Final.xml | 13 ++++++ ...__io_netty_netty_resolver_4_1_67_Final.xml | 13 ++++++ ..._io_netty_netty_transport_4_1_67_Final.xml | 13 ++++++ ...dehaus_jackson_jackson_core_asl_1_9_12.xml | 13 ++++++ ...__org_hdrhistogram_HdrHistogram_2_1_12.xml | 13 ++++++ .../Maven__org_json_json_20090211.xml | 13 ++++++ .../Maven__org_ow2_asm_asm_analysis_9_1.xml | 13 ++++++ .../Maven__org_ow2_asm_asm_commons_9_1.xml | 13 ++++++ .../Maven__org_ow2_asm_asm_tree_9_1.xml | 13 ++++++ .../Maven__org_ow2_asm_asm_util_9_1.xml | 13 ++++++ ...reactivestreams_reactive_streams_1_0_3.xml | 13 ++++++ demo.iml | 40 +++++++++++++++--- pom.xml | 5 +++ .../com/example/demo/DemoApplication.java | 13 ------ target/classes/ConnectDatabase.class | Bin 0 -> 2294 bytes .../com/example/demo/DemoApplication.class | Bin 733 -> 0 bytes .../com/example/demo/models/Profile.class | Bin 3701 -> 3649 bytes 36 files changed, 430 insertions(+), 18 deletions(-) create mode 100644 .idea/libraries/Maven__com_datastax_oss_java_driver_core_4_13_0.xml create mode 100644 .idea/libraries/Maven__com_datastax_oss_java_driver_shaded_guava_25_1_jre_graal_sub_1.xml create mode 100644 .idea/libraries/Maven__com_datastax_oss_native_protocol_1_5_0.xml create mode 100644 .idea/libraries/Maven__com_esri_geometry_esri_geometry_api_1_2_1.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jffi_1_3_1.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jffi_native_1_3_1.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jnr_a64asm_1_0_0.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jnr_constants_0_10_1.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jnr_ffi_2_2_2.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jnr_posix_3_1_5.xml create mode 100644 .idea/libraries/Maven__com_github_jnr_jnr_x86asm_1_0_2.xml create mode 100644 .idea/libraries/Maven__com_github_spotbugs_spotbugs_annotations_3_1_12.xml create mode 100644 .idea/libraries/Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml create mode 100644 .idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml create mode 100644 .idea/libraries/Maven__com_typesafe_config_1_4_1.xml create mode 100644 .idea/libraries/Maven__io_dropwizard_metrics_metrics_core_4_1_25.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_buffer_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_codec_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_common_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_handler_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_resolver_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__io_netty_netty_transport_4_1_67_Final.xml create mode 100644 .idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_9_12.xml create mode 100644 .idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml create mode 100644 .idea/libraries/Maven__org_json_json_20090211.xml create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_analysis_9_1.xml create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_commons_9_1.xml create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_tree_9_1.xml create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_util_9_1.xml create mode 100644 .idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml delete mode 100644 src/main/java/com/example/demo/DemoApplication.java create mode 100644 target/classes/ConnectDatabase.class delete mode 100644 target/classes/com/example/demo/DemoApplication.class diff --git a/.idea/libraries/Maven__com_datastax_oss_java_driver_core_4_13_0.xml b/.idea/libraries/Maven__com_datastax_oss_java_driver_core_4_13_0.xml new file mode 100644 index 000000000..11382471b --- /dev/null +++ b/.idea/libraries/Maven__com_datastax_oss_java_driver_core_4_13_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_datastax_oss_java_driver_shaded_guava_25_1_jre_graal_sub_1.xml b/.idea/libraries/Maven__com_datastax_oss_java_driver_shaded_guava_25_1_jre_graal_sub_1.xml new file mode 100644 index 000000000..6bf150008 --- /dev/null +++ b/.idea/libraries/Maven__com_datastax_oss_java_driver_shaded_guava_25_1_jre_graal_sub_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_datastax_oss_native_protocol_1_5_0.xml b/.idea/libraries/Maven__com_datastax_oss_native_protocol_1_5_0.xml new file mode 100644 index 000000000..7dc984fe3 --- /dev/null +++ b/.idea/libraries/Maven__com_datastax_oss_native_protocol_1_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_esri_geometry_esri_geometry_api_1_2_1.xml b/.idea/libraries/Maven__com_esri_geometry_esri_geometry_api_1_2_1.xml new file mode 100644 index 000000000..78ea4dda9 --- /dev/null +++ b/.idea/libraries/Maven__com_esri_geometry_esri_geometry_api_1_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jffi_1_3_1.xml b/.idea/libraries/Maven__com_github_jnr_jffi_1_3_1.xml new file mode 100644 index 000000000..5b5933644 --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jffi_1_3_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jffi_native_1_3_1.xml b/.idea/libraries/Maven__com_github_jnr_jffi_native_1_3_1.xml new file mode 100644 index 000000000..768bab74c --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jffi_native_1_3_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jnr_a64asm_1_0_0.xml b/.idea/libraries/Maven__com_github_jnr_jnr_a64asm_1_0_0.xml new file mode 100644 index 000000000..7c81fe212 --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jnr_a64asm_1_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jnr_constants_0_10_1.xml b/.idea/libraries/Maven__com_github_jnr_jnr_constants_0_10_1.xml new file mode 100644 index 000000000..c85ec6ac5 --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jnr_constants_0_10_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jnr_ffi_2_2_2.xml b/.idea/libraries/Maven__com_github_jnr_jnr_ffi_2_2_2.xml new file mode 100644 index 000000000..1d8e33229 --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jnr_ffi_2_2_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jnr_posix_3_1_5.xml b/.idea/libraries/Maven__com_github_jnr_jnr_posix_3_1_5.xml new file mode 100644 index 000000000..5efd8c64a --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jnr_posix_3_1_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_jnr_jnr_x86asm_1_0_2.xml b/.idea/libraries/Maven__com_github_jnr_jnr_x86asm_1_0_2.xml new file mode 100644 index 000000000..8b6f57d8a --- /dev/null +++ b/.idea/libraries/Maven__com_github_jnr_jnr_x86asm_1_0_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_spotbugs_spotbugs_annotations_3_1_12.xml b/.idea/libraries/Maven__com_github_spotbugs_spotbugs_annotations_3_1_12.xml new file mode 100644 index 000000000..a815845a2 --- /dev/null +++ b/.idea/libraries/Maven__com_github_spotbugs_spotbugs_annotations_3_1_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml b/.idea/libraries/Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml new file mode 100644 index 000000000..6fe105afb --- /dev/null +++ b/.idea/libraries/Maven__com_github_stephenc_jcip_jcip_annotations_1_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml new file mode 100644 index 000000000..1c380d0bd --- /dev/null +++ b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_typesafe_config_1_4_1.xml b/.idea/libraries/Maven__com_typesafe_config_1_4_1.xml new file mode 100644 index 000000000..ac8a59da1 --- /dev/null +++ b/.idea/libraries/Maven__com_typesafe_config_1_4_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_metrics_metrics_core_4_1_25.xml b/.idea/libraries/Maven__io_dropwizard_metrics_metrics_core_4_1_25.xml new file mode 100644 index 000000000..df673ee29 --- /dev/null +++ b/.idea/libraries/Maven__io_dropwizard_metrics_metrics_core_4_1_25.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_buffer_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_67_Final.xml new file mode 100644 index 000000000..44eea2f66 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_buffer_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_codec_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_codec_4_1_67_Final.xml new file mode 100644 index 000000000..9c663a5ec --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_codec_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_common_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_common_4_1_67_Final.xml new file mode 100644 index 000000000..f6ef17690 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_common_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_handler_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_handler_4_1_67_Final.xml new file mode 100644 index 000000000..036a8e305 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_handler_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_resolver_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_67_Final.xml new file mode 100644 index 000000000..d739d5a68 --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_resolver_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__io_netty_netty_transport_4_1_67_Final.xml b/.idea/libraries/Maven__io_netty_netty_transport_4_1_67_Final.xml new file mode 100644 index 000000000..a51cb29dd --- /dev/null +++ b/.idea/libraries/Maven__io_netty_netty_transport_4_1_67_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_9_12.xml b/.idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_9_12.xml new file mode 100644 index 000000000..a02acc09c --- /dev/null +++ b/.idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_9_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml new file mode 100644 index 000000000..6908885fb --- /dev/null +++ b/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_json_json_20090211.xml b/.idea/libraries/Maven__org_json_json_20090211.xml new file mode 100644 index 000000000..e57dc0ae9 --- /dev/null +++ b/.idea/libraries/Maven__org_json_json_20090211.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_analysis_9_1.xml b/.idea/libraries/Maven__org_ow2_asm_asm_analysis_9_1.xml new file mode 100644 index 000000000..a177d6a75 --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_analysis_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_commons_9_1.xml b/.idea/libraries/Maven__org_ow2_asm_asm_commons_9_1.xml new file mode 100644 index 000000000..ae10a769a --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_commons_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_tree_9_1.xml b/.idea/libraries/Maven__org_ow2_asm_asm_tree_9_1.xml new file mode 100644 index 000000000..fbcb2cee7 --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_tree_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_util_9_1.xml b/.idea/libraries/Maven__org_ow2_asm_asm_util_9_1.xml new file mode 100644 index 000000000..031c51c2f --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_util_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml b/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml new file mode 100644 index 000000000..f17253bf8 --- /dev/null +++ b/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 1d1385e1c..3e6f2e26d 100644 --- a/demo.iml +++ b/demo.iml @@ -35,7 +35,6 @@ - @@ -48,9 +47,6 @@ - - - @@ -60,6 +56,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -72,7 +103,6 @@ - diff --git a/pom.xml b/pom.xml index f0602ffd1..f21303d18 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,11 @@ org.springframework.boot spring-boot-starter-web + + com.datastax.oss + java-driver-core + 4.13.0 + org.springframework.boot spring-boot-starter-websocket diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java deleted file mode 100644 index 64b538a17..000000000 --- a/src/main/java/com/example/demo/DemoApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.demo; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class DemoApplication { - - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); - } - -} diff --git a/target/classes/ConnectDatabase.class b/target/classes/ConnectDatabase.class new file mode 100644 index 0000000000000000000000000000000000000000..c6944b47028103ae4eab302fbed09ebfd6b90b8e GIT binary patch literal 2294 zcmbtWU2_vv7=E_-*mS$KZJm>&exCE5{Qd7Ae*t(K>l$9d zxi08%PLAL$_nCBwrhtu1(Ed7l7eX7s|p1@1=|(HM!h2ZvRQGs zlPq|a=`5MPE!XYMXjroY1$~9Q=eoiQXUx#7n1Pt2p}J|i3XY|(7FNxhrs0_Gict!E z+g+KIjyilQjukAgZd9oigyyE<1%XlZ?VG|k%r)DvJYN{rx?@}xLBk14BBb4j?`6>*C3Yo4}@*2J+F50r7NB7k%E6b!~5GQpk;WOqqHDxSLmoFLR1tXUW zgw^mx#%dKhW7W)%Ml0TC_FH?6-u4$+#T6Z&;|m>E@uh;Z&n)zA;ujjWQx!floSMoP z=4OlK)Z9#t6zO}sF3sjI&z5sJ9be&V9oKMO!N_yCP>>FUL&l_hPGrnAf-W&iE&E+u&6pL=_UP4FHOdH8!DzQO)XbaFV$17PVX>?k1Te=a@r zJcMoIM&7mpcWuvDCfAHbGpvz*krlysCeu$J$OHI2)RNj`gO&$3?68)1yhgRuBxJh+ z7aDF=l6s+Se6QLevS=SsqkZu&`?L>JjYLpD-j))_}9F>Q5K z1!oS7WH9e_nJa^{!Z|klJCwW4&#!QdH#g%*@m+5T(8Q}; zb>cK$qY)}AzaYY!5V&&>9mz=KPekt_wuSfusL4dKa|;^Zw$SwedO?{VNp^4Jg$@)m z+vrj70KF5@f#^f@|AxMSXfnBtBOTbn(c9?aPO_h`BM(s=rNqcKjw!f}>EdW+3ny;l z{LYS1%*Tg${fKW`e{#UYt%l@a8KY@ z3^Z#vj3{M?sdI)_$7%Nsq`7w*KVXRa5`sGz!6@epp8~W;G#FEnRbi+YQ}L#Xv%o)4 tdCiR_E^(OQ^N7ylkEK93#-MP}Vvi)!{6cGQ@rm)4;H2<>j^w~Q{{ienVx#~7 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/DemoApplication.class b/target/classes/com/example/demo/DemoApplication.class deleted file mode 100644 index 25a3a3a6b963a50e4f39dabf4d68dc5745fc038f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 733 zcmah{%TC)s6g?9X9NbW7pio{?=_+K=*`RJxAwjCHOj|W5ELe@5i5Y6oMB_2#x4LS@ zf)C)M5O)kxqAFD_`Ci@UIcH|>A8zje9AYm-9j^mygxJKJ09y=;AC*?_h+&~~Fl4Cr z%}6q=L`usqWgbg=CgO}T?Z_k|8w#s@{G6=2OI0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A@&B=(rLH6C_5Mk>SXhDnx^Vp+14 zco5w^i)-digL@6HT|gXej%h^Z!;_fZGyZ8FKV9iItD%$hq*c(a^6(L|x){EF-{?fY za?sc~<cQVNa85<30)S;oi8Juc;Gii&y4(+7DPqKkPN=HVkAF7Z&{ zVT3N{=>}a^=xVQa?gzvNqWfXo+&dIim&Wk*?8gUJr3A+zg+9dUJXYuM9Kia#ph3ET z4G>@}!4UEZ4*3L%e1b+k0R*d$<$P4SyF^L4g7sDGUvm(1+(EGG*dZnltS6*(KZ4%G z|1F0m5n5ppFiyjG4o?Nobn#bGe#Rt0w=wqNNr;%DQJTRl?-|h@(y(F&cR|1o{)A-? z&sla*obFJfc)LT%;!KB9#X_nB&xLe{GQ~osL)l^>+aa}BP&<_4Xh|8ZhSpDPl~WOg@LSKv2=YHUo50yD&c;-PBLreILh%r4hX6~c9G0JjV5SZ*j#1fj@&M-#>5;E?1IZJ{zm8&;mV< zVM<1sO0i5&Xfci{8D)A5rYAj^xUvGh`1Tcg8q1W5GA+e2EyXjXqD-q``mzTTcaDIG zt5KmZVwuuWrsuIt%kfO Date: Sun, 5 Sep 2021 22:36:17 -0400 Subject: [PATCH 20/29] added jwt authorization with spring security --- .../Maven__io_jsonwebtoken_jjwt_0_9_1.xml | 13 +++ ...oot_spring_boot_starter_security_2_5_4.xml | 13 +++ ..._security_spring_security_config_5_5_2.xml | 13 +++ ...ork_security_spring_security_web_5_5_2.xml | 13 +++ .idea/runConfigurations.xml | 10 -- demo.iml | 12 ++- pom.xml | 13 ++- .../example/demo/config/ProfileConfig.java | 5 - .../demo/controller/ProfileController.java | 44 ++++++++- .../java/com/example/demo/models/Message.java | 10 +- .../java/com/example/demo/models/Profile.java | 80 ++++++++++++--- .../example/demo/repository/ProfileRepo.java | 4 + .../security/JwtAuthenticationEntryPoint.java | 19 ++++ .../com/example/demo/security/JwtFilter.java | 41 ++++++++ .../example/demo/security/JwtGenerator.java | 66 +++++++++++++ .../example/demo/security/LoginRequest.java | 23 +++++ .../example/demo/security/LoginResponse.java | 93 ++++++++++++++++++ .../security/WebSecurityConfiguration.java | 63 ++++++++++++ .../example/demo/service/ProfileService.java | 31 +++++- src/main/resources/application.properties | 6 +- .../com/example/demo/models/TestProfile.java | 2 +- target/classes/ConnectDatabase.class | Bin 2294 -> 0 bytes target/classes/application.properties | 6 +- .../example/demo/config/ProfileConfig.class | Bin 693 -> 409 bytes .../demo/controller/ProfileController.class | Bin 3609 -> 5769 bytes .../com/example/demo/models/Message.class | Bin 2009 -> 2105 bytes .../com/example/demo/models/Profile.class | Bin 3649 -> 4805 bytes .../example/demo/repository/ProfileRepo.class | Bin 683 -> 788 bytes .../JwtAuthenticationEntryPoint.class | Bin 0 -> 1285 bytes .../com/example/demo/security/JwtFilter.class | Bin 0 -> 2764 bytes .../example/demo/security/JwtGenerator.class | Bin 0 -> 3442 bytes .../example/demo/security/LoginRequest.class | Bin 0 -> 810 bytes .../example/demo/security/LoginResponse.class | Bin 0 -> 3183 bytes .../security/WebSecurityConfiguration.class | Bin 0 -> 5736 bytes .../example/demo/service/ProfileService.class | Bin 3091 -> 4168 bytes .../com/example/demo/models/TestProfile.class | Bin 3302 -> 3330 bytes 36 files changed, 526 insertions(+), 54 deletions(-) create mode 100644 .idea/libraries/Maven__io_jsonwebtoken_jjwt_0_9_1.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_2_5_4.xml create mode 100644 .idea/libraries/Maven__org_springframework_security_spring_security_config_5_5_2.xml create mode 100644 .idea/libraries/Maven__org_springframework_security_spring_security_web_5_5_2.xml delete mode 100644 .idea/runConfigurations.xml create mode 100644 src/main/java/com/example/demo/security/JwtAuthenticationEntryPoint.java create mode 100644 src/main/java/com/example/demo/security/JwtFilter.java create mode 100644 src/main/java/com/example/demo/security/JwtGenerator.java create mode 100644 src/main/java/com/example/demo/security/LoginRequest.java create mode 100644 src/main/java/com/example/demo/security/LoginResponse.java create mode 100644 src/main/java/com/example/demo/security/WebSecurityConfiguration.java delete mode 100644 target/classes/ConnectDatabase.class create mode 100644 target/classes/com/example/demo/security/JwtAuthenticationEntryPoint.class create mode 100644 target/classes/com/example/demo/security/JwtFilter.class create mode 100644 target/classes/com/example/demo/security/JwtGenerator.class create mode 100644 target/classes/com/example/demo/security/LoginRequest.class create mode 100644 target/classes/com/example/demo/security/LoginResponse.class create mode 100644 target/classes/com/example/demo/security/WebSecurityConfiguration.class diff --git a/.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_9_1.xml b/.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_9_1.xml new file mode 100644 index 000000000..f25b99b8f --- /dev/null +++ b/.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_2_5_4.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_2_5_4.xml new file mode 100644 index 000000000..68781cd55 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_2_5_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_security_spring_security_config_5_5_2.xml b/.idea/libraries/Maven__org_springframework_security_spring_security_config_5_5_2.xml new file mode 100644 index 000000000..2c8cd9a55 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_security_spring_security_config_5_5_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_security_spring_security_web_5_5_2.xml b/.idea/libraries/Maven__org_springframework_security_spring_security_web_5_5_2.xml new file mode 100644 index 000000000..3562f1210 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_security_spring_security_web_5_5_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea53..000000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/demo.iml b/demo.iml index 3e6f2e26d..33648800f 100644 --- a/demo.iml +++ b/demo.iml @@ -34,7 +34,9 @@ + + @@ -56,6 +58,7 @@ + @@ -117,12 +120,13 @@ + + + + - - - - + diff --git a/pom.xml b/pom.xml index f21303d18..60f7a8768 100644 --- a/pom.xml +++ b/pom.xml @@ -46,11 +46,16 @@ test - + - org.springframework.security - spring-security-core - 5.5.2 + io.jsonwebtoken + jjwt + 0.9.1 + + + + org.springframework.boot + spring-boot-starter-security diff --git a/src/main/java/com/example/demo/config/ProfileConfig.java b/src/main/java/com/example/demo/config/ProfileConfig.java index 8305e7783..1b8d5689b 100644 --- a/src/main/java/com/example/demo/config/ProfileConfig.java +++ b/src/main/java/com/example/demo/config/ProfileConfig.java @@ -7,9 +7,4 @@ @Configuration public class ProfileConfig { - - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } } diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index b84624126..1085b80ee 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -1,10 +1,18 @@ package com.example.demo.controller; import com.example.demo.models.Profile; +import com.example.demo.security.JwtGenerator; +import com.example.demo.security.LoginRequest; +import com.example.demo.security.LoginResponse; import com.example.demo.service.ProfileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -13,11 +21,23 @@ @RequestMapping(value = "/profile") public class ProfileController { + @Autowired + AuthenticationManager authenticationManager; + + @Autowired + JwtGenerator jwtGenerator; + @Autowired ProfileService service; @PostMapping(value = "/register") - public ResponseEntity createProfile(@RequestBody Profile profile) { + public ResponseEntity createProfile(@RequestBody Profile profile) { + if (service.existsByUsername(profile.getUsername())) { + return ResponseEntity.badRequest().body("Username is taken"); + } + if (service.existsByEmail(profile.getEmail())) { + return ResponseEntity.badRequest().body("Email is taken"); + } return new ResponseEntity<>(service.createProfile(profile), HttpStatus.CREATED); } @@ -26,14 +46,30 @@ public ResponseEntity findProfileById(@PathVariable Long id) { return new ResponseEntity<>(service.findById(id), HttpStatus.OK); } +// @GetMapping("/find/{username}") +// public ResponseEntity findProfileByUsername(@PathVariable String username) { +// return new ResponseEntity<>(service.findByUsername(username), HttpStatus.OK); +// } + @GetMapping(value = "/findAll") public ResponseEntity> findAllProfiles() { return new ResponseEntity<>(service.findAllProfiles(), HttpStatus.OK); } - @GetMapping(value = "/login/{username}/{password}") - public ResponseEntity login(@PathVariable String username, @PathVariable String password) { - return new ResponseEntity<>(service.login(username, password), HttpStatus.OK); + @PostMapping(value = "/login/{username}/{password}") + public ResponseEntity login(@PathVariable String username, @PathVariable String password) { + Authentication authentication = authenticationManager + .authenticate(new UsernamePasswordAuthenticationToken( + username, password)); + + SecurityContextHolder.getContext().setAuthentication(authentication); + String token = jwtGenerator.generateToken(username); + Profile profile = service.findByUsername(username); + return new ResponseEntity<>(new LoginResponse(profile.getId(), + token, profile.getFirstName(), profile.getLastName(), + profile.getUsername(), profile.getEmail(), + profile.getChannels(), profile.getMessages()) + , HttpStatus.OK); } @PutMapping(value = "/update") diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index b422f4078..2ada54648 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -13,15 +13,15 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; - @ManyToOne - @JoinColumn(name = "profile_id") - // @JsonIgnoreProperties("messages") + @ManyToOne(cascade = CascadeType.REMOVE) + @JoinColumn(name = "profile_id", + referencedColumnName = "id") Profile profile; String body; String timestamp; @ManyToOne - @JoinColumn(name = "channel_id") - // @JsonIgnoreProperties("messages") + @JoinColumn(name = "channel_id", + referencedColumnName = "id") Channel channel; diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 28f3fdb20..8f36edce8 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -3,47 +3,83 @@ import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; import javax.persistence.*; +import java.util.Collection; import java.util.List; @Entity -public class Profile { +public class Profile implements UserDetails { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; + private String token; private String firstName; private String lastName; private String username; private String password; private String email; + private boolean enabled = true; @ManyToMany - @JoinColumn(name = "channel_id", referencedColumnName = "id") + @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), + inverseJoinColumns = @JoinColumn(name = "channel_id")) private List channels; @OneToMany(mappedBy = "profile") - List messages; + @JsonIgnore + private List messages; public Profile() { } - public Profile(Long id, String firstName, String lastName, String username, String password, String email, List channels, List messages) { + public Profile(Long id, String token, String firstName, String lastName, String username, String password, String email, boolean enabled, List channels, List messages) { this.id = id; + this.token = token; this.firstName = firstName; this.lastName = lastName; this.username = username; this.password = password; this.email = email; + this.enabled = enabled; this.channels = channels; this.messages = messages; } - public List getMessages() { - return messages; + @Override + public String getUsername() { + return username; } - public void setMessages(List messages) { - this.messages = messages; + @Override + public boolean isAccountNonExpired() { + return enabled; + } + + @Override + public boolean isAccountNonLocked() { + return enabled; + } + + @Override + public boolean isCredentialsNonExpired() { + return enabled; + } + + @Override + public boolean isEnabled() { + return enabled; + } + + @Override + public Collection getAuthorities() { + return null; + } + + @Override + public String getPassword() { + return password; } public Long getId() { @@ -70,18 +106,10 @@ public void setLastName(String lastName) { this.lastName = lastName; } - public String getUsername() { - return username; - } - public void setUsername(String username) { this.username = username; } - public String getPassword() { - return password; - } - public void setPassword(String password) { this.password = password; } @@ -94,6 +122,10 @@ public void setEmail(String email) { this.email = email; } + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + public List getChannels() { return channels; } @@ -101,4 +133,20 @@ public List getChannels() { public void setChannels(List channels) { this.channels = channels; } + + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } } diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java index 7b4b5d8b3..050176f9c 100644 --- a/src/main/java/com/example/demo/repository/ProfileRepo.java +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -9,4 +9,8 @@ public interface ProfileRepo extends JpaRepository { Profile findByUsernameAndPassword(String username, String password); Profile findByUsername(String username); + + boolean existsByUsername(String username); + + boolean existsByEmail(String email); } diff --git a/src/main/java/com/example/demo/security/JwtAuthenticationEntryPoint.java b/src/main/java/com/example/demo/security/JwtAuthenticationEntryPoint.java new file mode 100644 index 000000000..b3cfd6105 --- /dev/null +++ b/src/main/java/com/example/demo/security/JwtAuthenticationEntryPoint.java @@ -0,0 +1,19 @@ +package com.example.demo.security; + +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@Component +public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { + + @Override + public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException { + httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, e.getMessage()); + } +} diff --git a/src/main/java/com/example/demo/security/JwtFilter.java b/src/main/java/com/example/demo/security/JwtFilter.java new file mode 100644 index 000000000..0a812d70b --- /dev/null +++ b/src/main/java/com/example/demo/security/JwtFilter.java @@ -0,0 +1,41 @@ +package com.example.demo.security; + +import com.example.demo.models.Profile; +import com.example.demo.service.ProfileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.WebAuthenticationDetails; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class JwtFilter extends OncePerRequestFilter { + + @Autowired + private ProfileService service; + + @Autowired + private JwtGenerator jwtGenerator; + + @Override + protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException { + String token = jwtGenerator.getToken(httpServletRequest); + if (token != null) { + String username = jwtGenerator.getUsernameFromToken(token); + Profile profile = service.findByUsername(username); + if (jwtGenerator.validateToken(token)) { + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(profile, null, null); + authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(httpServletRequest)); + + SecurityContextHolder.getContext().setAuthentication(authentication); + } + } + filterChain.doFilter(httpServletRequest, httpServletResponse); + } +} diff --git a/src/main/java/com/example/demo/security/JwtGenerator.java b/src/main/java/com/example/demo/security/JwtGenerator.java new file mode 100644 index 000000000..c397dfba2 --- /dev/null +++ b/src/main/java/com/example/demo/security/JwtGenerator.java @@ -0,0 +1,66 @@ +package com.example.demo.security; + +import com.example.demo.models.Profile; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.util.Date; + +@Component +public class JwtGenerator { + + @Value("${chatter-box.app.jwtSecret}") + private String secret; + @Value("${chatter-box.app.jwtExpirationMs}") + private int expiration; + + private Claims getTokenBody(String token) { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } + + public String getUsernameFromToken(String token) { + return getTokenBody(token) + .getSubject(); + } + + public Date getExpirationDate(String token) { + return getTokenBody(token) + .getExpiration(); + } + + public String generateToken(String username) { + return Jwts.builder() + .setSubject(username) + .setIssuedAt(new Date()) + .setExpiration(new Date(new Date().getTime() + expiration)) + .signWith(SignatureAlgorithm.HS256, secret) + .compact(); + } + + public String getToken(HttpServletRequest request) { + String header = request.getHeader("Authorization"); + if (header != null && header.startsWith("Bearer")) { + return header.substring(7); + } + return null; + } + + public boolean validateToken(String token) { + if (token != null) { + try { + getTokenBody(token); + return true; + } catch(Exception e) { + System.out.println("Error: " + e); + } + } + return false; + } +} diff --git a/src/main/java/com/example/demo/security/LoginRequest.java b/src/main/java/com/example/demo/security/LoginRequest.java new file mode 100644 index 000000000..b30c68be2 --- /dev/null +++ b/src/main/java/com/example/demo/security/LoginRequest.java @@ -0,0 +1,23 @@ +package com.example.demo.security; + +public class LoginRequest { + + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/src/main/java/com/example/demo/security/LoginResponse.java b/src/main/java/com/example/demo/security/LoginResponse.java new file mode 100644 index 000000000..edaa0894a --- /dev/null +++ b/src/main/java/com/example/demo/security/LoginResponse.java @@ -0,0 +1,93 @@ +package com.example.demo.security; + +import com.example.demo.models.Channel; +import com.example.demo.models.Message; + +import java.util.List; + +public class LoginResponse { + + private Long id; + private String token; + private String firstName; + private String lastName; + private String username; + private String email; + private List channels; + private List messages; + + public LoginResponse(Long id, String token, String firstName, String lastName, String username, String email, List channels, List messages) { + this.id = id; + this.token = token; + this.firstName = firstName; + this.lastName = lastName; + this.username = username; + this.email = email; + this.channels = channels; + this.messages = messages; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public List getChannels() { + return channels; + } + + public void setChannels(List channels) { + this.channels = channels; + } + + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } +} diff --git a/src/main/java/com/example/demo/security/WebSecurityConfiguration.java b/src/main/java/com/example/demo/security/WebSecurityConfiguration.java new file mode 100644 index 000000000..228e861b9 --- /dev/null +++ b/src/main/java/com/example/demo/security/WebSecurityConfiguration.java @@ -0,0 +1,63 @@ +package com.example.demo.security; + +import com.example.demo.service.ProfileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +@Configuration +@EnableWebSecurity +public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Autowired + private ProfileService service; + + @Autowired + private JwtGenerator jwtGenerator; + + @Autowired + private JwtAuthenticationEntryPoint entryPoint; + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Bean JwtFilter jwtFilter() { + return new JwtFilter(); + } + + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(service).passwordEncoder(passwordEncoder()); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .addFilterBefore(jwtFilter(), UsernamePasswordAuthenticationFilter.class) + .cors().and().csrf().disable() + .exceptionHandling().authenticationEntryPoint(entryPoint) + .and() + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .authorizeRequests().antMatchers("/profile/login/**", "/profile/register").permitAll() + .anyRequest().authenticated(); + } +} diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index c145e0896..49440e9cb 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -3,13 +3,16 @@ import com.example.demo.models.Profile; import com.example.demo.repository.ProfileRepo; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import java.util.List; @Service -public class ProfileService { +public class ProfileService implements UserDetailsService { @Autowired private PasswordEncoder passwordEncoder; @@ -23,6 +26,7 @@ public Profile createProfile(Profile profileData) { profile.setLastName(profileData.getLastName()); profile.setUsername(profileData.getUsername()); profile.setPassword(passwordEncoder.encode(profileData.getPassword())); + profile.setEnabled(true); profile.setEmail(profileData.getEmail()); profile.setChannels(profileData.getChannels()); return repository.save(profile); @@ -32,6 +36,31 @@ public Profile findById(Long id) { return repository.findById(id).get(); } + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + Profile profile = repository.findByUsername(username); + if (profile == null) { + throw new UsernameNotFoundException("Profile with username " + username + " not found"); + } + return profile; + } + + public Profile findByUsername(String username) { + Profile profile = repository.findByUsername(username); + if (profile == null) { + throw new UsernameNotFoundException("Profile with username " + username + " not found"); + } + return profile; + } + + public boolean existsByUsername(String username) { + return repository.existsByUsername(username); + } + + public boolean existsByEmail(String email) { + return repository.existsByEmail(email); + } + public List findAllProfiles() { return repository.findAll(); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 94980e58a..635656c8b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,8 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=root +spring.datasource.username=zach spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +chatter-box.app.jwtSecret=someSecretKey +chatter-box.app.jwtExpirationMs=36000000 \ No newline at end of file diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java index d25a09f3c..b5fb0bf6b 100644 --- a/src/test/java/com/example/demo/models/TestProfile.java +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -34,7 +34,7 @@ public void constructorTest() { List expectedMessages = Stream.of(new Message(), new Message(), new Message(), new Message()).collect(Collectors.toList()); // When - Profile profile = new Profile(expectedId, expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, expectedChannels, expectedMessages); + Profile profile = new Profile(expectedId, "", expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, true, expectedChannels, expectedMessages); // Then Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); diff --git a/target/classes/ConnectDatabase.class b/target/classes/ConnectDatabase.class deleted file mode 100644 index c6944b47028103ae4eab302fbed09ebfd6b90b8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2294 zcmbtWU2_vv7=E_-*mS$KZJm>&exCE5{Qd7Ae*t(K>l$9d zxi08%PLAL$_nCBwrhtu1(Ed7l7eX7s|p1@1=|(HM!h2ZvRQGs zlPq|a=`5MPE!XYMXjroY1$~9Q=eoiQXUx#7n1Pt2p}J|i3XY|(7FNxhrs0_Gict!E z+g+KIjyilQjukAgZd9oigyyE<1%XlZ?VG|k%r)DvJYN{rx?@}xLBk14BBb4j?`6>*C3Yo4}@*2J+F50r7NB7k%E6b!~5GQpk;WOqqHDxSLmoFLR1tXUW zgw^mx#%dKhW7W)%Ml0TC_FH?6-u4$+#T6Z&;|m>E@uh;Z&n)zA;ujjWQx!floSMoP z=4OlK)Z9#t6zO}sF3sjI&z5sJ9be&V9oKMO!N_yCP>>FUL&l_hPGrnAf-W&iE&E+u&6pL=_UP4FHOdH8!DzQO)XbaFV$17PVX>?k1Te=a@r zJcMoIM&7mpcWuvDCfAHbGpvz*krlysCeu$J$OHI2)RNj`gO&$3?68)1yhgRuBxJh+ z7aDF=l6s+Se6QLevS=SsqkZu&`?L>JjYLpD-j))_}9F>Q5K z1!oS7WH9e_nJa^{!Z|klJCwW4&#!QdH#g%*@m+5T(8Q}; zb>cK$qY)}AzaYY!5V&&>9mz=KPekt_wuSfusL4dKa|;^Zw$SwedO?{VNp^4Jg$@)m z+vrj70KF5@f#^f@|AxMSXfnBtBOTbn(c9?aPO_h`BM(s=rNqcKjw!f}>EdW+3ny;l z{LYS1%*Tg${fKW`e{#UYt%l@a8KY@ z3^Z#vj3{M?sdI)_$7%Nsq`7w*KVXRa5`sGz!6@epp8~W;G#FEnRbi+YQ}L#Xv%o)4 tdCiR_E^(OQ^N7ylkEK93#-MP}Vvi)!{6cGQ@rm)4;H2<>j^w~Q{{ienVx#~7 diff --git a/target/classes/application.properties b/target/classes/application.properties index 94980e58a..635656c8b 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,6 +1,8 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=root +spring.datasource.username=zach spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +chatter-box.app.jwtSecret=someSecretKey +chatter-box.app.jwtExpirationMs=36000000 \ No newline at end of file diff --git a/target/classes/com/example/demo/config/ProfileConfig.class b/target/classes/com/example/demo/config/ProfileConfig.class index b88a9368ccb8c2ff1682bfda0e0fb295fbdb8d7f..bb215688ef61ea7e8c07171fe4f35314175895e8 100644 GIT binary patch delta 124 zcmdnWI+I!S)W2Q(7#J8#7=*YOm>Kxl83foF1SiTCOx9ymn)pa&asZ&IS$KT!3hZ@K7fxx zyreCgI5da1`ORb|@%zWi8-N`w7BGt0EanPG#d$u91%}MN(#jn$jI6EK8PXNglnlkH z((*J48q!{hhEJ2}s_}$h7goi6f0%aHDr8u#dM4oVUIblV@}>+7_l$0-Hm_OJQogJt z-5&9FMHt>0+dS4Dy~r{guB}&%ZS$~em2S7J2qc}~@KAb@Rqla%_Mz(x9{_pnHv^F_ zok!ZKK-N{LNZXOt#tEm4CTW}hl9M_o?;RIktGq0QCa%JTiL572NHlr=C4Z|UZUw{c zu#7#^kxiuRjU$6B*&W7fBk|13mDu_pzYHrweQbtOte5*jxA|G4BRz*@r0EL8PYU$s zk)@cUj#FloM>n3qo|5A{#Y{5Hqd@g|ZvkUef$9lN5=ji+PRM}VD^gd_7<@cjn%6-*e7;&OLYj z{oi-q1@I{Tl|e7&n(+_{8O+1T;2h3p(1Kzb3oS5V$;T!6`1v&K6dZZ$HlvISa@eBm zUXdG~QC=~4=x$e;t4TkuJ|kin<$=@z_*&&YS5&EO@xEQfwBh0jabUy#igW%G(` zUX{&j8Qh02$x&aH%~#U+Y6@RV;dKR_dfA;9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(JvWvJcPgtRD zM7j7jclnZ&lg%1#VyT8Jn5bbAQ#I6aqlOQ0gO6aG5?OHG#Q8tO!Qm_2O|ZnjkqZB1 zO8hYBY zApw5nEEUxyKy&pJh348Rip_hcu$pt$DN5&2>r?<(WYn9ie~HB|V}|+Wm_xE`q>-{L zQd+8$tV9xFs+)p~W+f$CXmCAc87(Hwwtx%d3Yr`R(&n62`3DNWaU-p=Y&P%aR=A3_ ztio;1lDTZEJFh0yXqC)sCW2fHtmfg n>0vI@=lM)SotWNTi%j2+VUpfDW0HO<;DH&xFwa(6=S$!}_(hU- literal 2009 zcmai!TTc@~6vxlB+ZO67caSO|7p0WTs-UPK2JsRM2$4#BGfO*`CEHoj-5PlFBWWTr z@xc$^hcf=p>;_8N!b9iG?3~N*T&92j{r*El3-mlo8G77KXmNpQeI#Oj;DM<{aXFVI+Qiv@dK$! z(poRWXe{R9tyHpR2eQ0tyLAbrHb3BV<@i#4L@FL1vc9qUvA88Db6E4fIIa{lx>53~ zmOQenhpx2Bvg%n?uPj~P+74A0XAq7OEgpHqzE1(#wu=f)zo@{M0TY zt|2i&9UG34@9Wh)Su5J;1~Ygi+ugNm4xgisMzHUoJ+14rDSh9raQ>h24N2&hUs==! zgDC5ZUzoXbQwIB9dE2g`f&oTEP^uz>bri5WKhP(@Pki6eX;AJ1YLtPalS6;26fq>2Pqe? zds`HQnGFA9R;s-Vf8o`={B&Zosyn`K+Fy$zXL9&B!Xt0BCkW8Or2ZiYq zN)%>JC|Q_2A)_#8oKWh_YYy2G{2TDu4qrFmtp}b4X+lR?2t7qn;4`WT?>K#C%IRE_ zddJxsutmiTsB(?C6kG;|yi516GNc8m6Da(o#CLoMvrOxclR9>DhLe@E0$>*k;1B+VwoPsGc`n diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index 523eba33ecf61e552c0f9fbec1eb1b8fd8028eca..3606cbccac763ab705ca4a6283a77a47bf271073 100644 GIT binary patch literal 4805 zcmd5;S##S|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+EHoU95>`WEDpPbQ$7J<4h^>W^^vF+Ik}^%18|C8=i=)EdpxLg?~h zoHmuLt~t;?>OmVknvji)TBA>BQNff>GCfu@J)uukOz9-kBAA}^VB*S(;>Fq5Xi3SG zNir=fnU>W|nIzL1n4b1v;;s=f4NImKB~v!Zw4r4BOwE){GHrory9X1$wup&eheoSP zrd*O~SIM-dX38a*s$hE7gNfgL#Kf;vLr7Kilut4}S2BIBX38g-z5~;X9!%VUA|~!0 z8m%k4g`Q+OR4@hIVgpLPPbc{7HP LKQ-LWwu$}*wTiY$ diff --git a/target/classes/com/example/demo/repository/ProfileRepo.class b/target/classes/com/example/demo/repository/ProfileRepo.class index d94a94bdf6faa1247a787bf96ce26babbf3b9f1b..6035cdffc55ded64a11a4753fc986f6d6a325de3 100644 GIT binary patch delta 172 zcmZ3@I)zR6)W2Q(7#J8#7$n#kMA;d{*crqp3g2=RNUg{$E-7}Z3@uJA%1g{mWn>W5 z@X1OnOVrOv%uCk~E-A{)OSjgHVr1ZjDRs?F%*L$V`l%qw delta 69 zcmbQjwwhJ=)W2Q(7#J8#7)00^1lbvc*cpT;3g6mnz*x%2$TWEwla?F;M;b4YzMnDb#_YWkMO~t z;)_Nf`~m(bo%=zyD#`SOdJRFu0x?M4~2zotwJhSv}w3u+ep=TW4wU6+PppM%h!h73!R<# z)Q(y#N1Mn;_0N|USQ%P8=}}ka zr0QG7Xd^IR*!~kztny1R%CCZe!%xHrTPB0g4BuR~g6(MOGsMUE^CX`U7??tq&ujwV zTaIu1T3{NfIQTW&H2ZR^GvdSAC#1e0ox)j`3>O1tI5Hn+DkbQCCXVB8`8azHvzUv~ nIb6m(=e@#_W9+$#1zh9bQz-_6VPHTs#r62Sftzfjb{B!4JpFWb literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/security/JwtFilter.class b/target/classes/com/example/demo/security/JwtFilter.class new file mode 100644 index 0000000000000000000000000000000000000000..52c4f5f081bfdb612f91e488a75f9d959c284c32 GIT binary patch literal 2764 z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erator.class b/target/classes/com/example/demo/security/JwtGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..063daf804e445e256b5b834db68c92d14cb7af09 GIT binary patch literal 3442 zcma)8`EwM<8GWs5R=Xn^1PBWofid7k5*i2NBNje{xFjSjvqA)H$C=%2q!GI_>zQ68 z+3}f>gT%%Txk!8_zC)@Al@chfa``9!kiRMA%IlfY?!vAM)ztP{@MZ9R>B?CVdXbWV{mr9^(e9k^+TLs&lu`5f(xPX4yC~;9|E!gjwi{Sy?40uaMa!-zSkrc)ENQa!oPH6wd;3ed zSz9UT@6LJ)gLbJjI5)2{VKgrbB;`WM@k3t%VpL#TL-~UhsfmDEZTlS8QI88Wr*};Y zw2XLpy1HZBapkdcF)RHko7>Qv^>TJ$+V&m&9Z$BXS%>>dkLSFiB^T^ssUWSqEP56( zD*KLFw8rMuVd+Z7<@wx;IV07ScUHRlz5JrUK)N2oUE_{t%>|x2FSAOES|bJ9DFzye z@LOQbgjBO$e$v(;5)a0(o`z2Z(swy?$oGn&6M>x#9W=<>TIyG!IbbX9dHeS(mz7hn zv=pQ2n29zhW1op~9EU(+WxE1Hk+B6r~gw{y63hjkbE4JR%GmY63dAkdq}% z=OI=NIhXOueoh{8G)30d=6X80|T#^conai zxDROqubX%SKQr-joHy_b6Tif-1iBmZ!^FdQ#Kf<0!NhOyTN7{MEdv)#yp4ARI>Ve- z(q`g!xMbq@_=Abv7}UQ1XyQ+}WZ=&xF5@pI{)%@^yoU<}Yq(6h`Ob@BaT$2u#0S_% zfcHz=mp%bC@gYV{e1yLVtgEuCf|h~5oA?-?2yCpbMm=MH*(rosG7kE_=RdmD#HaX7 z51*U(0v8N?Y2qKaLN2ea%2*y%A5UfHWRAV6W-4;ain$d=rjLcxRi&51=Y23p**G^vLn)qYe28)$nDL(u7?+-A*1$No`1&h}?q5D3^J=C%I6nwV!U5EHr zXz~G$ZQ*1m?}~sK3E)9I6t1)B)4EoEJ`4c3>js+o{*C5kv^1fA8LdrNMw`GlFs_Cw z+GICc!_mM-UKZ~}7kaRXv)V;B4be>OLcjem+|{F;Z58|gV;I7|*ze)kZ>q2VIugrh z7pVH_L^H)V(_1f+d{*tJD)v*2>_3LbzsG*E-u^b)znAv6t=|3iGgpiZlJ4Y37ak> zIk3i9!d+K|#=aRk$6fReva6l^>Lx`r`r7Z-$V|oW7L4EkUA0r{AR}nPAxb46{)f#5 z4kOO{2qy)OU^I^BBF*S{(*56JN0|GQEmtP4Ve?n$C45`Dwl3kGfhBBP!o5q_-h74H zEi4NYcgF#4BC|nQTIeE4Mw!e>2O-)?AXWnHATh^qls@UH5^_4Gj1H998#gfCvl6G~ QC&3BFV__-k`gscYKXdeC3jhEB literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/security/LoginRequest.class b/target/classes/com/example/demo/security/LoginRequest.class new file mode 100644 index 0000000000000000000000000000000000000000..0d7aecc46e66a3730f7da07805622405d1912159 GIT binary patch literal 810 zcma))OH0E*5Xb-9Hho5G)z-J*MXG|icvHLxp6Uau-nZ#ew=_xJYI&XLe@(zuC?E$Lkw_9jq2%VWEHw7L8fTVL68thI|wX<#SIkOgFmxhC4m( zcbukH((mljd7p>jZJ^o=**)n?z0Z)YZ(K5D4uUpSl^fC*$C1|(>YTTFai75Dy-Tj7 z@xOx^eI-MNdczGoN8E9*-xE$-c!3iNH&RmHJB^?t{WEbLiBOYrsU!5o0B*Lvk%U(Y zN0X}c-#G?#>PYCTpnb{}4XTAA5Yzp1Fq&yI^oq?OQm#0ZW}3<<*0#AJ8wC_?WRbIx zM~-3re=`xs@PbcTUEyl1(OX#bKq>mDVZ5WBv|3S3(7kXSs886q;p`!O3yZEigyHIyz=98_zOppmb|e)e15 vpqY6XX6ekLpNAHPY9dp5oT-w?R7++`k26(?srCnxx!VC#K4zLDo5K7j@2iP% literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/security/LoginResponse.class b/target/classes/com/example/demo/security/LoginResponse.class new file mode 100644 index 0000000000000000000000000000000000000000..b3e97ffa4ff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es/com/example/demo/models/TestProfile.class b/target/test-classes/com/example/demo/models/TestProfile.class index 57155895fade5a2730ed24c7c978ec10995dd5e5..2eb10c7b42c795490d7079c73165ac6868167d24 100644 GIT binary patch delta 1052 zcmb`G+iwg}9LK+BcV^C+*^_8&QW>SKD!ScWmtJT~RjI{`Xsa$oiwEMav@Ug7s_yGj zL*h~5rJkgkOr;6WH1Rhyjf4b|c;Jor{q`2()joXBXHI_SH}m`K%m;U1X34~_@z(%q z@W{aeBqY{32q3|+-ob{U^0JlyS{<~ZU176Ahr$+xtqR*DwmS$T5ke<+IM|6@OkEP) z61yF^NGR;#K6|-OsD8+?5%p54q>-x%X%A@5Rw>kD zF_utu7434j>h#%~%vowPL46(C`{BKHyaUncMX|VRxTb3vu5{HHW;NJR*Y;t&#OxS@ zMG$9@1XN0-m`o;{$zpPtBvXh#1G z3d7i#c4Ajy72S-5Wy+fKWvi*|Z((b)vR^sRlEtna^HJj3aUZ3w?HWGj&|>;1qs8(u zmlo-xoEGI{-hcLIW(0l;btm((L{UzbD9p(c;hZc{kdq~JPL@zPS;EN6dXtxx%F237 b9|FHX_8+deD($M6K7uCvE31XH2C()wGh?Bm delta 1045 zcmb`F&u>go6vw}J=Dm0Cd%X$CB;_e>wWaNJhH6zQZ51sxQd9MtBH9F{T1wTAp;Y~7 z%k)`T+H_&rG~S4XE$M$C5wQ@FNJv;~oHM_IwVC9c&wDxd%sHRABTGKJWpnedUISPQ z&%sKxO0+o$pq0aR2RpEnC{a|>wi_{p4uw4moeFyu_DSq_5JGDn4&b1JLpaQIMB=DK zmjgH5nHPhBU^yzLjDqI&fxezoz1iU)OmLXw@QA}>Bs8Xw5GeJkgNtVe3>gp;-muj_J8v1HeFgd9j{!kFD=1dd z(`w3svKdZ7%n$?+rf8*JI;bMn=>kL$r6++^bU1)YFQ#H5>`kkpMy|@IcR)*~N?`-F zuBPfW^p?BTq|Vl+&r+K=aOeyC^o0GSI}&vb*K{pcx+;l+2D{3&eHbsXG{RsJL>VLj zRT3#ClgVbXm>ed_l*go)G!gF=MA-XfSH-7kf+VdzM|*yt{eIBIJbzDmn#}wrzR{hk zqq!BnVjb#fyF7fsdZHi};1lgvPbx$Bhz24Pi|`&Bi7a&B88)F2lKz*IXd+UW#;%kP zy9UklV=OCOwmDbULS=u;+L96d&UqeR=GqY-g{~d-QRLdL;iH(6>0>!1%SQ<%>7$gA z@=^Am{h4WjmhOt@WQl^TERmm;B|=$QVqsR6&{ Date: Sun, 5 Sep 2021 23:18:09 -0400 Subject: [PATCH 21/29] updated profile service tests --- .../demo/controller/ProfileController.java | 5 -- .../example/demo/repository/ProfileRepo.java | 2 +- .../example/demo/service/ProfileService.java | 12 ---- .../demo/services/TestProfileService.java | 62 ++++++++++++++---- .../demo/controller/ProfileController.class | Bin 5769 -> 5769 bytes .../example/demo/repository/ProfileRepo.class | Bin 788 -> 652 bytes .../example/demo/service/ProfileService.class | Bin 4168 -> 3641 bytes .../demo/services/TestProfileService.class | Bin 3983 -> 4927 bytes 8 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index 1085b80ee..5c3796212 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -46,11 +46,6 @@ public ResponseEntity findProfileById(@PathVariable Long id) { return new ResponseEntity<>(service.findById(id), HttpStatus.OK); } -// @GetMapping("/find/{username}") -// public ResponseEntity findProfileByUsername(@PathVariable String username) { -// return new ResponseEntity<>(service.findByUsername(username), HttpStatus.OK); -// } - @GetMapping(value = "/findAll") public ResponseEntity> findAllProfiles() { return new ResponseEntity<>(service.findAllProfiles(), HttpStatus.OK); diff --git a/src/main/java/com/example/demo/repository/ProfileRepo.java b/src/main/java/com/example/demo/repository/ProfileRepo.java index 050176f9c..3ca7101a5 100644 --- a/src/main/java/com/example/demo/repository/ProfileRepo.java +++ b/src/main/java/com/example/demo/repository/ProfileRepo.java @@ -6,7 +6,7 @@ @Repository public interface ProfileRepo extends JpaRepository { - Profile findByUsernameAndPassword(String username, String password); +// Profile findByUsernameAndPassword(String username, String password); Profile findByUsername(String username); diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index 49440e9cb..a53e06b53 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -65,14 +65,6 @@ public List findAllProfiles() { return repository.findAll(); } - public Profile login(String username, String password) { - Profile profileToCheckPassword = repository.findByUsername(username); - if (verifyPassword(password, profileToCheckPassword)) { - return profileToCheckPassword; - } - return null; - } - public Profile update(Profile profileData) { return repository.save(profileData); } @@ -80,8 +72,4 @@ public Profile update(Profile profileData) { public void deleteProfileById(Long id) { repository.deleteById(id); } - - private boolean verifyPassword(String password, Profile profile) { - return passwordEncoder.matches(password, profile.getPassword()); - } } diff --git a/src/test/java/com/example/demo/services/TestProfileService.java b/src/test/java/com/example/demo/services/TestProfileService.java index a3de52991..bafbcd09d 100644 --- a/src/test/java/com/example/demo/services/TestProfileService.java +++ b/src/test/java/com/example/demo/services/TestProfileService.java @@ -66,20 +66,6 @@ public void findAllProfilesTest() { Assert.assertEquals(expectedProfiles, actualProfiles); } - @Test - public void loginTest() { - Profile profile = new Profile(); - String username = "test username"; - String password = "test password"; - profile.setUsername(username); profile.setPassword(password); - - Mockito.when(repository.findByUsername(username)).thenReturn(profile); - service.login(username, password); - service.login(username, password); - - Mockito.verify(repository, Mockito.times(2)).findByUsername(username); - } - @Test public void updateTest() { Profile expectedProfile = new Profile(); @@ -103,4 +89,52 @@ public void deleteByIdTest() { Mockito.verify(repository, Mockito.times(2)).deleteById(id); } + + @Test + public void existsByUsernameTest() { + Profile profile = new Profile(); + String username = "Ben"; + profile.setUsername(username); + + Mockito.when(repository.existsByUsername(username)).thenReturn(true); + boolean existsByUsername = service.existsByUsername(username); + + Assert.assertTrue(existsByUsername); + } + + @Test + public void existsByEmailTest() { + Profile profile = new Profile(); + String email = "Ben@gmail.com"; + profile.setEmail(email); + + Mockito.when(repository.existsByEmail(email)).thenReturn(true); + boolean existsByEmail = service.existsByEmail(email); + + Assert.assertTrue(existsByEmail); + } + + @Test + public void findByUsernameTest() { + Profile expectedProfile = new Profile(); + String username = "Ben"; + expectedProfile.setUsername(username); + + Mockito.when(repository.findByUsername(username)).thenReturn(expectedProfile); + Profile actualProfile = service.findByUsername(username); + + Assert.assertEquals(expectedProfile, actualProfile); + } + + @Test + public void loadByUsernameTest() { + Profile expectedProfile = new Profile(); + String username = "Ben"; + expectedProfile.setUsername(username); + + Mockito.when(repository.findByUsername(username)).thenReturn(expectedProfile); + Profile actualProfile = (Profile) service.loadUserByUsername(username); + + Assert.assertEquals(expectedProfile, actualProfile); + } } diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index 70c300a11451e7f4775ad6608ce0e564c56e9991..e61fb6cd11905023ec8ad50e82f04c654d91d3ae 100644 GIT binary patch delta 71 zcmeCw?bO|HSD4Xw@;%{Qsum2q43-SS3^oih47Lnv40a3#4E79;3=Rz5Kr)oUi6M=_ ae)3+CU5p-+D@40keHl0y{3f%DH30xl{twXr delta 71 zcmeCw?bO|HSD4Xa@;%{Qsff$?3=9k=45I7|LhKB}>?3nK#y11kd~0~=5g tDpC>fd@!3G4L|*foXmQ0U*r=)F;Tm003-w3sL|8 delta 209 zcmeBSoxff$?3=9k=3=-@NqU;P}>H5JXMVWc&))OZRPqcRAfb3_R#UyvRa)K+Vhy{6Lb4L4ZLJObamx M18Fv(J`n~60ENXM$^ZZW diff --git a/target/classes/com/example/demo/service/ProfileService.class b/target/classes/com/example/demo/service/ProfileService.class index 2ea58fd418b130821183834cd6657dd883eb71ed..25f086fdfc2798aa7728b05c8def4da690503e40 100644 GIT binary patch delta 1221 zcmbVMSx*yD6#nj%cIwQP1`UXT*do-W2t&n7)l!6)O7@DKPGjPaalX$y%jzI^B0d(ZjKI`iE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{6+;GiONc!wK@t| zCYLxGs6rwNw=ad;#|4U&$sA;TC} diff --git a/target/test-classes/com/example/demo/services/TestProfileService.class b/target/test-classes/com/example/demo/services/TestProfileService.class index ea65c92c0e906e40f9013eebb277ba93b66d7273..2c73efb48dab7aec87442a246ee06e1163f03118 100644 GIT binary patch literal 4927 zcmb7I340UQ6+I(t#>i8=V4%>DKt2LCG6-U5A?#~nBHIKTD5OmoOJg%2%_uV?V>esd zB+c3;EnU(*-M2JN($v_YO=!B)CEb@l)34{wrjaZP@%L%ooBQ6q@7#OOyI1m+|GxeP zfX(<%8e1@?Vmyr$#uiX=CJhs3Wp*x&B1-bGRM;|>Td@H5HB(dmn$vLLilQg-itLz3 z<2)u?F@+C_o%?0=fixb(Ln8Iwlk%mCzrQNSz}T!m5WBUV3h1^bvb*)vB%7!ag++%6)Zbiu{^V695-Ea zv}o+LEZfsP)3#g%ojKbX&z9``IU3FmaHN9j8qS27HyR!ju0>}I2V3Qs8dLq&StIX> zL6>W7W!-hp+fL!2mA4CqqhOc6+buh$H9qF(C4;NyvaXS@IHot1%{xxFTw`q+_o4BazAxoqK)#$=hU8ii1*VAWi+C88_3QP2p#-S_`&g+BO4QKXHT zR$<>%e<84&G7GZptUjSKH=G^sKI%&8K+f{r?!@0rOk@j< z+=D9`{*1q9_$&UV;_n*%fq$y_mxh0ft=>7|A?>69HmU+-U6qMLqf+G>1vs=2-T06r z#8*>66ddTj=0$2y>ud8*VlApK<75))CS_mhTz7v@4dW&Z#~d^Beiz6dPrMAUPSMUEPU$7kIn<9a!p_tIgEu7A@bBw7kE_`o6v4?j~2CkQ`I2^vyMrZXNMV1w$Z2GbKdMvQ`dIWLQ@G1_W^d+GL-d&S; zB+z&eo6hbAfom5SLG9Y>lJC3+8q>(h!TZ>t$h)=4LnHQ7^Ap98VGgnucNZZ^fjL>+ zz(5Zxyc+gAMkzuT>oRn0buCdrE0Y|R^E$I(H<4t^uIQTvFG0|}=oO=I$aGw9ke!Lm zDmv2d%5gL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{`O%JdFPV8vw&6 delta 1478 zcmZ9MYg1cQ6o#LZKu$#O6;Wfo zR;$wXc)wKZ{cbxtNM)w_+3}b7(I23$m4pan=B&N;y1e_{?^!3mHO%dm7 z_}Ijt%|Rb72Fqw+$j2}bsyE`}Ar7fIY;#1{qkhVGxKujzSL)*tqS|;&CXr%~MzZop)81B_=20$-!7UV_{FFCdcE6nDe*0q0u`PO{Y&!rp7FM(^F&7Oe|j% z7>gxhnb@A0-Z5vkWY)8Vtrm681$SM8;TGC$o;GB8#?VU0=8WN4o-;hp3l`1J4OVm3 z@FFi6&hoO&D~5BtYIu#;4Rf3~T;QUOV|at}Hg6i<;-Y5WHoU{THt!kU=L3tiC!(jK z?bDffqJ4KN6`kper!zJm8ZPmX;bSfvKH;)Oc}A{QKb?-HlF^ef-EY^x(&Y@F@|odt zHDBR8&jy)>P4dRw@`xk|lz1LlH_M7@wk&pQE*9ptWihR@WiL{T z-R8`hs^$)fDF&=#yI7O+OSzp+*;(8nwJxds({x3&whEntCcMICjqtfim~0Uy+FK=+ zI?wrDuS9onr(i7c+$mX$T?NFW5qo!`*Ot@olAT46a1O;KU54F) z=U#=kr+`--ND1D#KwVbx>T^0pi(E#yhkFI@kleOQJQw##l`{6Cx$a`FTVg92_vBBI z`s;$KJckx>jr@YUuc9VWvA#dlHcxG6^E`E}KjX=^U8CN`0&7CoSnFa~f+cN|-LTU0 zlrCT|;QgJle8=!rfp(!XH_7LPkn+-lpI!poPc?l)EF$@Sk!BwU8OX_=mu{$d)o{Nw zsP2CDO50w63q=@v73-baU~RS`5}Kz`uGF|d)&G=gWp Date: Wed, 8 Sep 2021 15:27:19 -0400 Subject: [PATCH 22/29] websockenconfig --- ...ence_hibernate_jpa_2_1_api_1_0_2_Final.xml | 13 +++++++ demo.iml | 3 +- pom.xml | 8 +++- .../example/demo/WebsocketApplication.java | 2 +- .../demo/controller/SocketController.java | 17 --------- .../demo/controller/WebSocketController.java | 36 ++++++++++++++++++ src/main/resources/application.properties | 2 +- target/classes/ConnectDatabase.class | Bin 2294 -> 0 bytes target/classes/application.properties | 2 +- .../example/demo/WebsocketApplication$1.class | Bin 1584 -> 1678 bytes .../demo/controller/SocketController.class | Bin 966 -> 0 bytes .../demo/controller/WebSocketController.class | Bin 0 -> 2114 bytes 12 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 .idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_2_Final.xml delete mode 100644 src/main/java/com/example/demo/controller/SocketController.java create mode 100644 src/main/java/com/example/demo/controller/WebSocketController.java delete mode 100644 target/classes/ConnectDatabase.class delete mode 100644 target/classes/com/example/demo/controller/SocketController.class create mode 100644 target/classes/com/example/demo/controller/WebSocketController.class diff --git a/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_2_Final.xml b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_2_Final.xml new file mode 100644 index 000000000..1d8ce4056 --- /dev/null +++ b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_2_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo.iml b/demo.iml index 3e6f2e26d..173b7c31f 100644 --- a/demo.iml +++ b/demo.iml @@ -134,6 +134,7 @@ - + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index f21303d18..bb3ff4ffd 100644 --- a/pom.xml +++ b/pom.xml @@ -75,9 +75,15 @@ mysql mysql-connector-java + runtime 8.0.26 - + + + org.hibernate.javax.persistence + hibernate-jpa-2.1-api + 1.0.2.Final + diff --git a/src/main/java/com/example/demo/WebsocketApplication.java b/src/main/java/com/example/demo/WebsocketApplication.java index be848368e..7f9d840d7 100644 --- a/src/main/java/com/example/demo/WebsocketApplication.java +++ b/src/main/java/com/example/demo/WebsocketApplication.java @@ -19,7 +19,7 @@ public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**").allowCredentials(true).allowedOriginPatterns("*").allowedHeaders("*"); + registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE").allowCredentials(true).allowedOriginPatterns("*").allowedHeaders("*"); } }; } diff --git a/src/main/java/com/example/demo/controller/SocketController.java b/src/main/java/com/example/demo/controller/SocketController.java deleted file mode 100644 index a608632ed..000000000 --- a/src/main/java/com/example/demo/controller/SocketController.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.example.demo.controller; - -import org.springframework.messaging.Message; -import org.springframework.messaging.handler.annotation.MessageMapping; -import org.springframework.messaging.handler.annotation.Payload; -import org.springframework.messaging.handler.annotation.SendTo; -import org.springframework.stereotype.Controller; - -@Controller -public class SocketController { - - @MessageMapping("/profile-all") - @SendTo("/topic/profile") - public Message send(@Payload Message message) { - return message; - } -} \ No newline at end of file diff --git a/src/main/java/com/example/demo/controller/WebSocketController.java b/src/main/java/com/example/demo/controller/WebSocketController.java new file mode 100644 index 000000000..580c7f177 --- /dev/null +++ b/src/main/java/com/example/demo/controller/WebSocketController.java @@ -0,0 +1,36 @@ +package com.example.demo.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.messaging.Message; +import org.springframework.messaging.handler.annotation.MessageMapping; +import org.springframework.messaging.handler.annotation.Payload; +import org.springframework.messaging.handler.annotation.SendTo; +import org.springframework.messaging.simp.SimpMessagingTemplate; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@Controller +public class WebSocketController { + + @Autowired + SimpMessagingTemplate template; + + @PostMapping("/send") + public ResponseEntity sendMessage(@RequestBody Message message) { + template.convertAndSend("/topic/message", message); + return new ResponseEntity<>(HttpStatus.OK); + } + @MessageMapping("/sendMessage") + public void receiveMessage(@Payload Message message) { + // receive message from client + } + + + @SendTo("/topic/message") + public Message broadcastMessage(@Payload Message message) { + return message; + } +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 94980e58a..0de30be77 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -3,4 +3,4 @@ spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect diff --git a/target/classes/ConnectDatabase.class b/target/classes/ConnectDatabase.class deleted file mode 100644 index c6944b47028103ae4eab302fbed09ebfd6b90b8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2294 zcmbtWU2_vv7=E_-*mS$KZJm>&exCE5{Qd7Ae*t(K>l$9d zxi08%PLAL$_nCBwrhtu1(Ed7l7eX7s|p1@1=|(HM!h2ZvRQGs zlPq|a=`5MPE!XYMXjroY1$~9Q=eoiQXUx#7n1Pt2p}J|i3XY|(7FNxhrs0_Gict!E z+g+KIjyilQjukAgZd9oigyyE<1%XlZ?VG|k%r)DvJYN{rx?@}xLBk14BBb4j?`6>*C3Yo4}@*2J+F50r7NB7k%E6b!~5GQpk;WOqqHDxSLmoFLR1tXUW zgw^mx#%dKhW7W)%Ml0TC_FH?6-u4$+#T6Z&;|m>E@uh;Z&n)zA;ujjWQx!floSMoP z=4OlK)Z9#t6zO}sF3sjI&z5sJ9be&V9oKMO!N_yCP>>FUL&l_hPGrnAf-W&iE&E+u&6pL=_UP4FHOdH8!DzQO)XbaFV$17PVX>?k1Te=a@r zJcMoIM&7mpcWuvDCfAHbGpvz*krlysCeu$J$OHI2)RNj`gO&$3?68)1yhgRuBxJh+ z7aDF=l6s+Se6QLevS=SsqkZu&`?L>JjYLpD-j))_}9F>Q5K z1!oS7WH9e_nJa^{!Z|klJCwW4&#!QdH#g%*@m+5T(8Q}; zb>cK$qY)}AzaYY!5V&&>9mz=KPekt_wuSfusL4dKa|;^Zw$SwedO?{VNp^4Jg$@)m z+vrj70KF5@f#^f@|AxMSXfnBtBOTbn(c9?aPO_h`BM(s=rNqcKjw!f}>EdW+3ny;l z{LYS1%*Tg${fKW`e{#UYt%l@a8KY@ z3^Z#vj3{M?sdI)_$7%Nsq`7w*KVXRa5`sGz!6@epp8~W;G#FEnRbi+YQ}L#Xv%o)4 tdCiR_E^(OQ^N7ylkEK93#-MP}Vvi)!{6cGQ@rm)4;H2<>j^w~Q{{ienVx#~7 diff --git a/target/classes/application.properties b/target/classes/application.properties index 94980e58a..0de30be77 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -3,4 +3,4 @@ spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect diff --git a/target/classes/com/example/demo/WebsocketApplication$1.class b/target/classes/com/example/demo/WebsocketApplication$1.class index 912837e3b534487a9835f3b3d9f935fcbcd9831a..b450d1d5873f12c0b6b7c56cf67ee56b0ec0d1f2 100644 GIT binary patch delta 485 zcmYk2+fEZv6o$XundwZ2O({buhbkvQrHEB*K~bmz1BOFvG8oeNvKYMp>{{FrON^GU*;6EL93@=jqD3&OObS*6l0 zCI-vaR=BUQtDhoqR`s*k|6Pl0ngr%4Ccb*)SnL%b@sNd)vu>9}=9D9;7-f zHWzpJjF1-uemtjmAhDweei*`sj2Qw+wQ%Br%3NS|u-z-1niV9YnjN@N%?Z4ymJCu+ z2jA|{V|UA1aBnw03JgepITx-3MvNcx<>X95{|Tzx3#u?Ki`@$vml2D}czlXS;%%mx MVKk;va)J2W0qbHr@c;k- delta 415 zcmYk1NlF7j6o$V_ciXY8m^Nx0;+$wS4(&Wd4adup* zC{#|fMP9Q_UXgwH&OSdzK2`n8ysY1uMX%GZR!^_XrQNb$DxaM*Ci8Wm&?wgp0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=)U?@HQO5jFea8JlGdyV2^Iw{!f;$2=TRbDZI5A(pa&aXMHFL9ma z$`tXv$erZs<;pA1A%5aV2`}^Qg+YNOzUw0ayn)B7G@|9Tw3`BrKOqG zUorbT%HRHsx#y_-$R8tPwV}`z`f_z>@bXA0H%N6{;U8X5)F=yXfY*o0Zwwt@;IB9N zT>B0p!&`Wp|0>?=claU5cA1>KJ8OKrJEwSDn}QW%SdVl9*2l@iT_3}}H-Wq1P2+vs p%;D~G=iy4L6RM-QEl=T<#(1TF#%ql6n#b` Date: Wed, 8 Sep 2021 15:32:43 -0400 Subject: [PATCH 23/29] changed profile relations --- .../demo/controller/ProfileController.java | 9 +- .../java/com/example/demo/models/Channel.java | 28 ++++++- .../com/example/demo/models/ChannelType.java | 6 ++ .../java/com/example/demo/models/Message.java | 36 ++++---- .../java/com/example/demo/models/Profile.java | 77 ++++++++++++------ .../example/demo/security/LoginResponse.java | 21 +++-- .../example/demo/service/ChannelService.java | 19 +++++ .../example/demo/service/ProfileService.java | 17 ++-- src/main/resources/application.properties | 2 +- .../controllers/TestProfileController.java | 51 ++++++++++++ .../com/example/demo/models/TestProfile.java | 11 ++- target/classes/application.properties | 2 +- .../demo/controller/ProfileController.class | Bin 5769 -> 6013 bytes .../com/example/demo/models/Channel.class | Bin 2099 -> 3053 bytes .../com/example/demo/models/ChannelType.class | Bin 0 -> 1102 bytes .../com/example/demo/models/Message.class | Bin 2105 -> 2421 bytes .../com/example/demo/models/Profile.class | Bin 4805 -> 3376 bytes .../example/demo/security/LoginResponse.class | Bin 3183 -> 2993 bytes .../example/demo/service/ChannelService.class | Bin 3659 -> 5169 bytes .../example/demo/service/ProfileService.class | Bin 3641 -> 3046 bytes .../controllers/TestProfileController.class | Bin 346 -> 2128 bytes .../com/example/demo/models/TestProfile.class | Bin 3330 -> 3067 bytes .../demo/services/TestProfileService.class | Bin 4927 -> 4798 bytes 23 files changed, 206 insertions(+), 73 deletions(-) create mode 100644 src/main/java/com/example/demo/models/ChannelType.java create mode 100644 target/classes/com/example/demo/models/ChannelType.class diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index 5c3796212..f0046619a 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -24,6 +24,9 @@ public class ProfileController { @Autowired AuthenticationManager authenticationManager; + @Autowired + PasswordEncoder passwordEncoder; + @Autowired JwtGenerator jwtGenerator; @@ -38,6 +41,7 @@ public ResponseEntity createProfile(@RequestBody Profile profile) { if (service.existsByEmail(profile.getEmail())) { return ResponseEntity.badRequest().body("Email is taken"); } + profile.setPassword(passwordEncoder.encode(profile.getPassword())); return new ResponseEntity<>(service.createProfile(profile), HttpStatus.CREATED); } @@ -62,9 +66,8 @@ public ResponseEntity login(@PathVariable String username, @PathVariable Stri Profile profile = service.findByUsername(username); return new ResponseEntity<>(new LoginResponse(profile.getId(), token, profile.getFirstName(), profile.getLastName(), - profile.getUsername(), profile.getEmail(), - profile.getChannels(), profile.getMessages()) - , HttpStatus.OK); + profile.getUsername(), profile.getEmail() + ), HttpStatus.OK); } @PutMapping(value = "/update") diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 2d6a08f2f..2ebe3e9e5 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -1,5 +1,8 @@ package com.example.demo.models; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import javax.persistence.*; import java.util.List; @@ -11,11 +14,24 @@ public class Channel { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; - @ManyToMany(mappedBy = "channels") + @Enumerated(value = EnumType.STRING) + private ChannelType type; + @ManyToMany(fetch = FetchType.LAZY) private List profileList; - @OneToMany(mappedBy = "channel") + @OneToMany(fetch = FetchType.LAZY) private List messages; + public Channel() { + } + + public Channel(Long id, String name, ChannelType type, List profileList, List messages) { + this.id = id; + this.name = name; + this.type = type; + this.profileList = profileList; + this.messages = messages; + } + public Long getId() { return id; } @@ -47,4 +63,12 @@ public List getMessages() { public void setMessages(List messages) { this.messages = messages; } + + public ChannelType getType() { + return type; + } + + public void setType(ChannelType type) { + this.type = type; + } } diff --git a/src/main/java/com/example/demo/models/ChannelType.java b/src/main/java/com/example/demo/models/ChannelType.java new file mode 100644 index 000000000..f0d76de03 --- /dev/null +++ b/src/main/java/com/example/demo/models/ChannelType.java @@ -0,0 +1,6 @@ +package com.example.demo.models; + +public enum ChannelType { + DM, + CHANNEL; +} diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 2ada54648..7105aa569 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -13,26 +13,25 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; - @ManyToOne(cascade = CascadeType.REMOVE) - @JoinColumn(name = "profile_id", - referencedColumnName = "id") + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "profile_id", referencedColumnName = "id") Profile profile; String body; String timestamp; - @ManyToOne - @JoinColumn(name = "channel_id", - referencedColumnName = "id") + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "channel_id", referencedColumnName = "id") Channel channel; public Message() { } - public Message(Long id, Profile profile, String body, String timestamp) { + public Message(Long id, Profile profile, String body, String timestamp, Channel channel) { this.id = id; this.profile = profile; this.body = body; this.timestamp = timestamp; + this.channel = channel; } public Long getId() { @@ -43,14 +42,6 @@ public void setId(Long id) { this.id = id; } - public Profile getProfile() { - return profile; - } - - public void setProfile(Profile profile) { - this.profile = profile; - } - public String getBody() { return body; } @@ -67,4 +58,19 @@ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } + public Profile getProfile() { + return profile; + } + + public void setProfile(Profile profile) { + this.profile = profile; + } + + public Channel getChannel() { + return channel; + } + + public void setChannel(Channel channel) { + this.channel = channel; + } } diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 8f36edce8..c0c41f6fd 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonManagedReference; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; @@ -23,18 +24,22 @@ public class Profile implements UserDetails { private String password; private String email; private boolean enabled = true; - @ManyToMany - @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), - inverseJoinColumns = @JoinColumn(name = "channel_id")) - private List channels; - @OneToMany(mappedBy = "profile") - @JsonIgnore - private List messages; +// @ManyToMany(cascade = CascadeType.ALL) +// @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), +// inverseJoinColumns = @JoinColumn(name = "channel_id")) +// private List channels; +// @OneToMany(mappedBy = "profile") +// private List messages; public Profile() { } - public Profile(Long id, String token, String firstName, String lastName, String username, String password, String email, boolean enabled, List channels, List messages) { + public Profile(String username, String password) { + this.username = username; + this.password = password; + } + + public Profile(Long id, String token, String firstName, String lastName, String username, String password, String email, boolean enabled) { this.id = id; this.token = token; this.firstName = firstName; @@ -43,9 +48,31 @@ public Profile(Long id, String token, String firstName, String lastName, String this.password = password; this.email = email; this.enabled = enabled; - this.channels = channels; - this.messages = messages; } + // public Profile(Long id, String token, String firstName, String lastName, String username, String password, String email, boolean enabled, List channels) { +// this.id = id; +// this.token = token; +// this.firstName = firstName; +// this.lastName = lastName; +// this.username = username; +// this.password = password; +// this.email = email; +// this.enabled = enabled; +// this.channels = channels; +// } +// +// public Profile(Long id, String token, String firstName, String lastName, String username, String password, String email, boolean enabled, List channels, List messages) { +// this.id = id; +// this.token = token; +// this.firstName = firstName; +// this.lastName = lastName; +// this.username = username; +// this.password = password; +// this.email = email; +// this.enabled = enabled; +// this.channels = channels; +// this.messages = messages; +// } @Override public String getUsername() { @@ -126,21 +153,13 @@ public void setEnabled(boolean enabled) { this.enabled = enabled; } - public List getChannels() { - return channels; - } - - public void setChannels(List channels) { - this.channels = channels; - } - - public List getMessages() { - return messages; - } - - public void setMessages(List messages) { - this.messages = messages; - } +// public List getChannels() { +// return channels; +// } +// +// public void setChannels(List channels) { +// this.channels = channels; +// } public String getToken() { return token; @@ -149,4 +168,12 @@ public String getToken() { public void setToken(String token) { this.token = token; } + +// public List getMessages() { +// return messages; +// } +// +// public void setMessages(List messages) { +// this.messages = messages; +// } } diff --git a/src/main/java/com/example/demo/security/LoginResponse.java b/src/main/java/com/example/demo/security/LoginResponse.java index edaa0894a..10885d878 100644 --- a/src/main/java/com/example/demo/security/LoginResponse.java +++ b/src/main/java/com/example/demo/security/LoginResponse.java @@ -14,9 +14,8 @@ public class LoginResponse { private String username; private String email; private List channels; - private List messages; - public LoginResponse(Long id, String token, String firstName, String lastName, String username, String email, List channels, List messages) { + public LoginResponse(Long id, String token, String firstName, String lastName, String username, String email, List channels) { this.id = id; this.token = token; this.firstName = firstName; @@ -24,7 +23,15 @@ public LoginResponse(Long id, String token, String firstName, String lastName, S this.username = username; this.email = email; this.channels = channels; - this.messages = messages; + } + + public LoginResponse(Long id, String token, String firstName, String lastName, String username, String email) { + this.id = id; + this.token = token; + this.firstName = firstName; + this.lastName = lastName; + this.username = username; + this.email = email; } public Long getId() { @@ -82,12 +89,4 @@ public List getChannels() { public void setChannels(List channels) { this.channels = channels; } - - public List getMessages() { - return messages; - } - - public void setMessages(List messages) { - this.messages = messages; - } } diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 649bf9091..97d89c17e 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -1,6 +1,7 @@ package com.example.demo.service; import com.example.demo.models.Channel; +import com.example.demo.models.Profile; import com.example.demo.repository.ChannelRepo; import com.example.demo.repository.ProfileRepo; import org.springframework.beans.factory.annotation.Autowired; @@ -8,6 +9,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; @Service public class ChannelService { @@ -36,6 +38,23 @@ public List readAllChannels() { return result; } + public List findByProfileUsername(String username) { + List allChannels = readAllChannels(); + return allChannels + .stream() + .filter(channel -> { + List profilesInChannel = channel.getProfileList(); + for (Profile profile : profilesInChannel) { + if (profile.getUsername().equals(username)) { + return true; + } + } + return false; + }) + .collect(Collectors.toList()); + + } + public Channel update(Long id, Channel channel) { Channel channelInDb = readChannel(id); channelInDb.setId(channel.getId()); diff --git a/src/main/java/com/example/demo/service/ProfileService.java b/src/main/java/com/example/demo/service/ProfileService.java index a53e06b53..50076f205 100644 --- a/src/main/java/com/example/demo/service/ProfileService.java +++ b/src/main/java/com/example/demo/service/ProfileService.java @@ -20,15 +20,14 @@ public class ProfileService implements UserDetailsService { @Autowired private ProfileRepo repository; - public Profile createProfile(Profile profileData) { - Profile profile = new Profile(); - profile.setFirstName(profileData.getFirstName()); - profile.setLastName(profileData.getLastName()); - profile.setUsername(profileData.getUsername()); - profile.setPassword(passwordEncoder.encode(profileData.getPassword())); - profile.setEnabled(true); - profile.setEmail(profileData.getEmail()); - profile.setChannels(profileData.getChannels()); + public Profile createProfile(Profile profile) { +// Profile profile = new Profile(); +// profile.setFirstName(profileData.getFirstName()); +// profile.setLastName(profileData.getLastName()); +// profile.setUsername(profileData.getUsername()); +// profile.setPassword(passwordEncoder.encode(profileData.getPassword())); +// profile.setEnabled(true); +// profile.setEmail(profileData.getEmail()); return repository.save(profile); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 635656c8b..6057b7bbc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box spring.datasource.username=zach spring.datasource.password=zipcode0 -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect chatter-box.app.jwtSecret=someSecretKey diff --git a/src/test/java/com/example/demo/controllers/TestProfileController.java b/src/test/java/com/example/demo/controllers/TestProfileController.java index b5f2ea750..2af11d731 100644 --- a/src/test/java/com/example/demo/controllers/TestProfileController.java +++ b/src/test/java/com/example/demo/controllers/TestProfileController.java @@ -1,4 +1,55 @@ package com.example.demo.controllers; +import com.example.demo.controller.ProfileController; +import com.example.demo.models.Profile; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Before; +import org.junit.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.test.web.servlet.MockMvc; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ExtendWith(SpringExtension.class) +@WebMvcTest(controllers = ProfileController.class) public class TestProfileController { + + @Autowired + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean + private ProfileController controller; + + @Before + public void setUp() throws Exception { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + objectMapper = mapper; + } + + private Profile profile = new Profile(2L, "", "Ben", "Smith", "Ben123", "secretpassword", "ben@gmail.com", true); + private Profile profile1 = new Profile("Ben123", "secretpassword"); + +// @Test +// public void registerTest() throws Exception { +// Mockito.when(controller.createProfile(Mockito.any(Profile.class))).thenReturn(ResponseEntity.class); +// +// mockMvc.perform(post("/profile/register") +// .contentType("application/json") +// .content(objectMapper.writeValueAsString(profile))) +// .andExpect(status().isOk()); +// } } diff --git a/src/test/java/com/example/demo/models/TestProfile.java b/src/test/java/com/example/demo/models/TestProfile.java index b5fb0bf6b..7a9b119ac 100644 --- a/src/test/java/com/example/demo/models/TestProfile.java +++ b/src/test/java/com/example/demo/models/TestProfile.java @@ -18,7 +18,7 @@ public void nullableConstructorTest() { Assert.assertNull(profile.getId()); Assert.assertNull(profile.getFirstName()); Assert.assertNull(profile.getLastName()); Assert.assertNull(profile.getUsername()); Assert.assertNull(profile.getPassword()); Assert.assertNull(profile.getEmail()); - Assert.assertNull(profile.getChannels()); Assert.assertNull(profile.getMessages()); +// Assert.assertNull(profile.getChannels()); } @Test @@ -34,13 +34,13 @@ public void constructorTest() { List expectedMessages = Stream.of(new Message(), new Message(), new Message(), new Message()).collect(Collectors.toList()); // When - Profile profile = new Profile(expectedId, "", expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, true, expectedChannels, expectedMessages); + Profile profile = new Profile(expectedId, "", expectedFirstName, expectedLastName, expectedUsername, expectedPassword, expectedEmail, true); // Then Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); - Assert.assertEquals(expectedChannels, profile.getChannels()); Assert.assertEquals(expectedMessages, profile.getMessages()); +// Assert.assertEquals(expectedChannels, profile.getChannels()); } @Test @@ -63,13 +63,12 @@ public void settersTest() { profile.setUsername(expectedUsername); profile.setPassword(expectedPassword); profile.setEmail(expectedEmail); - profile.setChannels(expectedChannels); - profile.setMessages(expectedMessages); +// profile.setChannels(expectedChannels); // Then Assert.assertEquals(expectedId, profile.getId()); Assert.assertEquals(expectedFirstName, profile.getFirstName()); Assert.assertEquals(expectedLastName, profile.getLastName()); Assert.assertEquals(expectedUsername, profile.getUsername()); Assert.assertEquals(expectedPassword, profile.getPassword()); Assert.assertEquals(expectedEmail, profile.getEmail()); - Assert.assertEquals(expectedChannels, profile.getChannels()); Assert.assertEquals(expectedMessages, profile.getMessages()); +// Assert.assertEquals(expectedChannels, profile.getChannels()); } } diff --git a/target/classes/application.properties b/target/classes/application.properties index 635656c8b..6057b7bbc 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box spring.datasource.username=zach spring.datasource.password=zipcode0 -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect chatter-box.app.jwtSecret=someSecretKey diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index e61fb6cd11905023ec8ad50e82f04c654d91d3ae..ef3371fa9033bf322277e567bd21f7ccbeb96958 100644 GIT binary patch delta 1916 zcmaKt>08uQ6vsbzSbp%E3&b)ghKeohhytYnk%mOMfsqy|)+7@mFyIVowm8{ti)GVZ zrtP*P7>JbZn{B-9UH?GOQ*U}_Pv_1IKSt!~#qZp6&pr2^@A-buJaeGp?BdXwe@~qT zYM8VsW=AST^w{*$XXB^eCWC<#cDe}=G~q!L-j%{`leou3?r^i0JB@dj#ogxko>cY` zGFR_4+x=#HpYiTDmmaWq&}I$~xp|mJnr#m7sGG-l+#Eh(bC4%Z?o$?r%%e{m6E@}< zn}s}U&Ym;o`4nETc+uh|g~uCKD(BGTk?f2CZ!oy0KhW9a-`3yh3n&`GOA|feKQinE zfxQER{gqP*m96Jyj`XTOEq^sNnx#}(ysUYJ!xpbbuo z^!E7t7H?_Z<{iy34r|`!s3N_o&)ePWq-ZKwta;D8_P*u=KGb}~$BLrx{>t ze92duN|soBt@(y;HQ(`lc%NOK{{ug2&KRIS8B@*AnqL^w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@hj}E#qdcbX9(Qe%+x;=x3@xQ}MAx z?QptwB0iEx*}P?Vn|BQFve)n)`z$KD#^S@Heu%roX|7w&0h{*?AMl|e#z%&a`NZ(4 zy4`$cXy9CT-05$N@wv?xhA;Wb=AhvalQvU^!+dRMqS#0bzXs7axQ4ndO*5WPh&6xU)oD+qe0U5e!Z zbh+J;_RJii!N$V`nx-+6l+RFcP~H`J32Wp8ETw`vqH>D{`LzpwEl`uqAq6zQWMd_( zq)w;Ul0Q0+)nWxL*@iXp1X$}`y+VT4$+P|jtTdSoY?PO_Ug#n*EH-g*j_Bqb(MSQu z%1O@1aV)%aYXPT-&nY6TE|HWuCS5+0%|4UN7N5$cc_x>6OuFfjMrgy=2ovpX_ym(_ zs!mU&qoDiY9Fgqpd;OaEl6_<>F6WBeh5wSVl}MSS3`9yr2Ai5^ICGZj0DVWOX_@7$ z0P=303@h4MoEzKx&Y;qoW5HlFIL*Rnu`Y`g&Q>T=C{ntJoikti;Xx^cO~UA z!-!mWp$w~D#?;1o>B*ee< zvR5qGR(L82dJ`!N$e|1pe?lPF`Yp-}aEi z3)QT2PZ8|(J|EF)POvw6dldsp_oL;MQgITI$3D=#>#qqwJUP|esL+fWhrE0&K w)&D2kn|(gF_}u>vr+)@WT_lDZV3qO8!gUD6z`^1EPxav;Y7A diff --git a/target/classes/com/example/demo/models/Channel.class b/target/classes/com/example/demo/models/Channel.class index 37ca6a28f2cea858c0d24136999c17c9ad88ce6a..5261695bff097b610a9bfdcb7a9e5a15430f3861 100644 GIT binary patch literal 3053 zcmcJRU31z-6o$`&1hGRM$By0N`nySki4!HwN0Z_@p^oj);*W``XWBa%Hdr2zJRmah zzj9~Fbfy>m0sT>(zGo#QkVQi-dcm%=d-grgo^y7^-~asi7ZE+7!*RMsZ^kH1C2oG? z<|l5--0Y=kKTQXM5>`#nWckc|ZyF8Lt{Y{?t``Jl-*#-*YRY4)ZJjh^(Y77ebS=kj z3z}8tAB=O^YFlkr+Er*NQ(^ z0IJz$Qw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*tF=Sn+U|i^% ziv#CMxM;X4tV1+SGL!A7h1)h^)7c!$^zKQf#F4Nr^vWqWP)iHl!zco^W4p5BU3y+^ zBT#f4COS3UeW^MO3Aa>E19)U!je)&=Bkvh+SNLJX?^3_Hnx~VK5UK90qIKQO?zq&R z`)$HX#Tc&Tb^`Kr7yQoti2=W@atD~Uh=dtB)0;+FyvIkzDDF1HntU}FP5HFwJ3Jm% zD;K93nvGMG2IG{V(Ksb(EKX?}V>H+At8>NCE$v6?wAKRX#@sDgDD^bVjQ>sPuT7;xTWyBZ_*^T0OL7Kc@7U8hiN+q?ttYSG!)DX zb9ng&v2V8MJjMar7zLk00S8*7hgdOMqDL6J4_{N@D>ef(kI^|i?tAz#J%N`zoW~rH z-pecBDbNl*WLqZ@Fl{TO94|M#RCf}U!Pzk0BTS64wCuwa>}8tvWm=(C#Q29P*vm8z zriDICvO0`hri9J(l-69?c9O3t)XTKw!{k&~9$Tjk3fgR^5cBdCl59ac+fKeRV9WMl zlO4n88BWNCk{L|WM4L7VlM`?g#w}m!a4+?0U+Qg$?D$iMd#Tq!z0rqSwsALgnx@*+ VX^;9j(((eU0KK%kUAEsVqQ6}htRDaX diff --git a/target/classes/com/example/demo/models/ChannelType.class b/target/classes/com/example/demo/models/ChannelType.class new file mode 100644 index 0000000000000000000000000000000000000000..015a40d74d7d39710df5b4405df9efbfa4feaf01 GIT binary patch literal 1102 zcma)4YflqV5IwiM?Y7JILDgyzUr?|G>{`Vb(}qAQMw3!ZiX_BOx7%x3vJbM|68+{+ zQb@#TG<^0)8Ru?^mZ(WL*_}H(XU?3NJ3oGY`3_(e4^vQaS4SBY4bvKybQoBcpOqxi zIt5oG;$9M2X{#DchS<|BhJ}{pyQX-{-9ty1J>mMM>-U5+Fq`|_^MteW?oiYjwC3}T zc6+l$r_%05>(yq5Ve$2Z$%!NG48?$p8XRahEFO|E6WgZHaK-@4e&!VL}m5 zH;IPr+2I;P;U7X?RCXEEaNj1NUJ~BWEsfaIBgYSVw#O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@xwiKs_GjAYCv?^V*7E!oG|I7QR%7AAsw;Pvw zNSX@Md}D5R_5$PC{Z<$>HMlm+nVn0B8bh?to1jLAq0j1za1eF%cjh(JvWvJcPgtRD zM7j7jclnZ&lg%1#VyT8Jn5bbAQ#I6aqlOQ0gO6aG5?OHG#Q8tO!Qm_2O|ZnjkqZB1 zO8hYBY zApw5nEEUxyKy&pJh348Rip_hcu$pt$DN5&2>r?<(WYn9ie~HB|V}|+Wm_xE`q>-{L zQd+8$tV9xFs+)p~W+f$CXmCAc87(Hwwtx%d3Yr`R(&n62`3DNWaU-p=Y&P%aR=A3_ ztio;1lDTZEJFh0yXqC)sCW2fHtmfg n>0vI@=lM)SotWNTi%j2+VUpfDW0HO<;DH&xFwa(6=S$!}_(hU- diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index 3606cbccac763ab705ca4a6283a77a47bf271073..7bb52ad81da7c19a16e6d27e3056f0ab87e9ba8b 100644 GIT binary patch literal 3376 zcmcIlTTdia5Uw-KopBerF3ak|>Mk%`+P%2Af+(_p=q%vElDIJ@&CCIM>FFN3dscYR z=z}JjXySt=`tF0q2Tddh^hS>Iw94X57H_dAvAD-#jm0{PjSRh=q5B!y6qGP3g1SnN^vAkp>eilCvaP*Y zL4)_}mSB|>iVHpla6b+p0vtRTdlz8O3a59X-P--WMx}7 z>k^l;uE+bmqyM~*NLxoWzMoupu(d8I<=F?)64c#oUfq$- z7GLK0c3C&Kb;sa+aG3P=4G=R@D%({}9_rPaDYc5M+FBKEOjp}*>|Mj;bVkQo6KFkQ z2wnH2w{KTAbO#xD;9Ahf&Bm%yt)~Cq$wNlfxhK5`A+5b*_ZWUQ{pTuc?Nh#O=*wa!wrn3OkVVift z==82pApX_>nnkoFzx%WJ5U6=pPdHAFsWS7;E&s*w%|Oj>+I6Qam(j|A9yIkd4-Y{X zRU@393QMS`cQjj|XX$c*F3~du8l?ULU1aeTohwiuYXdAUuo$9#L6@KKitscV^J;zP z5o#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PUH$a-?#3Z_0Ngm2c4u zsAIy$Ji-!6n60^hX2N4@NRo0JI(H%|&xVcM4;blDewSt=DDMj^uS6=}qc=V5Q}`x0 zy0VITMaiv)XchVSP+D;FE$wG{+RJjzw-o+q@lmJ}=};<+=}{!6Ihv2clnP^71Ey*W zChmfYtN~!++{eF5B&Kv2(|RPP#b`|FFs4ml+KR!%_3mThT2$z*XtSBHSp#Ox7_;0w ze6w8M3f+%3n+=<_VAhT?%bmzK%N;|ZrAP*IVFsT>GPoR#DHq1{F))1+gNb{hkBK{& zLJw%=sbo2|>s4_R_*0nuEXFK1Sl=u+MTOp`cRaJfCYTSq`gw$_ZdtzzBdaJG`Bu>) zjQPctXP4dQ#>MspuzeYWja$AV8@>Ayre&k|(Vl}T_rmvZ?EOg8{bAH!#iD)$Bafp| z2Odcm_18fCO$=&&o_3=i!-MIg?majkU{Q-qt7I7Uw-KlnT8mDrWH_z91KRIn(DLK# UW8=p%fxg1BCjV&oy%R)#1ND8C(EtDd diff --git a/target/classes/com/example/demo/security/LoginResponse.class b/target/classes/com/example/demo/security/LoginResponse.class index b3e97ffa4ffba08d7ba136554134b1cb7d145b89..b584809ce6dbd5138d26fd0f8616fda403067bad 100644 GIT binary patch literal 2993 zcmc(f&vV;E6vyA%mSj7oO_Mgo(6mik)L3aF=#Kz(aG{|Yez>8Nv^kWM;w+AeEoWqz zp$GmKjvQeI4>KJ2132&}F?`=jSu2V>lLOOUc2~Qr_degZ@4dhO{qrv(x<`+zRHX+M zs!)@Mbsj$9p~b^P9zNyaGm9Qsv>~YA?+co3zx00a+@2S7-S!~pHU$~c;CmSenoAw+ zM4_(^E8qFyFxv9^Qc$_)>E&oB!$9pCvhVploOTYpAdtPGb~1|mp4;|^5u8+Z{BGby zqY!rP#*Xyydb=~|yYfe`f7p}mzU&X&{$L-L+>O{|vjq$0x*zyaOVCftDNv;$^__tK zzdM?=+1M3S+5nuOvu!_+TciG-44-*>J?zZ22OY1s>xDjlC!3|{z(+_LCp8XbX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ocg*0*8El<19 zXPoau9*^hJoOB^moN~VDfYSjp9_i`X)$gt)Y@z9UZ`iJcJH5m9ujIk5Ej(|yk(&%R zvpL|5VU{_Mo-2u-ykVXf0u~G}a@MfOu)Q2~O`qc>kKDxKVr99qGQ7=l*DTce(5bFx*qyPW_ diff --git a/target/classes/com/example/demo/service/ProfileService.class b/target/classes/com/example/demo/service/ProfileService.class index 25f086fdfc2798aa7728b05c8def4da690503e40..dce92d0789d0e6661ff1f7ef49fd11fffeca839c 100644 GIT binary patch literal 3046 zcmb_dZF3V<6n<{nl5`Vj8{Wh>f>lT*d&U2n~&U0@5`0M9i09?QW3kR_@j03oq z#dX|BV_EMXTlfSe{j`$C%`{dm3}Y#SHNAhD!7aU)Eo5+88{N^%x?Voh%jap_P2*k~ zUkHpeWV89m4=PKZ<5yH5FkAA2s@-e^u2Ma{?6sZ# z(*j3swY<=+t97^OZq(Gg=lP)wUEga8TDH$!L}_s4)%O2^dGr_su0!+ zRKst&+C*TY&Vv=%h+4-BOjd z>^8$@GTVdwpze`V+jObUj0A>MypL!u^R=203A>XoPQ*#ILbqm@7=S4cm))u-!&bn8 zUhFZLd8rO&wftL+3gsw}H3C|cp%fUS04WSZAeP1cWEQb3I51Y(Zv~FJ#)%TxZyd_8 z+|Otk2^9M`mbz1ZxZO~;F`v%iExet>8+bE~FLU?`Uke<4NyT%Rz&B}pn}ftgj+f#^ zf$Og>B(0pAet6Aqd6kYV1P*rxAy(2t%dJHh;USZ1;gK6|724t}17Md*2R5+6Fmu1$bIe(4p*1V>c)NLgaTJyJySC>rsnR`JD#k&IWP*^@Pz<|FqVUwI=}6;nLWR(5n9nRpbgY&4X| zQlCyn>0BjUIy?HtP?^w=KkbG#z5;#6l~PZev1EJW@rdVQhk3gm>o~@r<%1A7gcSb{ z<261X;m`IS?yqxCX`S!-X7QaP!1X9CZ0>^l(8;F|KSnMEt{MOsVE`Z(8{i#`^G)Dg zyhmW|yby&2_MQ9*smW&;NZ~gO{=kzI3S489qY;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bmi?+ z=xxmZL$gjWuAeILP_tLneOa?nAk{%6xf=H5>0n=M>p3HDO@c5@ttaF-Dt9rO+C7g? z0A0X?`l?!j^|}{5%`tEN+VSF|GsiN$tE#y5-f^1Y#`L}{ts&CPo6`v<+pDn2)Qk5QMx15CL{@10yp zIVA<}0&Y>LCwByQu%b39w4{MMN{JYbQ*x|Ua6{Y?%iE3ROG_ovHrxQRy=Hv7DFp*E tDu5Gs(11K-R9Bt4C5C!CkpE=h%bdiq2HlO0ZA$+bPF4&UuQjAoz~4fcZp;7x diff --git a/target/test-classes/com/example/demo/controllers/TestProfileController.class b/target/test-classes/com/example/demo/controllers/TestProfileController.class index f6fc918ed222295243c830e2b329ae58dc183648..e1363f97c41723b4c65da5112ef3a408f4f08572 100644 GIT binary patch literal 2128 zcmcImZBrXn6n-ut>=L#V(-sA_m0H{IQm)X7Rchs>RKXBx13~Hs=Vo)0ZrI(M*}Vbu zlYdEP5Xa8=1N>2r=WfyvN^qvmm=C+>oIU3`_de&Gd-K=dfBXsHKAvYViUkXwrb#uw zz6>7VGaH}VShVrb#uqjo+4wSpJ}eF58kUW;Vx(0Ik24s-!XVc0#7JKm^Vb&EEo?AY zfpYgZ4_t=Xyozc(ZbV*Kt41P_hbr3VTE?0m$}*2-bl^+PH(UOT3}erlq4ok<@?x*- z%jGasT4+y&F~ftNU}Y)7m{*0XRrDhlodCYv)auZSWQAZIRjx}{Z;D1kMhtiJt_mn7 z)-pN@d|nsseyl=X5n7bJu)?>x+$lWcs!&JD_f0TQg5{A28ouNe87O}GnLmwG)$`?Q zCxF5~>Ai5Jbc+f@7dH=2tAvXc+7rcDjTRWg#QB_osz^V6m5;pbw)Y&vz(X(e^dp8; zZnDJCze>Igm-AjI3(cS`qisRtGGz106@E!Xp3&RJe*MBDw(p-$dAiM*Z&M9>?KK@s zz0;s21Z}P}Ye%kZBqg-)O_GyZqTZwh@)cQCku(GsRWows6Jm~GyeIZ-T^tC8nS{$$ zc)i*1sDfNHJT8y43}b2(zGkG#uBTrRaQZ;_O~PF2S%Rby&8{fAy`)!|#iVBwEQ3l= zk9$ItJ5?0aZ-iC#YRyQVY42TGrfD#{BAB5r79D(uTMRc$H=b#zv&FTLcd&^91E{1c zGNgSK1KJ?bOxoQ1J%-^}x{=fk5yv!R6^2V?87|cV;rX)!Z!&E;_y7||dg|aNCK#sQ zU<@ogbFhPwgI#>*;9b1OFn@00U7PFOA`By@klYtxtvzN8S58fxZlNumTJtKb(L5x@ z+^SMQZeuck_A^oYbMAFpmtNH75L*2IEYHoT-RWM!g()XX7WQbwdeh%^hHcQPv>v*C zvm$S`-$X-4a@NC8Myoy*UDC+fg{{I5g`Iq!Vc~)k?%%PA!!erQqND@C_kKza-XxhB z0S1}-Z>W2TS!2Hw+*wjn(?OjFcccileSu1O22eX;%Q2z;>V_ZtU8p{cW zk8$~z1nV|EhmoS^82T|y(>H@Vq&Y2A{`R~D8+@pUBbcZGKb!?MghV(Uji{jGQKXL(BXaE2J delta 128 zcmca0aEnRw)W2Q(7#J8#7zDT&m>GE48Ti;4_$NPMterfaNrRP#frWu}vJZ<#FoPlk z6HoyNFajY^7)Y`KdHP^J0|Tqpb_T|cKmjHOb|A?H6lMTw-~f_5U^XiQCj%Fd$H>49 IB$*g^0P8Xg*8l(j diff --git a/target/test-classes/com/example/demo/models/TestProfile.class b/target/test-classes/com/example/demo/models/TestProfile.class index 2eb10c7b42c795490d7079c73165ac6868167d24..2e8c2b2b02fe5ff8a134c1865f7e832a987eeb15 100644 GIT binary patch delta 1388 zcmb`G$&XZ36oLxWJFAS%t&OwA|?1+Bn>1qpA% zA3#`|5JGh$(YQ0}LWl_o3rsYI1q%!b3kV7EoT}n6xX=WulHdK_t8?zHI^V0V{*UX6 zKR@~Qdtf4`Lx$1fF(<^NMPqKrJmxDc&{(LkNMo_al8~h=^J(>2?z6&YrOzslwvbv{ zYFN#hkoQ@uw9cd8@j*yEEk5hD`$OIPqmZE{8}xdk#>X0)G(OSz)Z;Uc&6lnmFsn8)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h#kVozpimUz59`O5qCfADTh^OjD)yUF9V6f_ENXF+l6Xm_j9 z^_6;e6_P0$uCGk`GEsML9_C4}_R1-AMjBH~3QCie$MH2E Date: Thu, 9 Sep 2021 06:05:32 -0400 Subject: [PATCH 24/29] changed message fields & added services to channel + message --- .../demo/controller/ChannelController.java | 10 +++++ .../demo/controller/MessageController.java | 5 +++ .../java/com/example/demo/models/Channel.java | 9 ++++- .../java/com/example/demo/models/Message.java | 36 +++++++++--------- .../java/com/example/demo/models/Profile.java | 10 ++--- .../example/demo/repository/ChannelRepo.java | 8 ++++ .../example/demo/repository/MessageRepo.java | 6 +-- .../example/demo/service/ChannelService.java | 13 +++++++ .../example/demo/service/MessageService.java | 7 +++- .../demo/controller/ChannelController.class | Bin 3296 -> 4131 bytes .../demo/controller/MessageController.class | Bin 3285 -> 3729 bytes .../com/example/demo/models/Channel.class | Bin 3053 -> 3319 bytes .../com/example/demo/models/Message.class | Bin 2421 -> 1967 bytes .../com/example/demo/models/Profile.class | Bin 3376 -> 3742 bytes .../example/demo/repository/ChannelRepo.class | Bin 339 -> 709 bytes .../example/demo/repository/MessageRepo.class | Bin 618 -> 618 bytes .../example/demo/service/ChannelService.class | Bin 5169 -> 5821 bytes .../example/demo/service/MessageService.class | Bin 2483 -> 2762 bytes 18 files changed, 76 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ChannelController.java b/src/main/java/com/example/demo/controller/ChannelController.java index 99d2cee29..38f35ff87 100644 --- a/src/main/java/com/example/demo/controller/ChannelController.java +++ b/src/main/java/com/example/demo/controller/ChannelController.java @@ -29,6 +29,16 @@ public ResponseEntity readChannel(@PathVariable Long id) { return new ResponseEntity<>(service.readChannel(id),HttpStatus.NOT_FOUND); } + @GetMapping("/exists/{name}") + public ResponseEntity existsByName(@PathVariable String name) { + return new ResponseEntity<>(service.existsByName(name), HttpStatus.OK); + } + + @GetMapping("find/{name}") + public ResponseEntity findByName(@PathVariable String name) { + return new ResponseEntity<>(service.findByName(name), HttpStatus.OK); + } + @RequestMapping(method = RequestMethod.GET, value = "/readAll") public ResponseEntity> readAllChannels() { return new ResponseEntity<>(service.readAllChannels(), HttpStatus.OK); diff --git a/src/main/java/com/example/demo/controller/MessageController.java b/src/main/java/com/example/demo/controller/MessageController.java index 251c94ea4..9e11117af 100644 --- a/src/main/java/com/example/demo/controller/MessageController.java +++ b/src/main/java/com/example/demo/controller/MessageController.java @@ -28,6 +28,11 @@ public ResponseEntity create(@RequestBody Message message) { return new ResponseEntity<>(messageService.create(message), HttpStatus.CREATED); } + @GetMapping("/find/{channelName}") + public ResponseEntity> findByChannelName(@PathVariable String channelName) { + return new ResponseEntity<>(messageService.findByChannelName(channelName), HttpStatus.OK); + } + @GetMapping(value = "/read/{id}") public ResponseEntity read(@PathVariable Long id ){ return new ResponseEntity<>(messageService.read(id), HttpStatus.OK); diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 2ebe3e9e5..b11da586b 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -16,9 +16,9 @@ public class Channel { private String name; @Enumerated(value = EnumType.STRING) private ChannelType type; - @ManyToMany(fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) private List profileList; - @OneToMany(fetch = FetchType.LAZY) + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List messages; public Channel() { @@ -32,6 +32,11 @@ public Channel(Long id, String name, ChannelType type, List profileList this.messages = messages; } + public Channel(String name, ChannelType type) { + this.name = name; + this.type = type; + } + public Long getId() { return id; } diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 7105aa569..b710a75a0 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -13,25 +13,27 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "profile_id", referencedColumnName = "id") - Profile profile; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "profile_id", referencedColumnName = "id") +// Profile profile; + String profileSentFrom; String body; String timestamp; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "channel_id", referencedColumnName = "id") - Channel channel; + String channelName; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "channel_id", referencedColumnName = "id") +// Channel channel; public Message() { } - public Message(Long id, Profile profile, String body, String timestamp, Channel channel) { + public Message(Long id, String profileSentFrom, String body, String timestamp, String channelName) { this.id = id; - this.profile = profile; + this.profileSentFrom = profileSentFrom; this.body = body; this.timestamp = timestamp; - this.channel = channel; + this.channelName = channelName; } public Long getId() { @@ -58,19 +60,19 @@ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } - public Profile getProfile() { - return profile; + public String getProfileSentFrom() { + return profileSentFrom; } - public void setProfile(Profile profile) { - this.profile = profile; + public void setProfileSentFrom(String profileSentFrom) { + this.profileSentFrom = profileSentFrom; } - public Channel getChannel() { - return channel; + public String getChannelName() { + return channelName; } - public void setChannel(Channel channel) { - this.channel = channel; + public void setChannelName(String channelName) { + this.channelName = channelName; } } diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index c0c41f6fd..26385f270 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -24,11 +24,11 @@ public class Profile implements UserDetails { private String password; private String email; private boolean enabled = true; -// @ManyToMany(cascade = CascadeType.ALL) -// @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), -// inverseJoinColumns = @JoinColumn(name = "channel_id")) -// private List channels; -// @OneToMany(mappedBy = "profile") + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), + inverseJoinColumns = @JoinColumn(name = "channel_id")) + private List channels; +// @OneToMany(mappedBy = "profile", cascade = CascadeType.ALL) // private List messages; public Profile() { diff --git a/src/main/java/com/example/demo/repository/ChannelRepo.java b/src/main/java/com/example/demo/repository/ChannelRepo.java index 552c3f776..3c5acffce 100644 --- a/src/main/java/com/example/demo/repository/ChannelRepo.java +++ b/src/main/java/com/example/demo/repository/ChannelRepo.java @@ -1,7 +1,15 @@ package com.example.demo.repository; import com.example.demo.models.Channel; +import com.example.demo.models.ChannelType; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface ChannelRepo extends JpaRepository { + List findByType(ChannelType type); + + boolean existsByName(String name); + + Channel findByName(String name); } diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java index 742951540..c4fe423d9 100644 --- a/src/main/java/com/example/demo/repository/MessageRepo.java +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -4,10 +4,10 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface MessageRepo extends JpaRepository { - - - Iterable getMessageByChannel_Id(Long id); + List findByChannelName(String channelName); } diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 97d89c17e..2eac5ee43 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -1,6 +1,7 @@ package com.example.demo.service; import com.example.demo.models.Channel; +import com.example.demo.models.ChannelType; import com.example.demo.models.Profile; import com.example.demo.repository.ChannelRepo; import com.example.demo.repository.ProfileRepo; @@ -38,6 +39,18 @@ public List readAllChannels() { return result; } + public List readAllChannelsByType(ChannelType type) { + return channelRepo.findByType(type); + } + + public boolean existsByName(String name) { + return channelRepo.existsByName(name); + } + + public Channel findByName(String name) { + return channelRepo.findByName(name); + } + public List findByProfileUsername(String username) { List allChannels = readAllChannels(); return allChannels diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java index 4f1244437..0d254d5cb 100644 --- a/src/main/java/com/example/demo/service/MessageService.java +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -26,6 +26,10 @@ public Message create (Message message){ return messageRepo.save(message); } + public List findByChannelName(String channelName) { + return messageRepo.findByChannelName(channelName); + } + public Message read(Long id){ return messageRepo.getById(id); } @@ -37,7 +41,8 @@ public List readAll(){ public Message update(Long id, Message newMessageData){ Message messageInDB = read(id); messageInDB.setBody(newMessageData.getBody()); - messageInDB.setProfile(newMessageData.getProfile()); + messageInDB.setProfileSentFrom(newMessageData.getProfileSentFrom()); + messageInDB.setChannelName(newMessageData.getChannelName()); messageInDB.setTimestamp(newMessageData.getTimestamp()); messageRepo.save(messageInDB); return messageInDB; diff --git a/target/classes/com/example/demo/controller/ChannelController.class b/target/classes/com/example/demo/controller/ChannelController.class index 850ff04974b0e08ebc5a20eabbd8bc4da50d0581..a0573b50452ad26d36ba578999b8716ca563bf73 100644 GIT binary patch literal 4131 zcmcImTXWM!7(MG;OdLTVDWTAoYbgl<)P!(NpyXo0#n@?L(sC)F*qcOPOGcIh8K%?e zKWdo{blRCd_Mtzj)3egrRuVy+(mr^lm3O~A=X__s-M{|+?GFH>SWTf9vq^m2g*}){ zVIKJ|+{Ho)34Eiv->U9C)!bLz2Pr(nck1ntY96cRiE1o0WHE_C5=DVzReGy-K?)3J z3U1kyFRgN=B+a5MyQconoLaFQN0#Qpp<@F3=W32`m*s+8wHHfr!f{;R@@?0t3S7*% z-m+P(c(${=Dx7~Fo-J(iaHw{s2 z_+e}y^VC|k%#!6Sn;DnXwv+yZO#yaqj6m1T`&Qu@#nSeD^zT<`Ese`A~5$MvBx73 zCtbJ1A~dE`_ds2RCm)7%Q}x|Ya}@4wwO(WO9+k?8 zQb{|NrDAAcJJx*C`e-d=&9_Tth7z=5IR$t}U^il9HK*N8#f=(T#)0uQWtpsdKm+^mvA~JAQ#$4ZGth^Rl8^=tVkwDb11qpq zjHd=pXub=9!?UjfeM}*xB}0>HB=2u!#8kK4XwczAe0T)j3&1F0ox?O+Sx3= zxy7fl;1m0%5b-w^f$3Jx%T3WX>^y;E?-c6>&wN&LzsB8{oSI8dUnM#Ls+5-~d}S80f(#Y>jXLKE-G332vH0 z=m;jypq=A^zTc6!ck&ms4ZT78YjnIt=TH0`4YfB2)gKPmp*RtTiI!I%j_wfb0LOxf zp9hc?$m5*y#RCY56BxiC->Nu?A&yEa&Hc0VpOf`#RjU&0jgd6YmC28&GC&`t~9X3 zCD@1uav}nxuK}d*T|lnJ0QqVokZYKry2_^G6h%3*x1P8+*cp%GRDdJ&Y_G-PQAgd4L;(hi1DL78m5m%xMM~GT!+J`4ShzmkGN8> z6%utv9SU;SmEiw~?2GHM9AeD=J??wAdG=^gnDeXotR fmECV?V7J$2Hh~OTC2%KT)62Ik`^O18bY$)yvMo9f delta 969 zcmaJ<%T5$Q6g^eLOfx-2s{^!vIMWX3;DBPcD5HXkFMQ)$9*Qn>la=1%n0_4VDBxkmWEQ8cbr@U`h@iVSfF4=PMQebYDL4NDxru z!*blqLCTQsKG8UL#XaBHfLdjsu`^8qi}W!zNdo#YK%~fQ5PA6V*V6DxJGa;7 z`n(UeNpdCHjSBBn`8Tf!fPkOI9?PkZM>V3MC8(zu#$N1W^c;1JFv}5Y`xz)|AC;br zU!cSG2pjK^i=Uaua`2Gj*#JspS796Bop1?TTtbZD0BarOSq`eQNotHZ;HNnZ8PwmT z4yB~RHmQhdiVjRjAwLd1f6-k-=LQOIZK3v9YMBw1Q!0VYIr86TM_GRoO*`n<-jFKA zU%YBYYMoL?sGwo%2UdR6k{YE_fyf%5H$_*i=%VI1GHx8(lFRW__z5e#OJhZ`o+wXD znQECbo0`)75qd$48GR44hOR9JGM@1!`%V&X(s%L?OJ-URWjdvH@=s4RPTAR>wtC96 NbcVP_#>u-n^BYGJQE~tP diff --git a/target/classes/com/example/demo/controller/MessageController.class b/target/classes/com/example/demo/controller/MessageController.class index 175e2774b557953fc6f82c8de4f514ddd1e2f917..ca43b96d88f8384b76bd232472f213b92cced588 100644 GIT binary patch literal 3729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7(9`Tf~@e^6*y@k{(f3Az<5>ehk@XcnUm?+#e)`HJcuQ*|TA@680&)A2;!5BGmPw4wvOwz_yZMF8+?Z+I~nP0FwPrHgs~b^>how9 zAi9YCJXCv_)yslCj3{!!Qi?pLNCvqMGzHEpt-?3wC66bY8oA#oc7d0eid|9-E=A_# z8~WBqUdNLolvMc$Np)725rY+_pd*wF2$O!4IYI{hv*01<1-(Su%M|ZrdK$@8ptUHb zcrVj)Fs=4s;(QAgD==}a1id2OVlR`?%k(0GNvHTVM82bqD!rN53Zdw8rQs)t1yn$46q9 F=wI}nyG8&2 delta 1104 zcmZ{jOHUL*6opS!Pj}A)Ljaj!1Z75$$AB}9jsl7Zhyp%YyLUy{vG2cNti1{U00M-> zg$tLu(I4X4o$=f%n087how~PEee2d&=T!fy{;V{={{HkCKpVS7oLMI)va#AYu(NUuQQI>(K7 z7)K2ntYIAGei}DXVwRGLtfY^xY{)ppk9V0BbJ#eCI<~8(8H-#Ej39?9X80zHScF+L zn5DrS0yZ%F`9w{dkNJsyDO*LvSd%jIJ>N6xP!XlPj-!54~AFADfqN0};I&qiT#DmJk#)7B znE2<~udwWqgEWVwvX$RiwbEhokyg3pu|r~?-M{sUM6bXa?(XLrA=i6A%GK+Jtf#zj z9m?#6t#NW48;ricIbX`n|6nUT!RCbzUH0aDdpEYpyVHYr2v;*W`3*Fl+W5@=#3I`k F@CW3UOtt_3 diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index 48af9080c9b17e988235e4f1ad51989381d1c0e3..eb3d6f465194d5358467fe69964e369931bd6152 100644 GIT binary patch literal 1967 zcmbW1-A)rx5Xa}V-4?JGC?5(cPy{XIV^Kg!Kq4Y2N%@G>-gvdN$Fii|ZFaW?-oppc z#Ky!6AHat){^x8{ma^5vi=8=VcFxRi=FIM|-#>m5(JHO?Q4cNmQi7hac*5vz1q$M50ljWjOZAduvxE}8-mw)v~rov^N{bSqj3rB+b>yG`= ztjZHTE(WK@fWWAeU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g_SJQM2vCb=ZNuEtnuX8jNgeho;sWHd$GpTXEQFx8f&Pc z-@TIoVF?jsYrn}d5wLY#k#YkzH)APJMx9ifoHQuEMK8uso{Ad3A8ULYJ>z4a$I2a+ z<_DK*ytTYKt)sslD-ZmFa4YQ6bkL>zs!~Grm!Owo6Usy}9mQh0LoXx7F#Mgul!;>c z5STt{gNdh^P(2S!-0Om7V=-l;m_CWcG#8I48^!b~Fn!hr6TjCG6Tdw{uf)6Uh`Rk8 zZog>b)*o*H{XEnJc#CDQX@dGy{St1!YU7q?Wr)_Fldr}yn2R#_bu5Fg#be4vQ~d^* zzHNhvXIhAfCzhZEdcCDthE9!QKh^Kx_WL$&c|eA4{UNv*n`%0m>JPE0-i=Q+9ZmH| bVEU;ICjMIvG4a4o(2|nN>aUz<@CwntFqsv3 diff --git a/target/classes/com/example/demo/repository/ChannelRepo.class b/target/classes/com/example/demo/repository/ChannelRepo.class index 10e569cb085c038447f5c637ee42644a766a71f9..f0e82fb914fbcab6ac6ac02595b35ffb711276c3 100644 GIT binary patch delta 314 zcmcc2bd*)))W2Q(7#J8#7)03_gxDE`*%?F_8Mx9i^HQ8DLn;eW85ztqCT1%*fY{cW zK3R!niTb4_nK}ACnZ+g6j0^(4sU;ctDFKN^iMgpIsYS(%3@jyJeVoCW>3NAIrA0t9 zqCjSdVl`u8mQsiv&>)`F3ZRL_PL+N@gBTe^H6V87B<7{-2bUCO=A~O}Mga}a14~0) z2vKW_P3^>N#f|ccj3LY{Kurv+3``7cK!36_GOzu>F>o_5!lZZ@7=S{& S416d;K$Q^n{0stMeS!cDrAFTX delta 61 zcmX@gdYMW7)W2Q(7#J8#7`WLPIM^9D*%`PP890M8)AJHbN{doA2QVr!3NtV;F|Ytt MF)^?*uz_iI0K1L~e*gdg diff --git a/target/classes/com/example/demo/repository/MessageRepo.class b/target/classes/com/example/demo/repository/MessageRepo.class index 3526db893c9621390793105fc51b35ff21261536..6d4bc6459134a48d00b00fe2db6d2b071311aa9b 100644 GI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$9Gupwnu zO4O;l;vu+GhW8x*%{9#U%ulk$s)$sL0`_$UWvODr*05ct@>sykc43W^(ORd*7?wV< z7Io9_y#H03Sk5QE3+U&A>mMis7aF*z@EDDvyJxkIHp@c21;VbSMaRX7@5LqD|G>X| ioW8@)_?}6)f_wP@_3_`2&Di3suEbTiI&QleTmAzF)cx}S diff --git a/target/classes/com/example/demo/service/MessageService.class b/target/classes/com/example/demo/service/MessageService.class index 6f36dafbd534870ec2efab654f962ab2b8bdbfc4..bfa8a4f85297aeb44566d982c06a45334f27ac67 100644 GIT binary patch literal 2762 zcma)7Yg-#d6n;o~?Ku-JhmEGuax zj&`gj@D!iKu%`A;)$*BI(sAmqD}@cUY^r5TEuX7pTP+#2>?q|g)Uq4HvlyNWB#P4W z%)H!|$Bw{AI_ne-`J-7pE=VIMi;m&)gJ=1UduFWHRObZR<}KUu9}A2PU)gG8SD)-3FruBFb=WvhQ^c})ZJq(W1T za$BZr7Nsv;n)h#)Y~L!%UCXnGy{@pIK$)C6?h9jInzm;g znAsq6vua>0lzivZa%E1HAnQugXXwjKN>F5)1+Nm`T$9qiq9G8Anjvt%v7`;!HxDd3 zw|KU6$mnEYgOLloGn_s$PfVj=+Ib`6tDNXLxGMQp!AM)4&%hJedZVsJ8-b3DmA6g5 zw>G+bUS z*0$1dF6iz~L$sIXdX;V`ZFw4v)UxTDwOL%VmlsJc(ueeACqf}euw__{P(0(5+^k%+ z)Yx=K7|{SssAdZcH)XZQagdIGb}Ws`yy&=%IUR4HKZY-Le1)%L_(sRK_)f7ERx%*slgh zR*&^w%WUqYH(uD|nj|*kd^`L>ul+vE&Rq;C*suq8$@ibpJoBwlfKHy z^Z85*^wzVpGV&xzV;!46Vd+7R^E;vfar?zmY4qG*&2s2rkjlP8T3r`x};+mum(2Z8~paZ?Q!_%!$ z8+UP!C)x$5e6=ZG6FdNe{I$`^+uX?xyh{`1DnmHsYGCvawET+JGOm@;mii6a=s98< z{zm)H{2cm@2de$J&RA=H2daJtFoXw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users.noreply.github.com> Date: Thu, 9 Sep 2021 22:57:53 -0400 Subject: [PATCH 25/29] Create .gitignore --- .gitignore | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cdb913b85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid From e7643e99ac1c9ca4bd093067d6452d8a39f092a4 Mon Sep 17 00:00:00 2001 From: Jeremy Sabina <85699387+JeremySabina@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:58:24 -0400 Subject: [PATCH 26/29] Create .gitignore --- .gitignore | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cdb913b85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid From 51182ca0c8807bc3f434217e8d9ed9d4009130d8 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 9 Sep 2021 22:59:14 -0400 Subject: [PATCH 27/29] git ignore --- .idea/runConfigurations.xml | 10 +++ .../java/com/example/demo/models/Message.java | 60 ++++++++++-------- .../example/demo/repository/MessageRepo.java | 2 +- .../example/demo/service/MessageService.java | 2 +- src/main/resources/application.properties | 4 +- target/classes/application.properties | 5 +- .../com/example/demo/models/Message.class | Bin 2421 -> 1443 bytes .../example/demo/repository/MessageRepo.class | Bin 618 -> 425 bytes .../example/demo/service/MessageService.class | Bin 2483 -> 2348 bytes 9 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 .idea/runConfigurations.xml diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 000000000..797acea53 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 7105aa569..325beb060 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -13,27 +13,33 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "profile_id", referencedColumnName = "id") - Profile profile; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "profile_id", referencedColumnName = "id") +// Profile profile; String body; String timestamp; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "channel_id", referencedColumnName = "id") - Channel channel; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "channel_id", referencedColumnName = "id") +// Channel channel; - public Message() { - } - - public Message(Long id, Profile profile, String body, String timestamp, Channel channel) { + public Message(Long id, String body, String timestamp) { this.id = id; - this.profile = profile; this.body = body; this.timestamp = timestamp; - this.channel = channel; } + public Message() { + } + +// public Message(Long id, Profile profile, String body, String timestamp, Channel channel) { +// this.id = id; +// this.profile = profile; +// this.body = body; +// this.timestamp = timestamp; +// this.channel = channel; +// } + public Long getId() { return id; } @@ -58,19 +64,19 @@ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } - public Profile getProfile() { - return profile; - } - - public void setProfile(Profile profile) { - this.profile = profile; - } - - public Channel getChannel() { - return channel; - } - - public void setChannel(Channel channel) { - this.channel = channel; - } +// public Profile getProfile() { +// return profile; +// } +// +// public void setProfile(Profile profile) { +// this.profile = profile; +// } +// +// public Channel getChannel() { +// return channel; +// } +// +// public void setChannel(Channel channel) { +// this.channel = channel; +// } } diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java index 742951540..3e542407f 100644 --- a/src/main/java/com/example/demo/repository/MessageRepo.java +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -8,6 +8,6 @@ public interface MessageRepo extends JpaRepository { - Iterable getMessageByChannel_Id(Long id); + // Iterable getMessageByChannel_Id(Long id); } diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java index 4f1244437..0ea381071 100644 --- a/src/main/java/com/example/demo/service/MessageService.java +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -37,7 +37,7 @@ public List readAll(){ public Message update(Long id, Message newMessageData){ Message messageInDB = read(id); messageInDB.setBody(newMessageData.getBody()); - messageInDB.setProfile(newMessageData.getProfile()); + // messageInDB.setProfile(newMessageData.getProfile()); messageInDB.setTimestamp(newMessageData.getTimestamp()); messageRepo.save(messageInDB); return messageInDB; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index bd00f719a..0c3e2ca8b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 -spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect chatter-box.app.jwtSecret=someSecretKey diff --git a/target/classes/application.properties b/target/classes/application.properties index aae8e178e..0c3e2ca8b 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,9 +1,8 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 -spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect chatter-box.app.jwtSecret=someSecretKey chatter-box.app.jwtExpirationMs=36000000 - diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index 48af9080c9b17e988235e4f1ad51989381d1c0e3..12ae9606db4ef3fda97a282706a5843f2bb79d57 100644 GIT binary patch literal 1443 zcmai!TTc^F5Xa~2_5yX0QZ7mbrFbjlvKmR$K!|A6kQ6ae`@U^Y%96d1-BSbKN)w5R z4}JhYl<_~io3fNeA3C#h&Rl*oXVTw)e*Pk&P1-0?f$HOwrxg|r7OO>CE7H0k&F%>* zH;=6^mg!ht-)#C`e@oE(r-7$zSGMiY?l^MS^L%9~+xJ32bCLV0c_M?*4wdw}(%kDI zXgTBJz4T;YDcNgV&OpLxEL3dw&;IF;O0BaK_RsBpZXG~%{2oFoDbzz1*b(eFlZMK2 zPXraVZO>Laf}Yn?u2EMhI|;pdveHJWH-1kFnrzyh{4j7kGH6+t0T=hXmeaNZo9*N< zr;cn4rPl2Ft|?Ce;YhP5UEg$(#tF@R8HQG$TPg2Lb>#OxT7l(Ch3N^>>s&G4mue3W zQK_$_kdmj!hwDUW#%op-wHTXv9uQMFFOTB!M|h@SU`;$Q0ujqJXu`;6=0% zk75U!VGGe1M$13J2%bh6=3=j5!-b?_ZZ412gTj;2QU;Sg%CwouRHNlACViCY1(;r5 z!^ESgvi_>&klNtEKDE7utM_y$l znW^uC3xOFt%bq$fo>6qIvYf~MMSsXz^87MQ%r)xS@OM$$h2#$cbEE zg@P8e`CI!!2B8~9QZ=RhtOciyjE$#K$-s$Z>%{T85=Pg;h~L}2iT23U=v}bAvHwHk zSWxjI@XuUN3R{f;f)I-Lto+AZ1f?T+7)UTD9JP2jYWL2~4%Uc*0D9Mn9MQS&_8 z?vS@Glh^lu`ccqoM!4s`t7^X2?I?y+P6ueE1oCHAbuN%+GGKLDvE2)8W1RXe)IO_2 z#+tv50#~a(#gc~+Dnr4|b4MxZO)9t+n*gAcSnJG%$F6dts-S#%>jZE$$Rp@R-Bt2M zw{t3khJ!O@2EXZeCr;qX@hTt5Fm&3iVy`?>gl?R79?ghDQgy~J!lMw)d-!4Lv73G8HArLZ;b>^8rlrw&71#Y=4eH@9_VwKyW%`JnIha{ zgZa?_$v%g$5TY?WJ_`;buO;jz?I~yzImXpE?BNn33|wxP-|4{+oF-9ea+*si;es>+ zmkDVuJ#?Daem7{!L;XEkNki=LB_e1^Yk&22c!Ikm>g`#yP8$|YQOTkinzd+|KC)BQo(IFbR4Os~O6Xh53EFUzc=)ruC1r$@Vg~ zZ(=eE_$1rg>39TELST8{jGMUUY z)5A=r-E1Z^&GZONdt;cmvjjbFS2yXrbK*Ty z7#Y+we6kYD67_Qu^V0Qw^7GQIHIW27OHzvxlX6n685sn8Q%f@PQvwo;5_405!o`dX zOqoCfID<3O^Abx+i&7aGJb{KO5jJgNmJ*Yl^+x$@Mk_`ZMg|rJRt6>pHlUkX85!7t f6bBG9F>o?4Ls?u5++YzN23{b|#=ywH$G`vpx;{8K diff --git a/target/classes/com/example/demo/service/MessageService.class b/target/classes/com/example/demo/service/MessageService.class index 6f36dafbd534870ec2efab654f962ab2b8bdbfc4..24797b5848d6b43d225dd919f9bbc0c0ffc0a2e4 100644 GIT binary patch delta 849 zcmZvaOI8y>6o$Xg()V)>r-tSNS)kk9=v-{tEfB6cu*$>IGlxCFWkc+IOxx{6g zt%eM8Wr(X>3s|#p-7eQdwcfC`4ZGa5%Pm{DZI?R%cLVMnzTHby$7vbHI2mx?@PLN_ zj|`hUHf-_4@RaRoE(GJy<>PV}a*Dj|C2suqb(Pnnu~L89jDJk%@ku+M7(3&zChF>87hF$OX9qRvJ=8nJqza{Kt;^76 zqu#}I8MZOgC1nK~#{@pRjaVbcfJVx?!n_P#kfBxGxaKsg5w3rgQtv8~pdnX$O%*3O zr!?UlPy6aXHS2VpgMfbSbzE-xUmBKgy|L>DV2I}LH kgf(zQ@gD<6JPvgl85lk8616nT|8ddhylcJC|3=#I2jz1_egFUf delta 959 zcmZva+foxj5Qe|q#jII|BqS0{P=f@7Y!c2V1r<+t1n~rjg2$j%S!H>+=h6q**YH9L zjfEGM*S>}?;1gK(%q|HRUTk;IboV#Y|IVlMPUhvWzu$iV<7|2yVk%CCX^)efiZjEk zj!t_Vrmt524y2}lhh3$=Xr`pMwqJyl< zqT(h?F1Hl7xudwtJ;gFBE~|?BtXUL-cBe3^c)*(CA-qQ%~!8$7R7-e>Ev_Kdd9+gzc1T65Tu-(x0fv~2dS7p zl@T?-!q)ed$d$O0!#Lz*H81vsxd}6 z8bk05i6XXi_AxAxW3-9eQh=ni$RnXX60b_3BR*~Jw4jHqZ0*u+Q)$kbFeO7m93~~r zTE_0Mt#N)jIzNUor`mgeBotI$q@1e-off}O(6mMLW+WH>?CJz@CjX Date: Thu, 9 Sep 2021 23:18:23 -0400 Subject: [PATCH 28/29] l --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0c3e2ca8b..50b564dcf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box spring.datasource.username=root spring.datasource.password=zipcode0 -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect chatter-box.app.jwtSecret=someSecretKey From 3259bc0e917a3578903362afcee136efb76c987c Mon Sep 17 00:00:00 2001 From: ZachKitto Date: Fri, 10 Sep 2021 06:40:08 -0400 Subject: [PATCH 29/29] changed entity fields --- .../demo/controller/ProfileController.java | 4 +- .../java/com/example/demo/models/Channel.java | 51 ++++++++++-------- .../java/com/example/demo/models/Message.java | 2 +- .../java/com/example/demo/models/Profile.java | 8 +-- .../example/demo/service/ChannelService.java | 32 +++++------ .../demo/controller/ProfileController.class | Bin 6013 -> 5753 bytes .../com/example/demo/models/Channel.class | Bin 3319 -> 1851 bytes .../com/example/demo/models/Message.class | Bin 1967 -> 2049 bytes .../com/example/demo/models/Profile.class | Bin 3742 -> 3376 bytes .../example/demo/service/ChannelService.class | Bin 5821 -> 4332 bytes 10 files changed, 52 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index f0046619a..fd70d6fcb 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -36,10 +36,10 @@ public class ProfileController { @PostMapping(value = "/register") public ResponseEntity createProfile(@RequestBody Profile profile) { if (service.existsByUsername(profile.getUsername())) { - return ResponseEntity.badRequest().body("Username is taken"); + return new ResponseEntity<>("Username is taken", HttpStatus.OK); } if (service.existsByEmail(profile.getEmail())) { - return ResponseEntity.badRequest().body("Email is taken"); + return new ResponseEntity<>("Email is taken", HttpStatus.OK); } profile.setPassword(passwordEncoder.encode(profile.getPassword())); return new ResponseEntity<>(service.createProfile(profile), HttpStatus.CREATED); diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index b11da586b..4aa6127af 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -16,20 +16,27 @@ public class Channel { private String name; @Enumerated(value = EnumType.STRING) private ChannelType type; - @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) - private List profileList; - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List messages; +// @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) +// private List profileList; +// @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) +// private List messages; public Channel() { } - public Channel(Long id, String name, ChannelType type, List profileList, List messages) { +// public Channel(Long id, String name, ChannelType type, List profileList, List messages) { +// this.id = id; +// this.name = name; +// this.type = type; +// this.profileList = profileList; +// this.messages = messages; +// } + + + public Channel(Long id, String name, ChannelType type) { this.id = id; this.name = name; this.type = type; - this.profileList = profileList; - this.messages = messages; } public Channel(String name, ChannelType type) { @@ -53,21 +60,21 @@ public void setName(String name) { this.name = name; } - public List getProfileList() { - return profileList; - } - - public void setProfileList(List profileList) { - this.profileList = profileList; - } - - public List getMessages() { - return messages; - } - - public void setMessages(List messages) { - this.messages = messages; - } +// public List getProfileList() { +// return profileList; +// } +// +// public void setProfileList(List profileList) { +// this.profileList = profileList; +// } +// +// public List getMessages() { +// return messages; +// } +// +// public void setMessages(List messages) { +// this.messages = messages; +// } public ChannelType getType() { return type; diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index b710a75a0..039441be5 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -18,7 +18,7 @@ public class Message { // Profile profile; String profileSentFrom; String body; - String timestamp; + String timestamp = new Date().toString(); String channelName; // @ManyToOne(fetch = FetchType.LAZY) // @JoinColumn(name = "channel_id", referencedColumnName = "id") diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 26385f270..4f62eeb9b 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -24,10 +24,10 @@ public class Profile implements UserDetails { private String password; private String email; private boolean enabled = true; - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), - inverseJoinColumns = @JoinColumn(name = "channel_id")) - private List channels; +// @ManyToMany(fetch = FetchType.LAZY) +// @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), +// inverseJoinColumns = @JoinColumn(name = "channel_id")) +// private List channels; // @OneToMany(mappedBy = "profile", cascade = CascadeType.ALL) // private List messages; diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 2eac5ee43..e7805e5bb 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -51,22 +51,22 @@ public Channel findByName(String name) { return channelRepo.findByName(name); } - public List findByProfileUsername(String username) { - List allChannels = readAllChannels(); - return allChannels - .stream() - .filter(channel -> { - List profilesInChannel = channel.getProfileList(); - for (Profile profile : profilesInChannel) { - if (profile.getUsername().equals(username)) { - return true; - } - } - return false; - }) - .collect(Collectors.toList()); - - } +// public List findByProfileUsername(String username) { +// List allChannels = readAllChannels(); +// return allChannels +// .stream() +// .filter(channel -> { +// List profilesInChannel = channel.getProfileList(); +// for (Profile profile : profilesInChannel) { +// if (profile.getUsername().equals(username)) { +// return true; +// } +// } +// return false; +// }) +// .collect(Collectors.toList()); +// +// } public Channel update(Long id, Channel channel) { Channel channelInDb = readChannel(id); diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index ef3371fa9033bf322277e567bd21f7ccbeb96958..fe9ea9199c5b747a832d62fbc7733438bec06a32 100644 GIT binary patch delta 1708 zcmZ{j+h0^w6vw~kFyomyvzfucApt4Oz~rK0rA0y-5~ZSMSfNo-QIUWlcE3#b`~75T zbiZFL1#A#8yFT?F)TbW$6MF2SKCN};a3HXUv-UoFt-bem{npxlFaN79`}04?PXg!i zlS?(X#;Ky$e(0L4voE2SMEx1H}~l5UiICl@%QWO z0W}Y5T-M%@Pw-@uI-hcRnrAfjS%>HJoafcNpyoxF3SLs*%W7VU z;W@nOu-_un?G2_%Mt=J>wy=R!h83)Ic+K!S2OJI>-eA~U?AG*I%-=E8vv;7ozo)Wy zsB&NT?w$dMHw|y`wxNM{4DWKl@E*e!$=3ev-o7x-P)nWReLeC6!-sri_?S-&=kuxI zGdoR;ma>pNOEcqfuAW0BNwLAFXt3laGQ5sPIqn-g z&5?hRUhFw?&I%bV8KX7hSR*pArLFX$tge=Do>-HQU^Q#x&k`9gkiOF0hlJ0Tac9j@ z?Aja!IU)xsnk3qpo;Qj!PV7kFisx{rT#3L{D?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h~3AGf3V&(NQcl8>D8Rci+mH}m|V!9QxiZI-dAllHAK2y9{DhW!iS+?b^3yNo# zj!_01$f%%^l4Z-icH>00$|mZQ3&W|H^<%STao-@DOzM z{Yv|ki~`rog7g-8`@D$mq_=}hX)L?cl>z@+GF&}5-t9rn@zNBQ?x}0y&XvW%MUldCZ7|U-;Lo$f zFeLnQr%!W$5oT1-^NxHl*grJgr+66tuc&wS5$F^cV%3KWMz5pJ3vYqmPX#LHCX`_U zp#sWKOY~*}U^YnwBV+ra>A?(`_0{(>UEpQ--F}G*45wp+13(n?C$(?w_2=ibr$!whrL? zYfy}Z3Bg3~HhO71KSO_5(g=-W04^~UW3Rp$Pfy@CDd{eKjw!I9{X&^dE2S|^&tUAH zOZRD3!rue*fE(B?D7(9`Tf~@e^6*y@k{(f3Az<5>ehk@XcnUm?+#e)`HJcuQ*|TA@680&)A2;!5BGmPw4wvOwz_yZMF8+?Z+I~nP0FwPrHgs~b^>how9 zAi9YCJXCv_)yslCj3{!!Qi?pLNCvqMGzHEpt-?3wC66bY8oA#oc7d0eid|9-E=A_# z8~WBqUdNLolvMc$Np)725rY+_pd*wF2$O!4IYI{hv*01<1-(Su%M|ZrdK$@8ptUHb zcrVj)Fs=4s;(QAgD==}a1id2OVlR`?%k(0GNvHTVM82bqD!rN53Zdw8rQs)t1yn$46q9 F=wI}nyG8&2 diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index eb3d6f465194d5358467fe69964e369931bd6152..a6d1e9808ac447a05712fef87a9f6ba31171c852 100644 GIT binary patch literal 2049 zcmbW1eQ(=T6vm&M#!1?mwoBJS$4l2TSn93yU>ywFRgA5JN$EDxQfb;>ZgNRIC3a=s zp!Ey!H%Np@An^hCP>AQ)R_Z41CZQfAZ&AYw&@4@NxyfbqXUokmFQv1>mGWMFY9cxY>s^ju+nUW zJy*YC_^x)_x)-`VhUv!co{nR$BiJt*IlM&F+&aVke>;Lbx2Mf<*nZ|kyp&-b6s(Rm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1C%GLYbnSOfN&3 za^XzTPNvsj+U>%`)7NGiR7~@sOz}>px1mf6;Y@+=#h<4To diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index f37020931edc2d7068ec1e6007fd35e5e0b97064..7bb52ad81da7c19a16e6d27e3056f0ab87e9ba8b 100644 GIT binary patch literal 3376 zcmcIlTTdia5Uw-KopBerF3ak|>Mk%`+P%2Af+(_p=q%vElDIJ@&CCIM>FFN3dscYR z=z}JjXySt=`tF0q2Tddh^hS>Iw94X57H_dAvAD-#jm0{PjSRh=q5B!y6qGP3g1SnN^vAkp>eilCvaP*Y zL4)_}mSB|>iVHpla6b+p0vtRTdlz8O3a59X-P--WMx}7 z>k^l;uE+bmqyM~*NLxoWzMoupu(d8I<=F?)64c#oUfq$- z7GLK0c3C&Kb;sa+aG3P=4G=R@D%({}9_rPaDYc5M+FBKEOjp}*>|Mj;bVkQo6KFkQ z2wnH2w{KTAbO#xD;9Ahf&Bm%yt)~Cq$wNlfxhK5`A+5b*_ZWUQ{pTuc?Nh#O=*wa!wrn3OkVVift z==82pApX_>nnkoFzx%WJ5U6=pPdHAFsWS7;E&s*w%|Oj>+I6Qam(j|A9yIkd4-Y{X zRU@393QMS`cQjj|XX$c*F3~du8l?ULU1aeTohwiuYXdAUuo$9#L6@KKitscV^J;zP z5o#{z&XX(2)1V?fJbqVWhVJ@0jbJ8r5)z^;B^Va;^BAj7W7nltlvYv?_2K}4ag<=p zY6WbyA}_TfHMJrWwIXS(18@lrAcwJ=gT26-FaA!Vm^`M$uh=C3gb=&~@(LwEQjVU3 zMgXR6WA{9E?CC0Q4@2L<%J+LiPsNF2>L^YgQ?lW+pHjGUHSl>2F-DQinDRaB+Xuek zi7TYy^>Ufu{~By_2^FE1Fh^>rItRg_SJQM2vCb=ZNuEtnuX8jNgeho;sWHd$GpTXEQFx8f&Pc z-@TIoVF?jsYrn}d5wLY#k#YkzH)APJMx9ifoHQuEMK8uso{Ad3A8ULYJ>z4a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$0N!Pb11TmokOr&bKxUJ2#l6`rUXLM* zgs}NukAUGQ7@kFCjnNT!dVv^mf=rW?fQMvD%4w;V!`3D`9>I4&0$>s=+bCm+0 zPwXK_WL$ZeRwqt+Mx8kAS>^Rm7LWum0t^9w!YCZX`4IjDKwiem$jN{n*ir-*VnR(az2l<&qWPd=aWgIMKPpHI0Gt2{-o1?4ju z1S}z<(c0+HOa##yR6)54o$1(+C!-*>4v==pU#FRvkf)-`@5d@%quGG_6n3t#G&fwT z-D`RE+CY6hQ3%{YTmydZ^2wi4+*K)|>PygEtV5Y7r)Dgt>+}X}Z~<=Nl!1I5qY?RZd;Pk8uC+^pf6Zf8=H{)S@qOhL<_VX^V z{&)+*&qGa6DIPW%h5Z7sUv`1zSsAkR=j5%}28z~2J)yDqRiAVXMx2)-5TYC7ub_pz?tj(0U3b@c~u`mqZq X{%sFA@xV^dl3L5^2b*W`9io2#M$w5J diff --git a/target/classes/com/example/demo/service/ChannelService.class b/target/classes/com/example/demo/service/ChannelService.class index ce9459643b6b9c254893e7817976c8d6f0eec9b3..1ef2b9e34dfa428f1132eae8a4ce0a23ef90f5ff 100644 GIT binary patch delta 1486 zcmaKrTT@$A6vuxj0S-CY5oD4noBc-K?Qnp5jCQZheGUP}P4q!mG7klr;jr;NWR4@| zm~{l8N8wyYJj76j`m&-5Z7qbh) zGx;OALrdWro{exi9N@VKql)Kw!RAH9OPo=>Opl_ETNSr)yW)B>inF|;c$IUCK~5{S z&>gmU%_P2V^M;L9yvbX}o3Uu0&dq0LPG;v9=5&>_MGrcE`rqaqy*t?GKhC@QVDPM7 zuG?AL$a@xhHxKE*0`2Ic%1HjRagL(jrNRge3H(NXxFak_U-3&{vBGLS^U> zDbkW-0IMzeFaScW2QU~-tO1Cx0f?3XqIA+#0qFDqWDXv{*U|0L)^E|+c%`k4rBt(= zTiGV5F6-FN4#~Jdvds;Pz8lNFo5Z$Ld_H!G?PhvB(gxh7{z`uxYpxe8UoS{6w^Xjz zDJD3ek~tY6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